diff --git a/Makefile b/Makefile index 7e1ab41..0243e2e 100644 --- a/Makefile +++ b/Makefile @@ -6,14 +6,14 @@ bin/assume-role: *.go bin: bin/assume-role-Linux bin/assume-role-Darwin bin/assume-role-Windows.exe bin/assume-role-Linux: *.go - env GOOS=linux go build -o $@ . + docker run --env GOOS=linux --volume ${PWD}:/go/assume-role --workdir /go/assume-role golang:1.13 go build -mod=vendor -o ./bin/assume-role-Linux bin/assume-role-Darwin: *.go - env GOOS=darwin go build -o $@ . + docker run --env GOOS=darwin --volume ${PWD}:/go/assume-role --workdir /go/assume-role golang:1.13 go build -mod=vendor -o ./bin/assume-role-Darwin bin/assume-role-Windows.exe: *.go - env GOOS=windows go build -o $@ . + docker run --env GOOS=windows --volume ${PWD}:/go/assume-role --workdir /go/assume-role golang:1.13 go build -mod=vendor -o ./bin/assume-role-Windows.exe clean: rm -rf bin/* test: - go test -race $(shell go list ./... | grep -v /vendor/) + docker run --env TZ=America/New_York --volume ${PWD}:/go/assume-role --workdir /go/assume-role golang:1.13 go test -mod=vendor -v . diff --git a/README.md b/README.md index 7aa5a8d..2471ed1 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,14 @@ This tool will request and set temporary credentials in your shell environment v ## Installation -On OS X, the best way to get it is to use homebrew: - -```bash -brew install remind101/formulae/assume-role +To install version 1.0.0: ``` - -If you have a working Go 1.6/1.7 environment: - -```bash -$ go get -u github.com/remind101/assume-role -``` - -On Windows with PowerShell, you can use [scoop.sh](http://scoop.sh/) - -```cmd -$ scoop bucket add extras -$ scoop install assume-role +cd /tmp/ +curl -L -o assume-role https://github.com/roadtrippers/assume-role/releases/download/1.0.0/assume-role-Darwin +echo 'dff2c8219d8f1ccf4574a5537bd04bf1c9f70f032d243e411b9f3ba724deead4 ./assume-role' > ./assume-role.sha256 +shasum -c assume-role.sha256 || echo "DO NOT PROCEED. SHASUM DID NOT MATCH" +mv ./assume-role /usr/local/bin +chmod +x /usr/local/bin/assume-role ``` ## Configuration @@ -86,41 +77,51 @@ $ assume-role prod aws iam get-user MFA code: 123456 ``` -If no command is provided, `assume-role` will output the temporary security credentials: - -```bash -$ assume-role prod -export AWS_ACCESS_KEY_ID="ASIAI....UOCA" -export AWS_SECRET_ACCESS_KEY="DuH...G1d" -export AWS_SESSION_TOKEN="AQ...1BQ==" -export AWS_SECURITY_TOKEN="AQ...1BQ==" -export ASSUMED_ROLE="prod" -# Run this to configure your shell: -# eval $(assume-role prod) +Useful bash profile setup: ``` - -Or windows PowerShell: -```cmd -$env:AWS_ACCESS_KEY_ID="ASIAI....UOCA" -$env:AWS_SECRET_ACCESS_KEY="DuH...G1d" -$env:AWS_SESSION_TOKEN="AQ...1BQ==" -$env:AWS_SECURITY_TOKEN="AQ...1BQ==" -$env:ASSUMED_ROLE="prod" -# Run this to configure your shell: -# assume-role.exe prod | Invoke-Expression +function assume-role(){ + unset AWS_ACCESS_KEY_ID + unset AWS_SECRET_ACCESS_KEY + unset AWS_SESSION_TOKEN + unset AWS_SECURITY_TOKEN + unset ASSUMED_ROLE + eval $(/usr/local/bin/assume-role $@) + export TF_VAR_aws_access_key=${AWS_ACCESS_KEY_ID} + export TF_VAR_aws_secret_key=${AWS_SECRET_ACCESS_KEY} + export TF_VAR_aws_session_token=${AWS_SESSION_TOKEN} + export AWS_ACCESS_KEY=${TF_VAR_aws_access_key} + export AWS_SECRET_KEY=${TF_VAR_aws_secret_key} +} + +print_assumed_role(){ + if test ! -z "${ASSUMED_ROLE}"; then + echo -n '[' + echo -n $ASSUMED_ROLE + + + if test ! -z "${AWS_SESSION_EXPIRATION}"; then + echo -n ", ${AWS_SESSION_EXPIRATION}" + fi + + echo -n '] ' + fi +} + +setup_default_prompt(){ + + if [ ! -z "${PROMPT_COMMAND}" ]; then + PROMPT_COMMAND="${PROMPT_COMMAND} ;" + fi + export PROMPT_COMMAND="${PROMPT_COMMAND} print_assumed_role" +} + +# at the end of ~/.bash_profile +setup_default_prompt ``` -If you use `eval $(assume-role)` frequently, you may want to create a alias for it: +This will make bash prompt to show assumed role configuration +and its expiration time, as shown below: -* zsh -```shell -alias assume-role='function(){eval $(command assume-role $@);}' ``` -* bash -```shell -function assume-role { eval $( $(which assume-role) $@); } +[vpc-thlprod, Wed 17:41] YOUR_REGULAR_BASH_PROMPT ``` - -## TODO - -* [ ] Cache credentials. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..83bffd9 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/remind101/assume-role + +go 1.13 + +require ( + github.com/aws/aws-sdk-go v1.26.3 + github.com/stretchr/testify v1.4.0 // indirect + golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect + gopkg.in/yaml.v2 v2.2.7 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..78f8b7f --- /dev/null +++ b/go.sum @@ -0,0 +1,22 @@ +github.com/aws/aws-sdk-go v1.26.3 h1:szQdfJcUBAhQT0zZEx4sxoDuWb7iScoucxCiVxDmaBk= +github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/main.go b/main.go index 733c03c..3469354 100644 --- a/main.go +++ b/main.go @@ -72,8 +72,9 @@ func main() { // Load credentials from configFilePath if it exists, else use regular AWS config var creds *credentials.Value var err error + var expiration *time.Time if roleArnRe.MatchString(role) { - creds, err = assumeRole(role, "", *duration) + creds, expiration, err = assumeRole(role, "", *duration) } else if _, err = os.Stat(configFilePath); err == nil { fmt.Fprintf(os.Stderr, "WARNING: using deprecated role file (%s), switch to config file"+ " (https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html)\n", @@ -86,9 +87,9 @@ func main() { must(fmt.Errorf("%s not in %s", role, configFilePath)) } - creds, err = assumeRole(roleConfig.Role, roleConfig.MFA, *duration) + creds, expiration, err = assumeRole(roleConfig.Role, roleConfig.MFA, *duration) } else { - creds, err = assumeProfile(role) + creds, expiration, err = assumeProfile(role) } must(err) @@ -96,11 +97,11 @@ func main() { if len(args) == 0 { switch *format { case "powershell": - printPowerShellCredentials(role, creds) + printPowerShellCredentials(role, creds, expiration) case "bash": - printCredentials(role, creds) + printCredentials(role, creds, expiration) case "fish": - printFishCredentials(role, creds) + printFishCredentials(role, creds, expiration) default: flag.Usage() os.Exit(1) @@ -128,38 +129,51 @@ func execWithCredentials(role string, argv []string, creds *credentials.Value) e return syscall.Exec(argv0, argv, env) } +// given that max time for a asession role is 12 hours +// just show DayOfWeek HH:MM, example: "Mon 12:01" in the local time zone +func formatExpirationTime(t *time.Time) string { + if t == nil { + return "" + } + l := t.Local() + return fmt.Sprintf("%s %02d:%02d", l.Weekday().String()[0:3], l.Hour(), l.Minute()) +} + // printCredentials prints the credentials in a way that can easily be sourced // with bash. -func printCredentials(role string, creds *credentials.Value) { +func printCredentials(role string, creds *credentials.Value, expiration *time.Time) { fmt.Printf("export AWS_ACCESS_KEY_ID=\"%s\"\n", creds.AccessKeyID) fmt.Printf("export AWS_SECRET_ACCESS_KEY=\"%s\"\n", creds.SecretAccessKey) fmt.Printf("export AWS_SESSION_TOKEN=\"%s\"\n", creds.SessionToken) fmt.Printf("export AWS_SECURITY_TOKEN=\"%s\"\n", creds.SessionToken) fmt.Printf("export ASSUMED_ROLE=\"%s\"\n", role) + fmt.Printf("export AWS_SESSION_EXPIRATION=\"%s\"\n", formatExpirationTime(expiration)) fmt.Printf("# Run this to configure your shell:\n") fmt.Printf("# eval $(%s)\n", strings.Join(os.Args, " ")) } // printFishCredentials prints the credentials in a way that can easily be sourced // with fish. -func printFishCredentials(role string, creds *credentials.Value) { +func printFishCredentials(role string, creds *credentials.Value, expiration *time.Time) { fmt.Printf("set -gx AWS_ACCESS_KEY_ID \"%s\";\n", creds.AccessKeyID) fmt.Printf("set -gx AWS_SECRET_ACCESS_KEY \"%s\";\n", creds.SecretAccessKey) fmt.Printf("set -gx AWS_SESSION_TOKEN \"%s\";\n", creds.SessionToken) fmt.Printf("set -gx AWS_SECURITY_TOKEN \"%s\";\n", creds.SessionToken) fmt.Printf("set -gx ASSUMED_ROLE \"%s\";\n", role) + fmt.Printf("set -gx AWS_SESSION_EXPIRATION \"%s\"", formatExpirationTime(expiration)) fmt.Printf("# Run this to configure your shell:\n") fmt.Printf("# eval (%s)\n", strings.Join(os.Args, " ")) } // printPowerShellCredentials prints the credentials in a way that can easily be sourced // with Windows powershell using Invoke-Expression. -func printPowerShellCredentials(role string, creds *credentials.Value) { +func printPowerShellCredentials(role string, creds *credentials.Value, expiration *time.Time) { fmt.Printf("$env:AWS_ACCESS_KEY_ID=\"%s\"\n", creds.AccessKeyID) fmt.Printf("$env:AWS_SECRET_ACCESS_KEY=\"%s\"\n", creds.SecretAccessKey) fmt.Printf("$env:AWS_SESSION_TOKEN=\"%s\"\n", creds.SessionToken) fmt.Printf("$env:AWS_SECURITY_TOKEN=\"%s\"\n", creds.SessionToken) fmt.Printf("$env:ASSUMED_ROLE=\"%s\"\n", role) + fmt.Printf("$env:AWS_SESSION_EXPIRATION=\"%s\"\n", formatExpirationTime(expiration)) fmt.Printf("# Run this to configure your shell:\n") fmt.Printf("# %s | Invoke-Expression \n", strings.Join(os.Args, " ")) } @@ -167,7 +181,7 @@ func printPowerShellCredentials(role string, creds *credentials.Value) { // assumeProfile assumes the named profile which must exist in ~/.aws/config // (https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html) and returns the temporary STS // credentials. -func assumeProfile(profile string) (*credentials.Value, error) { +func assumeProfile(profile string) (*credentials.Value, *time.Time, error) { sess := session.Must(session.NewSessionWithOptions(session.Options{ Profile: profile, SharedConfigState: session.SharedConfigEnable, @@ -176,13 +190,17 @@ func assumeProfile(profile string) (*credentials.Value, error) { creds, err := sess.Config.Credentials.Get() if err != nil { - return nil, err + return nil, nil, err } - return &creds, nil + expiration, err := sess.Config.Credentials.ExpiresAt() + if err != nil { + return nil, nil, err + } + return &creds, &expiration, nil } // assumeRole assumes the given role and returns the temporary STS credentials. -func assumeRole(role, mfa string, duration time.Duration) (*credentials.Value, error) { +func assumeRole(role, mfa string, duration time.Duration) (*credentials.Value, *time.Time, error) { sess := session.Must(session.NewSession()) svc := sts.New(sess) @@ -196,7 +214,7 @@ func assumeRole(role, mfa string, duration time.Duration) (*credentials.Value, e params.SerialNumber = aws.String(mfa) token, err := readTokenCode() if err != nil { - return nil, err + return nil, nil, err } params.TokenCode = aws.String(token) } @@ -204,15 +222,14 @@ func assumeRole(role, mfa string, duration time.Duration) (*credentials.Value, e resp, err := svc.AssumeRole(params) if err != nil { - return nil, err + return nil, nil, err } var creds credentials.Value creds.AccessKeyID = *resp.Credentials.AccessKeyId creds.SecretAccessKey = *resp.Credentials.SecretAccessKey creds.SessionToken = *resp.Credentials.SessionToken - - return &creds, nil + return &creds, resp.Credentials.Expiration, nil } type roleConfig struct { diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..6d65bd4 --- /dev/null +++ b/main_test.go @@ -0,0 +1,51 @@ +package main + +import ( + "testing" + "time" +) + +func parseTime(v string) *time.Time { + t, _ := time.Parse(time.RFC1123Z, v) + return &t +} + +func TestFormatExpirationTime(t *testing.T) { + + var testCases = []struct { + in *time.Time + out string + description string + }{ + { + parseTime("Tue, 17 Dec 2019 12:25:28 -0500"), + "Tue 12:25", + "Test base case", + }, + { + parseTime("Tue, 17 Dec 2019 17:25:28 -0000"), + "Tue 12:25", + "Test time in UTC", + }, + { + parseTime("Tue, 17 Dec 2019 18:25:28 -0000"), + "Tue 13:25", + "Test time in after 1:00 PM UTC", + }, + { + nil, + "", + "Test when input is nil", + }, + } + + for _, tt := range testCases { + t.Run(tt.description, func(t *testing.T) { + actualOutput := formatExpirationTime(tt.in) + if actualOutput != tt.out { + t.Errorf("got %v, want %v", actualOutput, tt.out) + } + }) + } + +} 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 0e35cdb..0000000 --- a/vendor/github.com/aws/aws-sdk-go/CHANGELOG.md +++ /dev/null @@ -1,913 +0,0 @@ -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/CONTRIBUTING.md b/vendor/github.com/aws/aws-sdk-go/CONTRIBUTING.md deleted file mode 100644 index 7c0186f..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 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/Makefile b/vendor/github.com/aws/aws-sdk-go/Makefile deleted file mode 100644 index fc2bc0c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/Makefile +++ /dev/null @@ -1,175 +0,0 @@ -LINTIGNOREDOT='awstesting/integration.+should not use dot imports' -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 ' -LINTIGNOREDEPS='vendor/.+\.go' -UNIT_TEST_TAGS="example codegen" - -SDK_WITH_VENDOR_PKGS=$(shell go list -tags ${UNIT_TEST_TAGS} ./... | grep -v "/vendor/src") -SDK_ONLY_PKGS=$(shell go list ./... | grep -v "/vendor/") -SDK_UNIT_TEST_ONLY_PKGS=$(shell go list -tags ${UNIT_TEST_TAGS} ./... | grep -v "/vendor/") -SDK_GO_1_4=$(shell go version | grep "go1.4") -SDK_GO_1_5=$(shell go version | grep "go1.5") -SDK_GO_VERSION=$(shell go version | awk '''{print $$3}''' | tr -d '''\n''') - -all: get-deps generate unit - -help: - @echo "Please use \`make ' where is one of" - @echo " api_info to print a list of services and versions" - @echo " docs to build SDK documentation" - @echo " build to go build the SDK" - @echo " unit to run unit tests" - @echo " integration to run integration tests" - @echo " performance to run performance tests" - @echo " verify to verify tests" - @echo " lint to lint the SDK" - @echo " vet to vet the SDK" - @echo " generate to go generate and make services" - @echo " gen-test to generate protocol tests" - @echo " gen-services to generate services" - @echo " get-deps to go get the SDK dependencies" - @echo " get-deps-tests to get the SDK's test dependencies" - @echo " get-deps-verify to get the SDK's verification dependencies" - -generate: gen-test gen-endpoints gen-services - -gen-test: gen-protocol-test - -gen-services: - go generate ./service - -gen-protocol-test: - go generate ./private/protocol/... - -gen-endpoints: - go generate ./models/endpoints/ - -build: - @echo "go build SDK and vendor packages" - @go build ${SDK_ONLY_PKGS} - -unit: get-deps-tests build verify - @echo "go test SDK and vendor packages" - @go test -tags ${UNIT_TEST_TAGS} $(SDK_UNIT_TEST_ONLY_PKGS) - -unit-with-race-cover: get-deps-tests build verify - @echo "go test SDK and vendor packages" - @go test -tags ${UNIT_TEST_TAGS} -race -cpu=1,2,4 $(SDK_UNIT_TEST_ONLY_PKGS) - -integration: get-deps-tests integ-custom smoke-tests performance - -integ-custom: - go test -tags "integration" ./awstesting/integration/customizations/... - -smoke-tests: get-deps-tests - gucumber -go-tags "integration" ./awstesting/integration/smoke - -performance: get-deps-tests - AWS_TESTING_LOG_RESULTS=${log-detailed} AWS_TESTING_REGION=$(region) AWS_TESTING_DB_TABLE=$(table) gucumber -go-tags "integration" ./awstesting/performance - -sandbox-tests: sandbox-test-go15 sandbox-test-go15-novendorexp sandbox-test-go16 sandbox-test-go17 sandbox-test-go18 sandbox-test-gotip - -sandbox-build-go15: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.5 -t "aws-sdk-go-1.5" . -sandbox-go15: sandbox-build-go15 - docker run -i -t aws-sdk-go-1.5 bash -sandbox-test-go15: sandbox-build-go15 - docker run -t aws-sdk-go-1.5 - -sandbox-build-go15-novendorexp: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.5-novendorexp -t "aws-sdk-go-1.5-novendorexp" . -sandbox-go15-novendorexp: sandbox-build-go15-novendorexp - docker run -i -t aws-sdk-go-1.5-novendorexp bash -sandbox-test-go15-novendorexp: sandbox-build-go15-novendorexp - docker run -t aws-sdk-go-1.5-novendorexp - -sandbox-build-go16: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.6 -t "aws-sdk-go-1.6" . -sandbox-go16: sandbox-build-go16 - docker run -i -t aws-sdk-go-1.6 bash -sandbox-test-go16: sandbox-build-go16 - docker run -t aws-sdk-go-1.6 - -sandbox-build-go17: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.7 -t "aws-sdk-go-1.7" . -sandbox-go17: sandbox-build-go17 - docker run -i -t aws-sdk-go-1.7 bash -sandbox-test-go17: sandbox-build-go17 - docker run -t aws-sdk-go-1.7 - -sandbox-build-go18: - docker build -f ./awstesting/sandbox/Dockerfile.test.go1.8 -t "aws-sdk-go-1.8" . -sandbox-go18: sandbox-build-go18 - docker run -i -t aws-sdk-go-1.8 bash -sandbox-test-go18: sandbox-build-go18 - docker run -t aws-sdk-go-1.8 - -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" . - -verify: get-deps-verify lint vet - -lint: - @echo "go lint SDK and vendor packages" - @lint=`if [ \( -z "${SDK_GO_1_4}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then golint ./...; else echo "skipping golint"; fi`; \ - lint=`echo "$$lint" | grep -E -v -e ${LINTIGNOREDOT} -e ${LINTIGNOREDOC} -e ${LINTIGNORECONST} -e ${LINTIGNORESTUTTER} -e ${LINTIGNOREINFLECT} -e ${LINTIGNOREDEPS} -e ${LINTIGNOREINFLECTS3UPLOAD}`; \ - echo "$$lint"; \ - if [ "$$lint" != "" ] && [ "$$lint" != "skipping golint" ]; then exit 1; fi - -SDK_BASE_FOLDERS=$(shell ls -d */ | grep -v vendor | grep -v awsmigrate) -ifneq (,$(findstring go1.4, ${SDK_GO_VERSION})) - GO_VET_CMD=echo skipping go vet, ${SDK_GO_VERSION} -else ifneq (,$(findstring go1.6, ${SDK_GO_VERSION})) - GO_VET_CMD=go tool vet --all -shadow -example=false -else - GO_VET_CMD=go tool vet --all -shadow -endif - -vet: - ${GO_VET_CMD} ${SDK_BASE_FOLDERS} - -get-deps: get-deps-tests get-deps-verify - @echo "go get SDK dependencies" - @go get -v $(SDK_ONLY_PKGS) - -get-deps-tests: - @echo "go get SDK testing dependencies" - go get github.com/gucumber/gucumber/cmd/gucumber - go get github.com/stretchr/testify - go get github.com/smartystreets/goconvey - go get golang.org/x/net/html - -get-deps-verify: - @echo "go get SDK verification utilities" - @if [ \( -z "${SDK_GO_1_4}" \) -a \( -z "${SDK_GO_1_5}" \) ]; then go get github.com/golang/lint/golint; else echo "skipped getting golint"; fi - -bench: - @echo "go bench SDK packages" - @go test -run NONE -bench . -benchmem -tags 'bench' $(SDK_ONLY_PKGS) - -bench-protocol: - @echo "go bench SDK protocol marshallers" - @go test -run NONE -bench . -benchmem -tags 'bench' ./private/protocol/... - -docs: - @echo "generate SDK docs" - @# This env variable, DOCS, is for internal use - @if [ -z ${AWS_DOC_GEN_TOOL} ]; then\ - rm -rf doc && bundle install && bundle exec yard;\ - else\ - $(AWS_DOC_GEN_TOOL) `pwd`;\ - fi - -api_info: - @go run private/model/cli/api-info/api-info.go diff --git a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt index 5f14d11..899129e 100644 --- a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt +++ b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt @@ -1,3 +1,3 @@ AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright 2014-2015 Stripe, Inc. 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 fefe453..0000000 --- a/vendor/github.com/aws/aws-sdk-go/README.md +++ /dev/null @@ -1,162 +0,0 @@ -# AWS SDK for Go [![API Reference](http://img.shields.io/badge/api-reference-blue.svg)](http://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](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/aws/aws-sdk-go/blob/master/LICENSE.txt) - -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. - -## Installing - -If you are using Go 1.5 with the `GO15VENDOREXPERIMENT=1` vendoring flag, or 1.6 and higher you can use the following command to retrieve the SDK. The SDK's non-testing dependencies will be included and are vendored in the `vendor` folder. - - go get -u github.com/aws/aws-sdk-go - -Otherwise if your Go environment does not have vendoring support enabled, or you do not want to include the vendored SDK's dependencies you can use the following command to retrieve the SDK and its non-testing dependencies using `go get`. - - go get -u github.com/aws/aws-sdk-go/aws/... - go get -u github.com/aws/aws-sdk-go/service/... - -If you're looking to retrieve just the SDK without any dependencies use the following command. - - go get -d github.com/aws/aws-sdk-go/ - -These two processes will still include the `vendor` folder and it should be deleted if its not going to be 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 of 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 repro 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 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 an AWS service. These are great guides both, if you're getting started with a service, or looking for more information on a service. You should not need this document for coding, though in some cases, services may supply helpful samples that you might want to look out for. - -[`SDK Examples`](https://github.com/aws/aws-sdk-go/tree/master/example) - Included in the SDK's repo are a several hand crafted examples using the SDK features and AWS services. - -## Configuring Credentials - -Before using the SDK, ensure that you've configured credentials. The best -way to configure credentials on a development machine is to use the -`~/.aws/credentials` file, which might look like: - -``` -[default] -aws_access_key_id = AKID1234567890 -aws_secret_access_key = MY-SECRET-KEY -``` - -You can learn more about the credentials file from this -[blog post](http://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs). - -Alternatively, you can set the following environment variables: - -``` -AWS_ACCESS_KEY_ID=AKID1234567890 -AWS_SECRET_ACCESS_KEY=MY-SECRET-KEY -``` - -### AWS shared config file (`~/.aws/config`) -The AWS SDK for Go added support the shared config file in release [v1.3.0](https://github.com/aws/aws-sdk-go/releases/tag/v1.3.0). You can opt into enabling support for the shared config by setting the environment variable `AWS_SDK_LOAD_CONFIG` to a truthy value. See the [Session](https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html) docs for more information about this feature. - -## Using the Go SDK - -To use a service in the SDK, create a service variable by calling the `New()` -function. Once you have a service client, you can call API operations which each -return response data and a possible error. - -For example the following code shows how to upload an object to Amazon S3 with a Context timeout. - -```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() - - sess := session.Must(session.NewSession()) - 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) -} -``` - -You can find more information and operations in our -[API documentation](http://docs.aws.amazon.com/sdk-for-go/api/). - -## 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/awserr/error.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go index 56fdfc2..99849c0 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go @@ -138,8 +138,27 @@ type RequestFailure interface { RequestID() string } -// NewRequestFailure returns a new request error wrapper for the given Error -// provided. +// NewRequestFailure returns a wrapped error with additional information for +// request status code, and service requestID. +// +// Should be used to wrap all request which involve service requests. Even if +// the request failed without a service response, but had an HTTP status code +// that may be meaningful. func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure { return newRequestError(err, statusCode, reqID) } + +// UnmarshalError provides the interface for the SDK failing to unmarshal data. +type UnmarshalError interface { + awsError + Bytes() []byte +} + +// NewUnmarshalError returns an initialized UnmarshalError error wrapper adding +// the bytes that fail to unmarshal to the error. +func NewUnmarshalError(err error, msg string, bytes []byte) UnmarshalError { + return &unmarshalError{ + awsError: New("UnmarshalError", msg, err), + bytes: bytes, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go index 0202a00..9cf7eaf 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go @@ -1,6 +1,9 @@ package awserr -import "fmt" +import ( + "encoding/hex" + "fmt" +) // SprintError returns a string of the formatted error code. // @@ -119,6 +122,7 @@ type requestError struct { awsError statusCode int requestID string + bytes []byte } // newRequestError returns a wrapped error with additional information for @@ -170,6 +174,29 @@ func (r requestError) OrigErrs() []error { return []error{r.OrigErr()} } +type unmarshalError struct { + awsError + bytes []byte +} + +// Error returns the string representation of the error. +// Satisfies the error interface. +func (e unmarshalError) Error() string { + extra := hex.Dump(e.bytes) + return SprintError(e.Code(), e.Message(), extra, e.OrigErr()) +} + +// String returns the string representation of the error. +// Alias for Error to satisfy the stringer interface. +func (e unmarshalError) String() string { + return e.Error() +} + +// Bytes returns the bytes that failed to unmarshal. +func (e unmarshalError) Bytes() []byte { + return e.bytes +} + // An error list that satisfies the golang interface type errorList []error @@ -181,7 +208,7 @@ func (e errorList) Error() string { // How do we want to handle the array size being zero if size := len(e); size > 0 { for i := 0; i < size; i++ { - msg += fmt.Sprintf("%s", e[i].Error()) + msg += e[i].Error() // We check the next index to see if it is within the slice. // If it is, then we append a newline. We do this, because unit tests // could be broken with the additional '\n' 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 0e75c5e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy_test.go +++ /dev/null @@ -1,265 +0,0 @@ -package awsutil_test - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/stretchr/testify/assert" -) - -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 - assert.Equal(t, f2.A, f1.A) - assert.Equal(t, f2.B, f1.B) - assert.Equal(t, f2.C, f1.C) - assert.Equal(t, f2.D, f1.D) - assert.Equal(t, f2.E.B, f1.E.B) - assert.Equal(t, f2.E.D, f1.E.D) - - // 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 - assert.NotEqual(t, f2.A, f1.A) - assert.NotEqual(t, f2.B, f1.B) - assert.NotEqual(t, f2.C, f1.C) - assert.NotEqual(t, f2.D, f1.D) - assert.NotEqual(t, f2.E.a, f1.E.a) - assert.NotEqual(t, f2.E.B, f1.E.B) - assert.NotEqual(t, f2.E.c, f1.E.c) - assert.NotEqual(t, f2.E.D, f1.E.D) -} - -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 - assert.Equal(t, f2.A, f1.A) - assert.NotEqual(t, f2.B, f1.B) - assert.NotEqual(t, f2.B.a, f1.B.a) - assert.Equal(t, f2.B.B, f2.B.B) -} - -func TestCopyIgnoreNilMembers(t *testing.T) { - type Foo struct { - A *string - B []string - C map[string]string - } - - f := &Foo{} - assert.Nil(t, f.A) - assert.Nil(t, f.B) - assert.Nil(t, f.C) - - var f2 Foo - awsutil.Copy(&f2, f) - assert.Nil(t, f2.A) - assert.Nil(t, f2.B) - assert.Nil(t, f2.C) - - fcopy := awsutil.CopyOf(f) - f3 := fcopy.(*Foo) - assert.Nil(t, f3.A) - assert.Nil(t, f3.B) - assert.Nil(t, f3.C) -} - -func TestCopyPrimitive(t *testing.T) { - str := "hello" - var s string - awsutil.Copy(&s, &str) - assert.Equal(t, "hello", s) -} - -func TestCopyNil(t *testing.T) { - var s string - awsutil.Copy(&s, nil) - assert.Equal(t, "", s) -} - -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) - assert.NoError(t, err) - assert.Equal(t, []byte("hello world"), b) - - // empty bytes because this is not a deep copy - b, err = ioutil.ReadAll(buf) - assert.NoError(t, err) - assert.Equal(t, []byte(""), b) -} - -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 - assert.Equal(t, f2.A, f1.A) - assert.Equal(t, f2.B, f1.B) - assert.Equal(t, f2.C, f1.C) - assert.Equal(t, "unique", f1.SrcUnique) - assert.Equal(t, 1, f1.SameNameDiffType) - assert.Equal(t, 0, f2.DstUnique) - assert.Equal(t, "", f2.SameNameDiffType) - assert.Equal(t, int1, *f1.unexportedPtr) - assert.Nil(t, f2.unexportedPtr) - assert.Equal(t, int2, *f1.ExportedPtr) - assert.Equal(t, int2, *f2.ExportedPtr) -} - -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.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go index 59fa4a5..142a7a0 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go @@ -15,7 +15,7 @@ func DeepEqual(a, b interface{}) bool { rb := reflect.Indirect(reflect.ValueOf(b)) if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { - // If the elements are both nil, and of the same type the are equal + // If the elements are both nil, and of the same type they are equal // If they are of different types they are not equal return reflect.TypeOf(a) == reflect.TypeOf(b) } else if raValid != rbValid { 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 7a5db6e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package awsutil_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/stretchr/testify/assert" -) - -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 { - assert.Equal(t, c.equal, awsutil.DeepEqual(c.a, c.b), "%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.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 11c52c3..a4eb6a7 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -70,7 +70,7 @@ func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTer value = value.FieldByNameFunc(func(name string) bool { if c == name { return true - } else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) { + } else if !caseSensitive && strings.EqualFold(name, c) { return true } return false @@ -185,13 +185,12 @@ func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { // SetValueAtPath sets a value at the case insensitive lexical path inside // of a structure. func SetValueAtPath(i interface{}, path string, v interface{}) { - if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil { - for _, rval := range rvals { - if rval.Kind() == reflect.Ptr && rval.IsNil() { - continue - } - setValue(rval, v) + rvals := rValuesAtPath(i, path, true, false, v == nil) + for _, rval := range rvals { + if rval.Kind() == reflect.Ptr && rval.IsNil() { + continue } + setValue(rval, v) } } 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 b222556..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value_test.go +++ /dev/null @@ -1,142 +0,0 @@ -package awsutil_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/stretchr/testify/assert" -) - -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) - assert.NoError(t, err, "case %d, expected no error, %s", i, c.path) - assert.Equal(t, c.expect, v, "case %d, %s", 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 != "" { - assert.Contains(t, err.Error(), c.errContains, "case %d, expected error, %s", i, c.path) - continue - } else { - assert.NoError(t, err, "case %d, expected no error, %s", i, c.path) - } - assert.Equal(t, c.expect, v, "case %d, %s", 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") - assert.Equal(t, "test1", s.C) - assert.Equal(t, "test2", s.B.B.C) - assert.Equal(t, "test3", s.B.D.C) - - awsutil.SetValueAtPath(&s, "B.*.C", "test0") - assert.Equal(t, "test0", s.B.B.C) - assert.Equal(t, "test0", s.B.D.C) - - var s2 Struct - awsutil.SetValueAtPath(&s2, "b.b.c", "test0") - assert.Equal(t, "test0", s2.B.B.C) - awsutil.SetValueAtPath(&s2, "A", []Struct{{}}) - assert.Equal(t, []Struct{{}}, s2.A) - - str := "foo" - - s3 := Struct{} - awsutil.SetValueAtPath(&s3, "b.b.c", str) - assert.Equal(t, "foo", s3.B.B.C) - - s3 = Struct{B: &Struct{B: &Struct{C: str}}} - awsutil.SetValueAtPath(&s3, "b.b.c", nil) - assert.Equal(t, "", s3.B.B.C) - - s3 = Struct{} - awsutil.SetValueAtPath(&s3, "b.b.c", nil) - assert.Equal(t, "", s3.B.B.C) - - s3 = Struct{} - awsutil.SetValueAtPath(&s3, "b.b.c", &str) - assert.Equal(t, "foo", s3.B.B.C) - - var s4 struct{ Name *string } - awsutil.SetValueAtPath(&s4, "Name", str) - assert.Equal(t, str, *s4.Name) - - s4 = struct{ Name *string }{} - awsutil.SetValueAtPath(&s4, "Name", nil) - assert.Equal(t, (*string)(nil), s4.Name) - - s4 = struct{ Name *string }{Name: &str} - awsutil.SetValueAtPath(&s4, "Name", nil) - assert.Equal(t, (*string)(nil), s4.Name) - - s4 = struct{ Name *string }{} - awsutil.SetValueAtPath(&s4, "Name", &str) - assert.Equal(t, str, *s4.Name) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go index b6432f1..645df24 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go @@ -23,28 +23,27 @@ func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) { case reflect.Struct: buf.WriteString("{\n") - names := []string{} for i := 0; i < v.Type().NumField(); i++ { - name := v.Type().Field(i).Name - f := v.Field(i) - if name[0:1] == strings.ToLower(name[0:1]) { + ft := v.Type().Field(i) + fv := v.Field(i) + + if ft.Name[0:1] == strings.ToLower(ft.Name[0:1]) { continue // ignore unexported fields } - if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() { + if (fv.Kind() == reflect.Ptr || fv.Kind() == reflect.Slice) && fv.IsNil() { continue // ignore unset fields } - names = append(names, name) - } - for i, n := range names { - val := v.FieldByName(n) buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(n + ": ") - stringValue(val, indent+2, buf) + buf.WriteString(ft.Name + ": ") - if i < len(names)-1 { - buf.WriteString(",\n") + if tag := ft.Tag.Get("sensitive"); tag == "true" { + buf.WriteString("") + } else { + stringValue(fv, indent+2, buf) } + + buf.WriteString(",\n") } buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go index 17fc76a..03334d6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go @@ -2,7 +2,6 @@ package client import ( "fmt" - "net/http/httputil" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client/metadata" @@ -13,9 +12,16 @@ import ( type Config struct { Config *aws.Config Handlers request.Handlers + PartitionID string Endpoint string SigningRegion string SigningName string + + // States that the signing name did not come from a modeled source but + // was derived based on other data. Used by service client constructors + // to determine if the signin name can be overridden based on metadata the + // service has. + SigningNameDerived bool } // ConfigProvider provides a generic way for a service client to receive @@ -46,7 +52,7 @@ func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, op svc := &Client{ Config: cfg, ClientInfo: info, - Handlers: handlers, + Handlers: handlers.Copy(), } switch retryer, ok := cfg.Retryer.(request.Retryer); { @@ -59,7 +65,7 @@ func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, op default: maxRetries := aws.IntValue(cfg.MaxRetries) if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { - maxRetries = 3 + maxRetries = DefaultRetryerMaxNumRetries } svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} } @@ -86,61 +92,6 @@ func (c *Client) AddDebugHandlers() { return } - c.Handlers.Send.PushFront(logRequest) - c.Handlers.Send.PushBack(logResponse) -} - -const logReqMsg = `DEBUG: Request %s/%s Details: ----[ REQUEST POST-SIGN ]----------------------------- -%s ------------------------------------------------------` - -const logReqErrMsg = `DEBUG ERROR: Request %s/%s: ----[ REQUEST DUMP ERROR ]----------------------------- -%s ------------------------------------------------------` - -func logRequest(r *request.Request) { - logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) - dumpedBody, err := httputil.DumpRequestOut(r.HTTPRequest, logBody) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - if logBody { - // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's - // Body as a NoOpCloser and will not be reset after read by the HTTP - // client reader. - r.ResetBody() - } - - r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody))) -} - -const logRespMsg = `DEBUG: Response %s/%s Details: ----[ RESPONSE ]-------------------------------------- -%s ------------------------------------------------------` - -const logRespErrMsg = `DEBUG ERROR: Response %s/%s: ----[ RESPONSE DUMP ERROR ]----------------------------- -%s ------------------------------------------------------` - -func logResponse(r *request.Request) { - var msg = "no response data" - if r.HTTPResponse != nil { - logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) - dumpedBody, err := httputil.DumpResponse(r.HTTPResponse, logBody) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - msg = string(dumpedBody) - } else if r.Error != nil { - msg = r.Error.Error() - } - r.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.ClientInfo.ServiceName, r.Operation.Name, msg)) + c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler) + c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go index 43a3676..9f6af19 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go @@ -1,90 +1,177 @@ package client import ( - "math/rand" - "sync" + "math" + "strconv" "time" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/sdkrand" ) // DefaultRetryer implements basic retry logic using exponential backoff for -// most services. If you want to implement custom retry logic, implement the -// request.Retryer interface or create a structure type that composes this -// struct and override the specific methods. For example, to override only -// the MaxRetries method: +// most services. If you want to implement custom retry logic, you can implement the +// request.Retryer interface. // -// type retryer struct { -// service.DefaultRetryer -// } -// -// // This implementation always has 100 max retries -// func (d retryer) MaxRetries() uint { return 100 } type DefaultRetryer struct { + // Num max Retries is the number of max retries that will be performed. + // By default, this is zero. NumMaxRetries int + + // MinRetryDelay is the minimum retry delay after which retry will be performed. + // If not set, the value is 0ns. + MinRetryDelay time.Duration + + // MinThrottleRetryDelay is the minimum retry delay when throttled. + // If not set, the value is 0ns. + MinThrottleDelay time.Duration + + // MaxRetryDelay is the maximum retry delay before which retry must be performed. + // If not set, the value is 0ns. + MaxRetryDelay time.Duration + + // MaxThrottleDelay is the maximum retry delay when throttled. + // If not set, the value is 0ns. + MaxThrottleDelay time.Duration } +const ( + // DefaultRetryerMaxNumRetries sets maximum number of retries + DefaultRetryerMaxNumRetries = 3 + + // DefaultRetryerMinRetryDelay sets minimum retry delay + DefaultRetryerMinRetryDelay = 30 * time.Millisecond + + // DefaultRetryerMinThrottleDelay sets minimum delay when throttled + DefaultRetryerMinThrottleDelay = 500 * time.Millisecond + + // DefaultRetryerMaxRetryDelay sets maximum retry delay + DefaultRetryerMaxRetryDelay = 300 * time.Second + + // DefaultRetryerMaxThrottleDelay sets maximum delay when throttled + DefaultRetryerMaxThrottleDelay = 300 * time.Second +) + // MaxRetries returns the number of maximum returns the service will use to make // an individual API request. func (d DefaultRetryer) MaxRetries() int { return d.NumMaxRetries } -var seededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) +// setRetryerDefaults sets the default values of the retryer if not set +func (d *DefaultRetryer) setRetryerDefaults() { + if d.MinRetryDelay == 0 { + d.MinRetryDelay = DefaultRetryerMinRetryDelay + } + if d.MaxRetryDelay == 0 { + d.MaxRetryDelay = DefaultRetryerMaxRetryDelay + } + if d.MinThrottleDelay == 0 { + d.MinThrottleDelay = DefaultRetryerMinThrottleDelay + } + if d.MaxThrottleDelay == 0 { + d.MaxThrottleDelay = DefaultRetryerMaxThrottleDelay + } +} // RetryRules returns the delay duration before retrying this request again func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { - // Set the upper limit of delay in retrying at ~five minutes - minTime := 30 - throttle := d.shouldThrottle(r) - if throttle { - minTime = 500 + + // if number of max retries is zero, no retries will be performed. + if d.NumMaxRetries == 0 { + return 0 + } + + // Sets default value for retryer members + d.setRetryerDefaults() + + // minDelay is the minimum retryer delay + minDelay := d.MinRetryDelay + + var initialDelay time.Duration + + isThrottle := r.IsErrorThrottle() + if isThrottle { + if delay, ok := getRetryAfterDelay(r); ok { + initialDelay = delay + } + minDelay = d.MinThrottleDelay } retryCount := r.RetryCount - if retryCount > 13 { - retryCount = 13 - } else if throttle && retryCount > 8 { - retryCount = 8 + + // maxDelay the maximum retryer delay + maxDelay := d.MaxRetryDelay + + if isThrottle { + maxDelay = d.MaxThrottleDelay } - delay := (1 << uint(retryCount)) * (seededRand.Intn(minTime) + minTime) - return time.Duration(delay) * time.Millisecond + var delay time.Duration + + // Logic to cap the retry count based on the minDelay provided + actualRetryCount := int(math.Log2(float64(minDelay))) + 1 + if actualRetryCount < 63-retryCount { + delay = time.Duration(1< maxDelay { + delay = getJitterDelay(maxDelay / 2) + } + } else { + delay = getJitterDelay(maxDelay / 2) + } + return delay + initialDelay +} + +// getJitterDelay returns a jittered delay for retry +func getJitterDelay(duration time.Duration) time.Duration { + return time.Duration(sdkrand.SeededRand.Int63n(int64(duration)) + int64(duration)) } // ShouldRetry returns true if the request should be retried. func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { - if r.HTTPResponse.StatusCode >= 500 { - return true + + // ShouldRetry returns false if number of max retries is 0. + if d.NumMaxRetries == 0 { + return false } - return r.IsErrorRetryable() || d.shouldThrottle(r) -} -// ShouldThrottle returns true if the request should be throttled. -func (d DefaultRetryer) shouldThrottle(r *request.Request) bool { - if r.HTTPResponse.StatusCode == 502 || - r.HTTPResponse.StatusCode == 503 || - r.HTTPResponse.StatusCode == 504 { - return true + // If one of the other handlers already set the retry state + // we don't want to override it based on the service's state + if r.Retryable != nil { + return *r.Retryable } - return r.IsErrorThrottle() + return r.IsErrorRetryable() || r.IsErrorThrottle() } -// lockedSource is a thread-safe implementation of rand.Source -type lockedSource struct { - lk sync.Mutex - src rand.Source -} +// This will look in the Retry-After header, RFC 7231, for how long +// it will wait before attempting another request +func getRetryAfterDelay(r *request.Request) (time.Duration, bool) { + if !canUseRetryAfterHeader(r) { + return 0, false + } + + delayStr := r.HTTPResponse.Header.Get("Retry-After") + if len(delayStr) == 0 { + return 0, false + } -func (r *lockedSource) Int63() (n int64) { - r.lk.Lock() - n = r.src.Int63() - r.lk.Unlock() - return + delay, err := strconv.Atoi(delayStr) + if err != nil { + return 0, false + } + + return time.Duration(delay) * time.Second, true } -func (r *lockedSource) Seed(seed int64) { - r.lk.Lock() - r.src.Seed(seed) - r.lk.Unlock() +// Will look at the status code to see if the retry header pertains to +// the status code. +func canUseRetryAfterHeader(r *request.Request) bool { + switch r.HTTPResponse.StatusCode { + case 429: + case 503: + default: + return false + } + + return true } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go new file mode 100644 index 0000000..8958c32 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go @@ -0,0 +1,194 @@ +package client + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "net/http/httputil" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +const logReqMsg = `DEBUG: Request %s/%s Details: +---[ REQUEST POST-SIGN ]----------------------------- +%s +-----------------------------------------------------` + +const logReqErrMsg = `DEBUG ERROR: Request %s/%s: +---[ REQUEST DUMP ERROR ]----------------------------- +%s +------------------------------------------------------` + +type logWriter struct { + // Logger is what we will use to log the payload of a response. + Logger aws.Logger + // buf stores the contents of what has been read + buf *bytes.Buffer +} + +func (logger *logWriter) Write(b []byte) (int, error) { + return logger.buf.Write(b) +} + +type teeReaderCloser struct { + // io.Reader will be a tee reader that is used during logging. + // This structure will read from a body and write the contents to a logger. + io.Reader + // Source is used just to close when we are done reading. + Source io.ReadCloser +} + +func (reader *teeReaderCloser) Close() error { + return reader.Source.Close() +} + +// LogHTTPRequestHandler is a SDK request handler to log the HTTP request sent +// to a service. Will include the HTTP request body if the LogLevel of the +// request matches LogDebugWithHTTPBody. +var LogHTTPRequestHandler = request.NamedHandler{ + Name: "awssdk.client.LogRequest", + Fn: logRequest, +} + +func logRequest(r *request.Request) { + logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) + bodySeekable := aws.IsReaderSeekable(r.Body) + + b, err := httputil.DumpRequestOut(r.HTTPRequest, logBody) + if err != nil { + r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, err)) + return + } + + if logBody { + if !bodySeekable { + r.SetReaderBody(aws.ReadSeekCloser(r.HTTPRequest.Body)) + } + // Reset the request body because dumpRequest will re-wrap the + // r.HTTPRequest's Body as a NoOpCloser and will not be reset after + // read by the HTTP client reader. + if err := r.Error; err != nil { + r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, err)) + return + } + } + + r.Config.Logger.Log(fmt.Sprintf(logReqMsg, + r.ClientInfo.ServiceName, r.Operation.Name, string(b))) +} + +// LogHTTPRequestHeaderHandler is a SDK request handler to log the HTTP request sent +// to a service. Will only log the HTTP request's headers. The request payload +// will not be read. +var LogHTTPRequestHeaderHandler = request.NamedHandler{ + Name: "awssdk.client.LogRequestHeader", + Fn: logRequestHeader, +} + +func logRequestHeader(r *request.Request) { + b, err := httputil.DumpRequestOut(r.HTTPRequest, false) + if err != nil { + r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, err)) + return + } + + r.Config.Logger.Log(fmt.Sprintf(logReqMsg, + r.ClientInfo.ServiceName, r.Operation.Name, string(b))) +} + +const logRespMsg = `DEBUG: Response %s/%s Details: +---[ RESPONSE ]-------------------------------------- +%s +-----------------------------------------------------` + +const logRespErrMsg = `DEBUG ERROR: Response %s/%s: +---[ RESPONSE DUMP ERROR ]----------------------------- +%s +-----------------------------------------------------` + +// LogHTTPResponseHandler is a SDK request handler to log the HTTP response +// received from a service. Will include the HTTP response body if the LogLevel +// of the request matches LogDebugWithHTTPBody. +var LogHTTPResponseHandler = request.NamedHandler{ + Name: "awssdk.client.LogResponse", + Fn: logResponse, +} + +func logResponse(r *request.Request) { + lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)} + + if r.HTTPResponse == nil { + lw.Logger.Log(fmt.Sprintf(logRespErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, "request's HTTPResponse is nil")) + return + } + + logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) + if logBody { + r.HTTPResponse.Body = &teeReaderCloser{ + Reader: io.TeeReader(r.HTTPResponse.Body, lw), + Source: r.HTTPResponse.Body, + } + } + + handlerFn := func(req *request.Request) { + b, err := httputil.DumpResponse(req.HTTPResponse, false) + if err != nil { + lw.Logger.Log(fmt.Sprintf(logRespErrMsg, + req.ClientInfo.ServiceName, req.Operation.Name, err)) + return + } + + lw.Logger.Log(fmt.Sprintf(logRespMsg, + req.ClientInfo.ServiceName, req.Operation.Name, string(b))) + + if logBody { + b, err := ioutil.ReadAll(lw.buf) + if err != nil { + lw.Logger.Log(fmt.Sprintf(logRespErrMsg, + req.ClientInfo.ServiceName, req.Operation.Name, err)) + return + } + + lw.Logger.Log(string(b)) + } + } + + const handlerName = "awsdk.client.LogResponse.ResponseBody" + + r.Handlers.Unmarshal.SetBackNamed(request.NamedHandler{ + Name: handlerName, Fn: handlerFn, + }) + r.Handlers.UnmarshalError.SetBackNamed(request.NamedHandler{ + Name: handlerName, Fn: handlerFn, + }) +} + +// LogHTTPResponseHeaderHandler is a SDK request handler to log the HTTP +// response received from a service. Will only log the HTTP response's headers. +// The response payload will not be read. +var LogHTTPResponseHeaderHandler = request.NamedHandler{ + Name: "awssdk.client.LogResponseHeader", + Fn: logResponseHeader, +} + +func logResponseHeader(r *request.Request) { + if r.Config.Logger == nil { + return + } + + b, err := httputil.DumpResponse(r.HTTPResponse, false) + if err != nil { + r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg, + r.ClientInfo.ServiceName, r.Operation.Name, err)) + return + } + + r.Config.Logger.Log(fmt.Sprintf(logRespMsg, + r.ClientInfo.ServiceName, r.Operation.Name, string(b))) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go index 4778056..0c48f72 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go @@ -3,7 +3,9 @@ package metadata // ClientInfo wraps immutable data from the client.Client structure. type ClientInfo struct { ServiceName string + ServiceID string APIVersion string + PartitionID string Endpoint string SigningName string SigningRegion string diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go new file mode 100644 index 0000000..881d575 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/no_op_retryer.go @@ -0,0 +1,28 @@ +package client + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws/request" +) + +// NoOpRetryer provides a retryer that performs no retries. +// It should be used when we do not want retries to be performed. +type NoOpRetryer struct{} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API; For NoOpRetryer the MaxRetries will always be zero. +func (d NoOpRetryer) MaxRetries() int { + return 0 +} + +// ShouldRetry will always return false for NoOpRetryer, as it should never retry. +func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool { + return false +} + +// RetryRules returns the delay duration before retrying this request again; +// since NoOpRetryer does not retry, RetryRules always returns 0. +func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration { + return 0 +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index 948e0a6..869db26 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -18,9 +18,9 @@ const UseServiceDefaultRetries = -1 type RequestRetryer interface{} // A Config provides service configuration for service clients. By default, -// all clients will use the defaults.DefaultConfig tructure. +// all clients will use the defaults.DefaultConfig structure. // -// // Create Session with MaxRetry configuration to be shared by multiple +// // Create Session with MaxRetries configuration to be shared by multiple // // service clients. // sess := session.Must(session.NewSession(&aws.Config{ // MaxRetries: aws.Int(3), @@ -45,21 +45,28 @@ type Config struct { // that overrides the default generated endpoint for a client. Set this // to `""` to use the default generated endpoint. // - // @note You must still provide a `Region` value when specifying an - // endpoint for a client. + // Note: You must still provide a `Region` value when specifying an + // endpoint for a client. Endpoint *string // The resolver to use for looking up endpoints for AWS service clients // to use based on region. EndpointResolver endpoints.Resolver + // EnforceShouldRetryCheck is used in the AfterRetryHandler to always call + // ShouldRetry regardless of whether or not if request.Retryable is set. + // This will utilize ShouldRetry method of custom retryers. If EnforceShouldRetryCheck + // is not set, then ShouldRetry will only be called if request.Retryable is nil. + // Proper handling of the request.Retryable field is important when setting this field. + EnforceShouldRetryCheck *bool + // The region to send requests to. This parameter is required and must // be configured globally or on a per-client basis unless otherwise // noted. A full list of regions is found in the "Regions and Endpoints" // document. // - // @see http://docs.aws.amazon.com/general/latest/gr/rande.html - // AWS Regions and Endpoints + // See http://docs.aws.amazon.com/general/latest/gr/rande.html for AWS + // Regions and Endpoints. Region *string // Set this to `true` to disable SSL when sending requests. Defaults @@ -88,7 +95,7 @@ type Config struct { // recoverable failures. // // When nil or the value does not implement the request.Retryer interface, - // the request.DefaultRetryer will be used. + // the client.DefaultRetryer will be used. // // When both Retryer and MaxRetries are non-nil, the former is used and // the latter ignored. @@ -113,9 +120,10 @@ type Config struct { // will use virtual hosted bucket addressing when possible // (`http://BUCKET.s3.amazonaws.com/KEY`). // - // @note This configuration option is specific to the Amazon S3 service. - // @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html - // Amazon S3: Virtual Hosting of Buckets + // Note: This configuration option is specific to the Amazon S3 service. + // + // See http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html + // for Amazon S3: Virtual Hosting of Buckets S3ForcePathStyle *bool // Set this to `true` to disable the SDK adding the `Expect: 100-Continue` @@ -144,6 +152,19 @@ type Config struct { // with accelerate. S3UseAccelerate *bool + // S3DisableContentMD5Validation config option is temporarily disabled, + // For S3 GetObject API calls, #1837. + // + // Set this to `true` to disable the S3 service client from automatically + // adding the ContentMD5 to S3 Object Put and Upload API calls. This option + // will also disable the SDK from performing object ContentMD5 validation + // on GetObject API calls. + S3DisableContentMD5Validation *bool + + // Set this to `true` to have the S3 service client to use the region specified + // in the ARN, when an ARN is provided as an argument to a bucket parameter. + S3UseARNRegion *bool + // Set this to `true` to disable the EC2Metadata client from overriding the // default http.Client's Timeout. This is helpful if you do not want the // EC2Metadata client to create a new http.Client. This options is only @@ -161,7 +182,7 @@ type Config struct { // EC2MetadataDisableTimeoutOverride *bool - // Instructs the endpiont to be generated for a service client to + // Instructs the endpoint to be generated for a service client to // be the dual stack endpoint. The dual stack endpoint will support // both IPv4 and IPv6 addressing. // @@ -207,12 +228,40 @@ type Config struct { // Key: aws.String("//foo//bar//moo"), // }) DisableRestProtocolURICleaning *bool + + // EnableEndpointDiscovery will allow for endpoint discovery on operations that + // have the definition in its model. By default, endpoint discovery is off. + // + // Example: + // sess := session.Must(session.NewSession(&aws.Config{ + // EnableEndpointDiscovery: aws.Bool(true), + // })) + // + // svc := s3.New(sess) + // out, err := svc.GetObject(&s3.GetObjectInput { + // Bucket: aws.String("bucketname"), + // Key: aws.String("/foo/bar/moo"), + // }) + EnableEndpointDiscovery *bool + + // DisableEndpointHostPrefix will disable the SDK's behavior of prefixing + // request endpoint hosts with modeled information. + // + // Disabling this feature is useful when you want to use local endpoints + // for testing that do not support the modeled host prefix pattern. + DisableEndpointHostPrefix *bool + + // STSRegionalEndpoint will enable regional or legacy endpoint resolving + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // S3UsEast1RegionalEndpoint will enable regional or legacy endpoint resolving + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint } // NewConfig returns a new Config pointer that can be chained with builder // methods to set multiple configuration values inline without using pointers. // -// // Create Session with MaxRetry configuration to be shared by multiple +// // Create Session with MaxRetries configuration to be shared by multiple // // service clients. // sess := session.Must(session.NewSession(aws.NewConfig(). // WithMaxRetries(3), @@ -329,6 +378,22 @@ func (c *Config) WithS3Disable100Continue(disable bool) *Config { func (c *Config) WithS3UseAccelerate(enable bool) *Config { c.S3UseAccelerate = &enable return c + +} + +// WithS3DisableContentMD5Validation sets a config +// S3DisableContentMD5Validation value returning a Config pointer for chaining. +func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config { + c.S3DisableContentMD5Validation = &enable + return c + +} + +// WithS3UseARNRegion sets a config S3UseARNRegion value and +// returning a Config pointer for chaining +func (c *Config) WithS3UseARNRegion(enable bool) *Config { + c.S3UseARNRegion = &enable + return c } // WithUseDualStack sets a config UseDualStack value returning a Config @@ -352,6 +417,19 @@ func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config { return c } +// WithEndpointDiscovery will set whether or not to use endpoint discovery. +func (c *Config) WithEndpointDiscovery(t bool) *Config { + c.EnableEndpointDiscovery = &t + return c +} + +// WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix +// when making requests. +func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config { + c.DisableEndpointHostPrefix = &t + return c +} + // MergeIn merges the passed in configs into the existing config object. func (c *Config) MergeIn(cfgs ...*Config) { for _, other := range cfgs { @@ -359,6 +437,20 @@ func (c *Config) MergeIn(cfgs ...*Config) { } } +// WithSTSRegionalEndpoint will set whether or not to use regional endpoint flag +// when resolving the endpoint for a service +func (c *Config) WithSTSRegionalEndpoint(sre endpoints.STSRegionalEndpoint) *Config { + c.STSRegionalEndpoint = sre + return c +} + +// WithS3UsEast1RegionalEndpoint will set whether or not to use regional endpoint flag +// when resolving the endpoint for a service +func (c *Config) WithS3UsEast1RegionalEndpoint(sre endpoints.S3UsEast1RegionalEndpoint) *Config { + c.S3UsEast1RegionalEndpoint = sre + return c +} + func mergeInConfig(dst *Config, other *Config) { if other == nil { return @@ -428,6 +520,14 @@ func mergeInConfig(dst *Config, other *Config) { dst.S3UseAccelerate = other.S3UseAccelerate } + if other.S3DisableContentMD5Validation != nil { + dst.S3DisableContentMD5Validation = other.S3DisableContentMD5Validation + } + + if other.S3UseARNRegion != nil { + dst.S3UseARNRegion = other.S3UseARNRegion + } + if other.UseDualStack != nil { dst.UseDualStack = other.UseDualStack } @@ -443,6 +543,26 @@ func mergeInConfig(dst *Config, other *Config) { if other.DisableRestProtocolURICleaning != nil { dst.DisableRestProtocolURICleaning = other.DisableRestProtocolURICleaning } + + if other.EnforceShouldRetryCheck != nil { + dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck + } + + if other.EnableEndpointDiscovery != nil { + dst.EnableEndpointDiscovery = other.EnableEndpointDiscovery + } + + if other.DisableEndpointHostPrefix != nil { + dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix + } + + if other.STSRegionalEndpoint != endpoints.UnsetSTSEndpoint { + dst.STSRegionalEndpoint = other.STSRegionalEndpoint + } + + if other.S3UsEast1RegionalEndpoint != endpoints.UnsetS3UsEast1Endpoint { + dst.S3UsEast1RegionalEndpoint = other.S3UsEast1RegionalEndpoint + } } // Copy will return a shallow copy of the Config object. If any additional 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.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go similarity index 58% rename from vendor/github.com/aws/aws-sdk-go/aws/context.go rename to vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go index 79f4268..2866f9a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/context.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go @@ -1,8 +1,8 @@ +// +build !go1.9 + package aws -import ( - "time" -) +import "time" // Context is an copy of the Go v1.7 stdlib's context.Context interface. // It is represented as a SDK interface to enable you to use the "WithContext" @@ -35,37 +35,3 @@ type Context interface { // functions. Value(key interface{}) interface{} } - -// BackgroundContext returns a context that will never be canceled, has no -// values, and no deadline. This context is used by the SDK to provide -// backwards compatibility with non-context API operations and functionality. -// -// Go 1.6 and before: -// This context function is equivalent to context.Background in the Go stdlib. -// -// Go 1.7 and later: -// The context returned will be the value returned by context.Background() -// -// See https://golang.org/pkg/context for more information on Contexts. -func BackgroundContext() Context { - return backgroundCtx -} - -// SleepWithContext will wait for the timer duration to expire, or the context -// is canceled. Which ever happens first. If the context is canceled the Context's -// error will be returned. -// -// Expects Context to always return a non-nil error if the Done channel is closed. -func SleepWithContext(ctx Context, dur time.Duration) error { - t := time.NewTimer(dur) - defer t.Stop() - - select { - case <-t.C: - break - case <-ctx.Done(): - return ctx.Err() - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go deleted file mode 100644 index e8cf93d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go +++ /dev/null @@ -1,41 +0,0 @@ -// +build !go1.7 - -package aws - -import "time" - -// An emptyCtx is a copy of the the Go 1.7 context.emptyCtx type. This -// is copied to provide a 1.6 and 1.5 safe version of context that is compatible -// with Go 1.7's Context. -// -// An emptyCtx is never canceled, has no values, and has no deadline. It is not -// struct{}, since vars of this type must have distinct addresses. -type emptyCtx int - -func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { - return -} - -func (*emptyCtx) Done() <-chan struct{} { - return nil -} - -func (*emptyCtx) Err() error { - return nil -} - -func (*emptyCtx) Value(key interface{}) interface{} { - return nil -} - -func (e *emptyCtx) String() string { - switch e { - case backgroundCtx: - return "aws.BackgroundContext" - } - return "unknown empty Context" -} - -var ( - backgroundCtx = new(emptyCtx) -) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go deleted file mode 100644 index 064f75c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build go1.7 - -package aws - -import "context" - -var ( - backgroundCtx = context.Background() -) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go new file mode 100644 index 0000000..3718b26 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go @@ -0,0 +1,11 @@ +// +build go1.9 + +package aws + +import "context" + +// Context is an alias of the Go stdlib's context.Context interface. +// It can be used within the SDK's API operation "WithContext" methods. +// +// See https://golang.org/pkg/context on how to use contexts. +type Context = context.Context diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go new file mode 100644 index 0000000..66c5945 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go @@ -0,0 +1,56 @@ +// +build !go1.7 + +package aws + +import "time" + +// An emptyCtx is a copy of the Go 1.7 context.emptyCtx type. This is copied to +// provide a 1.6 and 1.5 safe version of context that is compatible with Go +// 1.7's Context. +// +// An emptyCtx is never canceled, has no values, and has no deadline. It is not +// struct{}, since vars of this type must have distinct addresses. +type emptyCtx int + +func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { + return +} + +func (*emptyCtx) Done() <-chan struct{} { + return nil +} + +func (*emptyCtx) Err() error { + return nil +} + +func (*emptyCtx) Value(key interface{}) interface{} { + return nil +} + +func (e *emptyCtx) String() string { + switch e { + case backgroundCtx: + return "aws.BackgroundContext" + } + return "unknown empty Context" +} + +var ( + backgroundCtx = new(emptyCtx) +) + +// BackgroundContext returns a context that will never be canceled, has no +// values, and no deadline. This context is used by the SDK to provide +// backwards compatibility with non-context API operations and functionality. +// +// Go 1.6 and before: +// This context function is equivalent to context.Background in the Go stdlib. +// +// Go 1.7 and later: +// The context returned will be the value returned by context.Background() +// +// See https://golang.org/pkg/context for more information on Contexts. +func BackgroundContext() Context { + return backgroundCtx +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go new file mode 100644 index 0000000..9c29f29 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go @@ -0,0 +1,20 @@ +// +build go1.7 + +package aws + +import "context" + +// BackgroundContext returns a context that will never be canceled, has no +// values, and no deadline. This context is used by the SDK to provide +// backwards compatibility with non-context API operations and functionality. +// +// Go 1.6 and before: +// This context function is equivalent to context.Background in the Go stdlib. +// +// Go 1.7 and later: +// The context returned will be the value returned by context.Background() +// +// See https://golang.org/pkg/context for more information on Contexts. +func BackgroundContext() Context { + return context.Background() +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go b/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go new file mode 100644 index 0000000..304fd15 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go @@ -0,0 +1,24 @@ +package aws + +import ( + "time" +) + +// SleepWithContext will wait for the timer duration to expire, or the context +// is canceled. Which ever happens first. If the context is canceled the Context's +// error will be returned. +// +// Expects Context to always return a non-nil error if the Done channel is closed. +func SleepWithContext(ctx Context, dur time.Duration) error { + t := time.NewTimer(dur) + defer t.Stop() + + select { + case <-t.C: + break + case <-ctx.Done(): + return ctx.Err() + } + + return nil +} 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 d80a1bb..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, 1*time.Millisecond) - 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.go b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go index 3b73a7d..4e076c1 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/convert_types.go @@ -179,6 +179,242 @@ func IntValueMap(src map[string]*int) map[string]int { return dst } +// Uint returns a pointer to the uint value passed in. +func Uint(v uint) *uint { + return &v +} + +// UintValue returns the value of the uint pointer passed in or +// 0 if the pointer is nil. +func UintValue(v *uint) uint { + if v != nil { + return *v + } + return 0 +} + +// UintSlice converts a slice of uint values uinto a slice of +// uint pointers +func UintSlice(src []uint) []*uint { + dst := make([]*uint, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// UintValueSlice converts a slice of uint pointers uinto a slice of +// uint values +func UintValueSlice(src []*uint) []uint { + dst := make([]uint, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// UintMap converts a string map of uint values uinto a string +// map of uint pointers +func UintMap(src map[string]uint) map[string]*uint { + dst := make(map[string]*uint) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// UintValueMap converts a string map of uint pointers uinto a string +// map of uint values +func UintValueMap(src map[string]*uint) map[string]uint { + dst := make(map[string]uint) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int8 returns a pointer to the int8 value passed in. +func Int8(v int8) *int8 { + return &v +} + +// Int8Value returns the value of the int8 pointer passed in or +// 0 if the pointer is nil. +func Int8Value(v *int8) int8 { + if v != nil { + return *v + } + return 0 +} + +// Int8Slice converts a slice of int8 values into a slice of +// int8 pointers +func Int8Slice(src []int8) []*int8 { + dst := make([]*int8, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int8ValueSlice converts a slice of int8 pointers into a slice of +// int8 values +func Int8ValueSlice(src []*int8) []int8 { + dst := make([]int8, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int8Map converts a string map of int8 values into a string +// map of int8 pointers +func Int8Map(src map[string]int8) map[string]*int8 { + dst := make(map[string]*int8) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int8ValueMap converts a string map of int8 pointers into a string +// map of int8 values +func Int8ValueMap(src map[string]*int8) map[string]int8 { + dst := make(map[string]int8) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int16 returns a pointer to the int16 value passed in. +func Int16(v int16) *int16 { + return &v +} + +// Int16Value returns the value of the int16 pointer passed in or +// 0 if the pointer is nil. +func Int16Value(v *int16) int16 { + if v != nil { + return *v + } + return 0 +} + +// Int16Slice converts a slice of int16 values into a slice of +// int16 pointers +func Int16Slice(src []int16) []*int16 { + dst := make([]*int16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int16ValueSlice converts a slice of int16 pointers into a slice of +// int16 values +func Int16ValueSlice(src []*int16) []int16 { + dst := make([]int16, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int16Map converts a string map of int16 values into a string +// map of int16 pointers +func Int16Map(src map[string]int16) map[string]*int16 { + dst := make(map[string]*int16) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int16ValueMap converts a string map of int16 pointers into a string +// map of int16 values +func Int16ValueMap(src map[string]*int16) map[string]int16 { + dst := make(map[string]int16) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Int32 returns a pointer to the int32 value passed in. +func Int32(v int32) *int32 { + return &v +} + +// Int32Value returns the value of the int32 pointer passed in or +// 0 if the pointer is nil. +func Int32Value(v *int32) int32 { + if v != nil { + return *v + } + return 0 +} + +// Int32Slice converts a slice of int32 values into a slice of +// int32 pointers +func Int32Slice(src []int32) []*int32 { + dst := make([]*int32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Int32ValueSlice converts a slice of int32 pointers into a slice of +// int32 values +func Int32ValueSlice(src []*int32) []int32 { + dst := make([]int32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Int32Map converts a string map of int32 values into a string +// map of int32 pointers +func Int32Map(src map[string]int32) map[string]*int32 { + dst := make(map[string]*int32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Int32ValueMap converts a string map of int32 pointers into a string +// map of int32 values +func Int32ValueMap(src map[string]*int32) map[string]int32 { + dst := make(map[string]int32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + // Int64 returns a pointer to the int64 value passed in. func Int64(v int64) *int64 { return &v @@ -238,6 +474,301 @@ func Int64ValueMap(src map[string]*int64) map[string]int64 { return dst } +// Uint8 returns a pointer to the uint8 value passed in. +func Uint8(v uint8) *uint8 { + return &v +} + +// Uint8Value returns the value of the uint8 pointer passed in or +// 0 if the pointer is nil. +func Uint8Value(v *uint8) uint8 { + if v != nil { + return *v + } + return 0 +} + +// Uint8Slice converts a slice of uint8 values into a slice of +// uint8 pointers +func Uint8Slice(src []uint8) []*uint8 { + dst := make([]*uint8, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint8ValueSlice converts a slice of uint8 pointers into a slice of +// uint8 values +func Uint8ValueSlice(src []*uint8) []uint8 { + dst := make([]uint8, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint8Map converts a string map of uint8 values into a string +// map of uint8 pointers +func Uint8Map(src map[string]uint8) map[string]*uint8 { + dst := make(map[string]*uint8) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint8ValueMap converts a string map of uint8 pointers into a string +// map of uint8 values +func Uint8ValueMap(src map[string]*uint8) map[string]uint8 { + dst := make(map[string]uint8) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint16 returns a pointer to the uint16 value passed in. +func Uint16(v uint16) *uint16 { + return &v +} + +// Uint16Value returns the value of the uint16 pointer passed in or +// 0 if the pointer is nil. +func Uint16Value(v *uint16) uint16 { + if v != nil { + return *v + } + return 0 +} + +// Uint16Slice converts a slice of uint16 values into a slice of +// uint16 pointers +func Uint16Slice(src []uint16) []*uint16 { + dst := make([]*uint16, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint16ValueSlice converts a slice of uint16 pointers into a slice of +// uint16 values +func Uint16ValueSlice(src []*uint16) []uint16 { + dst := make([]uint16, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint16Map converts a string map of uint16 values into a string +// map of uint16 pointers +func Uint16Map(src map[string]uint16) map[string]*uint16 { + dst := make(map[string]*uint16) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint16ValueMap converts a string map of uint16 pointers into a string +// map of uint16 values +func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { + dst := make(map[string]uint16) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint32 returns a pointer to the uint32 value passed in. +func Uint32(v uint32) *uint32 { + return &v +} + +// Uint32Value returns the value of the uint32 pointer passed in or +// 0 if the pointer is nil. +func Uint32Value(v *uint32) uint32 { + if v != nil { + return *v + } + return 0 +} + +// Uint32Slice converts a slice of uint32 values into a slice of +// uint32 pointers +func Uint32Slice(src []uint32) []*uint32 { + dst := make([]*uint32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint32ValueSlice converts a slice of uint32 pointers into a slice of +// uint32 values +func Uint32ValueSlice(src []*uint32) []uint32 { + dst := make([]uint32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint32Map converts a string map of uint32 values into a string +// map of uint32 pointers +func Uint32Map(src map[string]uint32) map[string]*uint32 { + dst := make(map[string]*uint32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint32ValueMap converts a string map of uint32 pointers into a string +// map of uint32 values +func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { + dst := make(map[string]uint32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Uint64 returns a pointer to the uint64 value passed in. +func Uint64(v uint64) *uint64 { + return &v +} + +// Uint64Value returns the value of the uint64 pointer passed in or +// 0 if the pointer is nil. +func Uint64Value(v *uint64) uint64 { + if v != nil { + return *v + } + return 0 +} + +// Uint64Slice converts a slice of uint64 values into a slice of +// uint64 pointers +func Uint64Slice(src []uint64) []*uint64 { + dst := make([]*uint64, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Uint64ValueSlice converts a slice of uint64 pointers into a slice of +// uint64 values +func Uint64ValueSlice(src []*uint64) []uint64 { + dst := make([]uint64, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Uint64Map converts a string map of uint64 values into a string +// map of uint64 pointers +func Uint64Map(src map[string]uint64) map[string]*uint64 { + dst := make(map[string]*uint64) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Uint64ValueMap converts a string map of uint64 pointers into a string +// map of uint64 values +func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { + dst := make(map[string]uint64) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + +// Float32 returns a pointer to the float32 value passed in. +func Float32(v float32) *float32 { + return &v +} + +// Float32Value returns the value of the float32 pointer passed in or +// 0 if the pointer is nil. +func Float32Value(v *float32) float32 { + if v != nil { + return *v + } + return 0 +} + +// Float32Slice converts a slice of float32 values into a slice of +// float32 pointers +func Float32Slice(src []float32) []*float32 { + dst := make([]*float32, len(src)) + for i := 0; i < len(src); i++ { + dst[i] = &(src[i]) + } + return dst +} + +// Float32ValueSlice converts a slice of float32 pointers into a slice of +// float32 values +func Float32ValueSlice(src []*float32) []float32 { + dst := make([]float32, len(src)) + for i := 0; i < len(src); i++ { + if src[i] != nil { + dst[i] = *(src[i]) + } + } + return dst +} + +// Float32Map converts a string map of float32 values into a string +// map of float32 pointers +func Float32Map(src map[string]float32) map[string]*float32 { + dst := make(map[string]*float32) + for k, val := range src { + v := val + dst[k] = &v + } + return dst +} + +// Float32ValueMap converts a string map of float32 pointers into a string +// map of float32 values +func Float32ValueMap(src map[string]*float32) map[string]float32 { + dst := make(map[string]float32) + for k, val := range src { + if val != nil { + dst[k] = *val + } + } + return dst +} + // Float64 returns a pointer to the float64 value passed in. func Float64(v float64) *float64 { return &v @@ -311,6 +842,24 @@ func TimeValue(v *time.Time) time.Time { return time.Time{} } +// SecondsTimeValue converts an int64 pointer to a time.Time value +// representing seconds since Epoch or time.Time{} if the pointer is nil. +func SecondsTimeValue(v *int64) time.Time { + if v != nil { + return time.Unix((*v / 1000), 0) + } + return time.Time{} +} + +// MillisecondsTimeValue converts an int64 pointer to a time.Time value +// representing milliseconds sinch Epoch or time.Time{} if the pointer is nil. +func MillisecondsTimeValue(v *int64) time.Time { + if v != nil { + return time.Unix(0, (*v * 1000000)) + } + return time.Time{} +} + // TimeUnixMilli returns a Unix timestamp in milliseconds from "January 1, 1970 UTC". // The result is undefined if the Unix time cannot be represented by an int64. // Which includes calling TimeUnixMilli on a zero Time is undefined. 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 df7a3e5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/convert_types_test.go +++ /dev/null @@ -1,437 +0,0 @@ -package aws - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := StringValueSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - if in[i] == nil { - assert.Empty(t, out[i], "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) - } - } - - out2 := StringSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - for i := range out2 { - if in[i] == nil { - assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, in[i], out2[i], "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := StringValueMap(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := BoolValueSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - if in[i] == nil { - assert.Empty(t, out[i], "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) - } - } - - out2 := BoolSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - for i := range out2 { - if in[i] == nil { - assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, in[i], out2[i], "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := BoolValueMap(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := IntValueSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - if in[i] == nil { - assert.Empty(t, out[i], "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) - } - } - - out2 := IntSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - for i := range out2 { - if in[i] == nil { - assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, in[i], out2[i], "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := IntValueMap(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := Int64ValueSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - if in[i] == nil { - assert.Empty(t, out[i], "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) - } - } - - out2 := Int64Slice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - for i := range out2 { - if in[i] == nil { - assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, in[i], out2[i], "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := Int64ValueMap(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := Float64ValueSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - if in[i] == nil { - assert.Empty(t, out[i], "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) - } - } - - out2 := Float64Slice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - for i := range out2 { - if in[i] == nil { - assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, in[i], out2[i], "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := Float64ValueMap(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := TimeValueSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - if in[i] == nil { - assert.Empty(t, out[i], "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, *(in[i]), out[i], "Unexpected value at idx %d", idx) - } - } - - out2 := TimeSlice(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - for i := range out2 { - if in[i] == nil { - assert.Empty(t, *(out2[i]), "Unexpected value at idx %d", idx) - } else { - assert.Equal(t, in[i], out2[i], "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) - assert.Len(t, out, len(in), "Unexpected len at idx %d", idx) - for i := range out { - assert.Equal(t, in[i], *(out[i]), "Unexpected value at idx %d", idx) - } - - out2 := TimeValueMap(out) - assert.Len(t, out2, len(in), "Unexpected len at idx %d", idx) - assert.Equal(t, in, out2, "Unexpected value at idx %d", idx) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index 08a6665..0c60e61 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -3,12 +3,10 @@ package corehandlers import ( "bytes" "fmt" - "io" "io/ioutil" "net/http" "net/url" "regexp" - "runtime" "strconv" "time" @@ -27,7 +25,7 @@ type lener interface { // or will use the HTTPRequest.Header's "Content-Length" if defined. If unable // to determine request body length and no "Content-Length" was specified it will panic. // -// The Content-Length will only be aded to the request if the length of the body +// The Content-Length will only be added to the request if the length of the body // is greater than 0. If the body is empty or the current `Content-Length` // header is <= 0, the header will also be stripped. var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) { @@ -36,18 +34,13 @@ var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLen if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" { length, _ = strconv.ParseInt(slength, 10, 64) } else { - switch body := r.Body.(type) { - case nil: - length = 0 - case lener: - length = int64(body.Len()) - case io.Seeker: - r.BodyStart, _ = body.Seek(0, 1) - end, _ := body.Seek(0, 2) - body.Seek(r.BodyStart, 0) // make sure to seek back to original location - length = end - r.BodyStart - default: - panic("Cannot get length of body, must provide `ContentLength`") + if r.Body != nil { + var err error + length, err = aws.SeekerLen(r.Body) + if err != nil { + r.Error = awserr.New(request.ErrCodeSerialization, "failed to get request body's length", err) + return + } } } @@ -60,19 +53,12 @@ var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLen } }} -// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent. -var SDKVersionUserAgentHandler = request.NamedHandler{ - Name: "core.SDKVersionUserAgentHandler", - Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, - runtime.Version(), runtime.GOOS, runtime.GOARCH), -} - var reStatusCode = regexp.MustCompile(`^(\d{3})`) // ValidateReqSigHandler is a request handler to ensure that the request's // signature doesn't expire before it is sent. This can happen when a request -// is built and signed signficantly before it is sent. Or significant delays -// occur whne retrying requests that would cause the signature to expire. +// is built and signed significantly before it is sent. Or significant delays +// occur when retrying requests that would cause the signature to expire. var ValidateReqSigHandler = request.NamedHandler{ Name: "core.ValidateReqSigHandler", Fn: func(r *request.Request) { @@ -86,9 +72,9 @@ var ValidateReqSigHandler = request.NamedHandler{ signedTime = r.LastSignedAt } - // 10 minutes to allow for some clock skew/delays in transmission. + // 5 minutes to allow for some clock skew/delays in transmission. // Would be improved with aws/aws-sdk-go#423 - if signedTime.Add(10 * time.Minute).After(time.Now()) { + if signedTime.Add(5 * time.Minute).After(time.Now()) { return } @@ -98,54 +84,95 @@ var ValidateReqSigHandler = request.NamedHandler{ } // SendHandler is a request handler to send service request using HTTP client. -var SendHandler = request.NamedHandler{Name: "core.SendHandler", Fn: func(r *request.Request) { - var err error - r.HTTPResponse, err = r.Config.HTTPClient.Do(r.HTTPRequest) - if err != nil { - // Prevent leaking if an HTTPResponse was returned. Clean up - // the body. - if r.HTTPResponse != nil { - r.HTTPResponse.Body.Close() +var SendHandler = request.NamedHandler{ + Name: "core.SendHandler", + Fn: func(r *request.Request) { + sender := sendFollowRedirects + if r.DisableFollowRedirects { + sender = sendWithoutFollowRedirects } - // Capture the case where url.Error is returned for error processing - // response. e.g. 301 without location header comes back as string - // error and r.HTTPResponse is nil. Other url redirect errors will - // comeback in a similar method. - if e, ok := err.(*url.Error); ok && e.Err != nil { - if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { - code, _ := strconv.ParseInt(s[1], 10, 64) - r.HTTPResponse = &http.Response{ - StatusCode: int(code), - Status: http.StatusText(int(code)), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - return - } + + if request.NoBody == r.HTTPRequest.Body { + // Strip off the request body if the NoBody reader was used as a + // place holder for a request body. This prevents the SDK from + // making requests with a request body when it would be invalid + // to do so. + // + // Use a shallow copy of the http.Request to ensure the race condition + // of transport on Body will not trigger + reqOrig, reqCopy := r.HTTPRequest, *r.HTTPRequest + reqCopy.Body = nil + r.HTTPRequest = &reqCopy + defer func() { + r.HTTPRequest = reqOrig + }() + } + + var err error + r.HTTPResponse, err = sender(r) + if err != nil { + handleSendError(r, err) } - if r.HTTPResponse == nil { - // Add a dummy request response object to ensure the HTTPResponse - // value is consistent. + }, +} + +func sendFollowRedirects(r *request.Request) (*http.Response, error) { + return r.Config.HTTPClient.Do(r.HTTPRequest) +} + +func sendWithoutFollowRedirects(r *request.Request) (*http.Response, error) { + transport := r.Config.HTTPClient.Transport + if transport == nil { + transport = http.DefaultTransport + } + + return transport.RoundTrip(r.HTTPRequest) +} + +func handleSendError(r *request.Request, err error) { + // Prevent leaking if an HTTPResponse was returned. Clean up + // the body. + if r.HTTPResponse != nil { + r.HTTPResponse.Body.Close() + } + // Capture the case where url.Error is returned for error processing + // response. e.g. 301 without location header comes back as string + // error and r.HTTPResponse is nil. Other URL redirect errors will + // comeback in a similar method. + if e, ok := err.(*url.Error); ok && e.Err != nil { + if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { + code, _ := strconv.ParseInt(s[1], 10, 64) r.HTTPResponse = &http.Response{ - StatusCode: int(0), - Status: http.StatusText(int(0)), + StatusCode: int(code), + Status: http.StatusText(int(code)), Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } + return } - // Catch all other request errors. - r.Error = awserr.New("RequestError", "send request failed", err) - r.Retryable = aws.Bool(true) // network errors are retryable - - // Override the error with a context canceled error, if that was canceled. - ctx := r.Context() - select { - case <-ctx.Done(): - r.Error = awserr.New(request.CanceledErrorCode, - "request context canceled", ctx.Err()) - r.Retryable = aws.Bool(false) - default: + } + if r.HTTPResponse == nil { + // Add a dummy request response object to ensure the HTTPResponse + // value is consistent. + r.HTTPResponse = &http.Response{ + StatusCode: int(0), + Status: http.StatusText(int(0)), + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } } -}} + // Catch all request errors, and let the default retrier determine + // if the error is retryable. + r.Error = awserr.New("RequestError", "send request failed", err) + + // Override the error with a context canceled error, if that was canceled. + ctx := r.Context() + select { + case <-ctx.Done(): + r.Error = awserr.New(request.CanceledErrorCode, + "request context canceled", ctx.Err()) + r.Retryable = aws.Bool(false) + default: + } +} // ValidateResponseHandler is a request handler to validate service response. var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) { @@ -157,37 +184,39 @@ var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseH // AfterRetryHandler performs final checks to determine if the request should // be retried and how long to delay. -var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) { - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if r.Retryable == nil { - r.Retryable = aws.Bool(r.ShouldRetry(r)) - } +var AfterRetryHandler = request.NamedHandler{ + Name: "core.AfterRetryHandler", + Fn: func(r *request.Request) { + // If one of the other handlers already set the retry state + // we don't want to override it based on the service's state + if r.Retryable == nil || aws.BoolValue(r.Config.EnforceShouldRetryCheck) { + r.Retryable = aws.Bool(r.ShouldRetry(r)) + } - if r.WillRetry() { - r.RetryDelay = r.RetryRules(r) + if r.WillRetry() { + r.RetryDelay = r.RetryRules(r) - if sleepFn := r.Config.SleepDelay; sleepFn != nil { - // Support SleepDelay for backwards compatibility and testing - sleepFn(r.RetryDelay) - } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { - r.Error = awserr.New(request.CanceledErrorCode, - "request context canceled", err) - r.Retryable = aws.Bool(false) - return - } + if sleepFn := r.Config.SleepDelay; sleepFn != nil { + // Support SleepDelay for backwards compatibility and testing + sleepFn(r.RetryDelay) + } else if err := aws.SleepWithContext(r.Context(), r.RetryDelay); err != nil { + r.Error = awserr.New(request.CanceledErrorCode, + "request context canceled", err) + r.Retryable = aws.Bool(false) + return + } - // when the expired token exception occurs the credentials - // need to be expired locally so that the next request to - // get credentials will trigger a credentials refresh. - if r.IsErrorExpired() { - r.Config.Credentials.Expire() - } + // when the expired token exception occurs the credentials + // need to be expired locally so that the next request to + // get credentials will trigger a credentials refresh. + if r.IsErrorExpired() { + r.Config.Credentials.Expire() + } - r.RetryCount++ - r.Error = nil - } -}} + r.RetryCount++ + r.Error = nil + } + }} // ValidateEndpointHandler is a request handler to validate a request had the // appropriate Region and Endpoint set. Will set r.Error if the endpoint or 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 c698e9e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers_test.go +++ /dev/null @@ -1,322 +0,0 @@ -package corehandlers_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "net/http/httptest" - "os" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "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/service/s3" -) - -func TestValidateEndpointHandler(t *testing.T) { - os.Clearenv() - - 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() - - assert.NoError(t, err) -} - -func TestValidateEndpointHandlerErrorRegion(t *testing.T) { - os.Clearenv() - - svc := awstesting.NewClient() - svc.Handlers.Clear() - svc.Handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) - - req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - err := req.Build() - - assert.Error(t, err) - assert.Equal(t, aws.ErrMissingRegion, err) -} - -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) { - os.Clearenv() - 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) - - assert.True(t, svc.Config.Credentials.IsExpired(), "Expect to start out expired") - assert.False(t, credProvider.retrieveCalled) - - req := svc.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - req.Send() - - assert.True(t, svc.Config.Credentials.IsExpired()) - assert.False(t, credProvider.retrieveCalled) - - _, err := svc.Config.Credentials.Get() - assert.NoError(t, err) - assert.True(t, credProvider.retrieveCalled) -} - -func TestAfterRetryWithContextCanceled(t *testing.T) { - c := awstesting.NewClient() - - req := c.NewRequest(&request.Operation{Name: "Operation"}, nil, nil) - - ctx := &awstesting.FakeContext{DoneCh: make(chan struct{}, 0)} - 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{}, 0)} - 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{}, 0)} - 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() - - assert.Error(t, r.Error) - assert.NotNil(t, r.HTTPResponse) -} - -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) - - assert.NoError(t, c.Req.Error, "%d, expect no error", i) - assert.Equal(t, c.Resign, resigned, "%d, expected resigning to match", i) - } -} - -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"] - assert.Equal(t, hasContentLength, ok, "expect content length to be set, %t", hasContentLength) - if hasContentLength { - assert.Equal(t, contentLength, r.ContentLength) - } - - b, err := ioutil.ReadAll(r.Body) - assert.NoError(t, err) - r.Body.Close() - - authHeader := r.Header.Get("Authorization") - if hasContentLength { - assert.Contains(t, authHeader, "content-length") - } else { - assert.NotContains(t, authHeader, "content-length") - } - - assert.Equal(t, contentLength, int64(len(b))) - })) - - return server -} - -func TestBuildContentLength_ZeroBody(t *testing.T) { - server := setupContentLengthTestServer(t, false, 0) - - 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"), - }) - - assert.NoError(t, err) -} - -func TestBuildContentLength_NegativeBody(t *testing.T) { - server := setupContentLengthTestServer(t, false, 0) - - 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") - - assert.NoError(t, req.Send()) -} - -func TestBuildContentLength_WithBody(t *testing.T) { - server := setupContentLengthTestServer(t, true, 1024) - - 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)), - }) - - assert.NoError(t, 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 66973ca..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator_test.go +++ /dev/null @@ -1,254 +0,0 @@ -package corehandlers_test - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - - "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" - "github.com/stretchr/testify/require" -) - -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) - require.NoError(t, req.Error) -} - -func TestMissingRequiredParameters(t *testing.T) { - input := &StructShape{} - req := testSvc.NewRequest(&request.Operation{}, input, nil) - corehandlers.ValidateParametersHandler.Fn(req) - - require.Error(t, req.Error) - assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) - assert.Equal(t, "3 validation error(s) found.", req.Error.(awserr.Error).Message()) - - errs := req.Error.(awserr.BatchedErrors).OrigErrs() - assert.Len(t, errs, 3) - assert.Equal(t, "ParamRequiredError: missing required field, StructShape.RequiredList.", errs[0].Error()) - assert.Equal(t, "ParamRequiredError: missing required field, StructShape.RequiredMap.", errs[1].Error()) - assert.Equal(t, "ParamRequiredError: missing required field, StructShape.RequiredBool.", errs[2].Error()) - - assert.Equal(t, "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()) -} - -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) - - require.Error(t, req.Error) - assert.Equal(t, "InvalidParameter", req.Error.(awserr.Error).Code()) - assert.Equal(t, "3 validation error(s) found.", req.Error.(awserr.Error).Message()) - - errs := req.Error.(awserr.BatchedErrors).OrigErrs() - assert.Len(t, errs, 3) - assert.Equal(t, "ParamRequiredError: missing required field, StructShape.RequiredList[0].Name.", errs[0].Error()) - assert.Equal(t, "ParamRequiredError: missing required field, StructShape.RequiredMap[key2].Name.", errs[1].Error()) - assert.Equal(t, "ParamRequiredError: missing required field, StructShape.OptionalStruct.Name.", errs[2].Error()) -} - -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) - - assert.Equal(t, c.err, req.Error, "%d case failed", i) - } -} - -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.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go new file mode 100644 index 0000000..ab69c7a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go @@ -0,0 +1,37 @@ +package corehandlers + +import ( + "os" + "runtime" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// SDKVersionUserAgentHandler is a request handler for adding the SDK Version +// to the user agent. +var SDKVersionUserAgentHandler = request.NamedHandler{ + Name: "core.SDKVersionUserAgentHandler", + Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, + runtime.Version(), runtime.GOOS, runtime.GOARCH), +} + +const execEnvVar = `AWS_EXECUTION_ENV` +const execEnvUAKey = `exec-env` + +// AddHostExecEnvUserAgentHander is a request handler appending the SDK's +// execution environment to the user agent. +// +// If the environment variable AWS_EXECUTION_ENV is set, its value will be +// appended to the user agent string. +var AddHostExecEnvUserAgentHander = request.NamedHandler{ + Name: "core.AddHostExecEnvUserAgentHander", + Fn: func(r *request.Request) { + v := os.Getenv(execEnvVar) + if len(v) == 0 { + return + } + + request.AddToUserAgent(r, execEnvUAKey+"/"+v) + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go index 6efc77b..3ad1e79 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go @@ -9,11 +9,9 @@ var ( // providers in the ChainProvider. // // This has been deprecated. For verbose error messaging set - // aws.Config.CredentialsChainVerboseErrors to true - // - // @readonly + // aws.Config.CredentialsChainVerboseErrors to true. ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", - `no valid providers in chain. Deprecated. + `no valid providers in chain. Deprecated. For verbose messaging see aws.Config.CredentialsChainVerboseErrors`, nil) ) @@ -39,16 +37,18 @@ var ( // does not return any credentials ChainProvider will return the error // ErrNoValidProvidersFoundInChain // -// creds := NewChainCredentials( -// []Provider{ -// &EnvProvider{}, -// &EC2RoleProvider{ +// creds := credentials.NewChainCredentials( +// []credentials.Provider{ +// &credentials.EnvProvider{}, +// &ec2rolecreds.EC2RoleProvider{ // Client: ec2metadata.New(sess), // }, // }) // // // Usage of ChainCredentials with aws.Config -// svc := ec2.New(&aws.Config{Credentials: creds}) +// svc := ec2.New(session.Must(session.NewSession(&aws.Config{ +// Credentials: creds, +// }))) // type ChainProvider struct { Providers []Provider 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 3b393a2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider_test.go +++ /dev/null @@ -1,154 +0,0 @@ -package credentials - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/stretchr/testify/assert" -) - -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() - assert.Nil(t, err, "Expect no error") - assert.Equal(t, "secondStubProvider", creds.ProviderName, "Expect provider name to match") - - // Also check credentials - assert.Equal(t, "AKIF", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "NOSECRET", creds.SecretAccessKey, "Expect secret access key to match") - assert.Empty(t, creds.SessionToken, "Expect session token to be empty") - -} - -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() - assert.Nil(t, err, "Expect no error") - assert.Equal(t, "AKID", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "SECRET", creds.SecretAccessKey, "Expect secret access key to match") - assert.Empty(t, creds.SessionToken, "Expect session token to be empty") -} - -func TestChainProviderIsExpired(t *testing.T) { - stubProvider := &stubProvider{expired: true} - p := &ChainProvider{ - Providers: []Provider{ - stubProvider, - }, - } - - assert.True(t, p.IsExpired(), "Expect expired to be true before any Retrieve") - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - assert.False(t, p.IsExpired(), "Expect not expired after retrieve") - - stubProvider.expired = true - assert.True(t, p.IsExpired(), "Expect return of expired provider") - - _, err = p.Retrieve() - assert.False(t, p.IsExpired(), "Expect not expired after retrieve") -} - -func TestChainProviderWithNoProvider(t *testing.T) { - p := &ChainProvider{ - Providers: []Provider{}, - } - - assert.True(t, p.IsExpired(), "Expect expired with no providers") - _, err := p.Retrieve() - assert.Equal(t, - ErrNoValidProvidersFoundInChain, - err, - "Expect no providers error returned") -} - -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]}, - }, - } - - assert.True(t, p.IsExpired(), "Expect expired with no providers") - _, err := p.Retrieve() - - assert.Equal(t, - ErrNoValidProvidersFoundInChain, - err, - "Expect no providers error returned") -} - -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]}, - }, - } - - assert.True(t, p.IsExpired(), "Expect expired with no providers") - _, err := p.Retrieve() - - assert.Equal(t, - awserr.NewBatchError("NoCredentialProviders", "no valid providers in chain", errs), - err, - "Expect no providers error returned") -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index c29baf0..4af5921 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go @@ -14,7 +14,7 @@ // // Example of using the environment variable credentials. // -// creds := NewEnvCredentials() +// creds := credentials.NewEnvCredentials() // // // Retrieve the credentials value // credValue, err := creds.Get() @@ -26,7 +26,7 @@ // This may be helpful to proactively expire credentials and refresh them sooner // than they would naturally expire on their own. // -// creds := NewCredentials(&EC2RoleProvider{}) +// creds := credentials.NewCredentials(&ec2rolecreds.EC2RoleProvider{}) // creds.Expire() // credsValue, err := creds.Get() // // New credentials will be retrieved instead of from cache. @@ -43,14 +43,17 @@ // func (m *MyProvider) Retrieve() (Value, error) {...} // func (m *MyProvider) IsExpired() bool {...} // -// creds := NewCredentials(&MyProvider{}) +// creds := credentials.NewCredentials(&MyProvider{}) // credValue, err := creds.Get() // package credentials import ( + "fmt" "sync" "time" + + "github.com/aws/aws-sdk-go/aws/awserr" ) // AnonymousCredentials is an empty Credential object that can be used as @@ -60,10 +63,10 @@ import ( // when making service API calls. For example, when accessing public // s3 buckets. // -// svc := s3.New(&aws.Config{Credentials: AnonymousCredentials}) +// svc := s3.New(session.Must(session.NewSession(&aws.Config{ +// Credentials: credentials.AnonymousCredentials, +// }))) // // Access public S3 buckets. -// -// @readonly var AnonymousCredentials = NewStaticCredentials("", "", "") // A Value is the AWS credentials value for individual credential fields. @@ -81,6 +84,12 @@ type Value struct { ProviderName string } +// HasKeys returns if the credentials Value has both AccessKeyID and +// SecretAccessKey value set. +func (v Value) HasKeys() bool { + return len(v.AccessKeyID) != 0 && len(v.SecretAccessKey) != 0 +} + // A Provider is the interface for any component which will provide credentials // Value. A provider is required to manage its own Expired state, and what to // be expired means. @@ -97,6 +106,35 @@ type Provider interface { IsExpired() bool } +// An Expirer is an interface that Providers can implement to expose the expiration +// time, if known. If the Provider cannot accurately provide this info, +// it should not implement this interface. +type Expirer interface { + // The time at which the credentials are no longer valid + ExpiresAt() time.Time +} + +// An ErrorProvider is a stub credentials provider that always returns an error +// this is used by the SDK when construction a known provider is not possible +// due to an error. +type ErrorProvider struct { + // The error to be returned from Retrieve + Err error + + // The provider name to set on the Retrieved returned Value + ProviderName string +} + +// Retrieve will always return the error that the ErrorProvider was created with. +func (p ErrorProvider) Retrieve() (Value, error) { + return Value{ProviderName: p.ProviderName}, p.Err +} + +// IsExpired will always return not expired. +func (p ErrorProvider) IsExpired() bool { + return false +} + // A Expiry provides shared expiration logic to be used by credentials // providers to implement expiry functionality. // @@ -135,13 +173,19 @@ func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) { // IsExpired returns if the credentials are expired. func (e *Expiry) IsExpired() bool { - if e.CurrentTime == nil { - e.CurrentTime = time.Now + curTime := e.CurrentTime + if curTime == nil { + curTime = time.Now } - return e.expiration.Before(e.CurrentTime()) + return e.expiration.Before(curTime()) +} + +// ExpiresAt returns the expiration time of the credential +func (e *Expiry) ExpiresAt() time.Time { + return e.expiration } -// A Credentials provides synchronous safe retrieval of AWS credentials Value. +// A Credentials provides concurrency safe retrieval of AWS credentials Value. // Credentials will cache the credentials value until they expire. Once the value // expires the next Get will attempt to retrieve valid credentials. // @@ -155,7 +199,8 @@ func (e *Expiry) IsExpired() bool { type Credentials struct { creds Value forceRefresh bool - m sync.Mutex + + m sync.RWMutex provider Provider } @@ -178,6 +223,17 @@ func NewCredentials(provider Provider) *Credentials { // If Credentials.Expire() was called the credentials Value will be force // expired, and the next call to Get() will cause them to be refreshed. func (c *Credentials) Get() (Value, error) { + // Check the cached credentials first with just the read lock. + c.m.RLock() + if !c.isExpired() { + creds := c.creds + c.m.RUnlock() + return creds, nil + } + c.m.RUnlock() + + // Credentials are expired need to retrieve the credentials taking the full + // lock. c.m.Lock() defer c.m.Unlock() @@ -211,8 +267,8 @@ func (c *Credentials) Expire() { // If the Credentials were forced to be expired with Expire() this will // reflect that override. func (c *Credentials) IsExpired() bool { - c.m.Lock() - defer c.m.Unlock() + c.m.RLock() + defer c.m.RUnlock() return c.isExpired() } @@ -221,3 +277,23 @@ func (c *Credentials) IsExpired() bool { func (c *Credentials) isExpired() bool { return c.forceRefresh || c.provider.IsExpired() } + +// ExpiresAt provides access to the functionality of the Expirer interface of +// the underlying Provider, if it supports that interface. Otherwise, it returns +// an error. +func (c *Credentials) ExpiresAt() (time.Time, error) { + c.m.RLock() + defer c.m.RUnlock() + + expirer, ok := c.provider.(Expirer) + if !ok { + return time.Time{}, awserr.New("ProviderNotExpirer", + fmt.Sprintf("provider %s does not support ExpiresAt()", c.creds.ProviderName), + nil) + } + if c.forceRefresh { + // set expiration time to the distant past + return time.Time{}, nil + } + return expirer.ExpiresAt(), nil +} 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 7b79ba9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package credentials - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/stretchr/testify/assert" -) - -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() - assert.Nil(t, err, "Expected no error") - assert.Equal(t, "AKID", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "SECRET", creds.SecretAccessKey, "Expect secret access key to match") - assert.Empty(t, creds.SessionToken, "Expect session token to be empty") -} - -func TestCredentialsGetWithError(t *testing.T) { - c := NewCredentials(&stubProvider{err: awserr.New("provider error", "", nil), expired: true}) - - _, err := c.Get() - assert.Equal(t, "provider error", err.(awserr.Error).Code(), "Expected provider error") -} - -func TestCredentialsExpire(t *testing.T) { - stub := &stubProvider{} - c := NewCredentials(stub) - - stub.expired = false - assert.True(t, c.IsExpired(), "Expected to start out expired") - c.Expire() - assert.True(t, c.IsExpired(), "Expected to be expired") - - c.forceRefresh = false - assert.False(t, c.IsExpired(), "Expected not to be expired") - - stub.expired = true - assert.True(t, c.IsExpired(), "Expected to be expired") -} - -func TestCredentialsGetWithProviderName(t *testing.T) { - stub := &stubProvider{} - - c := NewCredentials(stub) - - creds, err := c.Get() - assert.Nil(t, err, "Expected no error") - assert.Equal(t, creds.ProviderName, "stubProvider", "Expected provider name to match") -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go index c397495..43d4ed3 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go @@ -4,7 +4,6 @@ import ( "bufio" "encoding/json" "fmt" - "path" "strings" "time" @@ -12,6 +11,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/sdkuri" ) // ProviderName provides a name of EC2Role provider @@ -125,7 +126,7 @@ type ec2RoleCredRespBody struct { Message string } -const iamSecurityCredsPath = "/iam/security-credentials" +const iamSecurityCredsPath = "iam/security-credentials/" // requestCredList requests a list of credentials from the EC2 service. // If there are no credentials, or there is an error making or receiving the request @@ -142,7 +143,8 @@ func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) { } if err := s.Err(); err != nil { - return nil, awserr.New("SerializationError", "failed to read EC2 instance role from metadata service", err) + return nil, awserr.New(request.ErrCodeSerialization, + "failed to read EC2 instance role from metadata service", err) } return credsList, nil @@ -153,7 +155,7 @@ func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) { // If the credentials cannot be found, or there is an error reading the response // and error will be returned. func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) { - resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName)) + resp, err := client.GetMetadata(sdkuri.PathJoin(iamSecurityCredsPath, credsName)) if err != nil { return ec2RoleCredRespBody{}, awserr.New("EC2RoleRequestError", @@ -164,7 +166,7 @@ func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCred respCreds := ec2RoleCredRespBody{} if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil { return ec2RoleCredRespBody{}, - awserr.New("SerializationError", + awserr.New(request.ErrCodeSerialization, fmt.Sprintf("failed to decode %s EC2 instance role credentials", credsName), err) } 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 cccd4bf..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider_test.go +++ /dev/null @@ -1,159 +0,0 @@ -package ec2rolecreds_test - -import ( - "fmt" - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "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, "bad request", http.StatusBadRequest) - } - })) - - 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() - assert.Nil(t, err, "Expect no error, %v", err) - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") -} - -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() - assert.Error(t, err, "Expect error") - - e := err.(awserr.Error) - assert.Equal(t, "ErrorCode", e.Code()) - assert.Equal(t, "ErrorMsg", e.Message()) - assert.Nil(t, e.OrigErr()) - - assert.Equal(t, "", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "", creds.SessionToken, "Expect session token to match") -} - -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) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") - - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error, %v", err) - - assert.False(t, p.IsExpired(), "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) - } - - assert.True(t, p.IsExpired(), "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) - } - - assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve.") - - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error, %v", err) - - assert.False(t, p.IsExpired(), "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) - } - - assert.True(t, p.IsExpired(), "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.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go index a4cec5c..1a7af53 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go @@ -39,6 +39,7 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" ) // ProviderName is the name of the credentials provider. @@ -65,6 +66,10 @@ type Provider struct { // // If ExpiryWindow is 0 or less it will be ignored. ExpiryWindow time.Duration + + // Optional authorization token value if set will be used as the value of + // the Authorization header of the endpoint credential request. + AuthorizationToken string } // NewProviderClient returns a credentials Provider for retrieving AWS credentials @@ -93,8 +98,8 @@ func NewProviderClient(cfg aws.Config, handlers request.Handlers, endpoint strin return p } -// NewCredentialsClient returns a Credentials wrapper for retrieving credentials -// from an arbitrary endpoint concurrently. The client will request the +// NewCredentialsClient returns a pointer to a new Credentials object +// wrapping the endpoint credentials Provider. func NewCredentialsClient(cfg aws.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials { return credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...)) } @@ -152,6 +157,9 @@ func (p *Provider) getCredentials() (*getCredentialsOutput, error) { out := &getCredentialsOutput{} req := p.Client.NewRequest(op, nil, out) req.HTTPRequest.Header.Set("Accept", "application/json") + if authToken := p.AuthorizationToken; len(authToken) != 0 { + req.HTTPRequest.Header.Set("Authorization", authToken) + } return out, req.Send() } @@ -167,7 +175,7 @@ func unmarshalHandler(r *request.Request) { out := r.Data.(*getCredentialsOutput) if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&out); err != nil { - r.Error = awserr.New("SerializationError", + r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode endpoint credentials", err, ) @@ -178,11 +186,15 @@ func unmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() var errOut errorOutput - if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&errOut); err != nil { - r.Error = awserr.New("SerializationError", - "failed to decode endpoint credentials", - err, + err := jsonutil.UnmarshalJSONError(&errOut, r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, + "failed to decode error message", err), + r.HTTPResponse.StatusCode, + r.RequestID, ) + return } // Response body format is not consistent between metadata endpoints. 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 ad057a3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider_test.go +++ /dev/null @@ -1,111 +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" - "github.com/stretchr/testify/assert" -) - -func TestRetrieveRefreshableCredentials(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "/path/to/endpoint", r.URL.Path) - assert.Equal(t, "application/json", r.Header.Get("Accept")) - assert.Equal(t, "else", r.URL.Query().Get("something")) - - 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) - } - })) - - client := endpointcreds.NewProviderClient(*unit.Session.Config, - unit.Session.Handlers, - server.URL+"/path/to/endpoint?something=else", - ) - creds, err := client.Retrieve() - - assert.NoError(t, err) - - assert.Equal(t, "AKID", creds.AccessKeyID) - assert.Equal(t, "SECRET", creds.SecretAccessKey) - assert.Equal(t, "TOKEN", creds.SessionToken) - assert.False(t, client.IsExpired()) - - client.(*endpointcreds.Provider).CurrentTime = func() time.Time { - return time.Now().Add(2 * time.Hour) - } - - assert.True(t, client.IsExpired()) -} - -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) - } - })) - - client := endpointcreds.NewProviderClient(*unit.Session.Config, unit.Session.Handlers, server.URL) - creds, err := client.Retrieve() - - assert.NoError(t, err) - - assert.Equal(t, "AKID", creds.AccessKeyID) - assert.Equal(t, "SECRET", creds.SecretAccessKey) - assert.Empty(t, creds.SessionToken) - assert.False(t, client.IsExpired()) -} - -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) - } - })) - - client := endpointcreds.NewProviderClient(*unit.Session.Config, unit.Session.Handlers, server.URL) - creds, err := client.Retrieve() - - assert.Error(t, err) - aerr := err.(awserr.Error) - - assert.Equal(t, "CredentialsEndpointError", aerr.Code()) - assert.Equal(t, "failed to load credentials", aerr.Message()) - - aerr = aerr.OrigErr().(awserr.Error) - assert.Equal(t, "Error", aerr.Code()) - assert.Equal(t, "Message", aerr.Message()) - - assert.Empty(t, creds.AccessKeyID) - assert.Empty(t, creds.SecretAccessKey) - assert.Empty(t, creds.SessionToken) - assert.True(t, client.IsExpired()) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go index 96655bc..54c5cf7 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go @@ -12,14 +12,10 @@ const EnvProviderName = "EnvProvider" var ( // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be // found in the process's environment. - // - // @readonly ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil) // ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key // can't be found in the process's environment. - // - // @readonly ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil) ) @@ -29,6 +25,7 @@ var ( // Environment variables used: // // * Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY +// // * Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY type EnvProvider struct { retrieved bool 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 53f6ce2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package credentials - -import ( - "github.com/stretchr/testify/assert" - "os" - "testing" -) - -func TestEnvProviderRetrieve(t *testing.T) { - os.Clearenv() - 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() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "access", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") -} - -func TestEnvProviderIsExpired(t *testing.T) { - os.Clearenv() - os.Setenv("AWS_ACCESS_KEY_ID", "access") - os.Setenv("AWS_SECRET_ACCESS_KEY", "secret") - os.Setenv("AWS_SESSION_TOKEN", "token") - - e := EnvProvider{} - - assert.True(t, e.IsExpired(), "Expect creds to be expired before retrieve.") - - _, err := e.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.False(t, e.IsExpired(), "Expect creds to not be expired after retrieve.") -} - -func TestEnvProviderNoAccessKeyID(t *testing.T) { - os.Clearenv() - os.Setenv("AWS_SECRET_ACCESS_KEY", "secret") - - e := EnvProvider{} - creds, err := e.Retrieve() - assert.Equal(t, ErrAccessKeyIDNotFound, err, "ErrAccessKeyIDNotFound expected, but was %#v error: %#v", creds, err) -} - -func TestEnvProviderNoSecretAccessKey(t *testing.T) { - os.Clearenv() - os.Setenv("AWS_ACCESS_KEY_ID", "access") - - e := EnvProvider{} - creds, err := e.Retrieve() - assert.Equal(t, ErrSecretAccessKeyNotFound, err, "ErrSecretAccessKeyNotFound expected, but was %#v error: %#v", creds, err) -} - -func TestEnvProviderAlternateNames(t *testing.T) { - os.Clearenv() - os.Setenv("AWS_ACCESS_KEY", "access") - os.Setenv("AWS_SECRET_KEY", "secret") - - e := EnvProvider{} - creds, err := e.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "access", creds.AccessKeyID, "Expected access key ID") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expected secret access key") - assert.Empty(t, creds.SessionToken, "Expected no token") -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go new file mode 100644 index 0000000..e624836 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go @@ -0,0 +1,426 @@ +/* +Package processcreds is a credential Provider to retrieve `credential_process` +credentials. + +WARNING: The following describes a method of sourcing credentials from an external +process. This can potentially be dangerous, so proceed with caution. Other +credential providers should be preferred if at all possible. If using this +option, you should make sure that the config file is as locked down as possible +using security best practices for your operating system. + +You can use credentials from a `credential_process` in a variety of ways. + +One way is to setup your shared config file, located in the default +location, with the `credential_process` key and the command you want to be +called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable +(e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file. + + [default] + credential_process = /command/to/call + +Creating a new session will use the credential process to retrieve credentials. +NOTE: If there are credentials in the profile you are using, the credential +process will not be used. + + // Initialize a session to load credentials. + sess, _ := session.NewSession(&aws.Config{ + Region: aws.String("us-east-1")}, + ) + + // Create S3 service client to use the credentials. + svc := s3.New(sess) + +Another way to use the `credential_process` method is by using +`credentials.NewCredentials()` and providing a command to be executed to +retrieve credentials: + + // Create credentials using the ProcessProvider. + creds := processcreds.NewCredentials("/path/to/command") + + // Create service client value configured for credentials. + svc := s3.New(sess, &aws.Config{Credentials: creds}) + +You can set a non-default timeout for the `credential_process` with another +constructor, `credentials.NewCredentialsTimeout()`, providing the timeout. To +set a one minute timeout: + + // Create credentials using the ProcessProvider. + creds := processcreds.NewCredentialsTimeout( + "/path/to/command", + time.Duration(500) * time.Millisecond) + +If you need more control, you can set any configurable options in the +credentials using one or more option functions. For example, you can set a two +minute timeout, a credential duration of 60 minutes, and a maximum stdout +buffer size of 2k. + + creds := processcreds.NewCredentials( + "/path/to/command", + func(opt *ProcessProvider) { + opt.Timeout = time.Duration(2) * time.Minute + opt.Duration = time.Duration(60) * time.Minute + opt.MaxBufSize = 2048 + }) + +You can also use your own `exec.Cmd`: + + // Create an exec.Cmd + myCommand := exec.Command("/path/to/command") + + // Create credentials using your exec.Cmd and custom timeout + creds := processcreds.NewCredentialsCommand( + myCommand, + func(opt *processcreds.ProcessProvider) { + opt.Timeout = time.Duration(1) * time.Second + }) +*/ +package processcreds + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "os" + "os/exec" + "runtime" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/internal/sdkio" +) + +const ( + // ProviderName is the name this credentials provider will label any + // returned credentials Value with. + ProviderName = `ProcessProvider` + + // ErrCodeProcessProviderParse error parsing process output + ErrCodeProcessProviderParse = "ProcessProviderParseError" + + // ErrCodeProcessProviderVersion version error in output + ErrCodeProcessProviderVersion = "ProcessProviderVersionError" + + // ErrCodeProcessProviderRequired required attribute missing in output + ErrCodeProcessProviderRequired = "ProcessProviderRequiredError" + + // ErrCodeProcessProviderExecution execution of command failed + ErrCodeProcessProviderExecution = "ProcessProviderExecutionError" + + // errMsgProcessProviderTimeout process took longer than allowed + errMsgProcessProviderTimeout = "credential process timed out" + + // errMsgProcessProviderProcess process error + errMsgProcessProviderProcess = "error in credential_process" + + // errMsgProcessProviderParse problem parsing output + errMsgProcessProviderParse = "parse failed of credential_process output" + + // errMsgProcessProviderVersion version error in output + errMsgProcessProviderVersion = "wrong version in process output (not 1)" + + // errMsgProcessProviderMissKey missing access key id in output + errMsgProcessProviderMissKey = "missing AccessKeyId in process output" + + // errMsgProcessProviderMissSecret missing secret acess key in output + errMsgProcessProviderMissSecret = "missing SecretAccessKey in process output" + + // errMsgProcessProviderPrepareCmd prepare of command failed + errMsgProcessProviderPrepareCmd = "failed to prepare command" + + // errMsgProcessProviderEmptyCmd command must not be empty + errMsgProcessProviderEmptyCmd = "command must not be empty" + + // errMsgProcessProviderPipe failed to initialize pipe + errMsgProcessProviderPipe = "failed to initialize pipe" + + // DefaultDuration is the default amount of time in minutes that the + // credentials will be valid for. + DefaultDuration = time.Duration(15) * time.Minute + + // DefaultBufSize limits buffer size from growing to an enormous + // amount due to a faulty process. + DefaultBufSize = int(8 * sdkio.KibiByte) + + // DefaultTimeout default limit on time a process can run. + DefaultTimeout = time.Duration(1) * time.Minute +) + +// ProcessProvider satisfies the credentials.Provider interface, and is a +// client to retrieve credentials from a process. +type ProcessProvider struct { + staticCreds bool + credentials.Expiry + originalCommand []string + + // Expiry duration of the credentials. Defaults to 15 minutes if not set. + Duration time.Duration + + // ExpiryWindow will allow the credentials to trigger refreshing prior to + // the credentials actually expiring. This is beneficial so race conditions + // with expiring credentials do not cause request to fail unexpectedly + // due to ExpiredTokenException exceptions. + // + // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true + // 10 seconds before the credentials are actually expired. + // + // If ExpiryWindow is 0 or less it will be ignored. + ExpiryWindow time.Duration + + // A string representing an os command that should return a JSON with + // credential information. + command *exec.Cmd + + // MaxBufSize limits memory usage from growing to an enormous + // amount due to a faulty process. + MaxBufSize int + + // Timeout limits the time a process can run. + Timeout time.Duration +} + +// NewCredentials returns a pointer to a new Credentials object wrapping the +// ProcessProvider. The credentials will expire every 15 minutes by default. +func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials { + p := &ProcessProvider{ + command: exec.Command(command), + Duration: DefaultDuration, + Timeout: DefaultTimeout, + MaxBufSize: DefaultBufSize, + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) +} + +// NewCredentialsTimeout returns a pointer to a new Credentials object with +// the specified command and timeout, and default duration and max buffer size. +func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials { + p := NewCredentials(command, func(opt *ProcessProvider) { + opt.Timeout = timeout + }) + + return p +} + +// NewCredentialsCommand returns a pointer to a new Credentials object with +// the specified command, and default timeout, duration and max buffer size. +func NewCredentialsCommand(command *exec.Cmd, options ...func(*ProcessProvider)) *credentials.Credentials { + p := &ProcessProvider{ + command: command, + Duration: DefaultDuration, + Timeout: DefaultTimeout, + MaxBufSize: DefaultBufSize, + } + + for _, option := range options { + option(p) + } + + return credentials.NewCredentials(p) +} + +type credentialProcessResponse struct { + Version int + AccessKeyID string `json:"AccessKeyId"` + SecretAccessKey string + SessionToken string + Expiration *time.Time +} + +// Retrieve executes the 'credential_process' and returns the credentials. +func (p *ProcessProvider) Retrieve() (credentials.Value, error) { + out, err := p.executeCredentialProcess() + if err != nil { + return credentials.Value{ProviderName: ProviderName}, err + } + + // Serialize and validate response + resp := &credentialProcessResponse{} + if err = json.Unmarshal(out, resp); err != nil { + return credentials.Value{ProviderName: ProviderName}, awserr.New( + ErrCodeProcessProviderParse, + fmt.Sprintf("%s: %s", errMsgProcessProviderParse, string(out)), + err) + } + + if resp.Version != 1 { + return credentials.Value{ProviderName: ProviderName}, awserr.New( + ErrCodeProcessProviderVersion, + errMsgProcessProviderVersion, + nil) + } + + if len(resp.AccessKeyID) == 0 { + return credentials.Value{ProviderName: ProviderName}, awserr.New( + ErrCodeProcessProviderRequired, + errMsgProcessProviderMissKey, + nil) + } + + if len(resp.SecretAccessKey) == 0 { + return credentials.Value{ProviderName: ProviderName}, awserr.New( + ErrCodeProcessProviderRequired, + errMsgProcessProviderMissSecret, + nil) + } + + // Handle expiration + p.staticCreds = resp.Expiration == nil + if resp.Expiration != nil { + p.SetExpiration(*resp.Expiration, p.ExpiryWindow) + } + + return credentials.Value{ + ProviderName: ProviderName, + AccessKeyID: resp.AccessKeyID, + SecretAccessKey: resp.SecretAccessKey, + SessionToken: resp.SessionToken, + }, nil +} + +// IsExpired returns true if the credentials retrieved are expired, or not yet +// retrieved. +func (p *ProcessProvider) IsExpired() bool { + if p.staticCreds { + return false + } + return p.Expiry.IsExpired() +} + +// prepareCommand prepares the command to be executed. +func (p *ProcessProvider) prepareCommand() error { + + var cmdArgs []string + if runtime.GOOS == "windows" { + cmdArgs = []string{"cmd.exe", "/C"} + } else { + cmdArgs = []string{"sh", "-c"} + } + + if len(p.originalCommand) == 0 { + p.originalCommand = make([]string, len(p.command.Args)) + copy(p.originalCommand, p.command.Args) + + // check for empty command because it succeeds + if len(strings.TrimSpace(p.originalCommand[0])) < 1 { + return awserr.New( + ErrCodeProcessProviderExecution, + fmt.Sprintf( + "%s: %s", + errMsgProcessProviderPrepareCmd, + errMsgProcessProviderEmptyCmd), + nil) + } + } + + cmdArgs = append(cmdArgs, p.originalCommand...) + p.command = exec.Command(cmdArgs[0], cmdArgs[1:]...) + p.command.Env = os.Environ() + + return nil +} + +// executeCredentialProcess starts the credential process on the OS and +// returns the results or an error. +func (p *ProcessProvider) executeCredentialProcess() ([]byte, error) { + + if err := p.prepareCommand(); err != nil { + return nil, err + } + + // Setup the pipes + outReadPipe, outWritePipe, err := os.Pipe() + if err != nil { + return nil, awserr.New( + ErrCodeProcessProviderExecution, + errMsgProcessProviderPipe, + err) + } + + p.command.Stderr = os.Stderr // display stderr on console for MFA + p.command.Stdout = outWritePipe // get creds json on process's stdout + p.command.Stdin = os.Stdin // enable stdin for MFA + + output := bytes.NewBuffer(make([]byte, 0, p.MaxBufSize)) + + stdoutCh := make(chan error, 1) + go readInput( + io.LimitReader(outReadPipe, int64(p.MaxBufSize)), + output, + stdoutCh) + + execCh := make(chan error, 1) + go executeCommand(*p.command, execCh) + + finished := false + var errors []error + for !finished { + select { + case readError := <-stdoutCh: + errors = appendError(errors, readError) + finished = true + case execError := <-execCh: + err := outWritePipe.Close() + errors = appendError(errors, err) + errors = appendError(errors, execError) + if errors != nil { + return output.Bytes(), awserr.NewBatchError( + ErrCodeProcessProviderExecution, + errMsgProcessProviderProcess, + errors) + } + case <-time.After(p.Timeout): + finished = true + return output.Bytes(), awserr.NewBatchError( + ErrCodeProcessProviderExecution, + errMsgProcessProviderTimeout, + errors) // errors can be nil + } + } + + out := output.Bytes() + + if runtime.GOOS == "windows" { + // windows adds slashes to quotes + out = []byte(strings.Replace(string(out), `\"`, `"`, -1)) + } + + return out, nil +} + +// appendError conveniently checks for nil before appending slice +func appendError(errors []error, err error) []error { + if err != nil { + return append(errors, err) + } + return errors +} + +func executeCommand(cmd exec.Cmd, exec chan error) { + // Start the command + err := cmd.Start() + if err == nil { + err = cmd.Wait() + } + + exec <- err +} + +func readInput(r io.Reader, w io.Writer, read chan error) { + tee := io.TeeReader(r, w) + + _, err := ioutil.ReadAll(tee) + + if err == io.EOF { + err = nil + } + + read <- err // will only arrive here when write end of pipe is closed +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go index 7fb7cbf..e155149 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go @@ -3,11 +3,10 @@ package credentials import ( "fmt" "os" - "path/filepath" - - "github.com/go-ini/ini" "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/internal/ini" + "github.com/aws/aws-sdk-go/internal/shareddefaults" ) // SharedCredsProviderName provides a name of SharedCreds provider @@ -15,8 +14,6 @@ const SharedCredsProviderName = "SharedCredentialsProvider" var ( // ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. - // - // @readonly ErrSharedCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil) ) @@ -79,36 +76,37 @@ func (p *SharedCredentialsProvider) IsExpired() bool { // The credentials retrieved from the profile will be returned or error. Error will be // returned if it fails to read from the file, or the data is invalid. func loadProfile(filename, profile string) (Value, error) { - config, err := ini.Load(filename) + config, err := ini.OpenFile(filename) if err != nil { return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err) } - iniProfile, err := config.GetSection(profile) - if err != nil { - return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", err) + + iniProfile, ok := config.GetSection(profile) + if !ok { + return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", nil) } - id, err := iniProfile.GetKey("aws_access_key_id") - if err != nil { + id := iniProfile.String("aws_access_key_id") + if len(id) == 0 { return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsAccessKey", fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename), - err) + nil) } - secret, err := iniProfile.GetKey("aws_secret_access_key") - if err != nil { + secret := iniProfile.String("aws_secret_access_key") + if len(secret) == 0 { return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsSecret", fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename), nil) } // Default to empty string if not found - token := iniProfile.Key("aws_session_token") + token := iniProfile.String("aws_session_token") return Value{ - AccessKeyID: id.String(), - SecretAccessKey: secret.String(), - SessionToken: token.String(), + AccessKeyID: id, + SecretAccessKey: secret, + SessionToken: token, ProviderName: SharedCredsProviderName, }, nil } @@ -117,22 +115,23 @@ func loadProfile(filename, profile string) (Value, error) { // // Will return an error if the user's home directory path cannot be found. func (p *SharedCredentialsProvider) filename() (string, error) { - if p.Filename == "" { - if p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); p.Filename != "" { - return p.Filename, nil - } - - homeDir := os.Getenv("HOME") // *nix - if homeDir == "" { // Windows - homeDir = os.Getenv("USERPROFILE") - } - if homeDir == "" { - return "", ErrSharedCredentialsHomeNotFound - } - - p.Filename = filepath.Join(homeDir, ".aws", "credentials") + if len(p.Filename) != 0 { + return p.Filename, nil + } + + if p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); len(p.Filename) != 0 { + return p.Filename, nil } + if home := shareddefaults.UserHomeDir(); len(home) == 0 { + // Backwards compatibility of home directly not found error being returned. + // This error is too verbose, failure when opening the file would of been + // a better error to return. + return "", ErrSharedCredentialsHomeNotFound + } + + p.Filename = shareddefaults.SharedCredentialsFilename() + return p.Filename, nil } 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 6b4093a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider_test.go +++ /dev/null @@ -1,116 +0,0 @@ -package credentials - -import ( - "os" - "path/filepath" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestSharedCredentialsProvider(t *testing.T) { - os.Clearenv() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""} - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") -} - -func TestSharedCredentialsProviderIsExpired(t *testing.T) { - os.Clearenv() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""} - - assert.True(t, p.IsExpired(), "Expect creds to be expired before retrieve") - - _, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.False(t, p.IsExpired(), "Expect creds to not be expired after retrieve") -} - -func TestSharedCredentialsProviderWithAWS_SHARED_CREDENTIALS_FILE(t *testing.T) { - os.Clearenv() - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", "example.ini") - p := SharedCredentialsProvider{} - creds, err := p.Retrieve() - - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") -} - -func TestSharedCredentialsProviderWithAWS_SHARED_CREDENTIALS_FILEAbsPath(t *testing.T) { - os.Clearenv() - wd, err := os.Getwd() - assert.NoError(t, err) - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", filepath.Join(wd, "example.ini")) - p := SharedCredentialsProvider{} - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "token", creds.SessionToken, "Expect session token to match") -} - -func TestSharedCredentialsProviderWithAWS_PROFILE(t *testing.T) { - os.Clearenv() - os.Setenv("AWS_PROFILE", "no_token") - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: ""} - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Empty(t, creds.SessionToken, "Expect no token") -} - -func TestSharedCredentialsProviderWithoutTokenFromProfile(t *testing.T) { - os.Clearenv() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: "no_token"} - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Empty(t, creds.SessionToken, "Expect no token") -} - -func TestSharedCredentialsProviderColonInCredFile(t *testing.T) { - os.Clearenv() - - p := SharedCredentialsProvider{Filename: "example.ini", Profile: "with_colon"} - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "accessKey", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "secret", creds.SecretAccessKey, "Expect secret access key to match") - assert.Empty(t, creds.SessionToken, "Expect no token") -} - -func BenchmarkSharedCredentialsProvider(b *testing.B) { - os.Clearenv() - - 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.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go index 4f5dab3..531139e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go @@ -9,8 +9,6 @@ const StaticProviderName = "StaticProvider" var ( // ErrStaticCredentialsEmpty is emitted when static credentials are empty. - // - // @readonly ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) ) 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 ea01236..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package credentials - -import ( - "github.com/stretchr/testify/assert" - "testing" -) - -func TestStaticProviderGet(t *testing.T) { - s := StaticProvider{ - Value: Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "", - }, - } - - creds, err := s.Retrieve() - assert.Nil(t, err, "Expect no error") - assert.Equal(t, "AKID", creds.AccessKeyID, "Expect access key ID to match") - assert.Equal(t, "SECRET", creds.SecretAccessKey, "Expect secret access key to match") - assert.Empty(t, creds.SessionToken, "Expect no session token") -} - -func TestStaticProviderIsExpired(t *testing.T) { - s := StaticProvider{ - Value: Value{ - AccessKeyID: "AKID", - SecretAccessKey: "SECRET", - SessionToken: "", - }, - } - - assert.False(t, s.IsExpired(), "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 b840623..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 @@ -12,7 +12,7 @@ between multiple Credentials, Sessions or service clients. Assume Role To assume an IAM role using STS with the SDK you can create a new Credentials -with the SDKs's stscreds package. +with the SDKs's stscreds package. // Initial credentials loaded from SDK's default credential chain. Such as // the environment, shared credentials (~/.aws/credentials), or EC2 Instance @@ -80,16 +80,18 @@ package stscreds import ( "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/client" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/internal/sdkrand" "github.com/aws/aws-sdk-go/service/sts" ) -// StdinTokenProvider will prompt on stdout and read from stdin for a string value. +// StdinTokenProvider will prompt on stderr and read from stdin for a string value. // An error is returned if reading from stdin fails. // // Use this function go read MFA tokens from stdin. The function makes no attempt @@ -102,7 +104,7 @@ import ( // Will wait forever until something is provided on the stdin. func StdinTokenProvider() (string, error) { var v string - fmt.Printf("Assume Role MFA token code: ") + fmt.Fprintf(os.Stderr, "Assume Role MFA token code: ") _, err := fmt.Scanln(&v) return v, err @@ -142,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 @@ -193,6 +202,18 @@ type AssumeRoleProvider struct { // // If ExpiryWindow is 0 or less it will be ignored. ExpiryWindow time.Duration + + // MaxJitterFrac reduces the effective Duration of each credential requested + // by a random percentage between 0 and MaxJitterFraction. MaxJitterFrac must + // have a value between 0 and 1. Any other value may lead to expected behavior. + // With a MaxJitterFrac value of 0, default) will no jitter will be used. + // + // For example, with a Duration of 30m and a MaxJitterFrac of 0.1, the + // AssumeRole call will be made with an arbitrary Duration between 27m and + // 30m. + // + // MaxJitterFrac should not be negative. + MaxJitterFrac float64 } // NewCredentials returns a pointer to a new Credentials object wrapping the @@ -244,7 +265,6 @@ func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(* // Retrieve generates a new set of temporary credentials using STS. func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { - // Apply defaults where parameters are not set. if p.RoleSessionName == "" { // Try to work out a role name that will hopefully end up unique. @@ -254,11 +274,14 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { // Expire as often as AWS permits. p.Duration = DefaultDuration } + jitter := time.Duration(sdkrand.SeededRand.Float64() * p.MaxJitterFrac * float64(p.Duration)) input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int64(int64(p.Duration / 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 4c0212a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider_test.go +++ /dev/null @@ -1,150 +0,0 @@ -package stscreds - -import ( - "fmt" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/sts" - "github.com/stretchr/testify/assert" -) - -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() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "roleARN", creds.AccessKeyID, "Expect access key ID to be reflected role ARN") - assert.Equal(t, "assumedSecretAccessKey", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "assumedSessionToken", creds.SessionToken, "Expect session token to match") -} - -func TestAssumeRoleProvider_WithTokenCode(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - assert.Equal(t, "0123456789", *in.SerialNumber) - assert.Equal(t, "code", *in.TokenCode) - }, - } - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - SerialNumber: aws.String("0123456789"), - TokenCode: aws.String("code"), - } - - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "roleARN", creds.AccessKeyID, "Expect access key ID to be reflected role ARN") - assert.Equal(t, "assumedSecretAccessKey", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "assumedSessionToken", creds.SessionToken, "Expect session token to match") -} - -func TestAssumeRoleProvider_WithTokenProvider(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - assert.Equal(t, "0123456789", *in.SerialNumber) - assert.Equal(t, "code", *in.TokenCode) - }, - } - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - SerialNumber: aws.String("0123456789"), - TokenProvider: func() (string, error) { - return "code", nil - }, - } - - creds, err := p.Retrieve() - assert.Nil(t, err, "Expect no error") - - assert.Equal(t, "roleARN", creds.AccessKeyID, "Expect access key ID to be reflected role ARN") - assert.Equal(t, "assumedSecretAccessKey", creds.SecretAccessKey, "Expect secret access key to match") - assert.Equal(t, "assumedSessionToken", creds.SessionToken, "Expect session token to match") -} - -func TestAssumeRoleProvider_WithTokenProviderError(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - assert.Fail(t, "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() - assert.Error(t, err) - - assert.Empty(t, creds.AccessKeyID) - assert.Empty(t, creds.SecretAccessKey) - assert.Empty(t, creds.SessionToken) -} - -func TestAssumeRoleProvider_MFAWithNoToken(t *testing.T) { - stub := &stubSTS{ - TestInput: func(in *sts.AssumeRoleInput) { - assert.Fail(t, "API request should not of been called") - }, - } - p := &AssumeRoleProvider{ - Client: stub, - RoleARN: "roleARN", - SerialNumber: aws.String("0123456789"), - } - - creds, err := p.Retrieve() - assert.Error(t, err) - - assert.Empty(t, creds.AccessKeyID) - assert.Empty(t, creds.SecretAccessKey) - assert.Empty(t, creds.SessionToken) -} - -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.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go new file mode 100644 index 0000000..b20b633 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go @@ -0,0 +1,100 @@ +package stscreds + +import ( + "fmt" + "io/ioutil" + "strconv" + "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/credentials" + "github.com/aws/aws-sdk-go/service/sts" + "github.com/aws/aws-sdk-go/service/sts/stsiface" +) + +const ( + // ErrCodeWebIdentity will be used as an error code when constructing + // a new error to be returned during session creation or retrieval. + ErrCodeWebIdentity = "WebIdentityErr" + + // WebIdentityProviderName is the web identity provider name + WebIdentityProviderName = "WebIdentityCredentials" +) + +// now is used to return a time.Time object representing +// the current time. This can be used to easily test and +// compare test values. +var now = time.Now + +// WebIdentityRoleProvider is used to retrieve credentials using +// an OIDC token. +type WebIdentityRoleProvider struct { + credentials.Expiry + + client stsiface.STSAPI + ExpiryWindow time.Duration + + tokenFilePath string + roleARN string + roleSessionName string +} + +// NewWebIdentityCredentials will return a new set of credentials with a given +// configuration, role arn, and token file path. +func NewWebIdentityCredentials(c client.ConfigProvider, roleARN, roleSessionName, path string) *credentials.Credentials { + svc := sts.New(c) + p := NewWebIdentityRoleProvider(svc, roleARN, roleSessionName, path) + return credentials.NewCredentials(p) +} + +// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the +// provided stsiface.STSAPI +func NewWebIdentityRoleProvider(svc stsiface.STSAPI, roleARN, roleSessionName, path string) *WebIdentityRoleProvider { + return &WebIdentityRoleProvider{ + client: svc, + tokenFilePath: path, + roleARN: roleARN, + roleSessionName: roleSessionName, + } +} + +// Retrieve will attempt to assume a role from a token which is located at +// 'WebIdentityTokenFilePath' specified destination and if that is empty an +// error will be returned. +func (p *WebIdentityRoleProvider) Retrieve() (credentials.Value, error) { + b, err := ioutil.ReadFile(p.tokenFilePath) + if err != nil { + errMsg := fmt.Sprintf("unable to read file at %s", p.tokenFilePath) + return credentials.Value{}, awserr.New(ErrCodeWebIdentity, errMsg, err) + } + + sessionName := p.roleSessionName + if len(sessionName) == 0 { + // session name is used to uniquely identify a session. This simply + // uses unix time in nanoseconds to uniquely identify sessions. + sessionName = strconv.FormatInt(now().UnixNano(), 10) + } + req, resp := p.client.AssumeRoleWithWebIdentityRequest(&sts.AssumeRoleWithWebIdentityInput{ + RoleArn: &p.roleARN, + RoleSessionName: &sessionName, + WebIdentityToken: aws.String(string(b)), + }) + // InvalidIdentityToken error is a temporary error that can occur + // when assuming an Role with a JWT web identity token. + req.RetryErrorCodes = append(req.RetryErrorCodes, sts.ErrCodeInvalidIdentityTokenException) + if err := req.Send(); err != nil { + return credentials.Value{}, awserr.New(ErrCodeWebIdentity, "failed to retrieve credentials", err) + } + + p.SetExpiration(aws.TimeValue(resp.Credentials.Expiration), p.ExpiryWindow) + + value := credentials.Value{ + AccessKeyID: aws.StringValue(resp.Credentials.AccessKeyId), + SecretAccessKey: aws.StringValue(resp.Credentials.SecretAccessKey), + SessionToken: aws.StringValue(resp.Credentials.SessionToken), + ProviderName: WebIdentityProviderName, + } + return value, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go new file mode 100644 index 0000000..25a66d1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go @@ -0,0 +1,69 @@ +// Package csm provides the Client Side Monitoring (CSM) client which enables +// sending metrics via UDP connection to the CSM agent. This package provides +// control options, and configuration for the CSM client. The client can be +// controlled manually, or automatically via the SDK's Session configuration. +// +// Enabling CSM client via SDK's Session configuration +// +// The CSM client can be enabled automatically via SDK's Session configuration. +// The SDK's session configuration enables the CSM client if the AWS_CSM_PORT +// environment variable is set to a non-empty value. +// +// The configuration options for the CSM client via the SDK's session +// configuration are: +// +// * AWS_CSM_PORT= +// The port number the CSM agent will receive metrics on. +// +// * AWS_CSM_HOST= +// The hostname, or IP address the CSM agent will receive metrics on. +// Without port number. +// +// Manually enabling the CSM client +// +// The CSM client can be started, paused, and resumed manually. The Start +// function will enable the CSM client to publish metrics to the CSM agent. It +// is safe to call Start concurrently, but if Start is called additional times +// with different ClientID or address it will panic. +// +// r, err := csm.Start("clientID", ":31000") +// if err != nil { +// panic(fmt.Errorf("failed starting CSM: %v", err)) +// } +// +// When controlling the CSM client manually, you must also inject its request +// handlers into the SDK's Session configuration for the SDK's API clients to +// publish metrics. +// +// sess, err := session.NewSession(&aws.Config{}) +// if err != nil { +// panic(fmt.Errorf("failed loading session: %v", err)) +// } +// +// // Add CSM client's metric publishing request handlers to the SDK's +// // Session Configuration. +// r.InjectHandlers(&sess.Handlers) +// +// Controlling CSM client +// +// Once the CSM client has been enabled the Get function will return a Reporter +// value that you can use to pause and resume the metrics published to the CSM +// agent. If Get function is called before the reporter is enabled with the +// Start function or via SDK's Session configuration nil will be returned. +// +// The Pause method can be called to stop the CSM client publishing metrics to +// the CSM agent. The Continue method will resume metric publishing. +// +// // Get the CSM client Reporter. +// r := csm.Get() +// +// // Will pause monitoring +// r.Pause() +// resp, err = client.GetObject(&s3.GetObjectInput{ +// Bucket: aws.String("bucket"), +// Key: aws.String("key"), +// }) +// +// // Resume monitoring +// r.Continue() +package csm diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go new file mode 100644 index 0000000..4b19e28 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go @@ -0,0 +1,89 @@ +package csm + +import ( + "fmt" + "strings" + "sync" +) + +var ( + lock sync.Mutex +) + +const ( + // DefaultPort is used when no port is specified. + DefaultPort = "31000" + + // DefaultHost is the host that will be used when none is specified. + DefaultHost = "127.0.0.1" +) + +// AddressWithDefaults returns a CSM address built from the host and port +// values. If the host or port is not set, default values will be used +// instead. If host is "localhost" it will be replaced with "127.0.0.1". +func AddressWithDefaults(host, port string) string { + if len(host) == 0 || strings.EqualFold(host, "localhost") { + host = DefaultHost + } + + if len(port) == 0 { + port = DefaultPort + } + + // Only IP6 host can contain a colon + if strings.Contains(host, ":") { + return "[" + host + "]:" + port + } + + return host + ":" + port +} + +// Start will start a long running go routine to capture +// client side metrics. Calling start multiple time will only +// start the metric listener once and will panic if a different +// client ID or port is passed in. +// +// r, err := csm.Start("clientID", "127.0.0.1:31000") +// if err != nil { +// panic(fmt.Errorf("expected no error, but received %v", err)) +// } +// sess := session.NewSession() +// r.InjectHandlers(sess.Handlers) +// +// svc := s3.New(sess) +// out, err := svc.GetObject(&s3.GetObjectInput{ +// Bucket: aws.String("bucket"), +// Key: aws.String("key"), +// }) +func Start(clientID string, url string) (*Reporter, error) { + lock.Lock() + defer lock.Unlock() + + if sender == nil { + sender = newReporter(clientID, url) + } else { + if sender.clientID != clientID { + panic(fmt.Errorf("inconsistent client IDs. %q was expected, but received %q", sender.clientID, clientID)) + } + + if sender.url != url { + panic(fmt.Errorf("inconsistent URLs. %q was expected, but received %q", sender.url, url)) + } + } + + if err := connect(url); err != nil { + sender = nil + return nil, err + } + + return sender, nil +} + +// Get will return a reporter if one exists, if one does not exist, nil will +// be returned. +func Get() *Reporter { + lock.Lock() + defer lock.Unlock() + + return sender +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go new file mode 100644 index 0000000..5bacc79 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go @@ -0,0 +1,109 @@ +package csm + +import ( + "strconv" + "time" + + "github.com/aws/aws-sdk-go/aws" +) + +type metricTime time.Time + +func (t metricTime) MarshalJSON() ([]byte, error) { + ns := time.Duration(time.Time(t).UnixNano()) + return []byte(strconv.FormatInt(int64(ns/time.Millisecond), 10)), nil +} + +type metric struct { + ClientID *string `json:"ClientId,omitempty"` + API *string `json:"Api,omitempty"` + Service *string `json:"Service,omitempty"` + Timestamp *metricTime `json:"Timestamp,omitempty"` + Type *string `json:"Type,omitempty"` + Version *int `json:"Version,omitempty"` + + AttemptCount *int `json:"AttemptCount,omitempty"` + Latency *int `json:"Latency,omitempty"` + + Fqdn *string `json:"Fqdn,omitempty"` + UserAgent *string `json:"UserAgent,omitempty"` + AttemptLatency *int `json:"AttemptLatency,omitempty"` + + SessionToken *string `json:"SessionToken,omitempty"` + Region *string `json:"Region,omitempty"` + AccessKey *string `json:"AccessKey,omitempty"` + HTTPStatusCode *int `json:"HttpStatusCode,omitempty"` + XAmzID2 *string `json:"XAmzId2,omitempty"` + XAmzRequestID *string `json:"XAmznRequestId,omitempty"` + + AWSException *string `json:"AwsException,omitempty"` + AWSExceptionMessage *string `json:"AwsExceptionMessage,omitempty"` + SDKException *string `json:"SdkException,omitempty"` + SDKExceptionMessage *string `json:"SdkExceptionMessage,omitempty"` + + FinalHTTPStatusCode *int `json:"FinalHttpStatusCode,omitempty"` + FinalAWSException *string `json:"FinalAwsException,omitempty"` + FinalAWSExceptionMessage *string `json:"FinalAwsExceptionMessage,omitempty"` + FinalSDKException *string `json:"FinalSdkException,omitempty"` + FinalSDKExceptionMessage *string `json:"FinalSdkExceptionMessage,omitempty"` + + DestinationIP *string `json:"DestinationIp,omitempty"` + ConnectionReused *int `json:"ConnectionReused,omitempty"` + + AcquireConnectionLatency *int `json:"AcquireConnectionLatency,omitempty"` + ConnectLatency *int `json:"ConnectLatency,omitempty"` + RequestLatency *int `json:"RequestLatency,omitempty"` + DNSLatency *int `json:"DnsLatency,omitempty"` + TCPLatency *int `json:"TcpLatency,omitempty"` + SSLLatency *int `json:"SslLatency,omitempty"` + + MaxRetriesExceeded *int `json:"MaxRetriesExceeded,omitempty"` +} + +func (m *metric) TruncateFields() { + m.ClientID = truncateString(m.ClientID, 255) + m.UserAgent = truncateString(m.UserAgent, 256) + + m.AWSException = truncateString(m.AWSException, 128) + m.AWSExceptionMessage = truncateString(m.AWSExceptionMessage, 512) + + m.SDKException = truncateString(m.SDKException, 128) + m.SDKExceptionMessage = truncateString(m.SDKExceptionMessage, 512) + + m.FinalAWSException = truncateString(m.FinalAWSException, 128) + m.FinalAWSExceptionMessage = truncateString(m.FinalAWSExceptionMessage, 512) + + m.FinalSDKException = truncateString(m.FinalSDKException, 128) + m.FinalSDKExceptionMessage = truncateString(m.FinalSDKExceptionMessage, 512) +} + +func truncateString(v *string, l int) *string { + if v != nil && len(*v) > l { + nv := (*v)[:l] + return &nv + } + + return v +} + +func (m *metric) SetException(e metricException) { + switch te := e.(type) { + case awsException: + m.AWSException = aws.String(te.exception) + m.AWSExceptionMessage = aws.String(te.message) + case sdkException: + m.SDKException = aws.String(te.exception) + m.SDKExceptionMessage = aws.String(te.message) + } +} + +func (m *metric) SetFinalException(e metricException) { + switch te := e.(type) { + case awsException: + m.FinalAWSException = aws.String(te.exception) + m.FinalAWSExceptionMessage = aws.String(te.message) + case sdkException: + m.FinalSDKException = aws.String(te.exception) + m.FinalSDKExceptionMessage = aws.String(te.message) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go new file mode 100644 index 0000000..82a3e34 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go @@ -0,0 +1,55 @@ +package csm + +import ( + "sync/atomic" +) + +const ( + runningEnum = iota + pausedEnum +) + +var ( + // MetricsChannelSize of metrics to hold in the channel + MetricsChannelSize = 100 +) + +type metricChan struct { + ch chan metric + paused *int64 +} + +func newMetricChan(size int) metricChan { + return metricChan{ + ch: make(chan metric, size), + paused: new(int64), + } +} + +func (ch *metricChan) Pause() { + atomic.StoreInt64(ch.paused, pausedEnum) +} + +func (ch *metricChan) Continue() { + atomic.StoreInt64(ch.paused, runningEnum) +} + +func (ch *metricChan) IsPaused() bool { + v := atomic.LoadInt64(ch.paused) + return v == pausedEnum +} + +// Push will push metrics to the metric channel if the channel +// is not paused +func (ch *metricChan) Push(m metric) bool { + if ch.IsPaused() { + return false + } + + select { + case ch.ch <- m: + return true + default: + return false + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go new file mode 100644 index 0000000..54a9928 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go @@ -0,0 +1,26 @@ +package csm + +type metricException interface { + Exception() string + Message() string +} + +type requestException struct { + exception string + message string +} + +func (e requestException) Exception() string { + return e.exception +} +func (e requestException) Message() string { + return e.message +} + +type awsException struct { + requestException +} + +type sdkException struct { + requestException +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go new file mode 100644 index 0000000..9186587 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go @@ -0,0 +1,264 @@ +package csm + +import ( + "encoding/json" + "net" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// Reporter will gather metrics of API requests made and +// send those metrics to the CSM endpoint. +type Reporter struct { + clientID string + url string + conn net.Conn + metricsCh metricChan + done chan struct{} +} + +var ( + sender *Reporter +) + +func connect(url string) error { + const network = "udp" + if err := sender.connect(network, url); err != nil { + return err + } + + if sender.done == nil { + sender.done = make(chan struct{}) + go sender.start() + } + + return nil +} + +func newReporter(clientID, url string) *Reporter { + return &Reporter{ + clientID: clientID, + url: url, + metricsCh: newMetricChan(MetricsChannelSize), + } +} + +func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) { + if rep == nil { + return + } + + now := time.Now() + creds, _ := r.Config.Credentials.Get() + + m := metric{ + ClientID: aws.String(rep.clientID), + API: aws.String(r.Operation.Name), + Service: aws.String(r.ClientInfo.ServiceID), + Timestamp: (*metricTime)(&now), + UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")), + Region: r.Config.Region, + Type: aws.String("ApiCallAttempt"), + Version: aws.Int(1), + + XAmzRequestID: aws.String(r.RequestID), + + AttemptLatency: aws.Int(int(now.Sub(r.AttemptTime).Nanoseconds() / int64(time.Millisecond))), + AccessKey: aws.String(creds.AccessKeyID), + } + + if r.HTTPResponse != nil { + m.HTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode) + } + + if r.Error != nil { + if awserr, ok := r.Error.(awserr.Error); ok { + m.SetException(getMetricException(awserr)) + } + } + + m.TruncateFields() + rep.metricsCh.Push(m) +} + +func getMetricException(err awserr.Error) metricException { + msg := err.Error() + code := err.Code() + + switch code { + case "RequestError", + request.ErrCodeSerialization, + request.CanceledErrorCode: + return sdkException{ + requestException{exception: code, message: msg}, + } + default: + return awsException{ + requestException{exception: code, message: msg}, + } + } +} + +func (rep *Reporter) sendAPICallMetric(r *request.Request) { + if rep == nil { + return + } + + now := time.Now() + m := metric{ + ClientID: aws.String(rep.clientID), + API: aws.String(r.Operation.Name), + Service: aws.String(r.ClientInfo.ServiceID), + Timestamp: (*metricTime)(&now), + UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")), + Type: aws.String("ApiCall"), + AttemptCount: aws.Int(r.RetryCount + 1), + Region: r.Config.Region, + Latency: aws.Int(int(time.Since(r.Time) / time.Millisecond)), + XAmzRequestID: aws.String(r.RequestID), + MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())), + } + + if r.HTTPResponse != nil { + m.FinalHTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode) + } + + if r.Error != nil { + if awserr, ok := r.Error.(awserr.Error); ok { + m.SetFinalException(getMetricException(awserr)) + } + } + + m.TruncateFields() + + // TODO: Probably want to figure something out for logging dropped + // metrics + rep.metricsCh.Push(m) +} + +func (rep *Reporter) connect(network, url string) error { + if rep.conn != nil { + rep.conn.Close() + } + + conn, err := net.Dial(network, url) + if err != nil { + return awserr.New("UDPError", "Could not connect", err) + } + + rep.conn = conn + + return nil +} + +func (rep *Reporter) close() { + if rep.done != nil { + close(rep.done) + } + + rep.metricsCh.Pause() +} + +func (rep *Reporter) start() { + defer func() { + rep.metricsCh.Pause() + }() + + for { + select { + case <-rep.done: + rep.done = nil + return + case m := <-rep.metricsCh.ch: + // TODO: What to do with this error? Probably should just log + b, err := json.Marshal(m) + if err != nil { + continue + } + + rep.conn.Write(b) + } + } +} + +// Pause will pause the metric channel preventing any new metrics from being +// added. It is safe to call concurrently with other calls to Pause, but if +// called concurently with Continue can lead to unexpected state. +func (rep *Reporter) Pause() { + lock.Lock() + defer lock.Unlock() + + if rep == nil { + return + } + + rep.close() +} + +// Continue will reopen the metric channel and allow for monitoring to be +// resumed. It is safe to call concurrently with other calls to Continue, but +// if called concurently with Pause can lead to unexpected state. +func (rep *Reporter) Continue() { + lock.Lock() + defer lock.Unlock() + if rep == nil { + return + } + + if !rep.metricsCh.IsPaused() { + return + } + + rep.metricsCh.Continue() +} + +// Client side metric handler names +const ( + APICallMetricHandlerName = "awscsm.SendAPICallMetric" + APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric" +) + +// InjectHandlers will will enable client side metrics and inject the proper +// handlers to handle how metrics are sent. +// +// InjectHandlers is NOT safe to call concurrently. Calling InjectHandlers +// multiple times may lead to unexpected behavior, (e.g. duplicate metrics). +// +// // Start must be called in order to inject the correct handlers +// r, err := csm.Start("clientID", "127.0.0.1:8094") +// if err != nil { +// panic(fmt.Errorf("expected no error, but received %v", err)) +// } +// +// sess := session.NewSession() +// r.InjectHandlers(&sess.Handlers) +// +// // create a new service client with our client side metric session +// svc := s3.New(sess) +func (rep *Reporter) InjectHandlers(handlers *request.Handlers) { + if rep == nil { + return + } + + handlers.Complete.PushFrontNamed(request.NamedHandler{ + Name: APICallMetricHandlerName, + Fn: rep.sendAPICallMetric, + }) + + handlers.CompleteAttempt.PushFrontNamed(request.NamedHandler{ + Name: APICallAttemptMetricHandlerName, + Fn: rep.sendAPICallAttemptMetric, + }) +} + +// boolIntValue return 1 for true and 0 for false. +func boolIntValue(b bool) int { + if b { + return 1 + } + + return 0 +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go index 110ca83..23bb639 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go @@ -9,11 +9,14 @@ package defaults import ( "fmt" + "net" "net/http" + "net/url" "os" "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/ec2rolecreds" @@ -21,6 +24,7 @@ import ( "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/shareddefaults" ) // A Defaults provides a collection of default values for SDK clients. @@ -70,6 +74,7 @@ func Handlers() request.Handlers { handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) handlers.Validate.AfterEachFn = request.HandlerListStopOnError handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) + handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHander) handlers.Build.AfterEachFn = request.HandlerListStopOnError handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) handlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler) @@ -88,33 +93,102 @@ func Handlers() request.Handlers { func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials { return credentials.NewCredentials(&credentials.ChainProvider{ VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: []credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - RemoteCredProvider(*cfg, handlers), - }, + Providers: CredProviders(cfg, handlers), }) } -// RemoteCredProvider returns a credenitials provider for the default remote +// CredProviders returns the slice of providers used in +// the default credential chain. +// +// For applications that need to use some other provider (for example use +// different environment variables for legacy reasons) but still fall back +// on the default chain of providers. This allows that default chaint to be +// automatically updated +func CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Provider { + return []credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, + RemoteCredProvider(*cfg, handlers), + } +} + +const ( + httpProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN" + httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI" +) + +// RemoteCredProvider returns a credentials provider for the default remote // endpoints such as EC2 or ECS Roles. func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.Provider { - ecsCredURI := os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI") + if u := os.Getenv(httpProviderEnvVar); len(u) > 0 { + return localHTTPCredProvider(cfg, handlers, u) + } - if len(ecsCredURI) > 0 { - return ecsCredProvider(cfg, handlers, ecsCredURI) + if uri := os.Getenv(shareddefaults.ECSCredsProviderEnvVar); len(uri) > 0 { + u := fmt.Sprintf("%s%s", shareddefaults.ECSContainerCredentialsURI, uri) + return httpCredProvider(cfg, handlers, u) } return ec2RoleProvider(cfg, handlers) } -func ecsCredProvider(cfg aws.Config, handlers request.Handlers, uri string) credentials.Provider { - const host = `169.254.170.2` +var lookupHostFn = net.LookupHost + +func isLoopbackHost(host string) (bool, error) { + ip := net.ParseIP(host) + if ip != nil { + return ip.IsLoopback(), nil + } + + // Host is not an ip, perform lookup + addrs, err := lookupHostFn(host) + if err != nil { + return false, err + } + for _, addr := range addrs { + if !net.ParseIP(addr).IsLoopback() { + return false, nil + } + } + + return true, nil +} + +func localHTTPCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider { + var errMsg string + + parsed, err := url.Parse(u) + if err != nil { + errMsg = fmt.Sprintf("invalid URL, %v", err) + } else { + host := aws.URLHostname(parsed) + if len(host) == 0 { + errMsg = "unable to parse host from local HTTP cred provider URL" + } else if isLoopback, loopbackErr := isLoopbackHost(host); loopbackErr != nil { + errMsg = fmt.Sprintf("failed to resolve host %q, %v", host, loopbackErr) + } else if !isLoopback { + errMsg = fmt.Sprintf("invalid endpoint host, %q, only loopback hosts are allowed.", host) + } + } + + if len(errMsg) > 0 { + if cfg.Logger != nil { + cfg.Logger.Log("Ignoring, HTTP credential provider", errMsg, err) + } + return credentials.ErrorProvider{ + Err: awserr.New("CredentialsEndpointError", errMsg, err), + ProviderName: endpointcreds.ProviderName, + } + } + + return httpCredProvider(cfg, handlers, u) +} - return endpointcreds.NewProviderClient(cfg, handlers, - fmt.Sprintf("http://%s%s", host, uri), +func httpCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider { + return endpointcreds.NewProviderClient(cfg, handlers, u, func(p *endpointcreds.Provider) { p.ExpiryWindow = 5 * time.Minute + p.AuthorizationToken = os.Getenv(httpProviderAuthorizationEnvVar) }, ) } 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 bea61de..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package defaults - -import ( - "fmt" - "os" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "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/stretchr/testify/assert" -) - -func TestECSCredProvider(t *testing.T) { - defer os.Clearenv() - os.Setenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI", "/abc/123") - - provider := RemoteCredProvider(aws.Config{}, request.Handlers{}) - - assert.NotNil(t, provider) - - ecsProvider, ok := provider.(*endpointcreds.Provider) - assert.NotNil(t, ecsProvider) - assert.True(t, ok) - - assert.Equal(t, fmt.Sprintf("http://169.254.170.2/abc/123"), - ecsProvider.Client.Endpoint) -} - -func TestDefaultEC2RoleProvider(t *testing.T) { - provider := RemoteCredProvider(aws.Config{}, request.Handlers{}) - - assert.NotNil(t, provider) - - ec2Provider, ok := provider.(*ec2rolecreds.EC2RoleProvider) - assert.NotNil(t, ec2Provider) - assert.True(t, ok) - - fmt.Println(ec2Provider.Client.Endpoint) - - assert.Equal(t, fmt.Sprintf("http://169.254.169.254/latest"), - ec2Provider.Client.Endpoint) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go new file mode 100644 index 0000000..ca0ee1d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go @@ -0,0 +1,27 @@ +package defaults + +import ( + "github.com/aws/aws-sdk-go/internal/shareddefaults" +) + +// SharedCredentialsFilename returns the SDK's default file path +// for the shared credentials file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/credentials +// - Windows: %USERPROFILE%\.aws\credentials +func SharedCredentialsFilename() string { + return shareddefaults.SharedCredentialsFilename() +} + +// SharedConfigFilename returns the SDK's default file path for +// the shared config file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/config +// - Windows: %USERPROFILE%\.aws\config +func SharedConfigFilename() string { + return shareddefaults.SharedConfigFilename() +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/doc.go new file mode 100644 index 0000000..4fcb616 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/doc.go @@ -0,0 +1,56 @@ +// Package aws provides the core SDK's utilities and shared types. Use this package's +// utilities to simplify setting and reading API operations parameters. +// +// Value and Pointer Conversion Utilities +// +// This package includes a helper conversion utility for each scalar type the SDK's +// API use. These utilities make getting a pointer of the scalar, and dereferencing +// a pointer easier. +// +// Each conversion utility comes in two forms. Value to Pointer and Pointer to Value. +// The Pointer to value will safely dereference the pointer and return its value. +// If the pointer was nil, the scalar's zero value will be returned. +// +// The value to pointer functions will be named after the scalar type. So get a +// *string from a string value use the "String" function. This makes it easy to +// to get pointer of a literal string value, because getting the address of a +// literal requires assigning the value to a variable first. +// +// var strPtr *string +// +// // Without the SDK's conversion functions +// str := "my string" +// strPtr = &str +// +// // With the SDK's conversion functions +// strPtr = aws.String("my string") +// +// // Convert *string to string value +// str = aws.StringValue(strPtr) +// +// In addition to scalars the aws package also includes conversion utilities for +// map and slice for commonly types used in API parameters. The map and slice +// conversion functions use similar naming pattern as the scalar conversion +// functions. +// +// var strPtrs []*string +// var strs []string = []string{"Go", "Gophers", "Go"} +// +// // Convert []string to []*string +// strPtrs = aws.StringSlice(strs) +// +// // Convert []*string to []string +// strs = aws.StringValueSlice(strPtrs) +// +// SDK Default HTTP Client +// +// The SDK will use the http.DefaultClient if a HTTP client is not provided to +// the SDK's Session, or service client constructor. This means that if the +// http.DefaultClient is modified by other components of your application the +// modifications will be picked up by the SDK as well. +// +// In some cases this might be intended, but it is a better practice to create +// a custom HTTP Client to share explicitly through your application. You can +// configure the SDK to use the custom HTTP Client by setting the HTTPClient +// value of the SDK's Config type when creating a Session or service client. +package aws diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go index 984407a..12897ee 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -4,28 +4,63 @@ import ( "encoding/json" "fmt" "net/http" - "path" + "strconv" "strings" "time" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/sdkuri" ) +// getToken uses the duration to return a token for EC2 metadata service, +// or an error if the request failed. +func (c *EC2Metadata) getToken(duration time.Duration) (tokenOutput, error) { + op := &request.Operation{ + Name: "GetToken", + HTTPMethod: "PUT", + HTTPPath: "/api/token", + } + + var output tokenOutput + req := c.NewRequest(op, nil, &output) + + // remove the fetch token handler from the request handlers to avoid infinite recursion + req.Handlers.Sign.RemoveByName(fetchTokenHandlerName) + + // Swap the unmarshalMetadataHandler with unmarshalTokenHandler on this request. + req.Handlers.Unmarshal.Swap(unmarshalMetadataHandlerName, unmarshalTokenHandler) + + ttl := strconv.FormatInt(int64(duration/time.Second), 10) + req.HTTPRequest.Header.Set(ttlHeader, ttl) + + err := req.Send() + + // Errors with bad request status should be returned. + if err != nil { + err = awserr.NewRequestFailure( + awserr.New(req.HTTPResponse.Status, http.StatusText(req.HTTPResponse.StatusCode), err), + req.HTTPResponse.StatusCode, req.RequestID) + } + + return output, err +} + // GetMetadata uses the path provided to request information from the EC2 -// instance metdata service. The content will be returned as a string, or +// instance metadata service. The content will be returned as a string, or // error if the request failed. func (c *EC2Metadata) GetMetadata(p string) (string, error) { op := &request.Operation{ Name: "GetMetadata", HTTPMethod: "GET", - HTTPPath: path.Join("/", "meta-data", p), + HTTPPath: sdkuri.PathJoin("/meta-data", p), } - output := &metadataOutput{} + req := c.NewRequest(op, nil, output) - return output.Content, req.Send() + err := req.Send() + return output.Content, err } // GetUserData returns the userdata that was configured for the service. If @@ -35,18 +70,14 @@ func (c *EC2Metadata) GetUserData() (string, error) { op := &request.Operation{ Name: "GetUserData", HTTPMethod: "GET", - HTTPPath: path.Join("/", "user-data"), + HTTPPath: "/user-data", } output := &metadataOutput{} req := c.NewRequest(op, nil, output) - req.Handlers.UnmarshalError.PushBack(func(r *request.Request) { - if r.HTTPResponse.StatusCode == http.StatusNotFound { - r.Error = awserr.New("NotFoundError", "user-data not found", r.Error) - } - }) - return output.Content, req.Send() + err := req.Send() + return output.Content, err } // GetDynamicData uses the path provided to request information from the EC2 @@ -56,13 +87,14 @@ func (c *EC2Metadata) GetDynamicData(p string) (string, error) { op := &request.Operation{ Name: "GetDynamicData", HTTPMethod: "GET", - HTTPPath: path.Join("/", "dynamic", p), + HTTPPath: sdkuri.PathJoin("/dynamic", p), } output := &metadataOutput{} req := c.NewRequest(op, nil, output) - return output.Content, req.Send() + err := req.Send() + return output.Content, err } // GetInstanceIdentityDocument retrieves an identity document describing an @@ -79,7 +111,7 @@ func (c *EC2Metadata) GetInstanceIdentityDocument() (EC2InstanceIdentityDocument doc := EC2InstanceIdentityDocument{} if err := json.NewDecoder(strings.NewReader(resp)).Decode(&doc); err != nil { return EC2InstanceIdentityDocument{}, - awserr.New("SerializationError", + awserr.New(request.ErrCodeSerialization, "failed to decode EC2 instance identity document", err) } @@ -98,7 +130,7 @@ func (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) { info := EC2IAMInfo{} if err := json.NewDecoder(strings.NewReader(resp)).Decode(&info); err != nil { return EC2IAMInfo{}, - awserr.New("SerializationError", + awserr.New(request.ErrCodeSerialization, "failed to decode EC2 IAM info", err) } @@ -113,13 +145,17 @@ func (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) { // Region returns the region the instance is running in. func (c *EC2Metadata) Region() (string, error) { - resp, err := c.GetMetadata("placement/availability-zone") + ec2InstanceIdentityDocument, err := c.GetInstanceIdentityDocument() if err != nil { return "", err } - - // returns region without the suffix. Eg: us-west-2a becomes us-west-2 - return resp[:len(resp)-1], nil + // extract region from the ec2InstanceIdentityDocument + region := ec2InstanceIdentityDocument.Region + if len(region) == 0 { + return "", awserr.New("EC2MetadataError", "invalid region received for ec2metadata instance", nil) + } + // returns region + return region, nil } // Available returns if the application has access to the EC2 Metadata service. @@ -145,18 +181,19 @@ type EC2IAMInfo struct { // An EC2InstanceIdentityDocument provides the shape for unmarshaling // an instance identity document type EC2InstanceIdentityDocument struct { - DevpayProductCodes []string `json:"devpayProductCodes"` - AvailabilityZone string `json:"availabilityZone"` - PrivateIP string `json:"privateIp"` - Version string `json:"version"` - Region string `json:"region"` - InstanceID string `json:"instanceId"` - BillingProducts []string `json:"billingProducts"` - InstanceType string `json:"instanceType"` - AccountID string `json:"accountId"` - PendingTime time.Time `json:"pendingTime"` - ImageID string `json:"imageId"` - KernelID string `json:"kernelId"` - RamdiskID string `json:"ramdiskId"` - Architecture string `json:"architecture"` + DevpayProductCodes []string `json:"devpayProductCodes"` + MarketplaceProductCodes []string `json:"marketplaceProductCodes"` + AvailabilityZone string `json:"availabilityZone"` + PrivateIP string `json:"privateIp"` + Version string `json:"version"` + Region string `json:"region"` + InstanceID string `json:"instanceId"` + BillingProducts []string `json:"billingProducts"` + InstanceType string `json:"instanceType"` + AccountID string `json:"accountId"` + PendingTime time.Time `json:"pendingTime"` + ImageID string `json:"imageId"` + KernelID string `json:"kernelId"` + RamdiskID string `json:"ramdiskId"` + Architecture string `json:"architecture"` } 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 35e7578..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api_test.go +++ /dev/null @@ -1,242 +0,0 @@ -package ec2metadata_test - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "path" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - - "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, - "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" -}` - -func initTestServer(path string, resp string) *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.RequestURI != path { - http.Error(w, "not found", http.StatusNotFound) - return - } - - w.Write([]byte(resp)) - })) -} - -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) - assert.Equal(t, "http://169.254.169.254/latest", req.ClientInfo.Endpoint) - assert.Equal(t, "http://169.254.169.254/latest/meta-data/testpath", req.HTTPRequest.URL.String()) -} - -func TestGetMetadata(t *testing.T) { - server := initTestServer( - "/latest/meta-data/some/path", - "success", // real response includes suffix - ) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - resp, err := c.GetMetadata("some/path") - - assert.NoError(t, err) - assert.Equal(t, "success", resp) -} - -func TestGetUserData(t *testing.T) { - server := initTestServer( - "/latest/user-data", - "success", // real response includes suffix - ) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - resp, err := c.GetUserData() - - assert.NoError(t, err) - assert.Equal(t, "success", resp) -} - -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() - assert.Error(t, err) - assert.Empty(t, resp) - - aerr, ok := err.(awserr.Error) - assert.True(t, ok) - assert.Equal(t, "NotFoundError", aerr.Code()) -} - -func TestGetRegion(t *testing.T) { - server := initTestServer( - "/latest/meta-data/placement/availability-zone", - "us-west-2a", // real response includes suffix - ) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - region, err := c.Region() - - assert.NoError(t, err) - assert.Equal(t, "us-west-2", region) -} - -func TestMetadataAvailable(t *testing.T) { - server := initTestServer( - "/latest/meta-data/instance-id", - "instance-id", - ) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - available := c.Available() - - assert.True(t, available) -} - -func TestMetadataIAMInfo_success(t *testing.T) { - server := initTestServer( - "/latest/meta-data/iam/info", - validIamInfo, - ) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - iamInfo, err := c.IAMInfo() - assert.NoError(t, err) - assert.Equal(t, "Success", iamInfo.Code) - assert.Equal(t, "arn:aws:iam::123456789012:instance-profile/my-instance-profile", iamInfo.InstanceProfileArn) - assert.Equal(t, "AIPAABCDEFGHIJKLMN123", iamInfo.InstanceProfileID) -} - -func TestMetadataIAMInfo_failure(t *testing.T) { - server := initTestServer( - "/latest/meta-data/iam/info", - unsuccessfulIamInfo, - ) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - iamInfo, err := c.IAMInfo() - assert.NotNil(t, err) - assert.Equal(t, "", iamInfo.Code) - assert.Equal(t, "", iamInfo.InstanceProfileArn) - assert.Equal(t, "", iamInfo.InstanceProfileID) -} - -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 - }) - - available := c.Available() - - assert.False(t, 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") - assert.Empty(t, data) - assert.Contains(t, err.Error(), "error message text") -} - -func TestEC2RoleProviderInstanceIdentity(t *testing.T) { - server := initTestServer( - "/latest/dynamic/instance-identity/document", - instanceIdentityDocument, - ) - defer server.Close() - c := ec2metadata.New(unit.Session, &aws.Config{Endpoint: aws.String(server.URL + "/latest")}) - - doc, err := c.GetInstanceIdentityDocument() - assert.Nil(t, err, "Expect no error, %v", err) - assert.Equal(t, doc.AccountID, "123456789012") - assert.Equal(t, doc.AvailabilityZone, "us-east-1d") - assert.Equal(t, doc.Region, "us-east-1") -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go index 5b4379d..8eccac0 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -1,5 +1,10 @@ // Package ec2metadata provides the client for making API calls to the // EC2 Metadata service. +// +// This package's client can be disabled completely by setting the environment +// variable "AWS_EC2_METADATA_DISABLED=true". This environment variable set to +// true instructs the SDK to disable the EC2 Metadata client. The client cannot +// be used while the environment variable is set to true, (case insensitive). package ec2metadata import ( @@ -7,17 +12,38 @@ import ( "errors" "io" "net/http" + "os" + "strconv" + "strings" "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" ) -// ServiceName is the name of the service. -const ServiceName = "ec2metadata" +const ( + // ServiceName is the name of the service. + ServiceName = "ec2metadata" + disableServiceEnvVar = "AWS_EC2_METADATA_DISABLED" + + // Headers for Token and TTL + ttlHeader = "x-aws-ec2-metadata-token-ttl-seconds" + tokenHeader = "x-aws-ec2-metadata-token" + + // Named Handler constants + fetchTokenHandlerName = "FetchTokenHandler" + unmarshalMetadataHandlerName = "unmarshalMetadataHandler" + unmarshalTokenHandlerName = "unmarshalTokenHandler" + enableTokenProviderHandlerName = "enableTokenProviderHandler" + + // TTL constants + defaultTTL = 21600 * time.Second + ttlExpirationWindow = 30 * time.Second +) // A EC2Metadata is an EC2 Metadata service Client. type EC2Metadata struct { @@ -63,6 +89,7 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio cfg, metadata.ClientInfo{ ServiceName: ServiceName, + ServiceID: ServiceName, Endpoint: endpoint, APIVersion: "latest", }, @@ -70,16 +97,47 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ), } - svc.Handlers.Unmarshal.PushBack(unmarshalHandler) + // token provider instance + tp := newTokenProvider(svc, defaultTTL) + + // NamedHandler for fetching token + svc.Handlers.Sign.PushBackNamed(request.NamedHandler{ + Name: fetchTokenHandlerName, + Fn: tp.fetchTokenHandler, + }) + // NamedHandler for enabling token provider + svc.Handlers.Complete.PushBackNamed(request.NamedHandler{ + Name: enableTokenProviderHandlerName, + Fn: tp.enableTokenProviderHandler, + }) + + svc.Handlers.Unmarshal.PushBackNamed(unmarshalHandler) svc.Handlers.UnmarshalError.PushBack(unmarshalError) svc.Handlers.Validate.Clear() svc.Handlers.Validate.PushBack(validateEndpointHandler) + // Disable the EC2 Metadata service if the environment variable is set. + // This short-circuits the service's functionality to always fail to send + // requests. + if strings.ToLower(os.Getenv(disableServiceEnvVar)) == "true" { + svc.Handlers.Send.SwapNamed(request.NamedHandler{ + Name: corehandlers.SendHandler.Name, + Fn: func(r *request.Request) { + r.HTTPResponse = &http.Response{ + Header: http.Header{}, + } + r.Error = awserr.New( + request.CanceledErrorCode, + "EC2 IMDS access disabled via "+disableServiceEnvVar+" env var", + nil) + }, + }) + } + // Add additional options to the service config for _, option := range opts { option(svc.Client) } - return svc } @@ -91,30 +149,74 @@ type metadataOutput struct { Content string } -func unmarshalHandler(r *request.Request) { - defer r.HTTPResponse.Body.Close() - b := &bytes.Buffer{} - if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata respose", err) - return - } +type tokenOutput struct { + Token string + TTL time.Duration +} - if data, ok := r.Data.(*metadataOutput); ok { - data.Content = b.String() - } +// unmarshal token handler is used to parse the response of a getToken operation +var unmarshalTokenHandler = request.NamedHandler{ + Name: unmarshalTokenHandlerName, + Fn: func(r *request.Request) { + defer r.HTTPResponse.Body.Close() + var b bytes.Buffer + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, + "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + + v := r.HTTPResponse.Header.Get(ttlHeader) + data, ok := r.Data.(*tokenOutput) + if !ok { + return + } + + data.Token = b.String() + // TTL is in seconds + i, err := strconv.ParseInt(v, 10, 64) + if err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ParamFormatErrCode, + "unable to parse EC2 token TTL response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + t := time.Duration(i) * time.Second + data.TTL = t + }, +} + +var unmarshalHandler = request.NamedHandler{ + Name: unmarshalMetadataHandlerName, + Fn: func(r *request.Request) { + defer r.HTTPResponse.Body.Close() + var b bytes.Buffer + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, + "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + + if data, ok := r.Data.(*metadataOutput); ok { + data.Content = b.String() + } + }, } func unmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() - b := &bytes.Buffer{} - if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata error respose", err) + var b bytes.Buffer + + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error response", err), + r.HTTPResponse.StatusCode, r.RequestID) return } // Response body format is not consistent between metadata endpoints. // Grab the error message as a string and include that as the source error - r.Error = awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())) + r.Error = awserr.NewRequestFailure(awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())), + r.HTTPResponse.StatusCode, r.RequestID) } func validateEndpointHandler(r *request.Request) { 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 c2bc215..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package ec2metadata_test - -import ( - "net/http" - "net/http/httptest" - "sync" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/stretchr/testify/assert" -) - -func TestClientOverrideDefaultHTTPClientTimeout(t *testing.T) { - svc := ec2metadata.New(unit.Session) - - assert.NotEqual(t, http.DefaultClient, svc.Config.HTTPClient) - assert.Equal(t, 5*time.Second, svc.Config.HTTPClient.Timeout) -} - -func TestClientNotOverrideDefaultHTTPClientTimeout(t *testing.T) { - http.DefaultClient.Transport = &http.Transport{} - defer func() { - http.DefaultClient.Transport = nil - }() - - svc := ec2metadata.New(unit.Session) - - assert.Equal(t, http.DefaultClient, svc.Config.HTTPClient) - - tr, ok := svc.Config.HTTPClient.Transport.(*http.Transport) - assert.True(t, ok) - assert.NotNil(t, tr) - assert.Nil(t, tr.Dial) -} - -func TestClientDisableOverrideDefaultHTTPClientTimeout(t *testing.T) { - svc := ec2metadata.New(unit.Session, aws.NewConfig().WithEC2MetadataDisableTimeoutOverride(true)) - - assert.Equal(t, http.DefaultClient, svc.Config.HTTPClient) -} - -func TestClientOverrideDefaultHTTPClientTimeoutRace(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("us-east-1a")) - })) - - cfg := aws.NewConfig().WithEndpoint(server.URL) - runEC2MetadataClients(t, cfg, 100) -} - -func TestClientOverrideDefaultHTTPClientTimeoutRaceWithTransport(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("us-east-1a")) - })) - - cfg := aws.NewConfig().WithEndpoint(server.URL).WithHTTPClient(&http.Client{ - Transport: http.DefaultTransport, - }) - - runEC2MetadataClients(t, cfg, 100) -} - -func runEC2MetadataClients(t *testing.T, cfg *aws.Config, atOnce int) { - var wg sync.WaitGroup - wg.Add(atOnce) - for i := 0; i < atOnce; i++ { - go func() { - svc := ec2metadata.New(unit.Session, cfg) - _, err := svc.Region() - assert.NoError(t, err) - wg.Done() - }() - } - wg.Wait() -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go new file mode 100644 index 0000000..06f7605 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go @@ -0,0 +1,92 @@ +package ec2metadata + +import ( + "net/http" + "sync/atomic" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" +) + +// A tokenProvider struct provides access to EC2Metadata client +// and atomic instance of a token, along with configuredTTL for it. +// tokenProvider also provides an atomic flag to disable the +// fetch token operation. +// The disabled member will use 0 as false, and 1 as true. +type tokenProvider struct { + client *EC2Metadata + token atomic.Value + configuredTTL time.Duration + disabled uint32 +} + +// A ec2Token struct helps use of token in EC2 Metadata service ops +type ec2Token struct { + token string + credentials.Expiry +} + +// newTokenProvider provides a pointer to a tokenProvider instance +func newTokenProvider(c *EC2Metadata, duration time.Duration) *tokenProvider { + return &tokenProvider{client: c, configuredTTL: duration} +} + +// fetchTokenHandler fetches token for EC2Metadata service client by default. +func (t *tokenProvider) fetchTokenHandler(r *request.Request) { + + // short-circuits to insecure data flow if tokenProvider is disabled. + if v := atomic.LoadUint32(&t.disabled); v == 1 { + return + } + + if ec2Token, ok := t.token.Load().(ec2Token); ok && !ec2Token.IsExpired() { + r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) + return + } + + output, err := t.client.getToken(t.configuredTTL) + + if err != nil { + + // change the disabled flag on token provider to true, + // when error is request timeout error. + if requestFailureError, ok := err.(awserr.RequestFailure); ok { + switch requestFailureError.StatusCode() { + case http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed: + atomic.StoreUint32(&t.disabled, 1) + case http.StatusBadRequest: + r.Error = requestFailureError + } + + // Check if request timed out while waiting for response + if e, ok := requestFailureError.OrigErr().(awserr.Error); ok { + if e.Code() == "RequestError" { + atomic.StoreUint32(&t.disabled, 1) + } + } + } + return + } + + newToken := ec2Token{ + token: output.Token, + } + newToken.SetExpiration(time.Now().Add(output.TTL), ttlExpirationWindow) + t.token.Store(newToken) + + // Inject token header to the request. + if ec2Token, ok := t.token.Load().(ec2Token); ok { + r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) + } +} + +// enableTokenProviderHandler enables the token provider +func (t *tokenProvider) enableTokenProviderHandler(r *request.Request) { + // If the error code status is 401, we enable the token provider + if e, ok := r.Error.(awserr.RequestFailure); ok && e != nil && + e.StatusCode() == http.StatusUnauthorized { + atomic.StoreUint32(&t.disabled, 0) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go index 74f72de..343a210 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go @@ -83,7 +83,10 @@ func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resol p := &ps[i] custAddEC2Metadata(p) custAddS3DualStack(p) + custRegionalS3(p) custRmIotDataService(p) + custFixAppAutoscalingChina(p) + custFixAppAutoscalingUsGov(p) } return ps, nil @@ -94,7 +97,39 @@ func custAddS3DualStack(p *partition) { return } - s, ok := p.Services["s3"] + custAddDualstack(p, "s3") + custAddDualstack(p, "s3-control") +} + +func custRegionalS3(p *partition) { + if p.ID != "aws" { + return + } + + service, ok := p.Services["s3"] + if !ok { + return + } + + // If global endpoint already exists no customization needed. + if _, ok := service.Endpoints["aws-global"]; ok { + return + } + + service.PartitionEndpoint = "aws-global" + service.Endpoints["us-east-1"] = endpoint{} + service.Endpoints["aws-global"] = endpoint{ + Hostname: "s3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + } + + p.Services["s3"] = service +} + +func custAddDualstack(p *partition, svcName string) { + s, ok := p.Services[svcName] if !ok { return } @@ -102,7 +137,7 @@ func custAddS3DualStack(p *partition) { s.Defaults.HasDualStack = boxedTrue s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}" - p.Services["s3"] = s + p.Services[svcName] = s } func custAddEC2Metadata(p *partition) { @@ -122,6 +157,54 @@ func custRmIotDataService(p *partition) { delete(p.Services, "data.iot") } +func custFixAppAutoscalingChina(p *partition) { + if p.ID != "aws-cn" { + return + } + + const serviceName = "application-autoscaling" + s, ok := p.Services[serviceName] + if !ok { + return + } + + const expectHostname = `autoscaling.{region}.amazonaws.com` + if e, a := s.Defaults.Hostname, expectHostname; e != a { + fmt.Printf("custFixAppAutoscalingChina: ignoring customization, expected %s, got %s\n", e, a) + return + } + + s.Defaults.Hostname = expectHostname + ".cn" + p.Services[serviceName] = s +} + +func custFixAppAutoscalingUsGov(p *partition) { + if p.ID != "aws-us-gov" { + return + } + + const serviceName = "application-autoscaling" + s, ok := p.Services[serviceName] + if !ok { + return + } + + if a := s.Defaults.CredentialScope.Service; a != "" { + fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty credential scope service, got %s\n", a) + return + } + + if a := s.Defaults.Hostname; a != "" { + fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty hostname, got %s\n", a) + return + } + + s.Defaults.CredentialScope.Service = "application-autoscaling" + s.Defaults.Hostname = "autoscaling.{region}.amazonaws.com" + + p.Services[serviceName] = s +} + type decodeModelError struct { awsError } 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 3193907..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode_test.go +++ /dev/null @@ -1,117 +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) - } -} 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 4adca3a..887de68 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 @@ -11,10 +11,13 @@ const ( AwsPartitionID = "aws" // AWS Standard partition. AwsCnPartitionID = "aws-cn" // AWS China partition. AwsUsGovPartitionID = "aws-us-gov" // AWS GovCloud (US) partition. + AwsIsoPartitionID = "aws-iso" // AWS ISO (US) partition. + AwsIsoBPartitionID = "aws-iso-b" // AWS ISOB (US) partition. ) // AWS Standard partition's regions. const ( + ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong). ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo). ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul). ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai). @@ -22,8 +25,11 @@ const ( ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney). CaCentral1RegionID = "ca-central-1" // Canada (Central). EuCentral1RegionID = "eu-central-1" // EU (Frankfurt). + EuNorth1RegionID = "eu-north-1" // EU (Stockholm). EuWest1RegionID = "eu-west-1" // EU (Ireland). EuWest2RegionID = "eu-west-2" // EU (London). + EuWest3RegionID = "eu-west-3" // EU (Paris). + MeSouth1RegionID = "me-south-1" // Middle East (Bahrain). SaEast1RegionID = "sa-east-1" // South America (Sao Paulo). UsEast1RegionID = "us-east-1" // US East (N. Virginia). UsEast2RegionID = "us-east-2" // US East (Ohio). @@ -33,132 +39,51 @@ const ( // AWS China partition's regions. const ( - CnNorth1RegionID = "cn-north-1" // China (Beijing). + CnNorth1RegionID = "cn-north-1" // China (Beijing). + CnNorthwest1RegionID = "cn-northwest-1" // China (Ningxia). ) // AWS GovCloud (US) partition's regions. const ( + UsGovEast1RegionID = "us-gov-east-1" // AWS GovCloud (US-East). UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US). ) -// Service identifiers +// AWS ISO (US) partition's regions. const ( - AcmServiceID = "acm" // Acm. - ApigatewayServiceID = "apigateway" // Apigateway. - ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling. - Appstream2ServiceID = "appstream2" // Appstream2. - AutoscalingServiceID = "autoscaling" // Autoscaling. - BatchServiceID = "batch" // Batch. - BudgetsServiceID = "budgets" // Budgets. - ClouddirectoryServiceID = "clouddirectory" // Clouddirectory. - CloudformationServiceID = "cloudformation" // Cloudformation. - CloudfrontServiceID = "cloudfront" // Cloudfront. - CloudhsmServiceID = "cloudhsm" // Cloudhsm. - CloudsearchServiceID = "cloudsearch" // Cloudsearch. - CloudtrailServiceID = "cloudtrail" // Cloudtrail. - CodebuildServiceID = "codebuild" // Codebuild. - CodecommitServiceID = "codecommit" // Codecommit. - CodedeployServiceID = "codedeploy" // Codedeploy. - CodepipelineServiceID = "codepipeline" // Codepipeline. - CognitoIdentityServiceID = "cognito-identity" // CognitoIdentity. - CognitoIdpServiceID = "cognito-idp" // CognitoIdp. - CognitoSyncServiceID = "cognito-sync" // CognitoSync. - ConfigServiceID = "config" // Config. - CurServiceID = "cur" // Cur. - DatapipelineServiceID = "datapipeline" // Datapipeline. - DevicefarmServiceID = "devicefarm" // Devicefarm. - DirectconnectServiceID = "directconnect" // Directconnect. - DiscoveryServiceID = "discovery" // Discovery. - DmsServiceID = "dms" // Dms. - DsServiceID = "ds" // Ds. - DynamodbServiceID = "dynamodb" // Dynamodb. - Ec2ServiceID = "ec2" // Ec2. - Ec2metadataServiceID = "ec2metadata" // Ec2metadata. - EcrServiceID = "ecr" // Ecr. - EcsServiceID = "ecs" // Ecs. - ElasticacheServiceID = "elasticache" // Elasticache. - ElasticbeanstalkServiceID = "elasticbeanstalk" // Elasticbeanstalk. - ElasticfilesystemServiceID = "elasticfilesystem" // Elasticfilesystem. - ElasticloadbalancingServiceID = "elasticloadbalancing" // Elasticloadbalancing. - ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce. - ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder. - EmailServiceID = "email" // Email. - EsServiceID = "es" // Es. - EventsServiceID = "events" // Events. - FirehoseServiceID = "firehose" // Firehose. - GameliftServiceID = "gamelift" // Gamelift. - GlacierServiceID = "glacier" // Glacier. - HealthServiceID = "health" // Health. - IamServiceID = "iam" // Iam. - ImportexportServiceID = "importexport" // Importexport. - InspectorServiceID = "inspector" // Inspector. - IotServiceID = "iot" // Iot. - KinesisServiceID = "kinesis" // Kinesis. - KinesisanalyticsServiceID = "kinesisanalytics" // Kinesisanalytics. - KmsServiceID = "kms" // Kms. - LambdaServiceID = "lambda" // Lambda. - LightsailServiceID = "lightsail" // Lightsail. - LogsServiceID = "logs" // Logs. - MachinelearningServiceID = "machinelearning" // Machinelearning. - MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics. - MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace. - MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics. - MonitoringServiceID = "monitoring" // Monitoring. - MturkRequesterServiceID = "mturk-requester" // MturkRequester. - OpsworksServiceID = "opsworks" // Opsworks. - OpsworksCmServiceID = "opsworks-cm" // OpsworksCm. - OrganizationsServiceID = "organizations" // Organizations. - PinpointServiceID = "pinpoint" // Pinpoint. - PollyServiceID = "polly" // Polly. - RdsServiceID = "rds" // Rds. - RedshiftServiceID = "redshift" // Redshift. - RekognitionServiceID = "rekognition" // Rekognition. - Route53ServiceID = "route53" // Route53. - Route53domainsServiceID = "route53domains" // Route53domains. - RuntimeLexServiceID = "runtime.lex" // RuntimeLex. - S3ServiceID = "s3" // S3. - SdbServiceID = "sdb" // Sdb. - ServicecatalogServiceID = "servicecatalog" // Servicecatalog. - ShieldServiceID = "shield" // Shield. - SmsServiceID = "sms" // Sms. - SnowballServiceID = "snowball" // Snowball. - SnsServiceID = "sns" // Sns. - SqsServiceID = "sqs" // Sqs. - SsmServiceID = "ssm" // Ssm. - StatesServiceID = "states" // States. - StoragegatewayServiceID = "storagegateway" // Storagegateway. - StreamsDynamodbServiceID = "streams.dynamodb" // StreamsDynamodb. - StsServiceID = "sts" // Sts. - SupportServiceID = "support" // Support. - SwfServiceID = "swf" // Swf. - TaggingServiceID = "tagging" // Tagging. - WafServiceID = "waf" // Waf. - WafRegionalServiceID = "waf-regional" // WafRegional. - WorkdocsServiceID = "workdocs" // Workdocs. - WorkspacesServiceID = "workspaces" // Workspaces. - XrayServiceID = "xray" // Xray. + UsIsoEast1RegionID = "us-iso-east-1" // US ISO East. +) + +// AWS ISOB (US) partition's regions. +const ( + UsIsobEast1RegionID = "us-isob-east-1" // US ISOB East (Ohio). ) // DefaultResolver returns an Endpoint resolver that will be able -// to resolve endpoints for: AWS Standard, AWS China, and AWS GovCloud (US). +// to resolve endpoints for: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // -// Casting the return value of this func to a EnumPartitions will -// allow you to get a list of the partitions in the order the endpoints -// will be resolved in. +// Use DefaultPartitions() to get the list of the default partitions. +func DefaultResolver() Resolver { + return defaultPartitions +} + +// DefaultPartitions returns a list of the partitions the SDK is bundled +// with. The available partitions are: AWS Standard, AWS China, AWS GovCloud (US), AWS ISO (US), and AWS ISOB (US). // -// resolver := endpoints.DefaultResolver() -// partitions := resolver.(endpoints.EnumPartitions).Partitions() +// partitions := endpoints.DefaultPartitions // for _, p := range partitions { // // ... inspect partitions // } -func DefaultResolver() Resolver { - return defaultPartitions +func DefaultPartitions() []Partition { + return defaultPartitions.Partitions() } var defaultPartitions = partitions{ awsPartition, awscnPartition, awsusgovPartition, + awsisoPartition, + awsisobPartition, } // AwsPartition returns the Resolver for AWS Standard. @@ -172,7 +97,7 @@ var awsPartition = partition{ DNSSuffix: "amazonaws.com", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$") + reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$") return reg }(), }, @@ -182,6 +107,9 @@ var awsPartition = partition{ SignatureVersions: []string{"v4"}, }, Regions: regions{ + "ap-east-1": region{ + Description: "Asia Pacific (Hong Kong)", + }, "ap-northeast-1": region{ Description: "Asia Pacific (Tokyo)", }, @@ -203,12 +131,21 @@ var awsPartition = partition{ "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)", }, @@ -226,9 +163,16 @@ var awsPartition = partition{ }, }, Services: services{ + "a4b": service{ + + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, "acm": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -236,8 +180,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -245,67 +192,201 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "apigateway": service{ - + "acm-pca": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, 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-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "eu-west-3": 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{}, }, }, - "application-autoscaling": service{ - Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", + "api.ecr": service{ + + Endpoints: endpoints{ + "ap-east-1": endpoint{ + Hostname: "api.ecr.ap-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-east-1", + }, + }, + "ap-northeast-1": endpoint{ + Hostname: "api.ecr.ap-northeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-1", + }, + }, + "ap-northeast-2": endpoint{ + Hostname: "api.ecr.ap-northeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-2", + }, + }, + "ap-south-1": endpoint{ + Hostname: "api.ecr.ap-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-south-1", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "api.ecr.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "api.ecr.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "api.ecr.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "api.ecr.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-north-1": endpoint{ + Hostname: "api.ecr.eu-north-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-north-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "api.ecr.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "api.ecr.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "eu-west-3": endpoint{ + Hostname: "api.ecr.eu-west-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-3", + }, + }, + "me-south-1": endpoint{ + Hostname: "api.ecr.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, + "sa-east-1": endpoint{ + Hostname: "api.ecr.sa-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "sa-east-1", + }, + }, + "us-east-1": endpoint{ + Hostname: "api.ecr.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "api.ecr.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{ + Hostname: "api.ecr.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{ + Hostname: "api.ecr.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, }, }, + }, + "api.mediatailor": service{ + 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-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "appstream2": service{ + "api.pricing": service{ Defaults: endpoint{ - Protocols: []string{"https"}, CredentialScope: credentialScope{ - Service: "appstream", + Service: "pricing", }, }, Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-south-1": endpoint{}, + "us-east-1": endpoint{}, }, }, - "autoscaling": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + "api.sagemaker": service{ + Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -313,48 +394,71 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "batch": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "budgets": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "budgets.amazonaws.com", + "us-east-1-fips": endpoint{ + Hostname: "api-fips.sagemaker.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "api-fips.sagemaker.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "api-fips.sagemaker.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "api-fips.sagemaker.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, - "clouddirectory": service{ + "apigateway": 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-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{}, }, }, - "cloudformation": service{ - + "application-autoscaling": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -362,8 +466,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -371,37 +478,32 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "cloudfront": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "cloudfront.amazonaws.com", - Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "cloudhsm": service{ + "appmesh": service{ 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-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "cloudsearch": service{ - + "appstream2": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + CredentialScope: credentialScope{ + Service: "appstream", + }, + }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -409,13 +511,17 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips": endpoint{ + Hostname: "appstream2-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "cloudtrail": service{ + "appsync": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -423,42 +529,43 @@ var awsPartition = partition{ "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{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, - "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "codebuild": service{ + "athena": 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-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{}, }, }, - "codecommit": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "autoscaling": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, }, - }, - "codedeploy": service{ - Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -466,8 +573,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -475,54 +585,133 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "codepipeline": service{ - + "autoscaling-plans": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, 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-west-1": endpoint{}, - "sa-east-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "cognito-identity": service{ + "backup": 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-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{}, }, }, - "cognito-idp": service{ + "batch": 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-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{}, }, }, - "cognito-sync": service{ + "budgets": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "budgets.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "ce": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "ce.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "chime": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + Defaults: endpoint{ + SSLCommonName: "service.chime.aws.amazon.com", + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "service.chime.aws.amazon.com", + Protocols: []string{"https"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "cloud9": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "clouddirectory": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, @@ -531,9 +720,10 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "config": service{ + "cloudformation": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -541,8 +731,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -550,31 +743,43 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "cur": service{ + "cloudfront": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, Endpoints: endpoints{ - "us-east-1": endpoint{}, + "aws-global": endpoint{ + Hostname: "cloudfront.amazonaws.com", + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, }, }, - "datapipeline": service{ + "cloudhsm": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": 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{}, }, }, - "devicefarm": service{ - - Endpoints: endpoints{ - "us-west-2": endpoint{}, + "cloudhsmv2": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "cloudhsm", + }, }, - }, - "directconnect": service{ - Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -582,8 +787,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -591,48 +799,48 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "discovery": service{ - - Endpoints: endpoints{ - "us-west-2": endpoint{}, - }, - }, - "dms": service{ + "cloudsearch": service{ 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-west-1": endpoint{}, - "eu-west-2": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "ds": service{ + "cloudtrail": 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-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{}, }, }, - "dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + "codebuild": service{ + Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -640,27 +848,46 @@ 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{}, - "local": endpoint{ - Hostname: "localhost:8000", - Protocols: []string{"http"}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "codebuild-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "codebuild-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "codebuild-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "codebuild-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, - "ec2": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + "codecommit": service{ + Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -668,78 +895,110 @@ 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{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "ec2metadata": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "169.254.169.254/latest", - Protocols: []string{"http"}, + "eu-west-3": endpoint{}, + "fips": endpoint{ + Hostname: "codecommit-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "ecr": service{ + "codedeploy": 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-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{}, + "us-east-1-fips": endpoint{ + Hostname: "codedeploy-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "codedeploy-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "codedeploy-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "codedeploy-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, - "ecs": service{ + "codepipeline": service{ 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{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "elasticache": service{ + "codestar": service{ 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-west-1": endpoint{}, "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "elasticbeanstalk": service{ + "cognito-identity": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -751,101 +1010,88 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, - "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "elasticfilesystem": service{ + "cognito-idp": service{ 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-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, - "elasticloadbalancing": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + "cognito-sync": service{ + 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-west-1": endpoint{}, "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, - "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "elasticmapreduce": service{ + "comprehend": service{ Defaults: endpoint{ - SSLCommonName: "{region}.{service}.{dnsSuffix}", - Protocols: []string{"http", "https"}, + Protocols: []string{"https"}, }, 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{ - SSLCommonName: "{service}.{region}.{dnsSuffix}", - }, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - SSLCommonName: "{service}.{region}.{dnsSuffix}", - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, - "elastictranscoder": service{ + "comprehendmedical": service{ Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, - "us-west-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, - "email": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "es": service{ + "config": 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-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{}, @@ -853,57 +1099,42 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "events": service{ + "connect": service{ 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-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "firehose": service{ + "cur": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, "us-east-1": endpoint{}, - "us-west-2": endpoint{}, }, }, - "gamelift": service{ + "data.mediastore": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, - "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "glacier": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + "dataexchange": service{ + 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-west-1": endpoint{}, "eu-west-2": endpoint{}, @@ -913,83 +1144,74 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "health": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "iam": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "iam.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "importexport": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "importexport.amazonaws.com", - SignatureVersions: []string{"v2", "v4"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - Service: "IngestionService", - }, - }, - }, - }, - "inspector": service{ + "datapipeline": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, - "ap-south-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "iot": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "execute-api", - }, - }, + "datasync": 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-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "datasync-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "datasync-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "datasync-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "datasync-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{}, }, }, - "kinesis": service{ + "dax": service{ 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-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -997,17 +1219,16 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "kinesisanalytics": service{ + "devicefarm": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "kms": service{ + "directconnect": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1015,8 +1236,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1024,32 +1248,123 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "lambda": service{ + "discovery": service{ + + Endpoints: endpoints{ + "eu-central-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "dms": 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-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{}, }, }, - "lightsail": service{ + "docdb": service{ Endpoints: endpoints{ - "us-east-1": endpoint{}, + "ap-northeast-1": endpoint{ + Hostname: "rds.ap-northeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-1", + }, + }, + "ap-northeast-2": endpoint{ + Hostname: "rds.ap-northeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-2", + }, + }, + "ap-south-1": endpoint{ + Hostname: "rds.ap-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-south-1", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "rds.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "rds.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + 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{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "rds.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "rds.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "eu-west-3": endpoint{ + Hostname: "rds.eu-west-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-3", + }, + }, + "us-east-1": endpoint{ + Hostname: "rds.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "rds.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "rds.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, - "logs": service{ + "ds": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1057,6 +1372,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{}, "sa-east-1": endpoint{}, @@ -1066,26 +1382,74 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "machinelearning": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, + "dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, }, - }, - "marketplacecommerceanalytics": service{ - Endpoints: endpoints{ - "us-east-1": endpoint{}, + "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{}, + "ca-central-1-fips": endpoint{ + Hostname: "dynamodb-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{}, + "local": endpoint{ + Hostname: "localhost:8000", + Protocols: []string{"http"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, - "metering.marketplace": service{ + "ec2": service{ Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "aws-marketplace", - }, + Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1093,8 +1457,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1102,17 +1469,21 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "mobileanalytics": service{ + "ec2metadata": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, Endpoints: endpoints{ - "us-east-1": endpoint{}, + "aws-global": endpoint{ + Hostname: "169.254.169.254/latest", + Protocols: []string{"http"}, + }, }, }, - "monitoring": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + "ecs": service{ + Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1120,8 +1491,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1129,27 +1503,51 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "mturk-requester": service{ - IsRegionalized: boxedFalse, + "elasticache": service{ Endpoints: endpoints{ - "sandbox": endpoint{ - Hostname: "mturk-requester-sandbox.us-east-1.amazonaws.com", + "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-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips": endpoint{ + Hostname: "elasticache-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, }, - "us-east-1": 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{}, }, }, - "opsworks": service{ + "elasticbeanstalk": 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-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{}, @@ -1157,49 +1555,10 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "opsworks-cm": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "organizations": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "organizations.us-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "pinpoint": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "mobiletargeting", - }, - }, - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "polly": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "rds": service{ + "elasticfilesystem": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1207,20 +1566,24 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - SSLCommonName: "{service}.{dnsSuffix}", - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "redshift": service{ - + "elasticloadbalancing": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1228,8 +1591,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1237,171 +1603,126 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "rekognition": service{ - - Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "route53": service{ - PartitionEndpoint: "aws-global", - IsRegionalized: boxedFalse, - - Endpoints: endpoints{ - "aws-global": endpoint{ - Hostname: "route53.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - "route53domains": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "runtime.lex": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "lex", - }, - }, - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "s3": service{ - PartitionEndpoint: "us-east-1", - IsRegionalized: boxedTrue, + "elasticmapreduce": service{ Defaults: endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"s3v4"}, - - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", + SSLCommonName: "{region}.{service}.{dnsSuffix}", + Protocols: []string{"https"}, }, Endpoints: endpoints{ - "ap-northeast-1": endpoint{ - Hostname: "s3-ap-northeast-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, "ap-northeast-2": 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"}, - }, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-west-1": endpoint{ - Hostname: "s3-eu-west-1.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, - }, - "eu-west-2": 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"}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{ + SSLCommonName: "{service}.{region}.{dnsSuffix}", }, + "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{ - Hostname: "s3.amazonaws.com", - SignatureVersions: []string{"s3", "s3v4"}, + SSLCommonName: "{service}.{region}.{dnsSuffix}", }, "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"}, - }, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "sdb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - SignatureVersions: []string{"v2"}, - }, + "elastictranscoder": service{ + Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-west-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - Hostname: "sdb.amazonaws.com", - }, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "servicecatalog": service{ + "email": service{ Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-1": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-2": endpoint{}, - "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, - "shield": service{ - IsRegionalized: boxedFalse, + "entitlement.marketplace": service{ Defaults: endpoint{ - SSLCommonName: "Shield.us-east-1.amazonaws.com", - Protocols: []string{"https"}, + CredentialScope: credentialScope{ + Service: "aws-marketplace", + }, }, Endpoints: endpoints{ "us-east-1": endpoint{}, }, }, - "sms": service{ + "es": 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-north-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips": endpoint{ + Hostname: "es-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "snowball": service{ + "events": 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-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{}, }, }, - "sns": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + "firehose": service{ + Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1409,8 +1730,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1418,10 +1742,9 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "sqs": service{ + "fms": service{ Defaults: endpoint{ - SSLCommonName: "{region}.queue.{dnsSuffix}", - Protocols: []string{"http", "https"}, + Protocols: []string{"https"}, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -1431,69 +1754,57 @@ 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{}, "sa-east-1": endpoint{}, - "us-east-1": endpoint{ - SSLCommonName: "queue.{dnsSuffix}", - }, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "ssm": service{ + "forecast": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, - "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "states": service{ + "forecastquery": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, - "eu-central-1": endpoint{}, + "ap-southeast-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, - "storagegateway": service{ + "fsx": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, - "ap-northeast-2": 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{}, - "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "streams.dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "http", "https", "https"}, - CredentialScope: credentialScope{ - Service: "dynamodb", - }, - }, + "gamelift": service{ + Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, @@ -1504,44 +1815,31 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, - "local": endpoint{ - Hostname: "localhost:8000", - Protocols: []string{"http"}, - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "sts": service{ - PartitionEndpoint: "aws-global", + "glacier": service{ Defaults: endpoint{ - Hostname: "sts.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, + Protocols: []string{"http", "https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{ - Hostname: "sts.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, + "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, - "aws-global": 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{}, @@ -1549,15 +1847,10 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "support": service{ - - Endpoints: endpoints{ - "us-east-1": endpoint{}, - }, - }, - "swf": service{ + "glue": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1565,8 +1858,11 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1574,9 +1870,39 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - "tagging": service{ + "greengrass": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "groundstation": service{ Endpoints: endpoints{ + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "guardduty": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1584,61 +1910,212 @@ 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{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "guardduty-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "guardduty-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "guardduty-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "guardduty-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, - "waf": service{ + "health": service{ + + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, + "iam": service{ PartitionEndpoint: "aws-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ "aws-global": endpoint{ - Hostname: "waf.amazonaws.com", + Hostname: "iam.amazonaws.com", CredentialScope: credentialScope{ Region: "us-east-1", }, }, }, }, - "waf-regional": service{ + "importexport": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "importexport.amazonaws.com", + SignatureVersions: []string{"v2", "v4"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + Service: "IngestionService", + }, + }, + }, + }, + "inspector": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-2": 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-1": endpoint{}, "us-west-2": endpoint{}, }, }, - "workdocs": service{ - + "iot": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "execute-api", + }, + }, 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-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{}, }, }, - "workspaces": service{ + "iotanalytics": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "iotevents": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, - "xray": service{ + "ioteventsdata": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{ + Hostname: "data.iotevents.ap-northeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-1", + }, + }, + "ap-northeast-2": endpoint{ + Hostname: "data.iotevents.ap-northeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-2", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "data.iotevents.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "data.iotevents.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "eu-central-1": endpoint{ + Hostname: "data.iotevents.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "data.iotevents.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "data.iotevents.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "data.iotevents.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "data.iotevents.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "data.iotevents.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "iotsecuredtunneling": service{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -1646,8 +2123,12 @@ 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{}, @@ -1655,87 +2136,3580 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, - }, -} - -// AwsCnPartition returns the Resolver for AWS China. -func AwsCnPartition() Partition { - return awscnPartition.Partition() -} - -var awscnPartition = 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)", - }, - }, - Services: services{ - "autoscaling": service{ + "iotthingsgraph": service{ Defaults: endpoint{ - Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "iotthingsgraph", + }, }, Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "cloudformation": service{ + "kafka": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "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-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-1": endpoint{}, + "us-west-2": endpoint{}, }, }, - "cloudtrail": service{ + "kinesis": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "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-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{}, + }, + }, + "kinesisanalytics": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kinesisvideo": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kms": 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-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{}, + }, + }, + "lakeformation": service{ + + 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-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "lambda": 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-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{}, + }, + }, + "license-manager": 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-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{}, + }, + }, + "lightsail": service{ + + 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-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "logs": 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-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{}, + }, + }, + "machinelearning": service{ + + Endpoints: endpoints{ + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + }, + }, + "marketplacecommerceanalytics": service{ + + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, + "mediaconnect": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": 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-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "mediaconvert": service{ + + 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-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-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "medialive": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": 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{}, + }, + }, + "mediapackage": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": 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-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "mediastore": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "metering.marketplace": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "aws-marketplace", + }, + }, + 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-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{}, + }, + }, + "mgh": service{ + + Endpoints: endpoints{ + "eu-central-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "mobileanalytics": service{ + + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, + "models.lex": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "lex", + }, + }, + Endpoints: endpoints{ + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "monitoring": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + 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-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{}, + }, + }, + "mq": service{ + + 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-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "mq-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "mq-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "mq-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "mq-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "mturk-requester": service{ + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "sandbox": endpoint{ + Hostname: "mturk-requester-sandbox.us-east-1.amazonaws.com", + }, + "us-east-1": endpoint{}, + }, + }, + "neptune": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{ + Hostname: "rds.ap-northeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-1", + }, + }, + "ap-northeast-2": endpoint{ + Hostname: "rds.ap-northeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-2", + }, + }, + "ap-south-1": endpoint{ + Hostname: "rds.ap-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-south-1", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "rds.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "rds.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + 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{ + Region: "eu-central-1", + }, + }, + "eu-north-1": endpoint{ + Hostname: "rds.eu-north-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-north-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "rds.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "rds.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "me-south-1": endpoint{ + Hostname: "rds.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, + "us-east-1": endpoint{ + Hostname: "rds.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "rds.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "rds.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "oidc": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{ + Hostname: "oidc.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "oidc.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "oidc.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "oidc.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "oidc.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "oidc.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "oidc.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "oidc.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "oidc.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "opsworks": service{ + + 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-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-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "opsworks-cm": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": 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{}, + }, + }, + "organizations": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "organizations.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "pinpoint": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "mobiletargeting", + }, + }, + Endpoints: endpoints{ + "ap-south-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "pinpoint-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "pinpoint-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "pinpoint.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-west-2": endpoint{ + Hostname: "pinpoint.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "polly": service{ + + 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{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "portal.sso": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{ + Hostname: "portal.sso.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "portal.sso.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "portal.sso.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "portal.sso.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "portal.sso.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "portal.sso.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "portal.sso.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "portal.sso.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "portal.sso.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "projects.iot1click": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "qldb": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "ram": service{ + + 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{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "rds": 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-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{ + SSLCommonName: "{service}.{dnsSuffix}", + }, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "redshift": 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-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{}, + }, + }, + "rekognition": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "resource-groups": 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-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "resource-groups-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "resource-groups-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "resource-groups-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "resource-groups-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{}, + }, + }, + "robomaker": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "route53": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "route53.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "route53domains": service{ + + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, + "route53resolver": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + 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-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "runtime.lex": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "lex", + }, + }, + Endpoints: endpoints{ + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "runtime.sagemaker": 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-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: "runtime-fips.sagemaker.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "runtime-fips.sagemaker.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "runtime-fips.sagemaker.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "runtime-fips.sagemaker.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "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-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{}, + "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"}, + }, + }, + }, + "s3-control": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + SignatureVersions: []string{"s3v4"}, + + HasDualStack: boxedTrue, + DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", + }, + Endpoints: endpoints{ + "ap-northeast-1": endpoint{ + Hostname: "s3-control.ap-northeast-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ap-northeast-1", + }, + }, + "ap-northeast-2": endpoint{ + Hostname: "s3-control.ap-northeast-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ap-northeast-2", + }, + }, + "ap-south-1": endpoint{ + Hostname: "s3-control.ap-south-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ap-south-1", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "s3-control.ap-southeast-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "s3-control.ap-southeast-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "s3-control.ca-central-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "s3-control.eu-central-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-north-1": endpoint{ + Hostname: "s3-control.eu-north-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "eu-north-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "s3-control.eu-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "s3-control.eu-west-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "eu-west-3": endpoint{ + Hostname: "s3-control.eu-west-3.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "eu-west-3", + }, + }, + "sa-east-1": endpoint{ + Hostname: "s3-control.sa-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "sa-east-1", + }, + }, + "us-east-1": endpoint{ + Hostname: "s3-control.us-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-1-fips": endpoint{ + Hostname: "s3-control-fips.us-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "s3-control.us-east-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-east-2-fips": endpoint{ + Hostname: "s3-control-fips.us-east-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{ + Hostname: "s3-control.us-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-1-fips": endpoint{ + Hostname: "s3-control-fips.us-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{ + Hostname: "s3-control.us-west-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-west-2-fips": endpoint{ + Hostname: "s3-control-fips.us-west-2.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "savingsplans": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "savingsplans.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "schemas": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "sdb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"v2"}, + }, + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{ + Hostname: "sdb.amazonaws.com", + }, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "secretsmanager": 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-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: "secretsmanager-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "secretsmanager-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "secretsmanager-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "secretsmanager-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "securityhub": 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-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{}, + }, + }, + "serverlessrepo": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "ap-east-1": endpoint{ + Protocols: []string{"https"}, + }, + "ap-northeast-1": endpoint{ + Protocols: []string{"https"}, + }, + "ap-northeast-2": endpoint{ + Protocols: []string{"https"}, + }, + "ap-south-1": endpoint{ + Protocols: []string{"https"}, + }, + "ap-southeast-1": endpoint{ + Protocols: []string{"https"}, + }, + "ap-southeast-2": endpoint{ + Protocols: []string{"https"}, + }, + "ca-central-1": endpoint{ + Protocols: []string{"https"}, + }, + "eu-central-1": endpoint{ + Protocols: []string{"https"}, + }, + "eu-north-1": endpoint{ + Protocols: []string{"https"}, + }, + "eu-west-1": endpoint{ + Protocols: []string{"https"}, + }, + "eu-west-2": endpoint{ + Protocols: []string{"https"}, + }, + "eu-west-3": endpoint{ + Protocols: []string{"https"}, + }, + "me-south-1": endpoint{ + Protocols: []string{"https"}, + }, + "sa-east-1": endpoint{ + Protocols: []string{"https"}, + }, + "us-east-1": endpoint{ + Protocols: []string{"https"}, + }, + "us-east-2": endpoint{ + Protocols: []string{"https"}, + }, + "us-west-1": endpoint{ + Protocols: []string{"https"}, + }, + "us-west-2": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "servicecatalog": service{ + + 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{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "servicecatalog-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "servicecatalog-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "servicecatalog-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "servicecatalog-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "servicediscovery": 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-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{}, + }, + }, + "session.qldb": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "shield": service{ + IsRegionalized: boxedFalse, + Defaults: endpoint{ + SSLCommonName: "shield.us-east-1.amazonaws.com", + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, + "sms": 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-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{}, + }, + }, + "snowball": service{ + + 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-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-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "sns": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + 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-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{}, + }, + }, + "sqs": service{ + Defaults: endpoint{ + SSLCommonName: "{region}.queue.{dnsSuffix}", + Protocols: []string{"http", "https"}, + }, + 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-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "sqs-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "sqs-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "sqs-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "sqs-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{ + SSLCommonName: "queue.{dnsSuffix}", + }, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "ssm": 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-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{}, + }, + }, + "states": 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-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{}, + }, + }, + "storagegateway": 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-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{}, + }, + }, + "streams.dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "dynamodb", + }, + }, + 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{}, + "ca-central-1-fips": endpoint{ + Hostname: "dynamodb-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{}, + "local": endpoint{ + Hostname: "localhost:8000", + Protocols: []string{"http"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "dynamodb-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "sts": service{ + PartitionEndpoint: "aws-global", + + 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", + }, + }, + }, + }, + "support": service{ + PartitionEndpoint: "aws-global", + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "support.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "swf": 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-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{}, + }, + }, + "tagging": 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-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{}, + }, + }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + 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{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "transcribestreaming": service{ + + Endpoints: endpoints{ + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "transfer": service{ + + 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{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "translate": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + 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-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "translate-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "translate-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "translate-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, + "waf": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "waf.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "waf-regional": service{ + + 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{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "workdocs": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "workmail": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "workspaces": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": 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{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "xray": 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-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{}, + }, + }, + }, +} + +// AwsCnPartition returns the Resolver for AWS China. +func AwsCnPartition() Partition { + return awscnPartition.Partition() +} + +var awscnPartition = 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{ + "api.ecr": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{ + Hostname: "api.ecr.cn-north-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + "cn-northwest-1": endpoint{ + Hostname: "api.ecr.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "apigateway": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "application-autoscaling": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "autoscaling": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "batch": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "cloudformation": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "cloudfront": service{ + PartitionEndpoint: "aws-cn-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "cloudfront.cn-northwest-1.amazonaws.com.cn", + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "cloudtrail": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "codebuild": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "codedeploy": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "cognito-identity": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "config": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "dax": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, + "directconnect": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "dms": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "ds": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "ec2": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "ec2metadata": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "169.254.169.254/latest", + Protocols: []string{"http"}, + }, + }, + }, + "ecs": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "elasticache": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "elasticbeanstalk": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "elasticloadbalancing": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "elasticmapreduce": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "es": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "events": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "firehose": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "gamelift": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "glacier": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "glue": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, + "greengrass": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "iam": service{ + PartitionEndpoint: "aws-cn-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "iam.cn-north-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + }, + }, + "iot": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "execute-api", + }, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "kinesis": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "lambda": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "license-manager": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "logs": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "mediaconvert": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{ + Hostname: "subscribe.mediaconvert.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "monitoring": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "polly": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, + "rds": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "redshift": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "s3": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "s3-control": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + SignatureVersions: []string{"s3v4"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{ + Hostname: "s3-control.cn-north-1.amazonaws.com.cn", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + "cn-northwest-1": endpoint{ + Hostname: "s3-control.cn-northwest-1.amazonaws.com.cn", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "secretsmanager": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "sms": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "snowball": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "sns": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "sqs": service{ + Defaults: endpoint{ + SSLCommonName: "{region}.queue.{dnsSuffix}", + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "ssm": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "states": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "storagegateway": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "streams.dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "dynamodb", + }, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "sts": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "support": service{ + PartitionEndpoint: "aws-cn-global", + + Endpoints: endpoints{ + "aws-cn-global": endpoint{ + Hostname: "support.cn-north-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + }, + }, + "swf": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "tagging": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{ + Hostname: "cn.transcribe.cn-north-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + "cn-northwest-1": endpoint{ + Hostname: "cn.transcribe.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "workspaces": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, + }, +} + +// AwsUsGovPartition returns the Resolver for AWS GovCloud (US). +func AwsUsGovPartition() Partition { + return awsusgovPartition.Partition() +} + +var awsusgovPartition = partition{ + ID: "aws-us-gov", + Name: "AWS GovCloud (US)", + DNSSuffix: "amazonaws.com", + RegionRegex: regionRegex{ + Regexp: func() *regexp.Regexp { + reg, _ := regexp.Compile("^us\\-gov\\-\\w+\\-\\d+$") + return reg + }(), + }, + Defaults: endpoint{ + Hostname: "{service}.{region}.{dnsSuffix}", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + Regions: regions{ + "us-gov-east-1": region{ + Description: "AWS GovCloud (US-East)", + }, + "us-gov-west-1": region{ + Description: "AWS GovCloud (US)", + }, + }, + Services: services{ + "acm": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "acm-pca": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "api.ecr": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Hostname: "api.ecr.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "api.ecr.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "api.sagemaker": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "apigateway": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.{region}.amazonaws.com", + Protocols: []string{"http", "https"}, + CredentialScope: credentialScope{ + Service: "application-autoscaling", + }, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "appstream2": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + CredentialScope: credentialScope{ + Service: "appstream", + }, + }, + Endpoints: endpoints{ + "fips": endpoint{ + Hostname: "appstream2-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-west-1": endpoint{}, + }, + }, + "athena": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "autoscaling": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "clouddirectory": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "cloudformation": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "cloudhsm": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "cloudhsmv2": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "cloudhsm", + }, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "cloudtrail": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "codebuild": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "codecommit": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "codedeploy": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "codedeploy-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "codedeploy-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "comprehend": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "config": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "datasync": service{ + + Endpoints: endpoints{ + "fips-us-gov-west-1": endpoint{ + Hostname: "datasync-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "directconnect": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "dms": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "ds": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "dynamodb": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "dynamodb.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "dynamodb.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "ec2": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "ec2metadata": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "169.254.169.254/latest", + Protocols: []string{"http"}, + }, + }, + }, + "ecs": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "elasticache": service{ + + Endpoints: endpoints{ + "fips": endpoint{ + Hostname: "elasticache-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "elasticbeanstalk": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "elasticfilesystem": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "elasticloadbalancing": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "elasticmapreduce": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "es": service{ + + Endpoints: endpoints{ + "fips": endpoint{ + Hostname: "es-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "events": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "firehose": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "glacier": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "glue": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "greengrass": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "guardduty": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "health": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "iam": service{ + PartitionEndpoint: "aws-us-gov-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-us-gov-global": endpoint{ + Hostname: "iam.us-gov.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "inspector": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "iot": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "execute-api", + }, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "kinesis": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "ProdFips": endpoint{ + Hostname: "kms-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "lambda": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "license-manager": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "logs": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "mediaconvert": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "metering.marketplace": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "aws-marketplace", + }, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "monitoring": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "neptune": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Hostname: "rds.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "rds.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "organizations": service{ + PartitionEndpoint: "aws-us-gov-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-us-gov-global": endpoint{ + Hostname: "organizations.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "polly": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "ram": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "rds": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "redshift": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "rekognition": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "resource-groups": service{ + + Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "resource-groups.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "resource-groups.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "route53": service{ + PartitionEndpoint: "aws-us-gov-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-us-gov-global": endpoint{ + Hostname: "route53.us-gov.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "route53resolver": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "runtime.sagemaker": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "s3": service{ + Defaults: endpoint{ + SignatureVersions: []string{"s3", "s3v4"}, + }, + Endpoints: endpoints{ + "fips-us-gov-west-1": endpoint{ + Hostname: "s3-fips-us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{ + Hostname: "s3.us-gov-east-1.amazonaws.com", + Protocols: []string{"http", "https"}, + }, + "us-gov-west-1": endpoint{ + Hostname: "s3.us-gov-west-1.amazonaws.com", + Protocols: []string{"http", "https"}, + }, + }, + }, + "s3-control": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + SignatureVersions: []string{"s3v4"}, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Hostname: "s3-control.us-gov-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-east-1-fips": endpoint{ + Hostname: "s3-control-fips.us-gov-east-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "s3-control.us-gov-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-west-1-fips": endpoint{ + Hostname: "s3-control-fips.us-gov-west-1.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "secretsmanager": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "secretsmanager-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "serverlessrepo": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{ + Protocols: []string{"https"}, + }, + "us-gov-west-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, + "servicecatalog": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "servicecatalog-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "sms": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "snowball": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "sns": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "sqs": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{ + SSLCommonName: "{region}.queue.{dnsSuffix}", + Protocols: []string{"http", "https"}, + }, + }, + }, + "ssm": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "states": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "storagegateway": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "streams.dynamodb": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "dynamodb", + }, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "dynamodb.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "dynamodb.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "sts": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "swf": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "tagging": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "translate": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "translate-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, + "waf-regional": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + "workspaces": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, + }, +} + +// AwsIsoPartition returns the Resolver for AWS ISO (US). +func AwsIsoPartition() Partition { + return awsisoPartition.Partition() +} + +var awsisoPartition = partition{ + ID: "aws-iso", + Name: "AWS ISO (US)", + DNSSuffix: "c2s.ic.gov", + RegionRegex: regionRegex{ + Regexp: func() *regexp.Regexp { + reg, _ := regexp.Compile("^us\\-iso\\-\\w+\\-\\d+$") + return reg + }(), + }, + Defaults: endpoint{ + Hostname: "{service}.{region}.{dnsSuffix}", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + Regions: regions{ + "us-iso-east-1": region{ + Description: "US ISO East", + }, + }, + Services: services{ + "api.ecr": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Hostname: "api.ecr.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "api.sagemaker": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "apigateway": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.us-iso-east-1.c2s.ic.gov", + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "autoscaling": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, + }, + }, + "cloudformation": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "cloudtrail": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "codedeploy": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "config": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "datapipeline": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, }, }, - "codedeploy": service{ + "directconnect": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, - "config": service{ + "dms": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, - "directconnect": service{ + "ds": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "dynamodb": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, }, }, "ec2": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "ec2metadata": service{ @@ -1749,57 +5723,63 @@ var awscnPartition = partition{ }, }, }, - "elasticache": service{ + "ecs": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, - "elasticbeanstalk": service{ + "elasticache": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "elasticloadbalancing": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, }, }, "elasticmapreduce": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{ + Protocols: []string{"https"}, + }, }, }, "events": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "glacier": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, }, + }, + "health": service{ + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "iam": service{ - PartitionEndpoint: "aws-cn-global", + PartitionEndpoint: "aws-iso-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ - "aws-cn-global": endpoint{ - Hostname: "iam.cn-north-1.amazonaws.com.cn", + "aws-iso-global": endpoint{ + Hostname: "iam.us-iso-east-1.c2s.ic.gov", CredentialScope: credentialScope{ - Region: "cn-north-1", + Region: "us-iso-east-1", }, }, }, @@ -1807,111 +5787,167 @@ var awscnPartition = partition{ "kinesis": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, + }, + }, + "kms": service{ + + Endpoints: endpoints{ + "ProdFips": endpoint{ + Hostname: "kms-fips.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + "us-iso-east-1": endpoint{}, + }, + }, + "lambda": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, }, }, "logs": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "monitoring": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, - }, + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "rds": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, + }, + }, + "route53": service{ + PartitionEndpoint: "aws-iso-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "route53.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, + }, + }, + "runtime.sagemaker": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, }, }, "s3": service{ Defaults: endpoint{ - Protocols: []string{"http", "https"}, SignatureVersions: []string{"s3v4"}, }, Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, + }, }, }, - "sns": service{ - Defaults: endpoint{ - Protocols: []string{"http", "https"}, + "snowball": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, }, + }, + "sns": service{ + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, }, }, "sqs": service{ - Defaults: endpoint{ - SSLCommonName: "{region}.queue.{dnsSuffix}", - Protocols: []string{"http", "https"}, - }, + Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, }, }, - "storagegateway": service{ + "states": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, "streams.dynamodb": service{ Defaults: endpoint{ - Protocols: []string{"http", "http", "https", "https"}, + Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, }, Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{ + Protocols: []string{"http", "https"}, + }, }, }, "sts": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, + }, + }, + "support": service{ + PartitionEndpoint: "aws-iso-global", + + Endpoints: endpoints{ + "aws-iso-global": endpoint{ + Hostname: "support.us-iso-east-1.c2s.ic.gov", + CredentialScope: credentialScope{ + Region: "us-iso-east-1", + }, + }, }, }, "swf": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, - "tagging": service{ + "workspaces": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "us-iso-east-1": endpoint{}, }, }, }, } -// AwsUsGovPartition returns the Resolver for AWS GovCloud (US). -func AwsUsGovPartition() Partition { - return awsusgovPartition.Partition() +// AwsIsoBPartition returns the Resolver for AWS ISOB (US). +func AwsIsoBPartition() Partition { + return awsisobPartition.Partition() } -var awsusgovPartition = partition{ - ID: "aws-us-gov", - Name: "AWS GovCloud (US)", - DNSSuffix: "amazonaws.com", +var awsisobPartition = partition{ + ID: "aws-iso-b", + Name: "AWS ISOB (US)", + DNSSuffix: "sc2s.sgov.gov", RegionRegex: regionRegex{ Regexp: func() *regexp.Regexp { - reg, _ := regexp.Compile("^us\\-gov\\-\\w+\\-\\d+$") + reg, _ := regexp.Compile("^us\\-isob\\-\\w+\\-\\d+$") return reg }(), }, @@ -1921,59 +5957,72 @@ var awsusgovPartition = partition{ SignatureVersions: []string{"v4"}, }, Regions: regions{ - "us-gov-west-1": region{ - Description: "AWS GovCloud (US)", + "us-isob-east-1": region{ + Description: "US ISOB East (Ohio)", }, }, Services: services{ - "autoscaling": service{ - + "application-autoscaling": service{ + Defaults: endpoint{ + Hostname: "autoscaling.us-isob-east-1.sc2s.sgov.gov", + Protocols: []string{"http", "https"}, + }, Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, + "us-isob-east-1": endpoint{}, }, }, - "cloudformation": service{ - + "autoscaling": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, - "cloudhsm": service{ + "cloudformation": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "cloudtrail": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "config": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "directconnect": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, - "dynamodb": service{ + "dms": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, + }, + }, + "dynamodb": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, }, }, "ec2": service{ - + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "ec2metadata": service{ @@ -1990,42 +6039,50 @@ var awsusgovPartition = partition{ "elasticache": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "elasticloadbalancing": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, + "us-isob-east-1": endpoint{ + Protocols: []string{"https"}, }, }, }, "elasticmapreduce": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, + "us-isob-east-1": endpoint{}, + }, + }, + "events": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, }, }, "glacier": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, + "us-isob-east-1": endpoint{}, + }, + }, + "health": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, }, }, "iam": service{ - PartitionEndpoint: "aws-us-gov-global", + PartitionEndpoint: "aws-iso-b-global", IsRegionalized: boxedFalse, Endpoints: endpoints{ - "aws-us-gov-global": endpoint{ - Hostname: "iam.us-gov.amazonaws.com", + "aws-iso-b-global": endpoint{ + Hostname: "iam.us-isob-east-1.sc2s.sgov.gov", CredentialScope: credentialScope{ - Region: "us-gov-west-1", + Region: "us-isob-east-1", }, }, }, @@ -2033,99 +6090,116 @@ var awsusgovPartition = partition{ "kinesis": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "kms": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "ProdFips": endpoint{ + Hostname: "kms-fips.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + "us-isob-east-1": endpoint{}, }, }, "logs": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "monitoring": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "rds": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "redshift": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "s3": service{ Defaults: endpoint{ - SignatureVersions: []string{"s3", "s3v4"}, + Protocols: []string{"http", "https"}, + SignatureVersions: []string{"s3v4"}, }, Endpoints: endpoints{ - "fips-us-gov-west-1": endpoint{ - Hostname: "s3-fips-us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, - "us-gov-west-1": endpoint{ - Hostname: "s3-us-gov-west-1.amazonaws.com", - Protocols: []string{"http", "https"}, - }, + "us-isob-east-1": endpoint{}, }, }, "snowball": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "sns": service{ - + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - Protocols: []string{"http", "https"}, - }, + "us-isob-east-1": endpoint{}, }, }, "sqs": service{ + Defaults: endpoint{ + SSLCommonName: "{region}.queue.{dnsSuffix}", + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, + "states": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{ - SSLCommonName: "{region}.queue.{dnsSuffix}", - Protocols: []string{"http", "https"}, - }, + "us-isob-east-1": endpoint{}, }, }, "streams.dynamodb": service{ Defaults: endpoint{ + Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "dynamodb", }, }, Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, "sts": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, + }, + }, + "support": service{ + PartitionEndpoint: "aws-iso-b-global", + + Endpoints: endpoints{ + "aws-iso-b-global": endpoint{ + Hostname: "support.us-isob-east-1.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, }, }, "swf": service{ Endpoints: endpoints{ - "us-gov-west-1": endpoint{}, + "us-isob-east-1": endpoint{}, }, }, }, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go new file mode 100644 index 0000000..ca8fc82 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go @@ -0,0 +1,141 @@ +package endpoints + +// Service identifiers +// +// Deprecated: Use client package's EndpointsID value instead of these +// ServiceIDs. These IDs are not maintained, and are out of date. +const ( + A4bServiceID = "a4b" // A4b. + AcmServiceID = "acm" // Acm. + AcmPcaServiceID = "acm-pca" // AcmPca. + ApiMediatailorServiceID = "api.mediatailor" // ApiMediatailor. + ApiPricingServiceID = "api.pricing" // ApiPricing. + ApiSagemakerServiceID = "api.sagemaker" // ApiSagemaker. + ApigatewayServiceID = "apigateway" // Apigateway. + ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling. + Appstream2ServiceID = "appstream2" // Appstream2. + AppsyncServiceID = "appsync" // Appsync. + AthenaServiceID = "athena" // Athena. + AutoscalingServiceID = "autoscaling" // Autoscaling. + AutoscalingPlansServiceID = "autoscaling-plans" // AutoscalingPlans. + BatchServiceID = "batch" // Batch. + BudgetsServiceID = "budgets" // Budgets. + CeServiceID = "ce" // Ce. + ChimeServiceID = "chime" // Chime. + Cloud9ServiceID = "cloud9" // Cloud9. + ClouddirectoryServiceID = "clouddirectory" // Clouddirectory. + CloudformationServiceID = "cloudformation" // Cloudformation. + CloudfrontServiceID = "cloudfront" // Cloudfront. + CloudhsmServiceID = "cloudhsm" // Cloudhsm. + Cloudhsmv2ServiceID = "cloudhsmv2" // Cloudhsmv2. + CloudsearchServiceID = "cloudsearch" // Cloudsearch. + CloudtrailServiceID = "cloudtrail" // Cloudtrail. + CodebuildServiceID = "codebuild" // Codebuild. + CodecommitServiceID = "codecommit" // Codecommit. + CodedeployServiceID = "codedeploy" // Codedeploy. + CodepipelineServiceID = "codepipeline" // Codepipeline. + CodestarServiceID = "codestar" // Codestar. + CognitoIdentityServiceID = "cognito-identity" // CognitoIdentity. + CognitoIdpServiceID = "cognito-idp" // CognitoIdp. + CognitoSyncServiceID = "cognito-sync" // CognitoSync. + ComprehendServiceID = "comprehend" // Comprehend. + ConfigServiceID = "config" // Config. + CurServiceID = "cur" // Cur. + DatapipelineServiceID = "datapipeline" // Datapipeline. + DaxServiceID = "dax" // Dax. + DevicefarmServiceID = "devicefarm" // Devicefarm. + DirectconnectServiceID = "directconnect" // Directconnect. + DiscoveryServiceID = "discovery" // Discovery. + DmsServiceID = "dms" // Dms. + DsServiceID = "ds" // Ds. + DynamodbServiceID = "dynamodb" // Dynamodb. + Ec2ServiceID = "ec2" // Ec2. + Ec2metadataServiceID = "ec2metadata" // Ec2metadata. + EcrServiceID = "ecr" // Ecr. + EcsServiceID = "ecs" // Ecs. + ElasticacheServiceID = "elasticache" // Elasticache. + ElasticbeanstalkServiceID = "elasticbeanstalk" // Elasticbeanstalk. + ElasticfilesystemServiceID = "elasticfilesystem" // Elasticfilesystem. + ElasticloadbalancingServiceID = "elasticloadbalancing" // Elasticloadbalancing. + ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce. + ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder. + EmailServiceID = "email" // Email. + EntitlementMarketplaceServiceID = "entitlement.marketplace" // EntitlementMarketplace. + EsServiceID = "es" // Es. + EventsServiceID = "events" // Events. + FirehoseServiceID = "firehose" // Firehose. + FmsServiceID = "fms" // Fms. + GameliftServiceID = "gamelift" // Gamelift. + GlacierServiceID = "glacier" // Glacier. + GlueServiceID = "glue" // Glue. + GreengrassServiceID = "greengrass" // Greengrass. + GuarddutyServiceID = "guardduty" // Guardduty. + HealthServiceID = "health" // Health. + IamServiceID = "iam" // Iam. + ImportexportServiceID = "importexport" // Importexport. + InspectorServiceID = "inspector" // Inspector. + IotServiceID = "iot" // Iot. + IotanalyticsServiceID = "iotanalytics" // Iotanalytics. + KinesisServiceID = "kinesis" // Kinesis. + KinesisanalyticsServiceID = "kinesisanalytics" // Kinesisanalytics. + KinesisvideoServiceID = "kinesisvideo" // Kinesisvideo. + KmsServiceID = "kms" // Kms. + LambdaServiceID = "lambda" // Lambda. + LightsailServiceID = "lightsail" // Lightsail. + LogsServiceID = "logs" // Logs. + MachinelearningServiceID = "machinelearning" // Machinelearning. + MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics. + MediaconvertServiceID = "mediaconvert" // Mediaconvert. + MedialiveServiceID = "medialive" // Medialive. + MediapackageServiceID = "mediapackage" // Mediapackage. + MediastoreServiceID = "mediastore" // Mediastore. + MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace. + MghServiceID = "mgh" // Mgh. + MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics. + ModelsLexServiceID = "models.lex" // ModelsLex. + MonitoringServiceID = "monitoring" // Monitoring. + MturkRequesterServiceID = "mturk-requester" // MturkRequester. + NeptuneServiceID = "neptune" // Neptune. + OpsworksServiceID = "opsworks" // Opsworks. + OpsworksCmServiceID = "opsworks-cm" // OpsworksCm. + OrganizationsServiceID = "organizations" // Organizations. + PinpointServiceID = "pinpoint" // Pinpoint. + PollyServiceID = "polly" // Polly. + RdsServiceID = "rds" // Rds. + RedshiftServiceID = "redshift" // Redshift. + RekognitionServiceID = "rekognition" // Rekognition. + ResourceGroupsServiceID = "resource-groups" // ResourceGroups. + Route53ServiceID = "route53" // Route53. + Route53domainsServiceID = "route53domains" // Route53domains. + RuntimeLexServiceID = "runtime.lex" // RuntimeLex. + RuntimeSagemakerServiceID = "runtime.sagemaker" // RuntimeSagemaker. + S3ServiceID = "s3" // S3. + S3ControlServiceID = "s3-control" // S3Control. + SagemakerServiceID = "api.sagemaker" // Sagemaker. + SdbServiceID = "sdb" // Sdb. + SecretsmanagerServiceID = "secretsmanager" // Secretsmanager. + ServerlessrepoServiceID = "serverlessrepo" // Serverlessrepo. + ServicecatalogServiceID = "servicecatalog" // Servicecatalog. + ServicediscoveryServiceID = "servicediscovery" // Servicediscovery. + ShieldServiceID = "shield" // Shield. + SmsServiceID = "sms" // Sms. + SnowballServiceID = "snowball" // Snowball. + SnsServiceID = "sns" // Sns. + SqsServiceID = "sqs" // Sqs. + SsmServiceID = "ssm" // Ssm. + StatesServiceID = "states" // States. + StoragegatewayServiceID = "storagegateway" // Storagegateway. + StreamsDynamodbServiceID = "streams.dynamodb" // StreamsDynamodb. + StsServiceID = "sts" // Sts. + SupportServiceID = "support" // Support. + SwfServiceID = "swf" // Swf. + TaggingServiceID = "tagging" // Tagging. + TransferServiceID = "transfer" // Transfer. + TranslateServiceID = "translate" // Translate. + WafServiceID = "waf" // Waf. + WafRegionalServiceID = "waf-regional" // WafRegional. + WorkdocsServiceID = "workdocs" // Workdocs. + WorkmailServiceID = "workmail" // Workmail. + WorkspacesServiceID = "workspaces" // Workspaces. + XrayServiceID = "xray" // Xray. +) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go index a0e9bc4..84316b9 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/doc.go @@ -21,12 +21,12 @@ // partitions := resolver.(endpoints.EnumPartitions).Partitions() // // for _, p := range partitions { -// fmt.Println("Regions for", p.Name) +// fmt.Println("Regions for", p.ID()) // for id, _ := range p.Regions() { // fmt.Println("*", id) // } // -// fmt.Println("Services for", p.Name) +// fmt.Println("Services for", p.ID()) // for id, _ := range p.Services() { // fmt.Println("*", id) // } 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 37e19ab..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 @@ -3,6 +3,7 @@ package endpoints import ( "fmt" "regexp" + "strings" "github.com/aws/aws-sdk-go/aws/awserr" ) @@ -35,7 +36,7 @@ type Options struct { // // If resolving an endpoint on the partition list the provided region will // be used to determine which partition's domain name pattern to the service - // endpoint ID with. If both the service and region are unkonwn and resolving + // endpoint ID with. If both the service and region are unknown and resolving // the endpoint on partition list an UnknownEndpointError error will be returned. // // If resolving and endpoint on a partition specific resolver that partition's @@ -46,6 +47,108 @@ type Options struct { // // This option is ignored if StrictMatching is enabled. ResolveUnknownService bool + + // STS Regional Endpoint flag helps with resolving the STS endpoint + STSRegionalEndpoint STSRegionalEndpoint + + // S3 Regional Endpoint flag helps with resolving the S3 endpoint + S3UsEast1RegionalEndpoint S3UsEast1RegionalEndpoint +} + +// STSRegionalEndpoint is an enum for the states of the STS Regional Endpoint +// options. +type STSRegionalEndpoint int + +func (e STSRegionalEndpoint) String() string { + switch e { + case LegacySTSEndpoint: + return "legacy" + case RegionalSTSEndpoint: + return "regional" + case UnsetSTSEndpoint: + return "" + default: + return "unknown" + } +} + +const ( + + // UnsetSTSEndpoint represents that STS Regional Endpoint flag is not specified. + UnsetSTSEndpoint STSRegionalEndpoint = iota + + // LegacySTSEndpoint represents when STS Regional Endpoint flag is specified + // to use legacy endpoints. + LegacySTSEndpoint + + // RegionalSTSEndpoint represents when STS Regional Endpoint flag is specified + // to use regional endpoints. + RegionalSTSEndpoint +) + +// GetSTSRegionalEndpoint function returns the STSRegionalEndpointFlag based +// on the input string provided in env config or shared config by the user. +// +// `legacy`, `regional` are the only case-insensitive valid strings for +// resolving the STS regional Endpoint flag. +func GetSTSRegionalEndpoint(s string) (STSRegionalEndpoint, error) { + switch { + case strings.EqualFold(s, "legacy"): + return LegacySTSEndpoint, nil + case strings.EqualFold(s, "regional"): + return RegionalSTSEndpoint, nil + default: + return UnsetSTSEndpoint, fmt.Errorf("unable to resolve the value of STSRegionalEndpoint for %v", s) + } +} + +// S3UsEast1RegionalEndpoint is an enum for the states of the S3 us-east-1 +// Regional Endpoint options. +type S3UsEast1RegionalEndpoint int + +func (e S3UsEast1RegionalEndpoint) String() string { + switch e { + case LegacyS3UsEast1Endpoint: + return "legacy" + case RegionalS3UsEast1Endpoint: + return "regional" + case UnsetS3UsEast1Endpoint: + return "" + default: + return "unknown" + } +} + +const ( + + // UnsetS3UsEast1Endpoint represents that S3 Regional Endpoint flag is not + // specified. + UnsetS3UsEast1Endpoint S3UsEast1RegionalEndpoint = iota + + // LegacyS3UsEast1Endpoint represents when S3 Regional Endpoint flag is + // specified to use legacy endpoints. + LegacyS3UsEast1Endpoint + + // RegionalS3UsEast1Endpoint represents when S3 Regional Endpoint flag is + // specified to use regional endpoints. + RegionalS3UsEast1Endpoint +) + +// GetS3UsEast1RegionalEndpoint function returns the S3UsEast1RegionalEndpointFlag based +// on the input string provided in env config or shared config by the user. +// +// `legacy`, `regional` are the only case-insensitive valid strings for +// resolving the S3 regional Endpoint flag. +func GetS3UsEast1RegionalEndpoint(s string) (S3UsEast1RegionalEndpoint, error) { + switch { + case strings.EqualFold(s, "legacy"): + return LegacyS3UsEast1Endpoint, nil + case strings.EqualFold(s, "regional"): + return RegionalS3UsEast1Endpoint, nil + default: + return UnsetS3UsEast1Endpoint, + fmt.Errorf("unable to resolve the value of S3UsEast1RegionalEndpoint for %v", s) + } } // Set combines all of the option functions together. @@ -79,6 +182,12 @@ func ResolveUnknownServiceOption(o *Options) { o.ResolveUnknownService = true } +// STSRegionalEndpointOption enables the STS endpoint resolver behavior to resolve +// STS endpoint to their regional endpoint, instead of the global endpoint. +func STSRegionalEndpointOption(o *Options) { + o.STSRegionalEndpoint = RegionalSTSEndpoint +} + // A Resolver provides the interface for functionality to resolve endpoints. // The build in Partition and DefaultResolver return value satisfy this interface. type Resolver interface { @@ -124,15 +233,61 @@ type EnumPartitions interface { Partitions() []Partition } +// RegionsForService returns a map of regions for the partition and service. +// If either the partition or service does not exist false will be returned +// as the second parameter. +// +// This example shows how to get the regions for DynamoDB in the AWS partition. +// rs, exists := endpoints.RegionsForService(endpoints.DefaultPartitions(), endpoints.AwsPartitionID, endpoints.DynamodbServiceID) +// +// This is equivalent to using the partition directly. +// rs := endpoints.AwsPartition().Services()[endpoints.DynamodbServiceID].Regions() +func RegionsForService(ps []Partition, partitionID, serviceID string) (map[string]Region, bool) { + for _, p := range ps { + if p.ID() != partitionID { + continue + } + if _, ok := p.p.Services[serviceID]; !ok { + break + } + + s := Service{ + id: serviceID, + p: p.p, + } + return s.Regions(), true + } + + return map[string]Region{}, false +} + +// PartitionForRegion returns the first partition which includes the region +// passed in. This includes both known regions and regions which match +// a pattern supported by the partition which may include regions that are +// not explicitly known by the partition. Use the Regions method of the +// returned Partition if explicit support is needed. +func PartitionForRegion(ps []Partition, regionID string) (Partition, bool) { + for _, p := range ps { + if _, ok := p.p.Regions[regionID]; ok || p.p.RegionRegex.MatchString(regionID) { + return p, true + } + } + + return Partition{}, false +} + // A Partition provides the ability to enumerate the partition's regions // and services. type Partition struct { - id string - p *partition + id, dnsSuffix string + p *partition } +// DNSSuffix returns the base domain name of the partition. +func (p Partition) DNSSuffix() string { return p.dnsSuffix } + // ID returns the identifier of the partition. -func (p *Partition) ID() string { return p.id } +func (p Partition) ID() string { return p.id } // EndpointFor attempts to resolve the endpoint based on service and region. // See Options for information on configuring how the endpoint is resolved. @@ -148,25 +303,26 @@ func (p *Partition) ID() string { return p.id } // require the provided service and region to be known by the partition. // If the endpoint cannot be strictly resolved an error will be returned. This // mode is useful to ensure the endpoint resolved is valid. Without -// StrictMatching enabled the endpoint returned my look valid but may not work. +// StrictMatching enabled the endpoint returned may look valid but may not work. // StrictMatching requires the SDK to be updated if you want to take advantage // of new regions and services expansions. // // Errors that can be returned. // * UnknownServiceError // * UnknownEndpointError -func (p *Partition) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { +func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { return p.p.EndpointFor(service, region, opts...) } // 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{} - for id := range p.p.Regions { +func (p Partition) Regions() map[string]Region { + rs := make(map[string]Region, len(p.p.Regions)) + for id, r := range p.p.Regions { rs[id] = Region{ - id: id, - p: p.p, + id: id, + desc: r.Description, + p: p.p, } } @@ -175,8 +331,8 @@ 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{} +func (p Partition) Services() map[string]Service { + ss := make(map[string]Service, len(p.p.Services)) for id := range p.p.Services { ss[id] = Service{ id: id, @@ -195,16 +351,20 @@ type Region struct { } // ID returns the region's identifier. -func (r *Region) ID() string { return r.id } +func (r Region) ID() string { return r.id } + +// Description returns the region's description. The region description +// is free text, it can be empty, and it may change between SDK releases. +func (r Region) Description() string { return r.desc } // ResolveEndpoint resolves an endpoint from the context of the region given // a service. See Partition.EndpointFor for usage and errors that can be returned. -func (r *Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) { +func (r Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) { return r.p.EndpointFor(service, r.id, opts...) } // Services returns a list of all services that are known to be in this region. -func (r *Region) Services() map[string]Service { +func (r Region) Services() map[string]Service { ss := map[string]Service{} for id, s := range r.p.Services { if _, ok := s.Endpoints[r.id]; ok { @@ -226,18 +386,40 @@ type Service struct { } // ID returns the identifier for the service. -func (s *Service) ID() string { return s.id } +func (s Service) ID() string { return s.id } // ResolveEndpoint resolves an endpoint from the context of a service given // a region. See Partition.EndpointFor for usage and errors that can be returned. -func (s *Service) ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error) { +func (s Service) ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error) { return s.p.EndpointFor(s.id, region, opts...) } +// Regions returns a map of Regions that the service is present in. +// +// 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) Regions() map[string]Region { + rs := map[string]Region{} + for id := range s.p.Services[s.id].Endpoints { + if r, ok := s.p.Regions[id]; ok { + rs[id] = Region{ + id: id, + desc: r.Description, + p: s.p, + } + } + } + + return rs +} + // Endpoints returns a map of Endpoints indexed by their ID for all known // endpoints for a service. -func (s *Service) Endpoints() map[string]Endpoint { - es := map[string]Endpoint{} +// +// 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 := 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, @@ -259,15 +441,15 @@ type Endpoint struct { } // ID returns the identifier for an endpoint. -func (e *Endpoint) ID() string { return e.id } +func (e Endpoint) ID() string { return e.id } // ServiceID returns the identifier the endpoint belongs to. -func (e *Endpoint) ServiceID() string { return e.serviceID } +func (e Endpoint) ServiceID() string { return e.serviceID } // ResolveEndpoint resolves an endpoint from the context of a service and // region the endpoint represents. See Partition.EndpointFor for usage and // errors that can be returned. -func (e *Endpoint) ResolveEndpoint(opts ...func(*Options)) (ResolvedEndpoint, error) { +func (e Endpoint) ResolveEndpoint(opts ...func(*Options)) (ResolvedEndpoint, error) { return e.p.EndpointFor(e.serviceID, e.id, opts...) } @@ -277,12 +459,19 @@ type ResolvedEndpoint struct { // The endpoint URL URL string + // The endpoint partition + PartitionID string + // The region that should be used for signing requests. SigningRegion string // The service name that should be used for signing requests. SigningName string + // States that the signing name for this endpoint was derived from metadata + // passed in, but was not explicitly modeled. + SigningNameDerived bool + // The signing method that should be used for signing requests. SigningMethod string } @@ -300,28 +489,6 @@ type EndpointNotFoundError struct { Region string } -//// NewEndpointNotFoundError builds and returns NewEndpointNotFoundError. -//func NewEndpointNotFoundError(p, s, r string) EndpointNotFoundError { -// return EndpointNotFoundError{ -// awsError: awserr.New("EndpointNotFoundError", "unable to find endpoint", nil), -// Partition: p, -// Service: s, -// Region: r, -// } -//} -// -//// Error returns string representation of the error. -//func (e EndpointNotFoundError) Error() string { -// extra := fmt.Sprintf("partition: %q, service: %q, region: %q", -// e.Partition, e.Service, e.Region) -// return awserr.SprintError(e.Code(), e.Message(), extra, e.OrigErr()) -//} -// -//// String returns the string representation of the error. -//func (e EndpointNotFoundError) String() string { -// return e.Error() -//} - // A UnknownServiceError is returned when the service does not resolve to an // endpoint. Includes a list of all known services for the partition. Returned // when a partition does not support the service. 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 8877d7b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints_test.go +++ /dev/null @@ -1,244 +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) - } - - 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 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") - - 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) - } -} 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/legacy_regions.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go new file mode 100644 index 0000000..df75e89 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go @@ -0,0 +1,24 @@ +package endpoints + +var legacyGlobalRegions = map[string]map[string]struct{}{ + "sts": { + "ap-northeast-1": {}, + "ap-south-1": {}, + "ap-southeast-1": {}, + "ap-southeast-2": {}, + "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": {}, + }, + "s3": { + "us-east-1": {}, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index 13d968a..eb2ac83 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -54,8 +54,9 @@ type partition struct { func (p partition) Partition() Partition { return Partition{ - id: p.ID, - p: &p, + dnsSuffix: p.DNSSuffix, + id: p.ID, + p: &p, } } @@ -74,24 +75,56 @@ func (p partition) canResolveEndpoint(service, region string, strictMatch bool) return p.RegionRegex.MatchString(region) } +func allowLegacyEmptyRegion(service string) bool { + legacy := map[string]struct{}{ + "budgets": {}, + "ce": {}, + "chime": {}, + "cloudfront": {}, + "ec2metadata": {}, + "iam": {}, + "importexport": {}, + "organizations": {}, + "route53": {}, + "sts": {}, + "support": {}, + "waf": {}, + } + + _, allowed := legacy[service] + return allowed +} + func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (resolved ResolvedEndpoint, err error) { var opt Options opt.Set(opts...) s, hasService := p.Services[service] - if !(hasService || opt.ResolveUnknownService) { + if len(service) == 0 || !(hasService || opt.ResolveUnknownService) { // Only return error if the resolver will not fallback to creating // endpoint based on service endpoint ID passed in. return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services)) } + if len(region) == 0 && allowLegacyEmptyRegion(service) && len(s.PartitionEndpoint) != 0 { + region = s.PartitionEndpoint + } + + if (service == "sts" && opt.STSRegionalEndpoint != RegionalSTSEndpoint) || + (service == "s3" && opt.S3UsEast1RegionalEndpoint != RegionalS3UsEast1Endpoint) { + if _, ok := legacyGlobalRegions[service][region]; ok { + region = "aws-global" + } + } + e, hasEndpoint := s.endpointForRegion(region) - if !hasEndpoint && opt.StrictMatching { + if len(region) == 0 || (!hasEndpoint && opt.StrictMatching) { return resolved, NewUnknownEndpointError(p.ID, service, region, endpointList(s.Endpoints)) } defs := []endpoint{p.Defaults, s.Defaults} - return e.resolve(service, region, p.DNSSuffix, defs, opt), nil + + return e.resolve(service, p.ID, region, p.DNSSuffix, defs, opt), nil } func serviceList(ss services) []string { @@ -200,7 +233,7 @@ func getByPriority(s []string, p []string, def string) string { return s[0] } -func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { +func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { var merged endpoint for _, def := range defs { merged.mergeIn(def) @@ -208,11 +241,23 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op merged.mergeIn(e) e = merged - hostname := e.Hostname + signingRegion := e.CredentialScope.Region + if len(signingRegion) == 0 { + signingRegion = region + } + + signingName := e.CredentialScope.Service + var signingNameDerived bool + if len(signingName) == 0 { + signingName = service + signingNameDerived = true + } + hostname := e.Hostname // Offset the hostname for dualstack if enabled if opts.UseDualStack && e.HasDualStack == boxedTrue { hostname = e.DualStackHostname + region = signingRegion } u := strings.Replace(hostname, "{service}", service, 1) @@ -222,20 +267,13 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op scheme := getEndpointScheme(e.Protocols, opts.DisableSSL) u = fmt.Sprintf("%s://%s", scheme, u) - signingRegion := e.CredentialScope.Region - if len(signingRegion) == 0 { - signingRegion = region - } - signingName := e.CredentialScope.Service - if len(signingName) == 0 { - signingName = service - } - return ResolvedEndpoint{ - URL: u, - SigningRegion: signingRegion, - SigningName: signingName, - SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), + URL: u, + PartitionID: partitionID, + SigningRegion: signingRegion, + SigningName: signingName, + SigningNameDerived: signingNameDerived, + SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go index fc7eada..0fdfcc5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go @@ -16,6 +16,10 @@ import ( type CodeGenOptions struct { // Options for how the model will be decoded. DecodeModelOptions DecodeModelOptions + + // Disables code generation of the service endpoint prefix IDs defined in + // the model. + DisableGenerateServiceIDs bool } // Set combines all of the option functions together @@ -39,8 +43,16 @@ func CodeGenModel(modelFile io.Reader, outFile io.Writer, optFns ...func(*CodeGe return err } + v := struct { + Resolver + CodeGenOptions + }{ + Resolver: resolver, + CodeGenOptions: opts, + } + tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl)) - if err := tmpl.ExecuteTemplate(outFile, "defaults", resolver); err != nil { + if err := tmpl.ExecuteTemplate(outFile, "defaults", v); err != nil { return fmt.Errorf("failed to execute template, %v", err) } @@ -166,15 +178,17 @@ import ( "regexp" ) - {{ template "partition consts" . }} + {{ template "partition consts" $.Resolver }} - {{ range $_, $partition := . }} + {{ range $_, $partition := $.Resolver }} {{ template "partition region consts" $partition }} {{ end }} - {{ template "service consts" . }} + {{ if not $.DisableGenerateServiceIDs -}} + {{ template "service consts" $.Resolver }} + {{- end }} - {{ template "endpoint resolvers" . }} + {{ template "endpoint resolvers" $.Resolver }} {{- end }} {{ define "partition consts" }} @@ -209,17 +223,20 @@ import ( // DefaultResolver returns an Endpoint resolver that will be able // to resolve endpoints for: {{ ListPartitionNames . }}. // - // Casting the return value of this func to a EnumPartitions will - // allow you to get a list of the partitions in the order the endpoints - // will be resolved in. + // Use DefaultPartitions() to get the list of the default partitions. + func DefaultResolver() Resolver { + return defaultPartitions + } + + // DefaultPartitions returns a list of the partitions the SDK is bundled + // with. The available partitions are: {{ ListPartitionNames . }}. // - // resolver := endpoints.DefaultResolver() - // partitions := resolver.(endpoints.EnumPartitions).Partitions() + // partitions := endpoints.DefaultPartitions // for _, p := range partitions { // // ... inspect partitions // } - func DefaultResolver() Resolver { - return defaultPartitions + func DefaultPartitions() []Partition { + return defaultPartitions.Partitions() } var defaultPartitions = partitions{ 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 1385cb4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_test.go +++ /dev/null @@ -1,354 +0,0 @@ -package endpoints - -import ( - "encoding/json" - "regexp" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestUnmarshalRegionRegex(t *testing.T) { - var input = []byte(` -{ - "regionRegex": "^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$" -}`) - - p := partition{} - err := json.Unmarshal(input, &p) - assert.NoError(t, err) - - expectRegexp, err := regexp.Compile(`^(us|eu|ap|sa|ca)\-\w+\-\d+$`) - assert.NoError(t, err) - - assert.Equal(t, expectRegexp.String(), p.RegionRegex.Regexp.String()) -} - -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) - assert.NoError(t, err) - - assert.Len(t, rs, 2) - r, ok := rs["aws-global"] - assert.True(t, ok) - assert.Equal(t, "AWS partition-global endpoint", r.Description) - - r, ok = rs["us-east-1"] - assert.True(t, ok) - assert.Equal(t, "US East (N. Virginia)", r.Description) -} - -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) - assert.NoError(t, err) - - assert.Len(t, ss, 3) - s, ok := ss["acm"] - assert.True(t, ok) - assert.Len(t, s.Endpoints, 1) - assert.Equal(t, boxedBoolUnset, s.IsRegionalized) - - s, ok = ss["apigateway"] - assert.True(t, ok) - assert.Len(t, s.Endpoints, 2) - assert.Equal(t, boxedTrue, s.IsRegionalized) - - s, ok = ss["notRegionalized"] - assert.True(t, ok) - assert.Len(t, s.Endpoints, 2) - assert.Equal(t, boxedFalse, s.IsRegionalized) -} - -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) - assert.NoError(t, err) - - assert.Len(t, es, 2) - s, ok := es["aws-global"] - assert.True(t, ok) - assert.Equal(t, "cloudfront.amazonaws.com", s.Hostname) - assert.Equal(t, []string{"http", "https"}, s.Protocols) - assert.Equal(t, []string{"v4"}, s.SignatureVersions) - assert.Equal(t, credentialScope{"us-east-1", "serviceName"}, s.CredentialScope) - assert.Equal(t, "commonName", s.SSLCommonName) -} - -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", "region", "dnsSuffix", - defs, Options{}, - ) - - assert.Equal(t, "https://service.region.dnsSuffix", resolved.URL) - assert.Equal(t, "signing_service", resolved.SigningName) - assert.Equal(t, "signing_region", resolved.SigningRegion) - assert.Equal(t, "v4", resolved.SigningMethod) -} - -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", - }, - }) - - assert.Equal(t, expected, actual) -} - -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{ - Endpoints: endpoints{ - "us-east-1": {}, - "us-west-2": { - HasDualStack: boxedTrue, - DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}", - }, - }, - }, - "service2": service{}, - "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", - }, - }, - }, - }, - }, -} - -func TestResolveEndpoint(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "us-west-2") - - assert.NoError(t, err) - assert.Equal(t, "https://service2.us-west-2.amazonaws.com", resolved.URL) - assert.Equal(t, "us-west-2", resolved.SigningRegion) - assert.Equal(t, "service2", resolved.SigningName) -} - -func TestResolveEndpoint_DisableSSL(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "us-west-2", DisableSSLOption) - - assert.NoError(t, err) - assert.Equal(t, "http://service2.us-west-2.amazonaws.com", resolved.URL) - assert.Equal(t, "us-west-2", resolved.SigningRegion) - assert.Equal(t, "service2", resolved.SigningName) -} - -func TestResolveEndpoint_UseDualStack(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service1", "us-west-2", UseDualStackOption) - - assert.NoError(t, err) - assert.Equal(t, "https://service1.dualstack.us-west-2.amazonaws.com", resolved.URL) - assert.Equal(t, "us-west-2", resolved.SigningRegion) - assert.Equal(t, "service1", resolved.SigningName) -} - -func TestResolveEndpoint_HTTPProtocol(t *testing.T) { - resolved, err := testPartitions.EndpointFor("httpService", "us-west-2") - - assert.NoError(t, err) - assert.Equal(t, "http://httpService.us-west-2.amazonaws.com", resolved.URL) - assert.Equal(t, "us-west-2", resolved.SigningRegion) - assert.Equal(t, "httpService", resolved.SigningName) -} - -func TestResolveEndpoint_UnknownService(t *testing.T) { - _, err := testPartitions.EndpointFor("unknownservice", "us-west-2") - - assert.Error(t, err) - - _, ok := err.(UnknownServiceError) - assert.True(t, ok, "expect error to be UnknownServiceError") -} - -func TestResolveEndpoint_ResolveUnknownService(t *testing.T) { - resolved, err := testPartitions.EndpointFor("unknown-service", "us-region-1", - ResolveUnknownServiceOption) - - assert.NoError(t, err) - - assert.Equal(t, "https://unknown-service.us-region-1.amazonaws.com", resolved.URL) - assert.Equal(t, "us-region-1", resolved.SigningRegion) - assert.Equal(t, "unknown-service", resolved.SigningName) -} - -func TestResolveEndpoint_UnknownMatchedRegion(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "us-region-1") - - assert.NoError(t, err) - assert.Equal(t, "https://service2.us-region-1.amazonaws.com", resolved.URL) - assert.Equal(t, "us-region-1", resolved.SigningRegion) - assert.Equal(t, "service2", resolved.SigningName) -} - -func TestResolveEndpoint_UnknownRegion(t *testing.T) { - resolved, err := testPartitions.EndpointFor("service2", "unknownregion") - - assert.NoError(t, err) - assert.Equal(t, "https://service2.unknownregion.amazonaws.com", resolved.URL) - assert.Equal(t, "unknownregion", resolved.SigningRegion) - assert.Equal(t, "service2", resolved.SigningName) -} - -func TestResolveEndpoint_StrictPartitionUnknownEndpoint(t *testing.T) { - _, err := testPartitions[0].EndpointFor("service2", "unknownregion", StrictMatchingOption) - - assert.Error(t, err) - - _, ok := err.(UnknownEndpointError) - assert.True(t, ok, "expect error to be UnknownEndpointError") -} - -func TestResolveEndpoint_StrictPartitionsUnknownEndpoint(t *testing.T) { - _, err := testPartitions.EndpointFor("service2", "us-region-1", StrictMatchingOption) - - assert.Error(t, err) - - _, ok := err.(UnknownEndpointError) - assert.True(t, ok, "expect error to be UnknownEndpointError") -} - -func TestResolveEndpoint_NotRegionalized(t *testing.T) { - resolved, err := testPartitions.EndpointFor("globalService", "us-west-2") - - assert.NoError(t, err) - assert.Equal(t, "https://globalService.amazonaws.com", resolved.URL) - assert.Equal(t, "us-east-1", resolved.SigningRegion) - assert.Equal(t, "globalService", resolved.SigningName) -} - -func TestResolveEndpoint_AwsGlobal(t *testing.T) { - resolved, err := testPartitions.EndpointFor("globalService", "aws-global") - - assert.NoError(t, err) - assert.Equal(t, "https://globalService.amazonaws.com", resolved.URL) - assert.Equal(t, "us-east-1", resolved.SigningRegion) - assert.Equal(t, "globalService", resolved.SigningName) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/errors.go b/vendor/github.com/aws/aws-sdk-go/aws/errors.go index 5766361..fa06f7a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/errors.go @@ -5,13 +5,9 @@ import "github.com/aws/aws-sdk-go/aws/awserr" var ( // ErrMissingRegion is an error that is returned if region configuration is // not found. - // - // @readonly ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) // ErrMissingEndpoint is an error that is returned if an endpoint cannot be // resolved for a service. - // - // @readonly ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) ) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go index a94f041..91a6f27 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go @@ -4,7 +4,8 @@ package aws // into a json string. This type can be used just like any other map. // // Example: -// values := JSONValue{ +// +// values := aws.JSONValue{ // "Foo": "Bar", // } // values["Baz"] = "Qux" diff --git a/vendor/github.com/aws/aws-sdk-go/aws/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/logger.go index db87188..6ed15b2 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/logger.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/logger.go @@ -26,14 +26,14 @@ func (l *LogLevelType) Value() LogLevelType { // Matches returns true if the v LogLevel is enabled by this LogLevel. Should be // used with logging sub levels. Is safe to use on nil value LogLevelTypes. If -// LogLevel is nill, will default to LogOff comparison. +// LogLevel is nil, will default to LogOff comparison. func (l *LogLevelType) Matches(v LogLevelType) bool { c := l.Value() return c&v == v } // AtLeast returns true if this LogLevel is at least high enough to satisfies v. -// Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default +// Is safe to use on nil value LogLevelTypes. If LogLevel is nil, will default // to LogOff comparison. func (l *LogLevelType) AtLeast(v LogLevelType) bool { c := l.Value() @@ -71,6 +71,12 @@ const ( // LogDebugWithRequestErrors states the SDK should log when service requests fail // to build, send, validate, or unmarshal. LogDebugWithRequestErrors + + // LogDebugWithEventStreamBody states the SDK should log EventStream + // request and response bodys. This should be used to log the EventStream + // wire unmarshaled message content of requests and responses made while + // using the SDK Will also enable LogDebug. + LogDebugWithEventStreamBody ) // A Logger is a minimalistic interface for the SDK to log messages to. Should diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go new file mode 100644 index 0000000..d9b37f4 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go @@ -0,0 +1,18 @@ +package request + +import ( + "strings" +) + +func isErrConnectionReset(err error) bool { + if strings.Contains(err.Error(), "read: connection reset") { + return false + } + + if strings.Contains(err.Error(), "connection reset") || + strings.Contains(err.Error(), "broken pipe") { + return true + } + + return false +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go index edf5538..185b073 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go @@ -14,14 +14,16 @@ type Handlers struct { Send HandlerList ValidateResponse HandlerList Unmarshal HandlerList + UnmarshalStream HandlerList UnmarshalMeta HandlerList UnmarshalError HandlerList Retry HandlerList AfterRetry HandlerList + CompleteAttempt HandlerList Complete HandlerList } -// Copy returns of this handler's lists. +// Copy returns a copy of this handler's lists. func (h *Handlers) Copy() Handlers { return Handlers{ Validate: h.Validate.copy(), @@ -30,29 +32,78 @@ func (h *Handlers) Copy() Handlers { Send: h.Send.copy(), ValidateResponse: h.ValidateResponse.copy(), Unmarshal: h.Unmarshal.copy(), + UnmarshalStream: h.UnmarshalStream.copy(), UnmarshalError: h.UnmarshalError.copy(), UnmarshalMeta: h.UnmarshalMeta.copy(), Retry: h.Retry.copy(), AfterRetry: h.AfterRetry.copy(), + CompleteAttempt: h.CompleteAttempt.copy(), Complete: h.Complete.copy(), } } -// Clear removes callback functions for all handlers +// Clear removes callback functions for all handlers. func (h *Handlers) Clear() { h.Validate.Clear() h.Build.Clear() h.Send.Clear() h.Sign.Clear() h.Unmarshal.Clear() + h.UnmarshalStream.Clear() h.UnmarshalMeta.Clear() h.UnmarshalError.Clear() h.ValidateResponse.Clear() h.Retry.Clear() h.AfterRetry.Clear() + h.CompleteAttempt.Clear() h.Complete.Clear() } +// IsEmpty returns if there are no handlers in any of the handlerlists. +func (h *Handlers) IsEmpty() bool { + if h.Validate.Len() != 0 { + return false + } + if h.Build.Len() != 0 { + return false + } + if h.Send.Len() != 0 { + return false + } + if h.Sign.Len() != 0 { + return false + } + if h.Unmarshal.Len() != 0 { + return false + } + if h.UnmarshalStream.Len() != 0 { + return false + } + if h.UnmarshalMeta.Len() != 0 { + return false + } + if h.UnmarshalError.Len() != 0 { + return false + } + if h.ValidateResponse.Len() != 0 { + return false + } + if h.Retry.Len() != 0 { + return false + } + if h.AfterRetry.Len() != 0 { + return false + } + if h.CompleteAttempt.Len() != 0 { + return false + } + if h.Complete.Len() != 0 { + return false + } + + return true +} + // A HandlerListRunItem represents an entry in the HandlerList which // is being run. type HandlerListRunItem struct { @@ -139,9 +190,14 @@ func (l *HandlerList) PushFrontNamed(n NamedHandler) { // Remove removes a NamedHandler n func (l *HandlerList) Remove(n NamedHandler) { + l.RemoveByName(n.Name) +} + +// RemoveByName removes a NamedHandler by name. +func (l *HandlerList) RemoveByName(name string) { for i := 0; i < len(l.list); i++ { m := l.list[i] - if m.Name == n.Name { + if m.Name == name { // Shift array preventing creating new arrays copy(l.list[i:], l.list[i+1:]) l.list[len(l.list)-1] = NamedHandler{} @@ -153,6 +209,52 @@ func (l *HandlerList) Remove(n NamedHandler) { } } +// SwapNamed will swap out any existing handlers with the same name as the +// passed in NamedHandler returning true if handlers were swapped. False is +// returned otherwise. +func (l *HandlerList) SwapNamed(n NamedHandler) (swapped bool) { + for i := 0; i < len(l.list); i++ { + if l.list[i].Name == n.Name { + l.list[i].Fn = n.Fn + swapped = true + } + } + + return swapped +} + +// Swap will swap out all handlers matching the name passed in. The matched +// handlers will be swapped in. True is returned if the handlers were swapped. +func (l *HandlerList) Swap(name string, replace NamedHandler) bool { + var swapped bool + + for i := 0; i < len(l.list); i++ { + if l.list[i].Name == name { + l.list[i] = replace + swapped = true + } + } + + return swapped +} + +// SetBackNamed will replace the named handler if it exists in the handler list. +// If the handler does not exist the handler will be added to the end of the list. +func (l *HandlerList) SetBackNamed(n NamedHandler) { + if !l.SwapNamed(n) { + l.PushBackNamed(n) + } +} + +// SetFrontNamed will replace the named handler if it exists in the handler list. +// If the handler does not exist the handler will be added to the beginning of +// the list. +func (l *HandlerList) SetFrontNamed(n NamedHandler) { + if !l.SwapNamed(n) { + l.PushFrontNamed(n) + } +} + // Run executes all handlers in the list with a given request object. func (l *HandlerList) Run(r *Request) { for i, h := range l.list { 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 e375a99..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package request_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "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) - assert.Equal(t, "a", s) - assert.Equal(t, "a", r.Data) -} - -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) {}) - assert.Equal(t, 4, l.Len()) - l.Remove(named) - assert.Equal(t, 2, l.Len()) -} - -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}) - - assert.Equal(t, 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) { - assert.Fail(t, "third handler should not be called") - }}) - l.Run(&request.Request{}) - - assert.Equal(t, 2, called, "Expect only two handlers to be called") -} - -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 2ce9ef4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/http_request_retry_test.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build go1.5 - -package request_test - -import ( - "errors" - "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" - "github.com/stretchr/testify/assert" -) - -func TestRequestCancelRetry(t *testing.T) { - c := make(chan struct{}) - - reqNum := 0 - s := mock.NewMockClient(aws.NewConfig().WithMaxRetries(10)) - 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++ - r.Error = errors.New("net/http: request canceled") - }) - out := &testData{} - r := s.NewRequest(&request.Operation{Name: "Operation"}, nil, out) - r.HTTPRequest.Cancel = c - close(c) - - err := r.Send() - assert.True(t, strings.Contains(err.Error(), "canceled")) - assert.Equal(t, 1, reqNum) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go index 02f07f4..9370fa5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go @@ -3,6 +3,8 @@ package request import ( "io" "sync" + + "github.com/aws/aws-sdk-go/internal/sdkio" ) // offsetReader is a thread-safe io.ReadCloser to prevent racing @@ -13,12 +15,15 @@ type offsetReader struct { closed bool } -func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader { +func newOffsetReader(buf io.ReadSeeker, offset int64) (*offsetReader, error) { reader := &offsetReader{} - buf.Seek(offset, 0) + _, err := buf.Seek(offset, sdkio.SeekStart) + if err != nil { + return nil, err + } reader.buf = buf - return reader + return reader, nil } // Close will close the instance of the offset reader's access to @@ -52,7 +57,9 @@ func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { // CloseAndCopy will return a new offsetReader with a copy of the old buffer // and close the old buffer. -func (o *offsetReader) CloseAndCopy(offset int64) *offsetReader { - o.Close() +func (o *offsetReader) CloseAndCopy(offset int64) (*offsetReader, error) { + if err := o.Close(); err != nil { + return nil, err + } return newOffsetReader(o.buf, offset) } 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 01856e3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader_test.go +++ /dev/null @@ -1,139 +0,0 @@ -package request - -import ( - "bytes" - "io" - "math/rand" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestOffsetReaderRead(t *testing.T) { - buf := []byte("testData") - reader := &offsetReader{buf: bytes.NewReader(buf)} - - tempBuf := make([]byte, len(buf)) - - n, err := reader.Read(tempBuf) - - assert.Equal(t, n, len(buf)) - assert.Nil(t, err) - assert.Equal(t, buf, tempBuf) -} - -func TestOffsetReaderSeek(t *testing.T) { - buf := []byte("testData") - reader := newOffsetReader(bytes.NewReader(buf), 0) - - orig, err := reader.Seek(0, 1) - assert.NoError(t, err) - assert.Equal(t, int64(0), orig) - - n, err := reader.Seek(0, 2) - assert.NoError(t, err) - assert.Equal(t, int64(len(buf)), n) - - n, err = reader.Seek(orig, 0) - assert.NoError(t, err) - assert.Equal(t, int64(0), n) -} - -func TestOffsetReaderClose(t *testing.T) { - buf := []byte("testData") - reader := &offsetReader{buf: bytes.NewReader(buf)} - - err := reader.Close() - assert.Nil(t, err) - - tempBuf := make([]byte, len(buf)) - n, err := reader.Read(tempBuf) - assert.Equal(t, n, 0) - assert.Equal(t, err, io.EOF) -} - -func TestOffsetReaderCloseAndCopy(t *testing.T) { - buf := []byte("testData") - tempBuf := make([]byte, len(buf)) - reader := &offsetReader{buf: bytes.NewReader(buf)} - - newReader := reader.CloseAndCopy(0) - - n, err := reader.Read(tempBuf) - assert.Equal(t, n, 0) - assert.Equal(t, err, io.EOF) - - n, err = newReader.Read(tempBuf) - assert.Equal(t, n, len(buf)) - assert.Nil(t, err) - assert.Equal(t, buf, tempBuf) -} - -func TestOffsetReaderCloseAndCopyOffset(t *testing.T) { - buf := []byte("testData") - tempBuf := make([]byte, len(buf)) - reader := &offsetReader{buf: bytes.NewReader(buf)} - - newReader := reader.CloseAndCopy(4) - n, err := newReader.Read(tempBuf) - assert.Equal(t, n, len(buf)-4) - assert.Nil(t, err) - - expected := []byte{'D', 'a', 't', 'a', 0, 0, 0, 0} - assert.Equal(t, expected, tempBuf) -} - -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.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go index ca9eac4..5217814 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "io" - "net" "net/http" "net/url" "reflect" @@ -14,12 +13,30 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/internal/sdkio" ) -// CanceledErrorCode is the error code that will be returned by an -// API request that was canceled. Requests given a aws.Context may -// return this error when canceled. -const CanceledErrorCode = "RequestCanceled" +const ( + // ErrCodeSerialization is the serialization error code that is received + // during protocol unmarshaling. + ErrCodeSerialization = "SerializationError" + + // ErrCodeRead is an error that is returned during HTTP reads. + ErrCodeRead = "ReadError" + + // ErrCodeResponseTimeout is the connection timeout error that is received + // during body reads. + ErrCodeResponseTimeout = "ResponseTimeout" + + // ErrCodeInvalidPresignExpire is returned when the expire time provided to + // presign is invalid + ErrCodeInvalidPresignExpire = "InvalidPresignExpireError" + + // CanceledErrorCode is the error code that will be returned by an + // API request that was canceled. Requests given a aws.Context may + // return this error when canceled. + CanceledErrorCode = "RequestCanceled" +) // A Request is the service request to be made. type Request struct { @@ -28,23 +45,38 @@ type Request struct { Handlers Handlers Retryer - Time time.Time - ExpireTime time.Duration - Operation *Operation - HTTPRequest *http.Request - HTTPResponse *http.Response - Body io.ReadSeeker - BodyStart int64 // offset from beginning of Body that the request body starts - Params interface{} - Error error - Data interface{} - RequestID string - RetryCount int - Retryable *bool - RetryDelay time.Duration - NotHoist bool - SignedHeaderVals http.Header - LastSignedAt time.Time + AttemptTime time.Time + Time time.Time + Operation *Operation + HTTPRequest *http.Request + HTTPResponse *http.Response + Body io.ReadSeeker + BodyStart int64 // offset from beginning of Body that the request body starts + Params interface{} + Error error + Data interface{} + RequestID string + RetryCount int + Retryable *bool + RetryDelay time.Duration + NotHoist bool + SignedHeaderVals http.Header + LastSignedAt time.Time + DisableFollowRedirects bool + + // Additional API error codes that should be retried. IsErrorRetryable + // will consider these codes in addition to its built in cases. + RetryErrorCodes []string + + // Additional API error codes that should be retried with throttle backoff + // delay. IsErrorThrottle will consider these codes in addition to its + // built in cases. + ThrottleErrorCodes []string + + // A value greater than 0 instructs the request to be signed as Presigned URL + // You should not set this field directly. Instead use Request's + // Presign or PresignRequest methods. + ExpireTime time.Duration context aws.Context @@ -67,8 +99,12 @@ type Operation struct { BeforePresignFn func(r *Request) error } -// New returns a new Request pointer for the service API -// operation and parameters. +// New returns a new Request pointer for the service API operation and +// parameters. +// +// A Retryer should be provided to direct how the request is retried. If +// Retryer is nil, a default no retry value will be used. You can use +// NoOpRetryer in the Client package to disable retry behavior directly. // // Params is any value of input parameters to be the request payload. // Data is pointer value to an object which the request's response @@ -76,6 +112,10 @@ type Operation struct { func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { + if retryer == nil { + retryer = noOpRetryer{} + } + method := operation.HTTPMethod if method == "" { method = "POST" @@ -90,6 +130,8 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, err = awserr.New("InvalidEndpointURL", "invalid endpoint uri", err) } + SanitizeHostForHeader(httpReq) + r := &Request{ Config: cfg, ClientInfo: clientInfo, @@ -200,9 +242,16 @@ func (r *Request) SetContext(ctx aws.Context) { // WillRetry returns if the request's can be retried. func (r *Request) WillRetry() bool { + if !aws.IsReaderSeekable(r.Body) && r.HTTPRequest.Body != NoBody { + return false + } return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() } +func fmtAttemptCount(retryCount, maxRetries int) string { + return fmt.Sprintf("attempt %v/%v", retryCount, maxRetries) +} + // ParamsFilled returns if the request's parameters have been populated // and the parameters are valid. False is returned if no parameters are // provided or invalid. @@ -231,59 +280,104 @@ func (r *Request) SetStringBody(s string) { // SetReaderBody will set the request's body reader. func (r *Request) SetReaderBody(reader io.ReadSeeker) { r.Body = reader + + if aws.IsReaderSeekable(reader) { + var err error + // Get the Bodies current offset so retries will start from the same + // initial position. + r.BodyStart, err = reader.Seek(0, sdkio.SeekCurrent) + if err != nil { + r.Error = awserr.New(ErrCodeSerialization, + "failed to determine start of request body", err) + return + } + } r.ResetBody() } // Presign returns the request's signed URL. Error will be returned -// if the signing fails. -func (r *Request) Presign(expireTime time.Duration) (string, error) { - r.ExpireTime = expireTime +// if the signing fails. The expire parameter is only used for presigned Amazon +// S3 API requests. All other AWS services will use a fixed expiration +// time of 15 minutes. +// +// It is invalid to create a presigned URL with a expire duration 0 or less. An +// error is returned if expire duration is 0 or less. +func (r *Request) Presign(expire time.Duration) (string, error) { + r = r.copy() + + // Presign requires all headers be hoisted. There is no way to retrieve + // the signed headers not hoisted without this. Making the presigned URL + // useless. r.NotHoist = false + u, _, err := getPresignedURL(r, expire) + return u, err +} + +// PresignRequest behaves just like presign, with the addition of returning a +// set of headers that were signed. The expire parameter is only used for +// presigned Amazon S3 API requests. All other AWS services will use a fixed +// expiration time of 15 minutes. +// +// It is invalid to create a presigned URL with a expire duration 0 or less. An +// error is returned if expire duration is 0 or less. +// +// Returns the URL string for the API operation with signature in the query string, +// and the HTTP headers that were included in the signature. These headers must +// be included in any HTTP request made with the presigned URL. +// +// To prevent hoisting any headers to the query string set NotHoist to true on +// this Request value prior to calling PresignRequest. +func (r *Request) PresignRequest(expire time.Duration) (string, http.Header, error) { + r = r.copy() + return getPresignedURL(r, expire) +} + +// IsPresigned returns true if the request represents a presigned API url. +func (r *Request) IsPresigned() bool { + return r.ExpireTime != 0 +} + +func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, error) { + if expire <= 0 { + return "", nil, awserr.New( + ErrCodeInvalidPresignExpire, + "presigned URL requires an expire duration greater than 0", + nil, + ) + } + + r.ExpireTime = expire + if r.Operation.BeforePresignFn != nil { - r = r.copy() - err := r.Operation.BeforePresignFn(r) - if err != nil { - return "", err + if err := r.Operation.BeforePresignFn(r); err != nil { + return "", nil, err } } - r.Sign() - if r.Error != nil { - return "", r.Error + if err := r.Sign(); err != nil { + return "", nil, err } - return r.HTTPRequest.URL.String(), nil -} -// PresignRequest behaves just like presign, but hoists all headers and signs them. -// Also returns the signed hash back to the user -func (r *Request) PresignRequest(expireTime time.Duration) (string, http.Header, error) { - r.ExpireTime = expireTime - r.NotHoist = true - r.Sign() - if r.Error != nil { - return "", nil, r.Error - } return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil } -func debugLogReqError(r *Request, stage string, retrying bool, err error) { +const ( + notRetrying = "not retrying" +) + +func debugLogReqError(r *Request, stage, retryStr string, err error) { if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) { return } - retryStr := "not retrying" - if retrying { - retryStr = "will retry" - } - r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err)) } // Build will build the request's object so it can be signed and sent // to the service. Build will also validate all the request's parameters. -// Anny additional build Handlers set on this request will be run +// Any additional build Handlers set on this request will be run // in the order they were set. // // The request will only be built once. Multiple calls to build will have @@ -295,12 +389,12 @@ func (r *Request) Build() error { if !r.built { r.Handlers.Validate.Run(r) if r.Error != nil { - debugLogReqError(r, "Validate Request", false, r.Error) + debugLogReqError(r, "Validate Request", notRetrying, r.Error) return r.Error } r.Handlers.Build.Run(r) if r.Error != nil { - debugLogReqError(r, "Build Request", false, r.Error) + debugLogReqError(r, "Build Request", notRetrying, r.Error) return r.Error } r.built = true @@ -309,14 +403,14 @@ func (r *Request) Build() error { return r.Error } -// Sign will sign the request returning error if errors are encountered. +// Sign will sign the request, returning error if errors are encountered. // -// Send will build the request prior to signing. All Sign Handlers will +// Sign will build the request prior to signing. All Sign Handlers will // be executed in the order they were set. func (r *Request) Sign() error { r.Build() if r.Error != nil { - debugLogReqError(r, "Build Request", false, r.Error) + debugLogReqError(r, "Build Request", notRetrying, r.Error) return r.Error } @@ -324,15 +418,16 @@ func (r *Request) Sign() error { return r.Error } -// ResetBody rewinds the request body backto its starting position, and -// set's the HTTP Request body reference. When the body is read prior -// to being sent in the HTTP request it will need to be rewound. -func (r *Request) ResetBody() { +func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) { if r.safeBody != nil { r.safeBody.Close() } - r.safeBody = newOffsetReader(r.Body, r.BodyStart) + r.safeBody, err = newOffsetReader(r.Body, r.BodyStart) + if err != nil { + return nil, awserr.New(ErrCodeSerialization, + "failed to get next request body reader", err) + } // Go 1.8 tightened and clarified the rules code needs to use when building // requests with the http package. Go 1.8 removed the automatic detection @@ -347,16 +442,16 @@ func (r *Request) ResetBody() { // of the SDK if they used that field. // // Related golang/go#18257 - l, err := computeBodyLength(r.Body) + l, err := aws.SeekerLen(r.Body) if err != nil { - r.Error = awserr.New("SerializationError", "failed to compute request body size", err) - return + return nil, awserr.New(ErrCodeSerialization, + "failed to compute request body size", err) } if l == 0 { - r.HTTPRequest.Body = noBodyReader + body = NoBody } else if l > 0 { - r.HTTPRequest.Body = r.safeBody + body = r.safeBody } else { // Hack to prevent sending bodies for methods where the body // should be ignored by the server. Sending bodies on these @@ -365,50 +460,17 @@ func (r *Request) ResetBody() { // Transfer-Encoding: chunked bodies for these methods. // // This would only happen if a aws.ReaderSeekerCloser was used with - // a io.Reader that was not also an io.Seeker. + // a io.Reader that was not also an io.Seeker, or did not implement + // Len() method. switch r.Operation.HTTPMethod { case "GET", "HEAD", "DELETE": - r.HTTPRequest.Body = noBodyReader + body = NoBody default: - r.HTTPRequest.Body = r.safeBody + body = r.safeBody } } -} - -// Attempts to compute the length of the body of the reader using the -// io.Seeker interface. If the value is not seekable because of being -// a ReaderSeekerCloser without an unerlying Seeker -1 will be returned. -// If no error occurs the length of the body will be returned. -func computeBodyLength(r io.ReadSeeker) (int64, error) { - seekable := true - // Determine if the seeker is actually seekable. ReaderSeekerCloser - // hides the fact that a io.Readers might not actually be seekable. - switch v := r.(type) { - case aws.ReaderSeekerCloser: - seekable = v.IsSeeker() - case *aws.ReaderSeekerCloser: - seekable = v.IsSeeker() - } - if !seekable { - return -1, nil - } - - curOffset, err := r.Seek(0, 1) - if err != nil { - return 0, err - } - - endOffset, err := r.Seek(0, 2) - if err != nil { - return 0, err - } - _, err = r.Seek(curOffset, 0) - if err != nil { - return 0, err - } - - return endOffset - curOffset, nil + return body, nil } // GetBody will return an io.ReadSeeker of the Request's underlying @@ -417,7 +479,7 @@ func (r *Request) GetBody() io.ReadSeeker { return r.safeBody } -// Send will send the request returning error if errors are encountered. +// Send will send the request, returning error if errors are encountered. // // Send will sign the request prior to sending. All Send Handlers will // be executed in the order they were set. @@ -437,78 +499,90 @@ func (r *Request) Send() error { r.Handlers.Complete.Run(r) }() + if err := r.Error; err != nil { + return err + } + for { - if aws.BoolValue(r.Retryable) { - if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { - r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", - r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) - } - - // The previous http.Request will have a reference to the r.Body - // and the HTTP Client's Transport may still be reading from - // the request's body even though the Client's Do returned. - r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) - r.ResetBody() - - // Closing response body to ensure that no response body is leaked - // between retry attempts. - if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { - r.HTTPResponse.Body.Close() - } - } + r.Error = nil + r.AttemptTime = time.Now() - r.Sign() - if r.Error != nil { - return r.Error + if err := r.Sign(); err != nil { + debugLogReqError(r, "Sign Request", notRetrying, err) + return err } - r.Retryable = nil - - r.Handlers.Send.Run(r) - if r.Error != nil { - if !shouldRetryCancel(r) { - return r.Error - } - - err := r.Error - r.Handlers.Retry.Run(r) - r.Handlers.AfterRetry.Run(r) - if r.Error != nil { - debugLogReqError(r, "Send Request", false, r.Error) - return r.Error - } - debugLogReqError(r, "Send Request", true, err) - continue + if err := r.sendRequest(); err == nil { + return nil } - r.Handlers.UnmarshalMeta.Run(r) - r.Handlers.ValidateResponse.Run(r) - if r.Error != nil { - err := r.Error - r.Handlers.UnmarshalError.Run(r) - r.Handlers.Retry.Run(r) - r.Handlers.AfterRetry.Run(r) - if r.Error != nil { - debugLogReqError(r, "Validate Response", false, r.Error) - return r.Error - } - debugLogReqError(r, "Validate Response", true, err) - continue + r.Handlers.Retry.Run(r) + r.Handlers.AfterRetry.Run(r) + + if r.Error != nil || !aws.BoolValue(r.Retryable) { + return r.Error } - r.Handlers.Unmarshal.Run(r) - if r.Error != nil { - err := r.Error - r.Handlers.Retry.Run(r) - r.Handlers.AfterRetry.Run(r) - if r.Error != nil { - debugLogReqError(r, "Unmarshal Response", false, r.Error) - return r.Error - } - debugLogReqError(r, "Unmarshal Response", true, err) - continue + if err := r.prepareRetry(); err != nil { + r.Error = err + return err } + } +} + +func (r *Request) prepareRetry() error { + if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) { + r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", + r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) + } + + // The previous http.Request will have a reference to the r.Body + // and the HTTP Client's Transport may still be reading from + // the request's body even though the Client's Do returned. + r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) + r.ResetBody() + if err := r.Error; err != nil { + return awserr.New(ErrCodeSerialization, + "failed to prepare body for retry", err) + + } - break + // Closing response body to ensure that no response body is leaked + // between retry attempts. + if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { + r.HTTPResponse.Body.Close() + } + + return nil +} + +func (r *Request) sendRequest() (sendErr error) { + defer r.Handlers.CompleteAttempt.Run(r) + + r.Retryable = nil + r.Handlers.Send.Run(r) + if r.Error != nil { + debugLogReqError(r, "Send Request", + fmtAttemptCount(r.RetryCount, r.MaxRetries()), + r.Error) + return r.Error + } + + r.Handlers.UnmarshalMeta.Run(r) + r.Handlers.ValidateResponse.Run(r) + if r.Error != nil { + r.Handlers.UnmarshalError.Run(r) + debugLogReqError(r, "Validate Response", + fmtAttemptCount(r.RetryCount, r.MaxRetries()), + r.Error) + return r.Error + } + + r.Handlers.Unmarshal.Run(r) + if r.Error != nil { + debugLogReqError(r, "Unmarshal Response", + fmtAttemptCount(r.RetryCount, r.MaxRetries()), + r.Error) + return r.Error } return nil @@ -534,28 +608,71 @@ func AddToUserAgent(r *Request, s string) { r.HTTPRequest.Header.Set("User-Agent", s) } -func shouldRetryCancel(r *Request) bool { - awsErr, ok := r.Error.(awserr.Error) - timeoutErr := false - errStr := r.Error.Error() - if ok { - if awsErr.Code() == CanceledErrorCode { - return false - } - err := awsErr.OrigErr() - netErr, netOK := err.(net.Error) - timeoutErr = netOK && netErr.Temporary() - if urlErr, ok := err.(*url.Error); !timeoutErr && ok { - errStr = urlErr.Err.Error() - } +// SanitizeHostForHeader removes default port from host and updates request.Host +func SanitizeHostForHeader(r *http.Request) { + host := getHost(r) + port := portOnly(host) + if port != "" && isDefaultPort(r.URL.Scheme, port) { + r.Host = stripPort(host) + } +} + +// Returns host from request +func getHost(r *http.Request) string { + if r.Host != "" { + return r.Host } - // There can be two types of canceled errors here. - // The first being a net.Error and the other being an error. - // If the request was timed out, we want to continue the retry - // process. Otherwise, return the canceled error. - return timeoutErr || - (errStr != "net/http: request canceled" && - errStr != "net/http: request canceled while waiting for connection") + return r.URL.Host +} + +// Hostname returns u.Host, without any port number. +// +// If Host is an IPv6 literal with a port number, Hostname returns the +// IPv6 literal without the square brackets. IPv6 literals may include +// a zone identifier. +// +// Copied from the Go 1.8 standard library (net/url) +func stripPort(hostport string) string { + colon := strings.IndexByte(hostport, ':') + if colon == -1 { + return hostport + } + if i := strings.IndexByte(hostport, ']'); i != -1 { + return strings.TrimPrefix(hostport[:i], "[") + } + return hostport[:colon] +} + +// Port returns the port part of u.Host, without the leading colon. +// If u.Host doesn't contain a port, Port returns an empty string. +// +// Copied from the Go 1.8 standard library (net/url) +func portOnly(hostport string) string { + colon := strings.IndexByte(hostport, ':') + if colon == -1 { + return "" + } + if i := strings.Index(hostport, "]:"); i != -1 { + return hostport[i+len("]:"):] + } + if strings.Contains(hostport, "]") { + return "" + } + return hostport[colon+len(":"):] +} + +// Returns true if the specified URI is using the standard port +// (i.e. port 80 for HTTP URIs or 443 for HTTPS URIs) +func isDefaultPort(scheme, port string) bool { + if port == "" { + return true + } + + lowerCaseScheme := strings.ToLower(scheme) + if (lowerCaseScheme == "http" && port == "80") || (lowerCaseScheme == "https" && port == "443") { + return true + } + return false } 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 d0314ab..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/stretchr/testify/assert" - - "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, - ) - - assert.Error(t, r.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.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go index 1323af9..e36e468 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go @@ -16,6 +16,24 @@ func (noBody) Read([]byte) (int, error) { return 0, io.EOF } func (noBody) Close() error { return nil } func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil } -// Is an empty reader that will trigger the Go HTTP client to not include +// NoBody is an empty reader that will trigger the Go HTTP client to not include // and body in the HTTP request. -var noBodyReader = noBody{} +var NoBody = noBody{} + +// ResetBody rewinds the request body back to its starting position, and +// sets the HTTP Request body reference. When the body is read prior +// to being sent in the HTTP request it will need to be rewound. +// +// ResetBody will automatically be called by the SDK's build handler, but if +// the request is being used directly ResetBody must be called before the request +// is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically +// call ResetBody. +func (r *Request) ResetBody() { + body, err := r.getNextRequestBody() + if err != nil { + r.Error = err + return + } + + r.HTTPRequest.Body = body +} 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.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go index 8b963f4..de1292f 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go @@ -2,8 +2,35 @@ package request -import "net/http" +import ( + "net/http" -// Is a http.NoBody reader instructing Go HTTP client to not include + "github.com/aws/aws-sdk-go/aws/awserr" +) + +// NoBody is a http.NoBody reader instructing Go HTTP client to not include // and body in the HTTP request. -var noBodyReader = http.NoBody +var NoBody = http.NoBody + +// ResetBody rewinds the request body back to its starting position, and +// sets the HTTP Request body reference. When the body is read prior +// to being sent in the HTTP request it will need to be rewound. +// +// ResetBody will automatically be called by the SDK's build handler, but if +// the request is being used directly ResetBody must be called before the request +// is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically +// call ResetBody. +// +// Will also set the Go 1.8's http.Request.GetBody member to allow retrying +// PUT/POST redirects. +func (r *Request) ResetBody() { + body, err := r.getNextRequestBody() + if err != nil { + r.Error = awserr.New(ErrCodeSerialization, + "failed to reset request body", err) + return + } + + r.HTTPRequest.Body = body + r.HTTPRequest.GetBody = r.getNextRequestBody +} 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 6a3aba6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8_test.go +++ /dev/null @@ -1,25 +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, http.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_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.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go index 59de673..64784e1 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go @@ -17,11 +17,13 @@ import ( // does the pagination between API operations, and Paginator defines the // configuration that will be used per page request. // -// cont := true -// for p.Next() && cont { +// for p.Next() { // data := p.Page().(*s3.ListObjectsOutput) // // process the page's data +// // ... +// // break out of loop to stop fetching additional pages // } +// // return p.Err() // // See service client API operation Pages methods for examples how the SDK will @@ -35,8 +37,12 @@ type Pagination struct { // NewRequest should always be built from the same API operations. It is // undefined if different API operations are returned on subsequent calls. NewRequest func() (*Request, error) + // EndPageOnSameToken, when enabled, will allow the paginator to stop on + // token that are the same as its previous tokens. + EndPageOnSameToken bool started bool + prevTokens []interface{} nextTokens []interface{} err error @@ -49,7 +55,15 @@ type Pagination struct { // // Will always return true if Next has not been called yet. func (p *Pagination) HasNextPage() bool { - return !(p.started && len(p.nextTokens) == 0) + if !p.started { + return true + } + + hasNextPage := len(p.nextTokens) != 0 + if p.EndPageOnSameToken { + return hasNextPage && !awsutil.DeepEqual(p.nextTokens, p.prevTokens) + } + return hasNextPage } // Err returns the error Pagination encountered when retrieving the next page. @@ -96,6 +110,7 @@ func (p *Pagination) Next() bool { return false } + p.prevTokens = p.nextTokens p.nextTokens = req.nextPageTokens() p.curPage = req.Data @@ -133,7 +148,7 @@ func (r *Request) nextPageTokens() []interface{} { return nil } case bool: - if v == false { + if !v { return nil } } @@ -142,13 +157,28 @@ func (r *Request) nextPageTokens() []interface{} { tokens := []interface{}{} tokenAdded := false for _, outToken := range r.Operation.OutputTokens { - v, _ := awsutil.ValuesAtPath(r.Data, outToken) - if len(v) > 0 { - tokens = append(tokens, v[0]) - tokenAdded = true - } else { + vs, _ := awsutil.ValuesAtPath(r.Data, outToken) + if len(vs) == 0 { tokens = append(tokens, nil) + continue } + v := vs[0] + + switch tv := v.(type) { + case *string: + if len(aws.StringValue(tv)) == 0 { + tokens = append(tokens, nil) + continue + } + case string: + if len(tv) == 0 { + tokens = append(tokens, nil) + continue + } + } + + tokenAdded = true + tokens = append(tokens, v) } if !tokenAdded { return nil 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 73a95ba..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination_test.go +++ /dev/null @@ -1,604 +0,0 @@ -package request_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "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++ - for _, item := range p.Items { - pages = append(pages, item) - } - if last { - if gotToEnd { - assert.Fail(t, "last=true happened twice") - } - gotToEnd = true - } - return true - }) - assert.Nil(t, err) - - assert.Equal(t, - []map[string]*dynamodb.AttributeValue{ - {"key": {S: aws.String("key1")}}, - {"key": {S: aws.String("key2")}}, - }, tokens) - assert.Equal(t, - []map[string]*dynamodb.AttributeValue{ - {"key": {S: aws.String("key1")}}, - {"key": {S: aws.String("key2")}}, - {"key": {S: aws.String("key3")}}, - }, pages) - assert.Equal(t, 3, numPages) - assert.True(t, gotToEnd) - assert.Nil(t, params.ExclusiveStartKey) -} - -// 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 { - assert.Fail(t, "last=true happened twice") - } - gotToEnd = true - } - return true - }) - - assert.Equal(t, []string{"Table2", "Table4"}, tokens) - assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) - assert.Equal(t, 3, numPages) - assert.True(t, gotToEnd) - assert.Nil(t, err) - assert.Nil(t, params.ExclusiveStartTableName) -} - -// 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 { - assert.Fail(t, "last=true happened twice") - } - gotToEnd = true - } - - return true - }) - - assert.Equal(t, []string{"Table2", "Table4"}, tokens) - assert.Equal(t, []string{"Table1", "Table2", "Table3", "Table4", "Table5"}, pages) - assert.Equal(t, 3, numPages) - assert.True(t, gotToEnd) - assert.Nil(t, 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 { - assert.Fail(t, "last=true happened twice") - } - gotToEnd = true - } - return true - }) - - assert.Equal(t, 2, numPages) - assert.False(t, gotToEnd) - assert.Nil(t, 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 - }) - assert.Equal(t, 1, numPages) - assert.True(t, gotToEnd) -} - -// 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 - }) - - assert.Equal(t, []string{"Key1", "Key2", "Key3"}, results) - assert.Nil(t, 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 - }) - - assert.Equal(t, []string{"Key1", "Key2"}, results) - assert.Nil(t, 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 - }) - - assert.NoError(t, err) - assert.Equal(t, []string{"", "second", ""}, idents) - assert.Equal(t, []string{"first.example.com.", "second.example.com.", "third.example.com."}, results) -} - -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") - } -} - -type testPageInput struct { - NextToken string -} -type testPageOutput struct { - Value string - NextToken *string -} - -func TestPagination_Standalone(t *testing.T) { - expect := []struct { - Value, PrevToken, NextToken string - }{ - {"FirstValue", "InitalToken", "FirstToken"}, - {"SecondValue", "FirstToken", "SecondToken"}, - {"ThirdValue", "SecondToken", ""}, - } - input := testPageInput{ - NextToken: expect[0].PrevToken, - } - - c := awstesting.NewClient() - i := 0 - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - r := c.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) { - in := req.Params.(*testPageInput) - if e, a := expect[i].PrevToken, 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: expect[i].Value, - } - if len(expect[i].NextToken) > 0 { - out.NextToken = aws.String(expect[i].NextToken) - } - req.Data = out - }) - return r, nil - }, - } - - for p.Next() { - data := p.Page().(*testPageOutput) - - if e, a := expect[i].Value, data.Value; e != a { - t.Errorf("%d, expect Value to be %q, got %q", i, e, a) - } - if e, a := expect[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(expect), 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 4efc505..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_resetbody_test.go +++ /dev/null @@ -1,58 +0,0 @@ -package request - -import ( - "bytes" - "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) - } -} - -func TestResetBody_ExcludeUnseekableBodyByMethod(t *testing.T) { - cases := []struct { - Method string - IsNoBody bool - }{ - {"GET", true}, - {"HEAD", true}, - {"DELETE", true}, - {"PUT", false}, - {"PATCH", false}, - {"POST", false}, - } - - reader := aws.ReadSeekCloser(bytes.NewBuffer([]byte("abc"))) - - for i, c := range cases { - r := Request{ - HTTPRequest: &http.Request{}, - Operation: &Operation{ - HTTPMethod: c.Method, - }, - } - - r.SetReaderBody(reader) - - if a, e := r.HTTPRequest.Body == noBodyReader, 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_test.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_test.go deleted file mode 100644 index 01f9609..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_test.go +++ /dev/null @@ -1,568 +0,0 @@ -package request_test - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "runtime" - "strconv" - "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/aws/request" - "github.com/aws/aws-sdk-go/awstesting" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -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) - } - return -} - -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: 501, Body: body(`{"__type":"UnknownError","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.Fatalf("expect no error, but got %v", err) - } - if e, a := 2, int(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: 429, Body: body(`{"__type":"ProvisionedThroughputExceededException","message":"Rate exceeded."}`)}, - {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.Fatalf("expect no error, but got %v", err) - } - if e, a := 2, int(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.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 = &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, int(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.NewConfig().WithSleepDelay(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, int(r.RetryCount); e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - - expectDelays := []struct{ min, max time.Duration }{{30, 59}, {60, 118}, {120, 236}} - 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", "")}) - 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, int(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"); e != a { - 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"); e != a { - 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")}) - // s.Handlers.Validate.Clear() - - 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"); e != a { - t.Errorf("expect %q user agent, got %q", e, a) - } -} - -func TestRequestThrottleRetries(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":"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.NewConfig().WithSleepDelay(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, int(r.RetryCount); e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - - expectDelays := []struct{ min, max time.Duration }{{500, 999}, {1000, 1998}, {2000, 3996}} - 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, int(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, int(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) - - if err := r.Send(); err != nil { - t.Fatalf("%d, expect no error sending request, got %v", i, err) - } - } -} - -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) - } -} 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 1d5ad8c..356e5d9 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 @@ -1,26 +1,75 @@ package request import ( + "net" + "net/url" + "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" ) -// Retryer is an interface to control retry logic for a given service. -// The default implementation used by most services is the service.DefaultRetryer -// structure, which contains basic retry logic using exponential backoff. +// Retryer provides the interface drive the SDK's request retry behavior. The +// Retryer implementation is responsible for implementing exponential backoff, +// and determine if a request API error should be retried. +// +// client.DefaultRetryer is the SDK's default implementation of the Retryer. It +// uses the which uses the Request.IsErrorRetryable and Request.IsErrorThrottle +// methods to determine if the request is retried. type Retryer interface { + // RetryRules return the retry delay that should be used by the SDK before + // making another request attempt for the failed request. RetryRules(*Request) time.Duration + + // ShouldRetry returns if the failed request is retryable. + // + // Implementations may consider request attempt count when determining if a + // request is retryable, but the SDK will use MaxRetries to limit the + // number of attempts a request are made. ShouldRetry(*Request) bool + + // MaxRetries is the number of times a request may be retried before + // failing. MaxRetries() int } -// WithRetryer sets a config Retryer value to the given Config returning it -// for chaining. +// WithRetryer sets a Retryer value to the given Config returning the Config +// value for chaining. The value must not be nil. func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { + if retryer == nil { + if cfg.Logger != nil { + cfg.Logger.Log("ERROR: Request.WithRetryer called with nil retryer. Replacing with retry disabled Retryer.") + } + retryer = noOpRetryer{} + } cfg.Retryer = retryer return cfg + +} + +// noOpRetryer is a internal no op retryer used when a request is created +// without a retryer. +// +// Provides a retryer that performs no retries. +// It should be used when we do not want retries to be performed. +type noOpRetryer struct{} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API; For NoOpRetryer the MaxRetries will always be zero. +func (d noOpRetryer) MaxRetries() int { + return 0 +} + +// ShouldRetry will always return false for NoOpRetryer, as it should never retry. +func (d noOpRetryer) ShouldRetry(_ *Request) bool { + return false +} + +// RetryRules returns the delay duration before retrying this request again; +// since NoOpRetryer does not retry, RetryRules always returns 0. +func (d noOpRetryer) RetryRules(_ *Request) time.Duration { + return 0 } // retryableCodes is a collection of service response codes which are retry-able @@ -28,18 +77,21 @@ func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { var retryableCodes = map[string]struct{}{ "RequestError": {}, "RequestTimeout": {}, + ErrCodeResponseTimeout: {}, "RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout } var throttleCodes = map[string]struct{}{ "ProvisionedThroughputExceededException": {}, + "ThrottledException": {}, // SNS, XRay, ResourceGroupsTagging API "Throttling": {}, "ThrottlingException": {}, "RequestLimitExceeded": {}, "RequestThrottled": {}, - "LimitExceededException": {}, // Deleting 10+ DynamoDb tables at once + "RequestThrottledException": {}, "TooManyRequestsException": {}, // Lambda functions "PriorRequestNotComplete": {}, // Route53 + "TransactionInProgressException": {}, } // credsExpiredCodes is a collection of error codes which signify the credentials @@ -69,35 +121,188 @@ func isCodeExpiredCreds(code string) bool { return ok } +var validParentCodes = map[string]struct{}{ + ErrCodeSerialization: {}, + ErrCodeRead: {}, +} + +func isNestedErrorRetryable(parentErr awserr.Error) bool { + if parentErr == nil { + return false + } + + if _, ok := validParentCodes[parentErr.Code()]; !ok { + return false + } + + err := parentErr.OrigErr() + if err == nil { + return false + } + + if aerr, ok := err.(awserr.Error); ok { + return isCodeRetryable(aerr.Code()) + } + + if t, ok := err.(temporary); ok { + return t.Temporary() || isErrConnectionReset(err) + } + + return isErrConnectionReset(err) +} + +// IsErrorRetryable returns whether the error is retryable, based on its Code. +// Returns false if error is nil. +func IsErrorRetryable(err error) bool { + if err == nil { + return false + } + return shouldRetryError(err) +} + +type temporary interface { + Temporary() bool +} + +func shouldRetryError(origErr error) bool { + switch err := origErr.(type) { + case awserr.Error: + if err.Code() == CanceledErrorCode { + return false + } + if isNestedErrorRetryable(err) { + return true + } + + origErr := err.OrigErr() + var shouldRetry bool + if origErr != nil { + shouldRetry := shouldRetryError(origErr) + if err.Code() == "RequestError" && !shouldRetry { + return false + } + } + if isCodeRetryable(err.Code()) { + return true + } + return shouldRetry + + case *url.Error: + if strings.Contains(err.Error(), "connection refused") { + // Refused connections should be retried as the service may not yet + // be running on the port. Go TCP dial considers refused + // connections as not temporary. + return true + } + // *url.Error only implements Temporary after golang 1.6 but since + // url.Error only wraps the error: + return shouldRetryError(err.Err) + + case temporary: + if netErr, ok := err.(*net.OpError); ok && netErr.Op == "dial" { + return true + } + // If the error is temporary, we want to allow continuation of the + // retry process + return err.Temporary() || isErrConnectionReset(origErr) + + case nil: + // `awserr.Error.OrigErr()` can be nil, meaning there was an error but + // because we don't know the cause, it is marked as retryable. See + // TestRequest4xxUnretryable for an example. + return true + + default: + switch err.Error() { + case "net/http: request canceled", + "net/http: request canceled while waiting for connection": + // known 1.5 error case when an http request is cancelled + return false + } + // here we don't know the error; so we allow a retry. + return true + } +} + +// IsErrorThrottle returns whether the error is to be throttled based on its code. +// Returns false if error is nil. +func IsErrorThrottle(err error) bool { + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + return isCodeThrottle(aerr.Code()) + } + return false +} + +// IsErrorExpiredCreds returns whether the error code is a credential expiry +// error. Returns false if error is nil. +func IsErrorExpiredCreds(err error) bool { + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + return isCodeExpiredCreds(aerr.Code()) + } + return false +} + // IsErrorRetryable returns whether the error is retryable, based on its Code. // Returns false if the request has no Error set. +// +// Alias for the utility function IsErrorRetryable func (r *Request) IsErrorRetryable() bool { - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - return isCodeRetryable(err.Code()) + if isErrCode(r.Error, r.RetryErrorCodes) { + return true + } + + // HTTP response status code 501 should not be retried. + // 501 represents Not Implemented which means the request method is not + // supported by the server and cannot be handled. + if r.HTTPResponse != nil { + // HTTP response status code 500 represents internal server error and + // should be retried without any throttle. + if r.HTTPResponse.StatusCode == 500 { + return true } } - return false + return IsErrorRetryable(r.Error) } -// IsErrorThrottle returns whether the error is to be throttled based on its code. -// Returns false if the request has no Error set +// IsErrorThrottle returns whether the error is to be throttled based on its +// code. Returns false if the request has no Error set. +// +// Alias for the utility function IsErrorThrottle func (r *Request) IsErrorThrottle() bool { - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - return isCodeThrottle(err.Code()) + if isErrCode(r.Error, r.ThrottleErrorCodes) { + return true + } + + if r.HTTPResponse != nil { + switch r.HTTPResponse.StatusCode { + case + 429, // error caused due to too many requests + 502, // Bad Gateway error should be throttled + 503, // caused when service is unavailable + 504: // error occurred due to gateway timeout + return true } } + + return IsErrorThrottle(r.Error) +} + +func isErrCode(err error, codes []string) bool { + if aerr, ok := err.(awserr.Error); ok && aerr != nil { + for _, code := range codes { + if code == aerr.Code() { + return true + } + } + } + return false } // IsErrorExpired returns whether the error code is a credential expiry error. // Returns false if the request has no Error set. +// +// Alias for the utility function IsErrorExpiredCreds func (r *Request) IsErrorExpired() bool { - if r.Error != nil { - if err, ok := r.Error.(awserr.Error); ok { - return isCodeExpiredCreds(err.Code()) - } - } - return false + return IsErrorExpiredCreds(r.Error) } 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 b1926e3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package request - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/aws/aws-sdk-go/aws/awserr" -) - -func TestRequestThrottling(t *testing.T) { - req := Request{} - - req.Error = awserr.New("Throttling", "", nil) - assert.True(t, req.IsErrorThrottle()) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go new file mode 100644 index 0000000..09a44eb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/timeout_read_closer.go @@ -0,0 +1,94 @@ +package request + +import ( + "io" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" +) + +var timeoutErr = awserr.New( + ErrCodeResponseTimeout, + "read on body has reached the timeout limit", + nil, +) + +type readResult struct { + n int + err error +} + +// timeoutReadCloser will handle body reads that take too long. +// We will return a ErrReadTimeout error if a timeout occurs. +type timeoutReadCloser struct { + reader io.ReadCloser + duration time.Duration +} + +// Read will spin off a goroutine to call the reader's Read method. We will +// select on the timer's channel or the read's channel. Whoever completes first +// will be returned. +func (r *timeoutReadCloser) Read(b []byte) (int, error) { + timer := time.NewTimer(r.duration) + c := make(chan readResult, 1) + + go func() { + n, err := r.reader.Read(b) + timer.Stop() + c <- readResult{n: n, err: err} + }() + + select { + case data := <-c: + return data.n, data.err + case <-timer.C: + return 0, timeoutErr + } +} + +func (r *timeoutReadCloser) Close() error { + return r.reader.Close() +} + +const ( + // HandlerResponseTimeout is what we use to signify the name of the + // response timeout handler. + HandlerResponseTimeout = "ResponseTimeoutHandler" +) + +// adaptToResponseTimeoutError is a handler that will replace any top level error +// to a ErrCodeResponseTimeout, if its child is that. +func adaptToResponseTimeoutError(req *Request) { + if err, ok := req.Error.(awserr.Error); ok { + aerr, ok := err.OrigErr().(awserr.Error) + if ok && aerr.Code() == ErrCodeResponseTimeout { + req.Error = aerr + } + } +} + +// WithResponseReadTimeout is a request option that will wrap the body in a timeout read closer. +// This will allow for per read timeouts. If a timeout occurred, we will return the +// ErrCodeResponseTimeout. +// +// svc.PutObjectWithContext(ctx, params, request.WithTimeoutReadCloser(30 * time.Second) +func WithResponseReadTimeout(duration time.Duration) Option { + return func(r *Request) { + + var timeoutHandler = NamedHandler{ + HandlerResponseTimeout, + func(req *Request) { + req.HTTPResponse.Body = &timeoutReadCloser{ + reader: req.HTTPResponse.Body, + duration: duration, + } + }} + + // remove the handler so we are not stomping over any new durations. + r.Handlers.Send.RemoveByName(HandlerResponseTimeout) + r.Handlers.Send.PushBackNamed(timeoutHandler) + + r.Handlers.Unmarshal.PushBack(adaptToResponseTimeoutError) + r.Handlers.UnmarshalError.PushBack(adaptToResponseTimeoutError) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go index 2520286..8630683 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go @@ -17,6 +17,12 @@ const ( ParamMinValueErrCode = "ParamMinValueError" // ParamMinLenErrCode is the error code for fields without enough elements. ParamMinLenErrCode = "ParamMinLenError" + // ParamMaxLenErrCode is the error code for value being too long. + ParamMaxLenErrCode = "ParamMaxLenError" + + // ParamFormatErrCode is the error code for a field with invalid + // format or characters. + ParamFormatErrCode = "ParamFormatInvalidError" ) // Validator provides a way for types to perform validation logic on their @@ -220,7 +226,7 @@ type ErrParamMinLen struct { func NewErrParamMinLen(field string, min int) *ErrParamMinLen { return &ErrParamMinLen{ errInvalidParam: errInvalidParam{ - code: ParamMinValueErrCode, + code: ParamMinLenErrCode, field: field, msg: fmt.Sprintf("minimum field size of %v", min), }, @@ -232,3 +238,49 @@ func NewErrParamMinLen(field string, min int) *ErrParamMinLen { func (e *ErrParamMinLen) MinLen() int { return e.min } + +// An ErrParamMaxLen represents a maximum length parameter error. +type ErrParamMaxLen struct { + errInvalidParam + max int +} + +// NewErrParamMaxLen creates a new maximum length parameter error. +func NewErrParamMaxLen(field string, max int, value string) *ErrParamMaxLen { + return &ErrParamMaxLen{ + errInvalidParam: errInvalidParam{ + code: ParamMaxLenErrCode, + field: field, + msg: fmt.Sprintf("maximum size of %v, %v", max, value), + }, + max: max, + } +} + +// MaxLen returns the field's required minimum length. +func (e *ErrParamMaxLen) MaxLen() int { + return e.max +} + +// An ErrParamFormat represents a invalid format parameter error. +type ErrParamFormat struct { + errInvalidParam + format string +} + +// NewErrParamFormat creates a new invalid format parameter error. +func NewErrParamFormat(field string, format, value string) *ErrParamFormat { + return &ErrParamFormat{ + errInvalidParam: errInvalidParam{ + code: ParamFormatErrCode, + field: field, + msg: fmt.Sprintf("format %v, %v", format, value), + }, + format: format, + } +} + +// Format returns the field's required format. +func (e *ErrParamFormat) Format() string { + return e.format +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go index 354c381..4601f88 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/waiter.go @@ -66,8 +66,8 @@ func WithWaiterRequestOptions(opts ...Option) WaiterOption { } } -// A Waiter provides the functionality to performing blocking call which will -// wait for an resource state to be satisfied a service. +// A Waiter provides the functionality to perform a blocking call which will +// wait for a resource state to be satisfied by a service. // // This type should not be used directly. The API operations provided in the // service packages prefixed with "WaitUntil" should be used instead. @@ -79,8 +79,9 @@ type Waiter struct { MaxAttempts int Delay WaiterDelay - RequestOptions []Option - NewRequest func([]Option) (*Request, error) + RequestOptions []Option + NewRequest func([]Option) (*Request, error) + SleepWithContext func(aws.Context, time.Duration) error } // ApplyOptions updates the waiter with the list of waiter options provided. @@ -178,14 +179,8 @@ func (w Waiter) WaitWithContext(ctx aws.Context) error { // See if any of the acceptors match the request's response, or error for _, a := range w.Acceptors { - var matched bool - matched, err = a.match(w.Name, w.Logger, req, err) - if err != nil { - // Error occurred during current waiter call - return err - } else if matched { - // Match was found can stop here and return - return nil + if matched, matchErr := a.match(w.Name, w.Logger, req, err); matched { + return matchErr } } @@ -201,8 +196,15 @@ func (w Waiter) WaitWithContext(ctx aws.Context) error { if sleepFn := req.Config.SleepDelay; sleepFn != nil { // Support SleepDelay for backwards compatibility and testing sleepFn(delay) - } else if err := aws.SleepWithContext(ctx, delay); err != nil { - return awserr.New(CanceledErrorCode, "waiter context canceled", err) + } else { + sleepCtxFn := w.SleepWithContext + if sleepCtxFn == nil { + sleepCtxFn = aws.SleepWithContext + } + + if err := sleepCtxFn(ctx, delay); err != nil { + return awserr.New(CanceledErrorCode, "waiter context canceled", err) + } } } @@ -274,7 +276,7 @@ func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err erro return true, nil case FailureWaiterState: // Waiter failure state triggered - return false, awserr.New("ResourceNotReady", + return true, awserr.New(WaiterResourceNotReadyErrorCode, "failed waiting for successful resource state", err) case RetryWaiterState: // clear the error and retry the operation 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 b1857fa..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/waiter_test.go +++ /dev/null @@ -1,615 +0,0 @@ -package request_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "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) { - assert.Fail(t, "too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, - Argument: "States[].State", - Expected: "running", - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - assert.NoError(t, err) - assert.Equal(t, 3, numBuiltReq) - assert.Equal(t, 3, reqNum) -} - -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) { - assert.Fail(t, "too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, - Argument: "States[].State", - Expected: "running", - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - assert.NoError(t, err) - assert.Equal(t, 3, numBuiltReq) - assert.Equal(t, 3, reqNum) -} - -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) { - assert.Fail(t, "too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - 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) - assert.Error(t, err) - assert.Equal(t, request.WaiterResourceNotReadyErrorCode, err.Code()) - assert.Equal(t, "failed waiting for successful resource state", err.Message()) - assert.Equal(t, 3, numBuiltReq) - assert.Equal(t, 3, reqNum) -} - -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 2, error case - }, - { // 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.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) { - assert.Fail(t, "too many polling requests made") - return - } - r.Data = resps[reqNum] - reqNum++ - }) - svc.Handlers.UnmarshalMeta.PushBack(func(r *request.Request) { - if reqNum == 1 { - r.Error = awserr.New("MockException", "mock exception message", nil) - // If there was an error unmarshal error will be called instead of unmarshal - // need to increment count here also - reqNum++ - } - }) - - w := request.Waiter{ - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(0), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, - Argument: "States[].State", - Expected: "running", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Argument: "", - Expected: "MockException", - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - assert.NoError(t, err) - assert.Equal(t, 3, numBuiltReq) - assert.Equal(t, 3, reqNum) -} - -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), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Argument: "", - Expected: 404, - }, - }, - NewRequest: BuildNewMockRequest(svc, &MockInput{}), - } - - err := w.WaitWithContext(aws.BackgroundContext()) - assert.NoError(t, err) - assert.Equal(t, 3, reqNum) -} - -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), - 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 - }, - } - - 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), - 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), - 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/cabundle_transport.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go new file mode 100644 index 0000000..ea9ebb6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go @@ -0,0 +1,26 @@ +// +build go1.7 + +package session + +import ( + "net" + "net/http" + "time" +) + +// Transport that should be used when a custom CA bundle is specified with the +// SDK. +func getCABundleTransport() *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + DualStack: true, + }).DialContext, + MaxIdleConns: 100, + IdleConnTimeout: 90 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go new file mode 100644 index 0000000..fec39df --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go @@ -0,0 +1,22 @@ +// +build !go1.6,go1.5 + +package session + +import ( + "net" + "net/http" + "time" +) + +// Transport that should be used when a custom CA bundle is specified with the +// SDK. +func getCABundleTransport() *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go new file mode 100644 index 0000000..1c5a539 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go @@ -0,0 +1,23 @@ +// +build !go1.7,go1.6 + +package session + +import ( + "net" + "net/http" + "time" +) + +// Transport that should be used when a custom CA bundle is specified with the +// SDK. +func getCABundleTransport() *http.Transport { + return &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, + ExpectContinueTimeout: 1 * time.Second, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go new file mode 100644 index 0000000..cc64e24 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go @@ -0,0 +1,259 @@ +package session + +import ( + "fmt" + "os" + + "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/credentials/processcreds" + "github.com/aws/aws-sdk-go/aws/credentials/stscreds" + "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/internal/shareddefaults" +) + +func resolveCredentials(cfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) (*credentials.Credentials, error) { + + switch { + case len(sessOpts.Profile) != 0: + // User explicitly provided an Profile in the session's configuration + // so load that profile from shared config first. + // Github(aws/aws-sdk-go#2727) + return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) + + case envCfg.Creds.HasKeys(): + // Environment credentials + return credentials.NewStaticCredentialsFromCreds(envCfg.Creds), nil + + case len(envCfg.WebIdentityTokenFilePath) != 0: + // Web identity token from environment, RoleARN required to also be + // set. + return assumeWebIdentity(cfg, handlers, + envCfg.WebIdentityTokenFilePath, + envCfg.RoleARN, + envCfg.RoleSessionName, + ) + + default: + // Fallback to the "default" credential resolution chain. + return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) + } +} + +// WebIdentityEmptyRoleARNErr will occur if 'AWS_WEB_IDENTITY_TOKEN_FILE' was set but +// 'AWS_ROLE_ARN' was not set. +var WebIdentityEmptyRoleARNErr = awserr.New(stscreds.ErrCodeWebIdentity, "role ARN is not set", nil) + +// WebIdentityEmptyTokenFilePathErr will occur if 'AWS_ROLE_ARN' was set but +// 'AWS_WEB_IDENTITY_TOKEN_FILE' was not set. +var WebIdentityEmptyTokenFilePathErr = awserr.New(stscreds.ErrCodeWebIdentity, "token file path is not set", nil) + +func assumeWebIdentity(cfg *aws.Config, handlers request.Handlers, + filepath string, + roleARN, sessionName string, +) (*credentials.Credentials, error) { + + if len(filepath) == 0 { + return nil, WebIdentityEmptyTokenFilePathErr + } + + if len(roleARN) == 0 { + return nil, WebIdentityEmptyRoleARNErr + } + + creds := stscreds.NewWebIdentityCredentials( + &Session{ + Config: cfg, + Handlers: handlers.Copy(), + }, + roleARN, + sessionName, + filepath, + ) + + return creds, nil +} + +func resolveCredsFromProfile(cfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) (creds *credentials.Credentials, err error) { + + switch { + case sharedCfg.SourceProfile != nil: + // Assume IAM role with credentials source from a different profile. + creds, err = resolveCredsFromProfile(cfg, envCfg, + *sharedCfg.SourceProfile, handlers, sessOpts, + ) + + case sharedCfg.Creds.HasKeys(): + // Static Credentials from Shared Config/Credentials file. + creds = credentials.NewStaticCredentialsFromCreds( + sharedCfg.Creds, + ) + + case len(sharedCfg.CredentialProcess) != 0: + // Get credentials from CredentialProcess + creds = processcreds.NewCredentials(sharedCfg.CredentialProcess) + + case len(sharedCfg.CredentialSource) != 0: + creds, err = resolveCredsFromSource(cfg, envCfg, + sharedCfg, handlers, sessOpts, + ) + + case len(sharedCfg.WebIdentityTokenFile) != 0: + // Credentials from Assume Web Identity token require an IAM Role, and + // that roll will be assumed. May be wrapped with another assume role + // via SourceProfile. + return assumeWebIdentity(cfg, handlers, + sharedCfg.WebIdentityTokenFile, + sharedCfg.RoleARN, + sharedCfg.RoleSessionName, + ) + + default: + // Fallback to default credentials provider, include mock errors for + // the credential chain so user can identify why credentials failed to + // be retrieved. + creds = credentials.NewCredentials(&credentials.ChainProvider{ + VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), + Providers: []credentials.Provider{ + &credProviderError{ + Err: awserr.New("EnvAccessKeyNotFound", + "failed to find credentials in the environment.", nil), + }, + &credProviderError{ + Err: awserr.New("SharedCredsLoad", + fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil), + }, + defaults.RemoteCredProvider(*cfg, handlers), + }, + }) + } + if err != nil { + return nil, err + } + + if len(sharedCfg.RoleARN) > 0 { + cfgCp := *cfg + cfgCp.Credentials = creds + return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts) + } + + return creds, nil +} + +// valid credential source values +const ( + credSourceEc2Metadata = "Ec2InstanceMetadata" + credSourceEnvironment = "Environment" + credSourceECSContainer = "EcsContainer" +) + +func resolveCredsFromSource(cfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) (creds *credentials.Credentials, err error) { + + switch sharedCfg.CredentialSource { + case credSourceEc2Metadata: + p := defaults.RemoteCredProvider(*cfg, handlers) + creds = credentials.NewCredentials(p) + + case credSourceEnvironment: + creds = credentials.NewStaticCredentialsFromCreds(envCfg.Creds) + + case credSourceECSContainer: + if len(os.Getenv(shareddefaults.ECSCredsProviderEnvVar)) == 0 { + return nil, ErrSharedConfigECSContainerEnvVarEmpty + } + + p := defaults.RemoteCredProvider(*cfg, handlers) + creds = credentials.NewCredentials(p) + + default: + return nil, ErrSharedConfigInvalidCredSource + } + + return creds, nil +} + +func credsFromAssumeRole(cfg aws.Config, + handlers request.Handlers, + sharedCfg sharedConfig, + sessOpts Options, +) (*credentials.Credentials, error) { + + if len(sharedCfg.MFASerial) != 0 && sessOpts.AssumeRoleTokenProvider == nil { + // AssumeRole Token provider is required if doing Assume Role + // with MFA. + return nil, AssumeRoleTokenProviderNotSetError{} + } + + return stscreds.NewCredentials( + &Session{ + Config: &cfg, + Handlers: handlers.Copy(), + }, + sharedCfg.RoleARN, + func(opt *stscreds.AssumeRoleProvider) { + opt.RoleSessionName = sharedCfg.RoleSessionName + opt.Duration = sessOpts.AssumeRoleDuration + + // Assume role with external ID + if len(sharedCfg.ExternalID) > 0 { + opt.ExternalID = aws.String(sharedCfg.ExternalID) + } + + // Assume role with MFA + if len(sharedCfg.MFASerial) > 0 { + opt.SerialNumber = aws.String(sharedCfg.MFASerial) + opt.TokenProvider = sessOpts.AssumeRoleTokenProvider + } + }, + ), nil +} + +// AssumeRoleTokenProviderNotSetError is an error returned when creating a +// session when the MFAToken option is not set when shared config is configured +// load assume a role with an MFA token. +type AssumeRoleTokenProviderNotSetError struct{} + +// Code is the short id of the error. +func (e AssumeRoleTokenProviderNotSetError) Code() string { + return "AssumeRoleTokenProviderNotSetError" +} + +// Message is the description of the error +func (e AssumeRoleTokenProviderNotSetError) Message() string { + return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") +} + +// OrigErr is the underlying error that caused the failure. +func (e AssumeRoleTokenProviderNotSetError) OrigErr() error { + return nil +} + +// Error satisfies the error interface. +func (e AssumeRoleTokenProviderNotSetError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", nil) +} + +type credProviderError struct { + Err error +} + +func (c credProviderError) Retrieve() (credentials.Value, error) { + return credentials.Value{}, c.Err +} +func (c credProviderError) IsExpired() bool { + return true +} 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 8a5a3a0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/custom_ca_bundle_test.go +++ /dev/null @@ -1,319 +0,0 @@ -package session - -import ( - "bytes" - "crypto/tls" - "io/ioutil" - "net" - "net/http" - "net/http/httptest" - "os" - "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/stretchr/testify/assert" -) - -func createTLSServer(cert, key []byte, done <-chan struct{}) (*httptest.Server, error) { - c, err := tls.X509KeyPair(cert, key) - if err != nil { - return nil, err - } - - s := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - })) - s.TLS = &tls.Config{ - Certificates: []tls.Certificate{c}, - } - s.TLS.BuildNameToCertificate() - s.StartTLS() - - go func() { - <-done - s.Close() - }() - - return s, nil -} - -func setupTestCAFile(b []byte) (string, error) { - bundleFile, err := ioutil.TempFile(os.TempDir(), "aws-sdk-go-session-test") - if err != nil { - return "", err - } - - _, err = bundleFile.Write(b) - if err != nil { - return "", err - } - - defer bundleFile.Close() - return bundleFile.Name(), nil -} - -func TestNewSession_WithCustomCABundle_Env(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - done := make(chan struct{}) - server, err := createTLSServer(testTLSBundleCert, testTLSBundleKey, done) - assert.NoError(t, err) - - // Write bundle to file - caFilename, err := setupTestCAFile(testTLSBundleCA) - defer func() { - os.Remove(caFilename) - }() - assert.NoError(t, err) - - os.Setenv("AWS_CA_BUNDLE", caFilename) - - s, err := NewSession(&aws.Config{ - HTTPClient: &http.Client{}, - Endpoint: aws.String(server.URL), - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - }) - assert.NoError(t, err) - assert.NotNil(t, s) - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - assert.NoError(t, err) - - assert.Equal(t, http.StatusOK, resp.StatusCode) -} - -func TestNewSession_WithCustomCABundle_EnvNotExists(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - os.Setenv("AWS_CA_BUNDLE", "file-not-exists") - - s, err := NewSession() - assert.Error(t, err) - assert.Equal(t, "LoadCustomCABundleError", err.(awserr.Error).Code()) - assert.Nil(t, s) -} - -func TestNewSession_WithCustomCABundle_Option(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - done := make(chan struct{}) - server, err := createTLSServer(testTLSBundleCert, testTLSBundleKey, done) - assert.NoError(t, err) - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - HTTPClient: &http.Client{}, - Endpoint: aws.String(server.URL), - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - }, - CustomCABundle: bytes.NewReader(testTLSBundleCA), - }) - assert.NoError(t, err) - assert.NotNil(t, s) - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - assert.NoError(t, err) - - assert.Equal(t, http.StatusOK, resp.StatusCode) -} - -func TestNewSession_WithCustomCABundle_OptionPriority(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - done := make(chan struct{}) - server, err := createTLSServer(testTLSBundleCert, testTLSBundleKey, done) - assert.NoError(t, err) - - os.Setenv("AWS_CA_BUNDLE", "file-not-exists") - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - HTTPClient: &http.Client{}, - Endpoint: aws.String(server.URL), - Region: aws.String("mock-region"), - Credentials: credentials.AnonymousCredentials, - }, - CustomCABundle: bytes.NewReader(testTLSBundleCA), - }) - assert.NoError(t, err) - assert.NotNil(t, s) - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - assert.NoError(t, err) - - assert.Equal(t, http.StatusOK, resp.StatusCode) -} - -type mockRoundTripper struct{} - -func (m *mockRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { - return nil, nil -} - -func TestNewSession_WithCustomCABundle_UnsupportedTransport(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - HTTPClient: &http.Client{ - Transport: &mockRoundTripper{}, - }, - }, - CustomCABundle: bytes.NewReader(testTLSBundleCA), - }) - assert.Error(t, err) - assert.Equal(t, "LoadCustomCABundleError", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "transport unsupported type") - assert.Nil(t, s) -} - -func TestNewSession_WithCustomCABundle_TransportSet(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - done := make(chan struct{}) - server, err := createTLSServer(testTLSBundleCert, testTLSBundleKey, done) - assert.NoError(t, err) - - s, err := NewSessionWithOptions(Options{ - Config: aws.Config{ - Endpoint: aws.String(server.URL), - 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(testTLSBundleCA), - }) - assert.NoError(t, err) - assert.NotNil(t, s) - - req, _ := http.NewRequest("GET", *s.Config.Endpoint, nil) - resp, err := s.Config.HTTPClient.Do(req) - assert.NoError(t, err) - - assert.Equal(t, http.StatusOK, resp.StatusCode) -} - -/* Cert generation steps -# Create the CA key -openssl genrsa -des3 -out ca.key 1024 - -# Create the CA Cert -openssl req -new -sha256 -x509 -days 3650 \ - -subj "/C=GO/ST=Gopher/O=Testing ROOT CA" \ - -key ca.key -out ca.crt - -# Create config -cat > csr_details.txt <<-EOF - -[req] -default_bits = 1024 -prompt = no -default_md = sha256 -req_extensions = SAN -distinguished_name = dn - -[ dn ] -C=GO -ST=Gopher -O=Testing Certificate -OU=Testing IP - -[SAN] -subjectAltName = IP:127.0.0.1 -EOF - -# Create certificate signing request -openssl req -new -sha256 -nodes -newkey rsa:1024 \ - -config <( cat csr_details.txt ) \ - -keyout ia.key -out ia.csr - -# Create a signed certificate -openssl x509 -req -days 3650 \ - -CAcreateserial \ - -extfile <( cat csr_details.txt ) \ - -extensions SAN \ - -CA ca.crt -CAkey ca.key -in ia.csr -out ia.crt - -# Verify -openssl req -noout -text -in ia.csr -openssl x509 -noout -text -in ia.crt -*/ -var ( - // ca.crt - testTLSBundleCA = []byte(`-----BEGIN CERTIFICATE----- -MIICiTCCAfKgAwIBAgIJAJ5X1olt05XjMA0GCSqGSIb3DQEBCwUAMDgxCzAJBgNV -BAYTAkdPMQ8wDQYDVQQIEwZHb3BoZXIxGDAWBgNVBAoTD1Rlc3RpbmcgUk9PVCBD -QTAeFw0xNzAzMDkwMDAyMDZaFw0yNzAzMDcwMDAyMDZaMDgxCzAJBgNVBAYTAkdP -MQ8wDQYDVQQIEwZHb3BoZXIxGDAWBgNVBAoTD1Rlc3RpbmcgUk9PVCBDQTCBnzAN -BgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAw/8DN+t9XQR60jx42rsQ2WE2Dx85rb3n -GQxnKZZLNddsT8rDyxJNP18aFalbRbFlyln5fxWxZIblu9Xkm/HRhOpbSimSqo1y -uDx21NVZ1YsOvXpHby71jx3gPrrhSc/t/zikhi++6D/C6m1CiIGuiJ0GBiJxtrub -UBMXT0QtI2ECAwEAAaOBmjCBlzAdBgNVHQ4EFgQU8XG3X/YHBA6T04kdEkq6+4GV -YykwaAYDVR0jBGEwX4AU8XG3X/YHBA6T04kdEkq6+4GVYymhPKQ6MDgxCzAJBgNV -BAYTAkdPMQ8wDQYDVQQIEwZHb3BoZXIxGDAWBgNVBAoTD1Rlc3RpbmcgUk9PVCBD -QYIJAJ5X1olt05XjMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADgYEAeILv -z49+uxmPcfOZzonuOloRcpdvyjiXblYxbzz6ch8GsE7Q886FTZbvwbgLhzdwSVgG -G8WHkodDUsymVepdqAamS3f8PdCUk8xIk9mop8LgaB9Ns0/TssxDvMr3sOD2Grb3 -xyWymTWMcj6uCiEBKtnUp4rPiefcvCRYZ17/hLE= ------END CERTIFICATE----- -`) - - // ai.crt - testTLSBundleCert = []byte(`-----BEGIN CERTIFICATE----- -MIICGjCCAYOgAwIBAgIJAIIu+NOoxxM0MA0GCSqGSIb3DQEBBQUAMDgxCzAJBgNV -BAYTAkdPMQ8wDQYDVQQIEwZHb3BoZXIxGDAWBgNVBAoTD1Rlc3RpbmcgUk9PVCBD -QTAeFw0xNzAzMDkwMDAzMTRaFw0yNzAzMDcwMDAzMTRaMFExCzAJBgNVBAYTAkdP -MQ8wDQYDVQQIDAZHb3BoZXIxHDAaBgNVBAoME1Rlc3RpbmcgQ2VydGlmaWNhdGUx -EzARBgNVBAsMClRlc3RpbmcgSVAwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB -AN1hWHeioo/nASvbrjwCQzXCiWiEzGkw353NxsAB54/NqDL3LXNATtiSJu8kJBrm -Ah12IFLtWLGXjGjjYlHbQWnOR6awveeXnQZukJyRWh7m/Qlt9Ho0CgZE1U+832ac -5GWVldNxW1Lz4I+W9/ehzqe8I80RS6eLEKfUFXGiW+9RAgMBAAGjEzARMA8GA1Ud -EQQIMAaHBH8AAAEwDQYJKoZIhvcNAQEFBQADgYEAdF4WQHfVdPCbgv9sxgJjcR1H -Hgw9rZ47gO1IiIhzglnLXQ6QuemRiHeYFg4kjcYBk1DJguxzDTGnUwhUXOibAB+S -zssmrkdYYvn9aUhjc3XK3tjAoDpsPpeBeTBamuUKDHoH/dNRXxerZ8vu6uPR3Pgs -5v/KCV6IAEcvNyOXMPo= ------END CERTIFICATE----- -`) - - // ai.key - testTLSBundleKey = []byte(`-----BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDdYVh3oqKP5wEr2648AkM1wolohMxpMN+dzcbAAeePzagy9y1z -QE7YkibvJCQa5gIddiBS7Vixl4xo42JR20FpzkemsL3nl50GbpCckVoe5v0JbfR6 -NAoGRNVPvN9mnORllZXTcVtS8+CPlvf3oc6nvCPNEUunixCn1BVxolvvUQIDAQAB -AoGBAMISrcirddGrlLZLLrKC1ULS2T0cdkqdQtwHYn4+7S5+/z42vMx1iumHLsSk -rVY7X41OWkX4trFxhvEIrc/O48bo2zw78P7flTxHy14uxXnllU8cLThE29SlUU7j -AVBNxJZMsXMlS/DowwD4CjFe+x4Pu9wZcReF2Z9ntzMpySABAkEA+iWoJCPE2JpS -y78q3HYYgpNY3gF3JqQ0SI/zTNkb3YyEIUffEYq0Y9pK13HjKtdsSuX4osTIhQkS -+UgRp6tCAQJBAOKPYTfQ2FX8ijgUpHZRuEAVaxASAS0UATiLgzXxLvOh/VC2at5x -wjOX6sD65pPz/0D8Qj52Cq6Q1TQ+377SDVECQAIy0od+yPweXxvrUjUd1JlRMjbB -TIrKZqs8mKbUQapw0bh5KTy+O1elU4MRPS3jNtBxtP25PQnuSnxmZcFTgAECQFzg -DiiFcsn9FuRagfkHExMiNJuH5feGxeFaP9WzI144v9GAllrOI6Bm3JNzx2ZLlg4b -20Qju8lIEj6yr6JYFaECQHM1VSojGRKpOl9Ox/R4yYSA9RV5Gyn00/aJNxVYyPD5 -i3acL2joQm2kLD/LO8paJ4+iQdRXCOMMIpjxSNjGQjQ= ------END RSA PRIVATE KEY----- -`) -) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go index 660d9be..7ec66e7 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go @@ -1,97 +1,93 @@ /* -Package session provides configuration for the SDK's service clients. - -Sessions can be shared across all service clients that share the same base -configuration. The Session is built from the SDK's default configuration and -request handlers. - -Sessions should be cached when possible, because creating a new Session will -load all configuration values from the environment, and config files each time -the Session is created. Sharing the Session value across all of your service -clients will ensure the configuration is loaded the fewest number of times possible. - -Concurrency +Package session provides configuration for the SDK's service clients. Sessions +can be shared across service clients that share the same base configuration. Sessions are safe to use concurrently as long as the Session is not being -modified. The SDK will not modify the Session once the Session has been created. -Creating service clients concurrently from a shared Session is safe. - -Sessions from Shared Config - -Sessions can be created using the method above that will only load the -additional config if the AWS_SDK_LOAD_CONFIG environment variable is set. -Alternatively you can explicitly create a Session with shared config enabled. -To do this you can use NewSessionWithOptions to configure how the Session will -be created. Using the NewSessionWithOptions with SharedConfigState set to -SharedConfigEnabled will create the session as if the AWS_SDK_LOAD_CONFIG -environment variable was set. +modified. Sessions should be cached when possible, because creating a new +Session will load all configuration values from the environment, and config +files each time the Session is created. Sharing the Session value across all of +your service clients will ensure the configuration is loaded the fewest number +of times possible. -Creating Sessions - -When creating Sessions optional aws.Config values can be passed in that will -override the default, or loaded config values the Session is being created -with. This allows you to provide additional, or case based, configuration -as needed. +Sessions options from Shared Config By default NewSession will only load credentials from the shared credentials file (~/.aws/credentials). If the AWS_SDK_LOAD_CONFIG environment variable is set to a truthy value the Session will be created from the configuration values from the shared config (~/.aws/config) and shared credentials -(~/.aws/credentials) files. See the section Sessions from Shared Config for -more information. +(~/.aws/credentials) files. Using the NewSessionWithOptions with +SharedConfigState set to SharedConfigEnable will create the session as if the +AWS_SDK_LOAD_CONFIG environment variable was set. -Create a Session with the default config and request handlers. With credentials -region, and profile loaded from the environment and shared config automatically. -Requires the AWS_PROFILE to be set, or "default" is used. +Credential and config loading order - // Create Session - sess := session.Must(session.NewSession()) +The Session will attempt to load configuration and credentials from the +environment, configuration files, and other credential sources. The order +configuration is loaded in is: - // Create a Session with a custom region - sess := session.Must(session.NewSession(&aws.Config{ - Region: aws.String("us-east-1"), - })) + * Environment Variables + * Shared Credentials file + * Shared Configuration file (if SharedConfig is enabled) + * EC2 Instance Metadata (credentials only) - // Create a S3 client instance from a session - sess := session.Must(session.NewSession()) +The Environment variables for credentials will have precedence over shared +config even if SharedConfig is enabled. To override this behavior, and use +shared config credentials instead specify the session.Options.Profile, (e.g. +when using credential_source=Environment to assume a role). + + sess, err := session.NewSessionWithOptions(session.Options{ + Profile: "myProfile", + }) - svc := s3.New(sess) +Creating Sessions -Create Session With Option Overrides +Creating a Session without additional options will load credentials region, and +profile loaded from the environment and shared config automatically. See, +"Environment Variables" section for information on environment variables used +by Session. -In addition to NewSession, Sessions can be created using NewSessionWithOptions. -This func allows you to control and override how the Session will be created -through code instead of being driven by environment variables only. + // Create Session + sess, err := session.NewSession() -Use NewSessionWithOptions when you want to provide the config profile, or -override the shared config state (AWS_SDK_LOAD_CONFIG). + +When creating Sessions optional aws.Config values can be passed in that will +override the default, or loaded, config values the Session is being created +with. This allows you to provide additional, or case based, configuration +as needed. + + // Create a Session with a custom region + sess, err := session.NewSession(&aws.Config{ + Region: aws.String("us-west-2"), + }) + +Use NewSessionWithOptions to provide additional configuration driving how the +Session's configuration will be loaded. Such as, specifying shared config +profile, or override the shared config state, (AWS_SDK_LOAD_CONFIG). // Equivalent to session.NewSession() - sess := session.Must(session.NewSessionWithOptions(session.Options{ + sess, err := session.NewSessionWithOptions(session.Options{ // Options - })) + }) - // Specify profile to load for the session's config - sess := session.Must(session.NewSessionWithOptions(session.Options{ - Profile: "profile_name", - })) + sess, err := session.NewSessionWithOptions(session.Options{ + // Specify profile to load for the session's config + Profile: "profile_name", - // Specify profile for config and region for requests - sess := session.Must(session.NewSessionWithOptions(session.Options{ - Config: aws.Config{Region: aws.String("us-east-1")}, - Profile: "profile_name", - })) + // Provide SDK Config options, such as Region. + Config: aws.Config{ + Region: aws.String("us-west-2"), + }, - // Force enable Shared Config support - sess := session.Must(session.NewSessionWithOptions(session.Options{ - SharedConfigState: SharedConfigEnable, - })) + // Force enable Shared Config support + SharedConfigState: session.SharedConfigEnable, + }) Adding Handlers -You can add handlers to a session for processing HTTP requests. All service -clients that use the session inherit the handlers. For example, the following -handler logs every request and its payload made by a service client: +You can add handlers to a session to decorate API operation, (e.g. adding HTTP +headers). All clients that use the Session receive a copy of the Session's +handlers. For example, the following request handler added to the Session logs +every requests made. // Create a session, and add additional handlers for all service // clients created with the Session to inherit. Adds logging handler. @@ -99,22 +95,15 @@ handler logs every request and its payload made by a service client: sess.Handlers.Send.PushFront(func(r *request.Request) { // Log every request made and its payload - logger.Println("Request: %s/%s, Payload: %s", + logger.Printf("Request: %s/%s, Params: %s", r.ClientInfo.ServiceName, r.Operation, r.Params) }) -Deprecated "New" function - -The New session function has been deprecated because it does not provide good -way to return errors that occur when loading the configuration files and values. -Because of this, NewSession was created so errors can be retrieved when -creating a session fails. - Shared Config Fields -By default the SDK will only load the shared credentials file's (~/.aws/credentials) -credentials values, and all other config is provided by the environment variables, -SDK defaults, and user provided aws.Config values. +By default the SDK will only load the shared credentials file's +(~/.aws/credentials) credentials values, and all other config is provided by +the environment variables, SDK defaults, and user provided aws.Config values. If the AWS_SDK_LOAD_CONFIG environment variable is set, or SharedConfigEnable option is used to create the Session the full shared config values will be @@ -124,26 +113,32 @@ file (~/.aws/config) and shared credentials file (~/.aws/credentials). Both files have the same format. If both config files are present the configuration from both files will be -read. The Session will be created from configuration values from the shared -credentials file (~/.aws/credentials) over those in the shared credentials -file (~/.aws/config). +read. The Session will be created from configuration values from the shared +credentials file (~/.aws/credentials) over those in the shared config file +(~/.aws/config). -Credentials are the values the SDK should use for authenticating requests with -AWS Services. They arfrom a configuration file will need to include both -aws_access_key_id and aws_secret_access_key must be provided together in the -same file to be considered valid. The values will be ignored if not a complete -group. aws_session_token is an optional field that can be provided if both of -the other two fields are also provided. +Credentials are the values the SDK uses to authenticating requests with AWS +Services. When specified in a file, both aws_access_key_id and +aws_secret_access_key must be provided together in the same file to be +considered valid. They will be ignored if both are not present. +aws_session_token is an optional field that can be provided in addition to the +other two fields. aws_access_key_id = AKID aws_secret_access_key = SECRET aws_session_token = TOKEN -Assume Role values allow you to configure the SDK to assume an IAM role using -a set of credentials provided in a config file via the source_profile field. -Both "role_arn" and "source_profile" are required. The SDK supports assuming -a role with MFA token if the session option AssumeRoleTokenProvider -is set. + ; region only supported if SharedConfigEnabled. + region = us-east-1 + +Assume Role configuration + +The role_arn field allows you to configure the SDK to assume an IAM role using +a set of credentials from another source. Such as when paired with static +credentials, "profile_source", "credential_process", or "credential_source" +fields. If "role_arn" is provided, a source of credentials must also be +specified, such as "source_profile", "credential_source", or +"credential_process". role_arn = arn:aws:iam:::role/ source_profile = profile_with_creds @@ -151,40 +146,16 @@ is set. mfa_serial = role_session_name = session_name -Region is the region the SDK should use for looking up AWS service endpoints -and signing requests. - - region = us-east-1 - -Assume Role with MFA token -To create a session with support for assuming an IAM role with MFA set the -session option AssumeRoleTokenProvider to a function that will prompt for the -MFA token code when the SDK assumes the role and refreshes the role's credentials. -This allows you to configure the SDK via the shared config to assumea role -with MFA tokens. - -In order for the SDK to assume a role with MFA the SharedConfigState -session option must be set to SharedConfigEnable, or AWS_SDK_LOAD_CONFIG -environment variable set. - -The shared configuration instructs the SDK to assume an IAM role with MFA -when the mfa_serial configuration field is set in the shared config -(~/.aws/config) or shared credentials (~/.aws/credentials) file. - -If mfa_serial is set in the configuration, the SDK will assume the role, and -the AssumeRoleTokenProvider session option is not set an an error will -be returned when creating the session. +The SDK supports assuming a role with MFA token. If "mfa_serial" is set, you +must also set the Session Option.AssumeRoleTokenProvider. The Session will fail +to load if the AssumeRoleTokenProvider is not specified. sess := session.Must(session.NewSessionWithOptions(session.Options{ AssumeRoleTokenProvider: stscreds.StdinTokenProvider, })) - // Create service client value configured for credentials - // from assumed role. - svc := s3.New(sess) - -To setup assume role outside of a session see the stscrds.AssumeRoleProvider +To setup Assume Role outside of a session see the stscreds.AssumeRoleProvider documentation. Environment Variables diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go index e6278a7..c1e0e9c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go @@ -1,13 +1,20 @@ package session import ( + "fmt" "os" - "path/filepath" "strconv" + "strings" + "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" ) +// EnvProviderName provides a name of the provider when config is loaded from environment. +const EnvProviderName = "EnvConfigCredentials" + // envConfig is a collection of environment values the SDK will read // setup config from. All environment values are optional. But some values // such as credentials require multiple values to be complete or the values @@ -76,8 +83,8 @@ type envConfig struct { // AWS_CONFIG_FILE=$HOME/my_shared_config SharedConfigFile string - // Sets the path to a custom Credentials Authroity (CA) Bundle PEM file - // that the SDK will use instead of the the system's root CA bundle. + // Sets the path to a custom Credentials Authority (CA) Bundle PEM file + // that the SDK will use instead of the system's root CA bundle. // Only use this if you want to configure the SDK to use a custom set // of CAs. // @@ -93,9 +100,69 @@ type envConfig struct { // // AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle CustomCABundle string + + csmEnabled string + CSMEnabled *bool + CSMPort string + CSMHost string + CSMClientID string + + // Enables endpoint discovery via environment variables. + // + // AWS_ENABLE_ENDPOINT_DISCOVERY=true + EnableEndpointDiscovery *bool + enableEndpointDiscovery string + + // Specifies the WebIdentity token the SDK should use to assume a role + // with. + // + // AWS_WEB_IDENTITY_TOKEN_FILE=file_path + WebIdentityTokenFilePath string + + // Specifies the IAM role arn to use when assuming an role. + // + // AWS_ROLE_ARN=role_arn + RoleARN string + + // Specifies the IAM role session name to use when assuming a role. + // + // AWS_ROLE_SESSION_NAME=session_name + RoleSessionName string + + // Specifies the STS Regional Endpoint flag for the SDK to resolve the endpoint + // for a service. + // + // AWS_STS_REGIONAL_ENDPOINTS=regional + // This can take value as `regional` or `legacy` + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // Specifies the S3 Regional Endpoint flag for the SDK to resolve the + // endpoint for a service. + // + // AWS_S3_US_EAST_1_REGIONAL_ENDPOINT=regional + // This can take value as `regional` or `legacy` + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // AWS_S3_USE_ARN_REGION=true + S3UseARNRegion bool } var ( + csmEnabledEnvKey = []string{ + "AWS_CSM_ENABLED", + } + csmHostEnvKey = []string{ + "AWS_CSM_HOST", + } + csmPortEnvKey = []string{ + "AWS_CSM_PORT", + } + csmClientIDEnvKey = []string{ + "AWS_CSM_CLIENT_ID", + } credAccessEnvKey = []string{ "AWS_ACCESS_KEY_ID", "AWS_ACCESS_KEY", @@ -108,6 +175,10 @@ var ( "AWS_SESSION_TOKEN", } + enableEndpointDiscoveryEnvKey = []string{ + "AWS_ENABLE_ENDPOINT_DISCOVERY", + } + regionEnvKeys = []string{ "AWS_REGION", "AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set @@ -116,6 +187,30 @@ var ( "AWS_PROFILE", "AWS_DEFAULT_PROFILE", // Only read if AWS_SDK_LOAD_CONFIG is also set } + sharedCredsFileEnvKey = []string{ + "AWS_SHARED_CREDENTIALS_FILE", + } + sharedConfigFileEnvKey = []string{ + "AWS_CONFIG_FILE", + } + webIdentityTokenFilePathEnvKey = []string{ + "AWS_WEB_IDENTITY_TOKEN_FILE", + } + roleARNEnvKey = []string{ + "AWS_ROLE_ARN", + } + roleSessionNameEnvKey = []string{ + "AWS_ROLE_SESSION_NAME", + } + stsRegionalEndpointKey = []string{ + "AWS_STS_REGIONAL_ENDPOINTS", + } + s3UsEast1RegionalEndpoint = []string{ + "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT", + } + s3UseARNRegionEnvKey = []string{ + "AWS_S3_USE_ARN_REGION", + } ) // loadEnvConfig retrieves the SDK's environment configuration. @@ -124,7 +219,7 @@ var ( // If the environment variable `AWS_SDK_LOAD_CONFIG` is set to a truthy value // the shared SDK config will be loaded in addition to the SDK's specific // configuration values. -func loadEnvConfig() envConfig { +func loadEnvConfig() (envConfig, error) { enableSharedConfig, _ := strconv.ParseBool(os.Getenv("AWS_SDK_LOAD_CONFIG")) return envConfigLoad(enableSharedConfig) } @@ -135,24 +230,42 @@ func loadEnvConfig() envConfig { // Loads the shared configuration in addition to the SDK's specific configuration. // This will load the same values as `loadEnvConfig` if the `AWS_SDK_LOAD_CONFIG` // environment variable is set. -func loadSharedEnvConfig() envConfig { +func loadSharedEnvConfig() (envConfig, error) { return envConfigLoad(true) } -func envConfigLoad(enableSharedConfig bool) envConfig { +func envConfigLoad(enableSharedConfig bool) (envConfig, error) { cfg := envConfig{} cfg.EnableSharedConfig = enableSharedConfig - setFromEnvVal(&cfg.Creds.AccessKeyID, credAccessEnvKey) - setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey) - setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey) + // Static environment credentials + var creds credentials.Value + setFromEnvVal(&creds.AccessKeyID, credAccessEnvKey) + setFromEnvVal(&creds.SecretAccessKey, credSecretEnvKey) + setFromEnvVal(&creds.SessionToken, credSessionEnvKey) + if creds.HasKeys() { + // Require logical grouping of credentials + creds.ProviderName = EnvProviderName + cfg.Creds = creds + } + + // Role Metadata + setFromEnvVal(&cfg.RoleARN, roleARNEnvKey) + setFromEnvVal(&cfg.RoleSessionName, roleSessionNameEnvKey) - // Require logical grouping of credentials - if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 { - cfg.Creds = credentials.Value{} - } else { - cfg.Creds.ProviderName = "EnvConfigCredentials" + // Web identity environment variables + setFromEnvVal(&cfg.WebIdentityTokenFilePath, webIdentityTokenFilePathEnvKey) + + // CSM environment variables + setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey) + setFromEnvVal(&cfg.CSMHost, csmHostEnvKey) + setFromEnvVal(&cfg.CSMPort, csmPortEnvKey) + setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey) + + if len(cfg.csmEnabled) != 0 { + v, _ := strconv.ParseBool(cfg.csmEnabled) + cfg.CSMEnabled = &v } regionKeys := regionEnvKeys @@ -165,44 +278,68 @@ func envConfigLoad(enableSharedConfig bool) envConfig { setFromEnvVal(&cfg.Region, regionKeys) setFromEnvVal(&cfg.Profile, profileKeys) - cfg.SharedCredentialsFile = sharedCredentialsFilename() - cfg.SharedConfigFile = sharedConfigFilename() + // endpoint discovery is in reference to it being enabled. + setFromEnvVal(&cfg.enableEndpointDiscovery, enableEndpointDiscoveryEnvKey) + if len(cfg.enableEndpointDiscovery) > 0 { + cfg.EnableEndpointDiscovery = aws.Bool(cfg.enableEndpointDiscovery != "false") + } - cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE") + setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey) + setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey) - return cfg -} + if len(cfg.SharedCredentialsFile) == 0 { + cfg.SharedCredentialsFile = defaults.SharedCredentialsFilename() + } + if len(cfg.SharedConfigFile) == 0 { + cfg.SharedConfigFile = defaults.SharedConfigFilename() + } -func setFromEnvVal(dst *string, keys []string) { - for _, k := range keys { - if v := os.Getenv(k); len(v) > 0 { - *dst = v - break + cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE") + + var err error + // STS Regional Endpoint variable + for _, k := range stsRegionalEndpointKey { + if v := os.Getenv(k); len(v) != 0 { + cfg.STSRegionalEndpoint, err = endpoints.GetSTSRegionalEndpoint(v) + if err != nil { + return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) + } } } -} -func sharedCredentialsFilename() string { - if name := os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); len(name) > 0 { - return name + // S3 Regional Endpoint variable + for _, k := range s3UsEast1RegionalEndpoint { + if v := os.Getenv(k); len(v) != 0 { + cfg.S3UsEast1RegionalEndpoint, err = endpoints.GetS3UsEast1RegionalEndpoint(v) + if err != nil { + return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) + } + } } - return filepath.Join(userHomeDir(), ".aws", "credentials") -} - -func sharedConfigFilename() string { - if name := os.Getenv("AWS_CONFIG_FILE"); len(name) > 0 { - return name + var s3UseARNRegion string + setFromEnvVal(&s3UseARNRegion, s3UseARNRegionEnvKey) + if len(s3UseARNRegion) != 0 { + switch { + case strings.EqualFold(s3UseARNRegion, "false"): + cfg.S3UseARNRegion = false + case strings.EqualFold(s3UseARNRegion, "true"): + cfg.S3UseARNRegion = true + default: + return envConfig{}, fmt.Errorf( + "invalid value for environment variable, %s=%s, need true or false", + s3UseARNRegionEnvKey[0], s3UseARNRegion) + } } - return filepath.Join(userHomeDir(), ".aws", "config") + return cfg, nil } -func userHomeDir() string { - homeDir := os.Getenv("HOME") // *nix - if len(homeDir) == 0 { // windows - homeDir = os.Getenv("USERPROFILE") +func setFromEnvVal(dst *string, keys []string) { + for _, k := range keys { + if v := os.Getenv(k); len(v) != 0 { + *dst = v + break + } } - - return homeDir } 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 162a710..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config_test.go +++ /dev/null @@ -1,291 +0,0 @@ -package session - -import ( - "os" - "path/filepath" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/stretchr/testify/assert" -) - -func TestLoadEnvConfig_Creds(t *testing.T) { - env := stashEnv() - defer popEnv(env) - - 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 _, c := range cases { - os.Clearenv() - - for k, v := range c.Env { - os.Setenv(k, v) - } - - cfg := loadEnvConfig() - assert.Equal(t, c.Val, cfg.Creds) - } -} - -func TestLoadEnvConfig(t *testing.T) { - env := stashEnv() - defer popEnv(env) - - cases := []struct { - Env map[string]string - Region, Profile string - CustomCABundle string - UseSharedConfigCall bool - }{ - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_PROFILE": "profile", - }, - Region: "region", Profile: "profile", - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_DEFAULT_REGION": "default_region", - "AWS_PROFILE": "profile", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - Region: "region", Profile: "profile", - }, - { - 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", - }, - Region: "region", Profile: "profile", - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - "AWS_SDK_LOAD_CONFIG": "1", - }, - Region: "default_region", Profile: "default_profile", - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_PROFILE": "profile", - }, - Region: "region", Profile: "profile", - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_REGION": "region", - "AWS_DEFAULT_REGION": "default_region", - "AWS_PROFILE": "profile", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - Region: "region", Profile: "profile", - 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", - }, - Region: "region", Profile: "profile", - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - }, - Region: "default_region", Profile: "default_profile", - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_DEFAULT_REGION": "default_region", - "AWS_DEFAULT_PROFILE": "default_profile", - "AWS_SDK_LOAD_CONFIG": "1", - }, - Region: "default_region", Profile: "default_profile", - UseSharedConfigCall: true, - }, - { - Env: map[string]string{ - "AWS_CA_BUNDLE": "custom_ca_bundle", - }, - CustomCABundle: "custom_ca_bundle", - }, - { - Env: map[string]string{ - "AWS_CA_BUNDLE": "custom_ca_bundle", - }, - CustomCABundle: "custom_ca_bundle", - UseSharedConfigCall: true, - }, - } - - for _, c := range cases { - os.Clearenv() - - for k, v := range c.Env { - os.Setenv(k, v) - } - - var cfg envConfig - if c.UseSharedConfigCall { - cfg = loadSharedEnvConfig() - } else { - cfg = loadEnvConfig() - } - - assert.Equal(t, c.Region, cfg.Region) - assert.Equal(t, c.Profile, cfg.Profile) - assert.Equal(t, c.CustomCABundle, cfg.CustomCABundle) - } -} - -func TestSharedCredsFilename(t *testing.T) { - env := stashEnv() - defer popEnv(env) - - os.Setenv("USERPROFILE", "profile_dir") - expect := filepath.Join("profile_dir", ".aws", "credentials") - name := sharedCredentialsFilename() - assert.Equal(t, expect, name) - - os.Setenv("HOME", "home_dir") - expect = filepath.Join("home_dir", ".aws", "credentials") - name = sharedCredentialsFilename() - assert.Equal(t, expect, name) - - expect = filepath.Join("path/to/credentials/file") - os.Setenv("AWS_SHARED_CREDENTIALS_FILE", expect) - name = sharedCredentialsFilename() - assert.Equal(t, expect, name) -} - -func TestSharedConfigFilename(t *testing.T) { - env := stashEnv() - defer popEnv(env) - - os.Setenv("USERPROFILE", "profile_dir") - expect := filepath.Join("profile_dir", ".aws", "config") - name := sharedConfigFilename() - assert.Equal(t, expect, name) - - os.Setenv("HOME", "home_dir") - expect = filepath.Join("home_dir", ".aws", "config") - name = sharedConfigFilename() - assert.Equal(t, expect, name) - - expect = filepath.Join("path/to/config/file") - os.Setenv("AWS_CONFIG_FILE", expect) - name = sharedConfigFilename() - assert.Equal(t, expect, name) -} - -func TestSetEnvValue(t *testing.T) { - env := stashEnv() - defer popEnv(env) - - 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", - }) - - assert.Equal(t, "2", dst) -} - -func stashEnv() []string { - env := os.Environ() - os.Clearenv() - - return env -} - -func popEnv(env []string) { - os.Clearenv() - - for _, e := range env { - p := strings.SplitN(e, "=", 2) - os.Setenv(p[0], p[1]) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index 96c740d..915e62c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -8,25 +8,43 @@ import ( "io/ioutil" "net/http" "os" + "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/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/csm" "github.com/aws/aws-sdk-go/aws/defaults" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" ) +const ( + // ErrCodeSharedConfig represents an error that occurs in the shared + // configuration logic + ErrCodeSharedConfig = "SharedConfigErr" +) + +// ErrSharedConfigSourceCollision will be returned if a section contains both +// source_profile and credential_source +var ErrSharedConfigSourceCollision = awserr.New(ErrCodeSharedConfig, "only source profile or credential source can be specified, not both", nil) + +// ErrSharedConfigECSContainerEnvVarEmpty will be returned if the environment +// variables are empty and Environment was set as the credential source +var ErrSharedConfigECSContainerEnvVarEmpty = awserr.New(ErrCodeSharedConfig, "EcsContainer was specified as the credential_source, but 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set", nil) + +// ErrSharedConfigInvalidCredSource will be returned if an invalid credential source was provided +var ErrSharedConfigInvalidCredSource = awserr.New(ErrCodeSharedConfig, "credential source values must be EcsContainer, Ec2InstanceMetadata, or Environment", nil) + // A Session provides a central location to create service clients from and // store configurations and request handlers for those services. // // Sessions are safe to create service clients concurrently, but it is not safe // to mutate the Session concurrently. // -// The Session satisfies the service client's client.ClientConfigProvider. +// The Session satisfies the service client's client.ConfigProvider. type Session struct { Config *aws.Config Handlers request.Handlers @@ -55,10 +73,15 @@ type Session struct { // func is called instead of waiting to receive an error until a request is made. func New(cfgs ...*aws.Config) *Session { // load initial config from environment - envCfg := loadEnvConfig() + envCfg, envErr := loadEnvConfig() if envCfg.EnableSharedConfig { - s, err := newSession(Options{}, envCfg, cfgs...) + var cfg aws.Config + cfg.MergeIn(cfgs...) + s, err := NewSessionWithOptions(Options{ + Config: cfg, + SharedConfigState: SharedConfigEnable, + }) if err != nil { // Old session.New expected all errors to be discovered when // a request is made, and would report the errors then. This @@ -70,16 +93,31 @@ func New(cfgs ...*aws.Config) *Session { // Session creation failed, need to report the error and prevent // any requests from succeeding. s = &Session{Config: defaults.Config()} - s.Config.MergeIn(cfgs...) - s.Config.Logger.Log("ERROR:", msg, "Error:", err) - s.Handlers.Validate.PushBack(func(r *request.Request) { - r.Error = err - }) + s.logDeprecatedNewSessionError(msg, err, cfgs) } + return s } - return deprecatedNewSession(cfgs...) + s := deprecatedNewSession(cfgs...) + if envErr != nil { + msg := "failed to load env config" + s.logDeprecatedNewSessionError(msg, envErr, cfgs) + } + + if csmCfg, err := loadCSMConfig(envCfg, []string{}); err != nil { + if l := s.Config.Logger; l != nil { + l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) + } + } else if csmCfg.Enabled { + err := enableCSM(&s.Handlers, csmCfg, s.Config.Logger) + if err != nil { + msg := "failed to enable CSM" + s.logDeprecatedNewSessionError(msg, err, cfgs) + } + } + + return s } // NewSession returns a new Session created from SDK defaults, config files, @@ -95,7 +133,7 @@ func New(cfgs ...*aws.Config) *Session { // to be built with retrieving credentials with AssumeRole set in the config. // // See the NewSessionWithOptions func for information on how to override or -// control through code how the Session will be created. Such as specifying the +// control through code how the Session will be created, such as specifying the // config profile, and controlling if shared config is enabled or not. func NewSession(cfgs ...*aws.Config) (*Session, error) { opts := Options{} @@ -155,6 +193,10 @@ type Options struct { // and enable or disable the shared config functionality. SharedConfigState SharedConfigState + // Ordered list of files the session will load configuration from. + // It will override environment variable AWS_SHARED_CREDENTIALS_FILE, AWS_CONFIG_FILE. + SharedConfigFiles []string + // When the SDK's shared config is configured to assume a role with MFA // this option is required in order to provide the mechanism that will // retrieve the MFA token. There is no default value for this field. If @@ -175,6 +217,12 @@ type Options struct { // the config enables assume role wit MFA via the mfa_serial field. AssumeRoleTokenProvider func() (string, error) + // When the SDK's shared config is configured to assume a role this option + // may be provided to set the expiry duration of the STS credentials. + // Defaults to 15 minutes if not set as documented in the + // stscreds.AssumeRoleProvider. + AssumeRoleDuration time.Duration + // Reader for a custom Credentials Authority (CA) bundle in PEM format that // the SDK will use instead of the default system's root CA bundle. Use this // only if you want to replace the CA bundle the SDK uses for TLS requests. @@ -189,6 +237,12 @@ type Options struct { // to also enable this feature. CustomCABundle session option field has priority // over the AWS_CA_BUNDLE environment variable, and will be used if both are set. CustomCABundle io.Reader + + // The handlers that the session and all API clients will be created with. + // This must be a complete set of handlers. Use the defaults.Handlers() + // function to initialize this value before changing the handlers to be + // used by the SDK. + Handlers request.Handlers } // NewSessionWithOptions returns a new Session created from SDK defaults, config files, @@ -218,17 +272,24 @@ type Options struct { // // // Force enable Shared Config support // sess := session.Must(session.NewSessionWithOptions(session.Options{ -// SharedConfigState: SharedConfigEnable, +// SharedConfigState: session.SharedConfigEnable, // })) func NewSessionWithOptions(opts Options) (*Session, error) { var envCfg envConfig + var err error if opts.SharedConfigState == SharedConfigEnable { - envCfg = loadSharedEnvConfig() + envCfg, err = loadSharedEnvConfig() + if err != nil { + return nil, fmt.Errorf("failed to load shared config, %v", err) + } } else { - envCfg = loadEnvConfig() + envCfg, err = loadEnvConfig() + if err != nil { + return nil, fmt.Errorf("failed to load environment config, %v", err) + } } - if len(opts.Profile) > 0 { + if len(opts.Profile) != 0 { envCfg.Profile = opts.Profile } @@ -291,32 +352,63 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session { } initHandlers(s) - return s } +func enableCSM(handlers *request.Handlers, cfg csmConfig, logger aws.Logger) error { + if logger != nil { + logger.Log("Enabling CSM") + } + + r, err := csm.Start(cfg.ClientID, csm.AddressWithDefaults(cfg.Host, cfg.Port)) + if err != nil { + return err + } + r.InjectHandlers(handlers) + + return nil +} + func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) { cfg := defaults.Config() - handlers := defaults.Handlers() + + handlers := opts.Handlers + if handlers.IsEmpty() { + handlers = defaults.Handlers() + } // Get a merged version of the user provided config to determine if // credentials were. userCfg := &aws.Config{} userCfg.MergeIn(cfgs...) + cfg.MergeIn(userCfg) - // Order config files will be loaded in with later files overwriting + // Ordered config files will be loaded in with later files overwriting // previous config file values. - cfgFiles := []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile} - if !envCfg.EnableSharedConfig { - // The shared config file (~/.aws/config) is only loaded if instructed - // to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG). - cfgFiles = cfgFiles[1:] + var cfgFiles []string + if opts.SharedConfigFiles != nil { + cfgFiles = opts.SharedConfigFiles + } else { + cfgFiles = []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile} + if !envCfg.EnableSharedConfig { + // The shared config file (~/.aws/config) is only loaded if instructed + // to load via the envConfig.EnableSharedConfig (AWS_SDK_LOAD_CONFIG). + cfgFiles = cfgFiles[1:] + } } // Load additional config from file(s) - sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles) + sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles, envCfg.EnableSharedConfig) if err != nil { - return nil, err + if len(envCfg.Profile) == 0 && !envCfg.EnableSharedConfig && (envCfg.Creds.HasKeys() || userCfg.Credentials != nil) { + // Special case where the user has not explicitly specified an AWS_PROFILE, + // or session.Options.profile, shared config is not enabled, and the + // environment has credentials, allow the shared config file to fail to + // load since the user has already provided credentials, and nothing else + // is required to be read file. Github(aws/aws-sdk-go#2455) + } else if _, ok := err.(SharedConfigProfileNotExistsError); !ok { + return nil, err + } } if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil { @@ -330,6 +422,17 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, initHandlers(s) + if csmCfg, err := loadCSMConfig(envCfg, cfgFiles); err != nil { + if l := s.Config.Logger; l != nil { + l.Log(fmt.Sprintf("ERROR: failed to load CSM configuration, %v", err)) + } + } else if csmCfg.Enabled { + err = enableCSM(&s.Handlers, csmCfg, s.Config.Logger) + if err != nil { + return nil, err + } + } + // Setup HTTP client with custom cert bundle if enabled if opts.CustomCABundle != nil { if err := loadCustomCABundle(s, opts.CustomCABundle); err != nil { @@ -340,6 +443,46 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, return s, nil } +type csmConfig struct { + Enabled bool + Host string + Port string + ClientID string +} + +var csmProfileName = "aws_csm" + +func loadCSMConfig(envCfg envConfig, cfgFiles []string) (csmConfig, error) { + if envCfg.CSMEnabled != nil { + if *envCfg.CSMEnabled { + return csmConfig{ + Enabled: true, + ClientID: envCfg.CSMClientID, + Host: envCfg.CSMHost, + Port: envCfg.CSMPort, + }, nil + } + return csmConfig{}, nil + } + + sharedCfg, err := loadSharedConfig(csmProfileName, cfgFiles, false) + if err != nil { + if _, ok := err.(SharedConfigProfileNotExistsError); !ok { + return csmConfig{}, err + } + } + if sharedCfg.CSMEnabled != nil && *sharedCfg.CSMEnabled == true { + return csmConfig{ + Enabled: true, + ClientID: sharedCfg.CSMClientID, + Host: sharedCfg.CSMHost, + Port: sharedCfg.CSMPort, + }, nil + } + + return csmConfig{}, nil +} + func loadCustomCABundle(s *Session, bundle io.Reader) error { var t *http.Transport switch v := s.Config.HTTPClient.Transport.(type) { @@ -352,7 +495,10 @@ func loadCustomCABundle(s *Session, bundle io.Reader) error { } } if t == nil { - t = &http.Transport{} + // Nil transport implies `http.DefaultTransport` should be used. Since + // the SDK cannot modify, nor copy the `DefaultTransport` specifying + // the values the next closest behavior. + t = getCABundleTransport() } p, err := loadCertPool(bundle) @@ -385,9 +531,11 @@ func loadCertPool(r io.Reader) (*x509.CertPool, error) { return p, nil } -func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options) error { - // Merge in user provided configuration - cfg.MergeIn(userCfg) +func mergeConfigSrcs(cfg, userCfg *aws.Config, + envCfg envConfig, sharedCfg sharedConfig, + handlers request.Handlers, + sessOpts Options, +) error { // Region if not already set by user if len(aws.StringValue(cfg.Region)) == 0 { @@ -398,101 +546,67 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share } } - // Configure credentials if not already set - if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { - if len(envCfg.Creds.AccessKeyID) > 0 { - cfg.Credentials = credentials.NewStaticCredentialsFromCreds( - envCfg.Creds, - ) - } else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil { - cfgCp := *cfg - cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds( - sharedCfg.AssumeRoleSource.Creds, - ) - if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil { - // AssumeRole Token provider is required if doing Assume Role - // with MFA. - return AssumeRoleTokenProviderNotSetError{} - } - cfg.Credentials = stscreds.NewCredentials( - &Session{ - Config: &cfgCp, - Handlers: handlers.Copy(), - }, - sharedCfg.AssumeRole.RoleARN, - func(opt *stscreds.AssumeRoleProvider) { - opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName - - // Assume role with external ID - if len(sharedCfg.AssumeRole.ExternalID) > 0 { - opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID) - } - - // Assume role with MFA - if len(sharedCfg.AssumeRole.MFASerial) > 0 { - opt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial) - opt.TokenProvider = sessOpts.AssumeRoleTokenProvider - } - }, - ) - } else if len(sharedCfg.Creds.AccessKeyID) > 0 { - cfg.Credentials = credentials.NewStaticCredentialsFromCreds( - sharedCfg.Creds, - ) - } else { - // Fallback to default credentials provider, include mock errors - // for the credential chain so user can identify why credentials - // failed to be retrieved. - cfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{ - VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: []credentials.Provider{ - &credProviderError{Err: awserr.New("EnvAccessKeyNotFound", "failed to find credentials in the environment.", nil)}, - &credProviderError{Err: awserr.New("SharedCredsLoad", fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil)}, - defaults.RemoteCredProvider(*cfg, handlers), - }, - }) + if cfg.EnableEndpointDiscovery == nil { + if envCfg.EnableEndpointDiscovery != nil { + cfg.WithEndpointDiscovery(*envCfg.EnableEndpointDiscovery) + } else if envCfg.EnableSharedConfig && sharedCfg.EnableEndpointDiscovery != nil { + cfg.WithEndpointDiscovery(*sharedCfg.EnableEndpointDiscovery) } } - return nil -} - -// AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the -// MFAToken option is not set when shared config is configured load assume a -// role with an MFA token. -type AssumeRoleTokenProviderNotSetError struct{} - -// Code is the short id of the error. -func (e AssumeRoleTokenProviderNotSetError) Code() string { - return "AssumeRoleTokenProviderNotSetError" -} + // Regional Endpoint flag for STS endpoint resolving + mergeSTSRegionalEndpointConfig(cfg, []endpoints.STSRegionalEndpoint{ + userCfg.STSRegionalEndpoint, + envCfg.STSRegionalEndpoint, + sharedCfg.STSRegionalEndpoint, + endpoints.LegacySTSEndpoint, + }) + + // Regional Endpoint flag for S3 endpoint resolving + mergeS3UsEast1RegionalEndpointConfig(cfg, []endpoints.S3UsEast1RegionalEndpoint{ + userCfg.S3UsEast1RegionalEndpoint, + envCfg.S3UsEast1RegionalEndpoint, + sharedCfg.S3UsEast1RegionalEndpoint, + endpoints.LegacyS3UsEast1Endpoint, + }) + + // Configure credentials if not already set by the user when creating the + // Session. + if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { + creds, err := resolveCredentials(cfg, envCfg, sharedCfg, handlers, sessOpts) + if err != nil { + return err + } + cfg.Credentials = creds + } -// Message is the description of the error -func (e AssumeRoleTokenProviderNotSetError) Message() string { - return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.") -} + cfg.S3UseARNRegion = userCfg.S3UseARNRegion + if cfg.S3UseARNRegion == nil { + cfg.S3UseARNRegion = &envCfg.S3UseARNRegion + } + if cfg.S3UseARNRegion == nil { + cfg.S3UseARNRegion = &sharedCfg.S3UseARNRegion + } -// OrigErr is the underlying error that caused the failure. -func (e AssumeRoleTokenProviderNotSetError) OrigErr() error { return nil } -// Error satisfies the error interface. -func (e AssumeRoleTokenProviderNotSetError) Error() string { - return awserr.SprintError(e.Code(), e.Message(), "", nil) -} - -type credProviderError struct { - Err error +func mergeSTSRegionalEndpointConfig(cfg *aws.Config, values []endpoints.STSRegionalEndpoint) { + for _, v := range values { + if v != endpoints.UnsetSTSEndpoint { + cfg.STSRegionalEndpoint = v + break + } + } } -var emptyCreds = credentials.Value{} - -func (c credProviderError) Retrieve() (credentials.Value, error) { - return credentials.Value{}, c.Err -} -func (c credProviderError) IsExpired() bool { - return true +func mergeS3UsEast1RegionalEndpointConfig(cfg *aws.Config, values []endpoints.S3UsEast1RegionalEndpoint) { + for _, v := range values { + if v != endpoints.UnsetS3UsEast1Endpoint { + cfg.S3UsEast1RegionalEndpoint = v + break + } + } } func initHandlers(s *Session) { @@ -503,7 +617,7 @@ func initHandlers(s *Session) { } } -// Copy creates and returns a copy of the current Session, coping the config +// Copy creates and returns a copy of the current Session, copying the config // and handlers. If any additional configs are provided they will be merged // on top of the Session's copied config. // @@ -523,46 +637,61 @@ func (s *Session) Copy(cfgs ...*aws.Config) *Session { // ClientConfig satisfies the client.ConfigProvider interface and is used to // configure the service client instances. Passing the Session to the service // client's constructor (New) will use this method to configure the client. -func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config { - // Backwards compatibility, the error will be eaten if user calls ClientConfig - // directly. All SDK services will use ClientconfigWithError. - cfg, _ := s.clientConfigWithErr(serviceName, cfgs...) - - return cfg -} - -func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (client.Config, error) { +func (s *Session) ClientConfig(service string, cfgs ...*aws.Config) client.Config { s = s.Copy(cfgs...) - var resolved endpoints.ResolvedEndpoint - var err error - region := aws.StringValue(s.Config.Region) + resolved, err := s.resolveEndpoint(service, region, s.Config) + if err != nil && s.Config.Logger != nil { + s.Config.Logger.Log(fmt.Sprintf( + "ERROR: unable to resolve endpoint for service %q, region %q, err: %v", + service, region, err)) + } - if endpoint := aws.StringValue(s.Config.Endpoint); len(endpoint) != 0 { - resolved.URL = endpoints.AddScheme(endpoint, aws.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region - } else { - resolved, err = s.Config.EndpointResolver.EndpointFor( - serviceName, region, - func(opt *endpoints.Options) { - opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL) - opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack) + return client.Config{ + Config: s.Config, + Handlers: s.Handlers, + PartitionID: resolved.PartitionID, + Endpoint: resolved.URL, + SigningRegion: resolved.SigningRegion, + SigningNameDerived: resolved.SigningNameDerived, + SigningName: resolved.SigningName, + } +} + +func (s *Session) resolveEndpoint(service, region string, cfg *aws.Config) (endpoints.ResolvedEndpoint, error) { - // Support the condition where the service is modeled but its - // endpoint metadata is not available. - opt.ResolveUnknownService = true - }, - ) + if ep := aws.StringValue(cfg.Endpoint); len(ep) != 0 { + return endpoints.ResolvedEndpoint{ + URL: endpoints.AddScheme(ep, aws.BoolValue(cfg.DisableSSL)), + SigningRegion: region, + }, nil } - return client.Config{ - Config: s.Config, - Handlers: s.Handlers, - Endpoint: resolved.URL, - SigningRegion: resolved.SigningRegion, - SigningName: resolved.SigningName, - }, err + resolved, err := cfg.EndpointResolver.EndpointFor(service, region, + func(opt *endpoints.Options) { + opt.DisableSSL = aws.BoolValue(cfg.DisableSSL) + opt.UseDualStack = aws.BoolValue(cfg.UseDualStack) + // Support for STSRegionalEndpoint where the STSRegionalEndpoint is + // provided in envConfig or sharedConfig with envConfig getting + // precedence. + opt.STSRegionalEndpoint = cfg.STSRegionalEndpoint + + // Support for S3UsEast1RegionalEndpoint where the S3UsEast1RegionalEndpoint is + // provided in envConfig or sharedConfig with envConfig getting + // precedence. + opt.S3UsEast1RegionalEndpoint = cfg.S3UsEast1RegionalEndpoint + + // Support the condition where the service is modeled but its + // endpoint metadata is not available. + opt.ResolveUnknownService = true + }, + ) + if err != nil { + return endpoints.ResolvedEndpoint{}, err + } + + return resolved, nil } // ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception @@ -572,19 +701,28 @@ func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Conf s = s.Copy(cfgs...) var resolved endpoints.ResolvedEndpoint - - region := aws.StringValue(s.Config.Region) - if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 { resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region + resolved.SigningRegion = aws.StringValue(s.Config.Region) } return client.Config{ - Config: s.Config, - Handlers: s.Handlers, - Endpoint: resolved.URL, - SigningRegion: resolved.SigningRegion, - SigningName: resolved.SigningName, + Config: s.Config, + Handlers: s.Handlers, + Endpoint: resolved.URL, + SigningRegion: resolved.SigningRegion, + SigningNameDerived: resolved.SigningNameDerived, + SigningName: resolved.SigningName, } } + +// logDeprecatedNewSessionError function enables error handling for session +func (s *Session) logDeprecatedNewSessionError(msg string, err error, cfgs []*aws.Config) { + // Session creation failed, need to report the error and prevent + // any requests from succeeding. + s.Config.MergeIn(cfgs...) + s.Config.Logger.Log("ERROR:", msg, "Error:", err) + s.Handlers.Validate.PushBack(func(r *request.Request) { + r.Error = err + }) +} 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 877af02..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session_test.go +++ /dev/null @@ -1,404 +0,0 @@ -package session - -import ( - "bytes" - "fmt" - "net/http" - "net/http/httptest" - "os" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "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/service/s3" -) - -func TestNewDefaultSession(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - s := New(&aws.Config{Region: aws.String("region")}) - - assert.Equal(t, "region", *s.Config.Region) - assert.Equal(t, http.DefaultClient, s.Config.HTTPClient) - assert.NotNil(t, s.Config.Logger) - assert.Equal(t, aws.LogOff, *s.Config.LogLevel) -} - -func TestNew_WithCustomCreds(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - customCreds := credentials.NewStaticCredentials("AKID", "SECRET", "TOKEN") - s := New(&aws.Config{Credentials: customCreds}) - - assert.Equal(t, customCreds, s.Config.Credentials) -} - -type mockLogger struct { - *bytes.Buffer -} - -func (w mockLogger) Log(args ...interface{}) { - fmt.Fprintln(w, args...) -} - -func TestNew_WithSessionLoadError(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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}}) - - assert.NotNil(t, s) - - svc := s3.New(s) - _, err := svc.ListBuckets(&s3.ListBucketsInput{}) - - assert.Error(t, err) - assert.Contains(t, logger.String(), "ERROR: failed to create session with AWS_SDK_LOAD_CONFIG enabled") - assert.Contains(t, err.Error(), SharedConfigAssumeRoleError{ - RoleARN: "assume_role_invalid_source_profile_role_arn", - }.Error()) -} - -func TestSessionCopy(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - os.Setenv("AWS_REGION", "orig_region") - - s := Session{ - Config: defaults.Config(), - Handlers: defaults.Handlers(), - } - - newSess := s.Copy(&aws.Config{Region: aws.String("new_region")}) - - assert.Equal(t, "orig_region", *s.Config.Region) - assert.Equal(t, "new_region", *newSess.Config.Region) -} - -func TestSessionClientConfig(t *testing.T) { - s, err := NewSession(&aws.Config{Region: aws.String("orig_region")}) - assert.NoError(t, err) - - cfg := s.ClientConfig("s3", &aws.Config{Region: aws.String("us-west-2")}) - - assert.Equal(t, "https://s3-us-west-2.amazonaws.com", cfg.Endpoint) - assert.Equal(t, "us-west-2", cfg.SigningRegion) - assert.Equal(t, "us-west-2", *cfg.Config.Region) -} - -func TestNewSession_NoCredentials(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - s, err := NewSession() - assert.NoError(t, err) - - assert.NotNil(t, s.Config.Credentials) - assert.NotEqual(t, credentials.AnonymousCredentials, s.Config.Credentials) -} - -func TestNewSessionWithOptions_OverrideProfile(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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", - }) - assert.NoError(t, err) - - assert.Equal(t, "full_profile_region", *s.Config.Region) - - creds, err := s.Config.Credentials.Get() - assert.NoError(t, err) - assert.Equal(t, "full_profile_akid", creds.AccessKeyID) - assert.Equal(t, "full_profile_secret", creds.SecretAccessKey) - assert.Empty(t, creds.SessionToken) - assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") -} - -func TestNewSessionWithOptions_OverrideSharedConfigEnable(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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, - }) - assert.NoError(t, err) - - assert.Equal(t, "full_profile_region", *s.Config.Region) - - creds, err := s.Config.Credentials.Get() - assert.NoError(t, err) - assert.Equal(t, "full_profile_akid", creds.AccessKeyID) - assert.Equal(t, "full_profile_secret", creds.SecretAccessKey) - assert.Empty(t, creds.SessionToken) - assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") -} - -func TestNewSessionWithOptions_OverrideSharedConfigDisable(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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, - }) - assert.NoError(t, err) - - assert.Empty(t, *s.Config.Region) - - creds, err := s.Config.Credentials.Get() - assert.NoError(t, err) - assert.Equal(t, "full_profile_akid", creds.AccessKeyID) - assert.Equal(t, "full_profile_secret", creds.SecretAccessKey) - assert.Empty(t, creds.SessionToken) - assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") -} - -func TestNewSessionWithOptions_Overrides(t *testing.T) { - cases := []struct { - InEnvs map[string]string - InProfile string - OutRegion string - OutCreds credentials.Value - }{ - { - 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", - }, - }, - { - 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: "env_akid", - SecretAccessKey: "env_secret", - ProviderName: "EnvConfigCredentials", - }, - }, - { - InEnvs: map[string]string{ - "AWS_SDK_LOAD_CONFIG": "0", - "AWS_SHARED_CREDENTIALS_FILE": testConfigFilename, - "AWS_CONFIG_FILE": testConfigOtherFilename, - "AWS_PROFILE": "shared_profile", - }, - InProfile: "config_file_load_order", - OutRegion: "shared_config_region", - OutCreds: credentials.Value{ - AccessKeyID: "shared_config_akid", - SecretAccessKey: "shared_config_secret", - ProviderName: "SharedConfigCredentials", - }, - }, - } - - for _, c := range cases { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - for k, v := range c.InEnvs { - os.Setenv(k, v) - } - - s, err := NewSessionWithOptions(Options{ - Profile: c.InProfile, - SharedConfigState: SharedConfigEnable, - }) - assert.NoError(t, err) - - creds, err := s.Config.Credentials.Get() - assert.NoError(t, err) - assert.Equal(t, c.OutRegion, *s.Config.Region) - assert.Equal(t, c.OutCreds.AccessKeyID, creds.AccessKeyID) - assert.Equal(t, c.OutCreds.SecretAccessKey, creds.SecretAccessKey) - assert.Equal(t, c.OutCreds.SessionToken, creds.SessionToken) - assert.Contains(t, creds.ProviderName, c.OutCreds.ProviderName) - } -} - -const assumeRoleRespMsg = ` - - - - arn:aws:sts::account_id:assumed-role/role/session_name - AKID:session_name - - - AKID - SECRET - SESSION_TOKEN - %s - - - - request-id - - -` - -func TestSesisonAssumeRole(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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")))) - })) - - s, err := NewSession(&aws.Config{Endpoint: aws.String(server.URL), DisableSSL: aws.Bool(true)}) - - creds, err := s.Config.Credentials.Get() - assert.NoError(t, err) - assert.Equal(t, "AKID", creds.AccessKeyID) - assert.Equal(t, "SECRET", creds.SecretAccessKey) - assert.Equal(t, "SESSION_TOKEN", creds.SessionToken) - assert.Contains(t, creds.ProviderName, "AssumeRoleProvider") -} - -func TestSessionAssumeRole_WithMFA(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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) { - assert.Equal(t, r.FormValue("SerialNumber"), "0123456789") - assert.Equal(t, r.FormValue("TokenCode"), "tokencode") - - w.Write([]byte(fmt.Sprintf(assumeRoleRespMsg, time.Now().Add(15*time.Minute).Format("2006-01-02T15:04:05Z")))) - })) - - 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 - }, - }) - assert.NoError(t, err) - - creds, err := sess.Config.Credentials.Get() - assert.NoError(t, err) - assert.True(t, customProviderCalled) - - assert.Equal(t, "AKID", creds.AccessKeyID) - assert.Equal(t, "SECRET", creds.SecretAccessKey) - assert.Equal(t, "SESSION_TOKEN", creds.SessionToken) - assert.Contains(t, creds.ProviderName, "AssumeRoleProvider") -} - -func TestSessionAssumeRole_WithMFA_NoTokenProvider(t *testing.T) { - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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, - }) - assert.Equal(t, err, AssumeRoleTokenProviderNotSetError{}) -} - -func TestSessionAssumeRole_DisableSharedConfig(t *testing.T) { - // Backwards compatibility with Shared config disabled - // assume role should not be built into the config. - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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() - assert.NoError(t, err) - - creds, err := s.Config.Credentials.Get() - assert.NoError(t, err) - assert.Equal(t, "assume_role_w_creds_akid", creds.AccessKeyID) - assert.Equal(t, "assume_role_w_creds_secret", creds.SecretAccessKey) - assert.Contains(t, creds.ProviderName, "SharedConfigCredentials") -} - -func TestSessionAssumeRole_InvalidSourceProfile(t *testing.T) { - // Backwards compatibility with Shared config disabled - // assume role should not be built into the config. - oldEnv := initSessionTestEnv() - defer popEnv(oldEnv) - - 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() - assert.Error(t, err) - assert.Contains(t, err.Error(), "SharedConfigAssumeRoleError: failed to load assume role") - assert.Nil(t, s) -} - -func initSessionTestEnv() (oldEnv []string) { - oldEnv = 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/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go index b58076f..a8ed880 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go @@ -2,11 +2,11 @@ package session import ( "fmt" - "io/ioutil" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/go-ini/ini" + "github.com/aws/aws-sdk-go/aws/endpoints" + "github.com/aws/aws-sdk-go/internal/ini" ) const ( @@ -16,68 +16,125 @@ const ( sessionTokenKey = `aws_session_token` // optional // Assume Role Credentials group - roleArnKey = `role_arn` // group required - sourceProfileKey = `source_profile` // group required - externalIDKey = `external_id` // optional - mfaSerialKey = `mfa_serial` // optional - roleSessionNameKey = `role_session_name` // optional + roleArnKey = `role_arn` // group required + sourceProfileKey = `source_profile` // group required (or credential_source) + credentialSourceKey = `credential_source` // group required (or source_profile) + externalIDKey = `external_id` // optional + mfaSerialKey = `mfa_serial` // optional + roleSessionNameKey = `role_session_name` // optional + + // CSM options + csmEnabledKey = `csm_enabled` + csmHostKey = `csm_host` + csmPortKey = `csm_port` + csmClientIDKey = `csm_client_id` // Additional Config fields regionKey = `region` + // endpoint discovery group + enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional + + // External Credential Process + credentialProcessKey = `credential_process` // optional + + // Web Identity Token File + webIdentityTokenFileKey = `web_identity_token_file` // optional + + // Additional config fields for regional or legacy endpoints + stsRegionalEndpointSharedKey = `sts_regional_endpoints` + + // Additional config fields for regional or legacy endpoints + s3UsEast1RegionalSharedKey = `s3_us_east_1_regional_endpoint` + // DefaultSharedConfigProfile is the default profile to be used when // loading configuration from the config files if another profile name // is not provided. DefaultSharedConfigProfile = `default` -) -type assumeRoleConfig struct { - RoleARN string - SourceProfile string - ExternalID string - MFASerial string - RoleSessionName string -} + // S3 ARN Region Usage + s3UseARNRegionKey = "s3_use_arn_region" +) // sharedConfig represents the configuration fields of the SDK config files. type sharedConfig struct { - // Credentials values from the config file. Both aws_access_key_id - // and aws_secret_access_key must be provided together in the same file - // to be considered valid. The values will be ignored if not a complete group. - // aws_session_token is an optional field that can be provided if both of the - // other two fields are also provided. + // Credentials values from the config file. Both aws_access_key_id and + // aws_secret_access_key must be provided together in the same file to be + // considered valid. The values will be ignored if not a complete group. + // aws_session_token is an optional field that can be provided if both of + // the other two fields are also provided. // // aws_access_key_id // aws_secret_access_key // aws_session_token Creds credentials.Value - AssumeRole assumeRoleConfig - AssumeRoleSource *sharedConfig + CredentialSource string + CredentialProcess string + WebIdentityTokenFile string - // Region is the region the SDK should use for looking up AWS service endpoints - // and signing requests. + RoleARN string + RoleSessionName string + ExternalID string + MFASerial string + + SourceProfileName string + SourceProfile *sharedConfig + + // Region is the region the SDK should use for looking up AWS service + // endpoints and signing requests. // // region Region string + + // EnableEndpointDiscovery can be enabled in the shared config by setting + // endpoint_discovery_enabled to true + // + // endpoint_discovery_enabled = true + EnableEndpointDiscovery *bool + + // CSM Options + CSMEnabled *bool + CSMHost string + CSMPort string + CSMClientID string + + // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service + // + // sts_regional_endpoints = regional + // This can take value as `LegacySTSEndpoint` or `RegionalSTSEndpoint` + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service + // + // s3_us_east_1_regional_endpoint = regional + // This can take value as `LegacyS3UsEast1Endpoint` or `RegionalS3UsEast1Endpoint` + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // s3_use_arn_region=true + S3UseARNRegion bool } type sharedConfigFile struct { Filename string - IniData *ini.File + IniData ini.Sections } -// loadSharedConfig retrieves the configuration from the list of files -// using the profile provided. The order the files are listed will determine +// loadSharedConfig retrieves the configuration from the list of files using +// the profile provided. The order the files are listed will determine // precedence. Values in subsequent files will overwrite values defined in // earlier files. // // For example, given two files A and B. Both define credentials. If the order -// of the files are A then B, B's credential values will be used instead of A's. +// of the files are A then B, B's credential values will be used instead of +// A's. // // See sharedConfig.setFromFile for information how the config files // will be loaded. -func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) { +func loadSharedConfig(profile string, filenames []string, exOpts bool) (sharedConfig, error) { if len(profile) == 0 { profile = DefaultSharedConfigProfile } @@ -88,16 +145,11 @@ func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) } cfg := sharedConfig{} - if err = cfg.setFromIniFiles(profile, files); err != nil { + profiles := map[string]struct{}{} + if err = cfg.setFromIniFiles(profiles, profile, files, exOpts); err != nil { return sharedConfig{}, err } - if len(cfg.AssumeRole.SourceProfile) > 0 { - if err := cfg.setAssumeRoleSource(profile, files); err != nil { - return sharedConfig{}, err - } - } - return cfg, nil } @@ -105,114 +157,278 @@ func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { files := make([]sharedConfigFile, 0, len(filenames)) for _, filename := range filenames { - b, err := ioutil.ReadFile(filename) - if err != nil { + sections, err := ini.OpenFile(filename) + if aerr, ok := err.(awserr.Error); ok && aerr.Code() == ini.ErrCodeUnableToReadFile { // Skip files which can't be opened and read for whatever reason continue - } - - f, err := ini.Load(b) - if err != nil { - return nil, SharedConfigLoadError{Filename: filename} + } else if err != nil { + return nil, SharedConfigLoadError{Filename: filename, Err: err} } files = append(files, sharedConfigFile{ - Filename: filename, IniData: f, + Filename: filename, IniData: sections, }) } return files, nil } -func (cfg *sharedConfig) setAssumeRoleSource(origProfile string, files []sharedConfigFile) error { - var assumeRoleSrc sharedConfig +func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile string, files []sharedConfigFile, exOpts bool) error { + // Trim files from the list that don't exist. + var skippedFiles int + var profileNotFoundErr error + for _, f := range files { + if err := cfg.setFromIniFile(profile, f, exOpts); err != nil { + if _, ok := err.(SharedConfigProfileNotExistsError); ok { + // Ignore profiles not defined in individual files. + profileNotFoundErr = err + skippedFiles++ + continue + } + return err + } + } + if skippedFiles == len(files) { + // If all files were skipped because the profile is not found, return + // the original profile not found error. + return profileNotFoundErr + } - // Multiple level assume role chains are not support - if cfg.AssumeRole.SourceProfile == origProfile { - assumeRoleSrc = *cfg - assumeRoleSrc.AssumeRole = assumeRoleConfig{} + if _, ok := profiles[profile]; ok { + // if this is the second instance of the profile the Assume Role + // options must be cleared because they are only valid for the + // first reference of a profile. The self linked instance of the + // profile only have credential provider options. + cfg.clearAssumeRoleOptions() } else { - err := assumeRoleSrc.setFromIniFiles(cfg.AssumeRole.SourceProfile, files) - if err != nil { + // First time a profile has been seen, It must either be a assume role + // or credentials. Assert if the credential type requires a role ARN, + // the ARN is also set. + if err := cfg.validateCredentialsRequireARN(profile); err != nil { return err } } + profiles[profile] = struct{}{} - if len(assumeRoleSrc.Creds.AccessKeyID) == 0 { - return SharedConfigAssumeRoleError{RoleARN: cfg.AssumeRole.RoleARN} + if err := cfg.validateCredentialType(); err != nil { + return err } - cfg.AssumeRoleSource = &assumeRoleSrc - - return nil -} + // Link source profiles for assume roles + if len(cfg.SourceProfileName) != 0 { + // Linked profile via source_profile ignore credential provider + // options, the source profile must provide the credentials. + cfg.clearCredentialOptions() -func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFile) error { - // Trim files from the list that don't exist. - for _, f := range files { - if err := cfg.setFromIniFile(profile, f); err != nil { + srcCfg := &sharedConfig{} + err := srcCfg.setFromIniFiles(profiles, cfg.SourceProfileName, files, exOpts) + if err != nil { + // SourceProfile that doesn't exist is an error in configuration. if _, ok := err.(SharedConfigProfileNotExistsError); ok { - // Ignore proviles missings - continue + err = SharedConfigAssumeRoleError{ + RoleARN: cfg.RoleARN, + SourceProfile: cfg.SourceProfileName, + } } return err } + + if !srcCfg.hasCredentials() { + return SharedConfigAssumeRoleError{ + RoleARN: cfg.RoleARN, + SourceProfile: cfg.SourceProfileName, + } + } + + cfg.SourceProfile = srcCfg } return nil } -// setFromFile loads the configuration from the file using -// the profile provided. A sharedConfig pointer type value is used so that -// multiple config file loadings can be chained. +// setFromFile loads the configuration from the file using the profile +// provided. A sharedConfig pointer type value is used so that multiple config +// file loadings can be chained. // // Only loads complete logically grouped values, and will not set fields in cfg -// for incomplete grouped values in the config. Such as credentials. For example -// if a config file only includes aws_access_key_id but no aws_secret_access_key -// the aws_access_key_id will be ignored. -func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error { - section, err := file.IniData.GetSection(profile) - if err != nil { +// for incomplete grouped values in the config. Such as credentials. For +// example if a config file only includes aws_access_key_id but no +// aws_secret_access_key the aws_access_key_id will be ignored. +func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, exOpts bool) error { + section, ok := file.IniData.GetSection(profile) + if !ok { // Fallback to to alternate profile name: profile - section, err = file.IniData.GetSection(fmt.Sprintf("profile %s", profile)) - if err != nil { - return SharedConfigProfileNotExistsError{Profile: profile, Err: err} + section, ok = file.IniData.GetSection(fmt.Sprintf("profile %s", profile)) + if !ok { + return SharedConfigProfileNotExistsError{Profile: profile, Err: nil} } } - // Shared Credentials - akid := section.Key(accessKeyIDKey).String() - secret := section.Key(secretAccessKey).String() - if len(akid) > 0 && len(secret) > 0 { - cfg.Creds = credentials.Value{ - AccessKeyID: akid, - SecretAccessKey: secret, - SessionToken: section.Key(sessionTokenKey).String(), - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), + if exOpts { + // Assume Role Parameters + updateString(&cfg.RoleARN, section, roleArnKey) + updateString(&cfg.ExternalID, section, externalIDKey) + updateString(&cfg.MFASerial, section, mfaSerialKey) + updateString(&cfg.RoleSessionName, section, roleSessionNameKey) + updateString(&cfg.SourceProfileName, section, sourceProfileKey) + updateString(&cfg.CredentialSource, section, credentialSourceKey) + updateString(&cfg.Region, section, regionKey) + + if v := section.String(stsRegionalEndpointSharedKey); len(v) != 0 { + sre, err := endpoints.GetSTSRegionalEndpoint(v) + if err != nil { + return fmt.Errorf("failed to load %s from shared config, %s, %v", + stsRegionalEndpointSharedKey, file.Filename, err) + } + cfg.STSRegionalEndpoint = sre } + + if v := section.String(s3UsEast1RegionalSharedKey); len(v) != 0 { + sre, err := endpoints.GetS3UsEast1RegionalEndpoint(v) + if err != nil { + return fmt.Errorf("failed to load %s from shared config, %s, %v", + s3UsEast1RegionalSharedKey, file.Filename, err) + } + cfg.S3UsEast1RegionalEndpoint = sre + } + } + + updateString(&cfg.CredentialProcess, section, credentialProcessKey) + updateString(&cfg.WebIdentityTokenFile, section, webIdentityTokenFileKey) + + // Shared Credentials + creds := credentials.Value{ + AccessKeyID: section.String(accessKeyIDKey), + SecretAccessKey: section.String(secretAccessKey), + SessionToken: section.String(sessionTokenKey), + ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), + } + if creds.HasKeys() { + cfg.Creds = creds + } + + // Endpoint discovery + updateBoolPtr(&cfg.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) + + // CSM options + updateBoolPtr(&cfg.CSMEnabled, section, csmEnabledKey) + updateString(&cfg.CSMHost, section, csmHostKey) + updateString(&cfg.CSMPort, section, csmPortKey) + updateString(&cfg.CSMClientID, section, csmClientIDKey) + + updateBool(&cfg.S3UseARNRegion, section, s3UseARNRegionKey) + + return nil +} + +func (cfg *sharedConfig) validateCredentialsRequireARN(profile string) error { + var credSource string + + switch { + case len(cfg.SourceProfileName) != 0: + credSource = sourceProfileKey + case len(cfg.CredentialSource) != 0: + credSource = credentialSourceKey + case len(cfg.WebIdentityTokenFile) != 0: + credSource = webIdentityTokenFileKey } - // Assume Role - roleArn := section.Key(roleArnKey).String() - srcProfile := section.Key(sourceProfileKey).String() - if len(roleArn) > 0 && len(srcProfile) > 0 { - cfg.AssumeRole = assumeRoleConfig{ - RoleARN: roleArn, - SourceProfile: srcProfile, - ExternalID: section.Key(externalIDKey).String(), - MFASerial: section.Key(mfaSerialKey).String(), - RoleSessionName: section.Key(roleSessionNameKey).String(), + if len(credSource) != 0 && len(cfg.RoleARN) == 0 { + return CredentialRequiresARNError{ + Type: credSource, + Profile: profile, } } - // Region - if v := section.Key(regionKey).String(); len(v) > 0 { - cfg.Region = v + return nil +} + +func (cfg *sharedConfig) validateCredentialType() error { + // Only one or no credential type can be defined. + if !oneOrNone( + len(cfg.SourceProfileName) != 0, + len(cfg.CredentialSource) != 0, + len(cfg.CredentialProcess) != 0, + len(cfg.WebIdentityTokenFile) != 0, + ) { + return ErrSharedConfigSourceCollision } return nil } +func (cfg *sharedConfig) hasCredentials() bool { + switch { + case len(cfg.SourceProfileName) != 0: + case len(cfg.CredentialSource) != 0: + case len(cfg.CredentialProcess) != 0: + case len(cfg.WebIdentityTokenFile) != 0: + case cfg.Creds.HasKeys(): + default: + return false + } + + return true +} + +func (cfg *sharedConfig) clearCredentialOptions() { + cfg.CredentialSource = "" + cfg.CredentialProcess = "" + cfg.WebIdentityTokenFile = "" + cfg.Creds = credentials.Value{} +} + +func (cfg *sharedConfig) clearAssumeRoleOptions() { + cfg.RoleARN = "" + cfg.ExternalID = "" + cfg.MFASerial = "" + cfg.RoleSessionName = "" + cfg.SourceProfileName = "" +} + +func oneOrNone(bs ...bool) bool { + var count int + + for _, b := range bs { + if b { + count++ + if count > 1 { + return false + } + } + } + + return true +} + +// updateString will only update the dst with the value in the section key, key +// is present in the section. +func updateString(dst *string, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = section.String(key) +} + +// updateBool will only update the dst with the value in the section key, key +// is present in the section. +func updateBool(dst *bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = section.Bool(key) +} + +// updateBoolPtr will only update the dst with the value in the section key, +// key is present in the section. +func updateBoolPtr(dst **bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = new(bool) + **dst = section.Bool(key) +} + // SharedConfigLoadError is an error for the shared config file failed to load. type SharedConfigLoadError struct { Filename string @@ -270,7 +486,8 @@ func (e SharedConfigProfileNotExistsError) Error() string { // profile contains assume role information, but that information is invalid // or not complete. type SharedConfigAssumeRoleError struct { - RoleARN string + RoleARN string + SourceProfile string } // Code is the short id of the error. @@ -280,8 +497,10 @@ func (e SharedConfigAssumeRoleError) Code() string { // Message is the description of the error func (e SharedConfigAssumeRoleError) Message() string { - return fmt.Sprintf("failed to load assume role for %s, source profile has no shared credentials", - e.RoleARN) + return fmt.Sprintf( + "failed to load assume role for %s, source profile %s has no shared credentials", + e.RoleARN, e.SourceProfile, + ) } // OrigErr is the underlying error that caused the failure. @@ -293,3 +512,36 @@ func (e SharedConfigAssumeRoleError) OrigErr() error { func (e SharedConfigAssumeRoleError) Error() string { return awserr.SprintError(e.Code(), e.Message(), "", nil) } + +// CredentialRequiresARNError provides the error for shared config credentials +// that are incorrectly configured in the shared config or credentials file. +type CredentialRequiresARNError struct { + // type of credentials that were configured. + Type string + + // Profile name the credentials were in. + Profile string +} + +// Code is the short id of the error. +func (e CredentialRequiresARNError) Code() string { + return "CredentialRequiresARNError" +} + +// Message is the description of the error +func (e CredentialRequiresARNError) Message() string { + return fmt.Sprintf( + "credential type %s requires role_arn, profile %s", + e.Type, e.Profile, + ) +} + +// OrigErr is the underlying error that caused the failure. +func (e CredentialRequiresARNError) OrigErr() error { + return nil +} + +// Error satisfies the error interface. +func (e CredentialRequiresARNError) Error() string { + return awserr.SprintError(e.Code(), e.Message(), "", nil) +} 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 3a07b8d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config_test.go +++ /dev/null @@ -1,274 +0,0 @@ -package session - -import ( - "fmt" - "path/filepath" - "testing" - - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/go-ini/ini" - "github.com/stretchr/testify/assert" -) - -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", - }, - { - 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{ - AssumeRole: assumeRoleConfig{ - RoleARN: "assume_role_role_arn", - SourceProfile: "complete_creds", - }, - AssumeRoleSource: &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{ - AssumeRole: assumeRoleConfig{ - RoleARN: "assume_role_invalid_source_profile_role_arn", - SourceProfile: "profile_not_exists", - }, - }, - Err: SharedConfigAssumeRoleError{RoleARN: "assume_role_invalid_source_profile_role_arn"}, - }, - { - Filenames: []string{testConfigOtherFilename, testConfigFilename}, - Profile: "assume_role_w_creds", - Expected: sharedConfig{ - Creds: credentials.Value{ - AccessKeyID: "assume_role_w_creds_akid", - SecretAccessKey: "assume_role_w_creds_secret", - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", testConfigFilename), - }, - AssumeRole: assumeRoleConfig{ - RoleARN: "assume_role_w_creds_role_arn", - SourceProfile: "assume_role_w_creds", - ExternalID: "1234", - RoleSessionName: "assume_role_w_creds_session_name", - }, - AssumeRoleSource: &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{ - AssumeRole: assumeRoleConfig{ - RoleARN: "assume_role_wo_creds_role_arn", - SourceProfile: "assume_role_wo_creds", - }, - }, - Err: SharedConfigAssumeRoleError{RoleARN: "assume_role_wo_creds_role_arn"}, - }, - { - Filenames: []string{filepath.Join("testdata", "shared_config_invalid_ini")}, - Profile: "profile_name", - Err: SharedConfigLoadError{Filename: filepath.Join("testdata", "shared_config_invalid_ini")}, - }, - } - - for i, c := range cases { - cfg, err := loadSharedConfig(c.Profile, c.Filenames) - if c.Err != nil { - assert.Contains(t, err.Error(), c.Err.Error(), "expected error, %d", i) - continue - } - - assert.NoError(t, err, "unexpected error, %d", i) - assert.Equal(t, c.Expected, cfg, "not equal, %d", i) - } -} - -func TestLoadSharedConfigFromFile(t *testing.T) { - filename := testConfigFilename - f, err := ini.Load(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{}, - }, - { - Profile: "assume_role", - Expected: sharedConfig{ - AssumeRole: assumeRoleConfig{ - RoleARN: "assume_role_role_arn", - SourceProfile: "complete_creds", - }, - }, - }, - { - Profile: "assume_role_w_mfa", - Expected: sharedConfig{ - AssumeRole: assumeRoleConfig{ - RoleARN: "assume_role_role_arn", - SourceProfile: "complete_creds", - MFASerial: "0123456789", - }, - }, - }, - { - Profile: "does_not_exists", - Err: SharedConfigProfileNotExistsError{Profile: "does_not_exists"}, - }, - } - - for i, c := range cases { - cfg := sharedConfig{} - - err := cfg.setFromIniFile(c.Profile, iniFile) - if c.Err != nil { - assert.Contains(t, err.Error(), c.Err.Error(), "expected error, %d", i) - continue - } - - assert.NoError(t, err, "unexpected error, %d", i) - assert.Equal(t, c.Expected, cfg, "not equal, %d", i) - } -} - -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 { - files, err := loadSharedConfigIniFiles(c.Filenames) - assert.NoError(t, err, "unexpected error, %d", i) - assert.Equal(t, len(c.Expected), len(files), "expected num files, %d", i) - - for i, expectedFile := range c.Expected { - assert.Equal(t, expectedFile.Filename, files[i].Filename) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config deleted file mode 100644 index 8705608..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config +++ /dev/null @@ -1,65 +0,0 @@ -[default] -s3 = - unsupported_key=123 - other_unsupported=abc - -region = default_region - -[profile alt_profile_name] -region = alt_profile_name_region - -[short_profile_name_first] -region = short_profile_name_first_short - -[profile short_profile_name_first] -region = short_profile_name_first_alt - -[partial_creds] -aws_access_key_id = partial_creds_akid - -[complete_creds] -aws_access_key_id = complete_creds_akid -aws_secret_access_key = complete_creds_secret - -[complete_creds_with_token] -aws_access_key_id = complete_creds_with_token_akid -aws_secret_access_key = complete_creds_with_token_secret -aws_session_token = complete_creds_with_token_token - -[full_profile] -aws_access_key_id = full_profile_akid -aws_secret_access_key = full_profile_secret -region = full_profile_region - -[config_file_load_order] -region = shared_config_region -aws_access_key_id = shared_config_akid -aws_secret_access_key = shared_config_secret - -[partial_assume_role] -role_arn = partial_assume_role_role_arn - -[assume_role] -role_arn = assume_role_role_arn -source_profile = complete_creds - -[assume_role_w_mfa] -role_arn = assume_role_role_arn -source_profile = complete_creds -mfa_serial = 0123456789 - -[assume_role_invalid_source_profile] -role_arn = assume_role_invalid_source_profile_role_arn -source_profile = profile_not_exists - -[assume_role_w_creds] -role_arn = assume_role_w_creds_role_arn -source_profile = assume_role_w_creds -external_id = 1234 -role_session_name = assume_role_w_creds_session_name -aws_access_key_id = assume_role_w_creds_akid -aws_secret_access_key = assume_role_w_creds_secret - -[assume_role_wo_creds] -role_arn = assume_role_wo_creds_role_arn -source_profile = assume_role_wo_creds diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_invalid_ini b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_invalid_ini deleted file mode 100644 index 4db0389..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_invalid_ini +++ /dev/null @@ -1 +0,0 @@ -[profile_nam diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_other b/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_other deleted file mode 100644 index 615831b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/testdata/shared_config_other +++ /dev/null @@ -1,17 +0,0 @@ -[default] -region = default_region - -[partial_creds] -aws_access_key_id = AKID - -[profile alt_profile_name] -region = alt_profile_name_region - -[creds_from_credentials] -aws_access_key_id = creds_from_config_akid -aws_secret_access_key = creds_from_config_secret - -[config_file_load_order] -region = shared_config_other_region -aws_access_key_id = shared_config_other_akid -aws_secret_access_key = shared_config_other_secret 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 2d4621c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_1_5_test.go +++ /dev/null @@ -1,67 +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" - "github.com/stretchr/testify/assert" -) - -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) - assert.NoError(t, 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)) - assert.NoError(t, err) - - actual := req.Header.Get("Authorization") - assert.Equal(t, c.ExpSig, actual) - assert.Equal(t, c.OrigURI, req.URL.Path) - assert.Equal(t, c.EscapedURI, req.URL.EscapedPath()) - } -} - -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) - assert.NoError(t, 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)) - assert.NoError(t, err) - - actual := req.Header.Get("Authorization") - assert.Equal(t, c.ExpSig, actual) - assert.Equal(t, c.OrigURI, req.URL.Path) - assert.Equal(t, c.EscapedURI, req.URL.EscapedPath()) - } -} 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 9b6b0be..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/functional_test.go +++ /dev/null @@ -1,120 +0,0 @@ -package v4_test - -import ( - "net/http" - "net/url" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "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" - "github.com/stretchr/testify/assert" -) - -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 TestPresignHandler(t *testing.T) { - svc := s3.New(unit.Session) - 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 = time.Unix(0, 0) - urlstr, err := req.Presign(5 * time.Minute) - - assert.NoError(t, 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() - assert.Equal(t, expectedHost, u.Host) - assert.Equal(t, expectedSig, urlQ.Get("X-Amz-Signature")) - assert.Equal(t, expectedCred, urlQ.Get("X-Amz-Credential")) - assert.Equal(t, expectedHeaders, urlQ.Get("X-Amz-SignedHeaders")) - assert.Equal(t, expectedDate, urlQ.Get("X-Amz-Date")) - assert.Equal(t, "300", urlQ.Get("X-Amz-Expires")) - - assert.NotContains(t, urlstr, "+") // + encoded as %20 -} - -func TestPresignRequest(t *testing.T) { - svc := s3.New(unit.Session) - 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 = time.Unix(0, 0) - urlstr, headers, err := req.PresignRequest(5 * time.Minute) - - assert.NoError(t, err) - - expectedHost := "bucket.s3.mock-region.amazonaws.com" - expectedDate := "19700101T000000Z" - expectedHeaders := "content-disposition;host;x-amz-acl;x-amz-content-sha256" - expectedSig := "a5b2b500dfbf2eab5b4f55bec3e3752e04536ea1d5c047aa93bc9f1130a72cd2" - expectedCred := "AKID/19700101/mock-region/s3/aws4_request" - expectedHeaderMap := http.Header{ - "x-amz-acl": []string{"public-read"}, - "content-disposition": []string{"a+b c$d"}, - "x-amz-content-sha256": []string{"UNSIGNED-PAYLOAD"}, - } - - u, _ := url.Parse(urlstr) - urlQ := u.Query() - assert.Equal(t, expectedHost, u.Host) - assert.Equal(t, expectedSig, urlQ.Get("X-Amz-Signature")) - assert.Equal(t, expectedCred, urlQ.Get("X-Amz-Credential")) - assert.Equal(t, expectedHeaders, urlQ.Get("X-Amz-SignedHeaders")) - assert.Equal(t, expectedDate, urlQ.Get("X-Amz-Date")) - assert.Equal(t, expectedHeaderMap, headers) - assert.Equal(t, "300", urlQ.Get("X-Amz-Expires")) - - assert.NotContains(t, urlstr, "+") // + encoded as %20 -} - -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) - assert.NoError(t, 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", time.Unix(0, 0)) - assert.NoError(t, err) - - actual := req.Header.Get("Authorization") - assert.Equal(t, expectSig, actual) -} 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 7dfddc8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package v4 - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestRuleCheckWhitelist(t *testing.T) { - w := whitelist{ - mapRule{ - "Cache-Control": struct{}{}, - }, - } - - assert.True(t, w.IsValid("Cache-Control")) - assert.False(t, w.IsValid("Cache-")) -} - -func TestRuleCheckBlacklist(t *testing.T) { - b := blacklist{ - mapRule{ - "Cache-Control": struct{}{}, - }, - } - - assert.False(t, b.IsValid("Cache-Control")) - assert.True(t, b.IsValid("Cache-")) -} - -func TestRuleCheckPattern(t *testing.T) { - p := patterns{"X-Amz-Meta-"} - - assert.True(t, p.IsValid("X-Amz-Meta-")) - assert.True(t, p.IsValid("X-Amz-Meta-Star")) - assert.False(t, p.IsValid("Cache-")) -} - -func TestRuleComplexWhitelist(t *testing.T) { - w := rules{ - whitelist{ - mapRule{ - "Cache-Control": struct{}{}, - }, - }, - patterns{"X-Amz-Meta-"}, - } - - r := rules{ - inclusiveRules{patterns{"X-Amz-"}, blacklist{w}}, - } - - assert.True(t, r.IsValid("X-Amz-Blah")) - assert.False(t, r.IsValid("X-Amz-Meta-")) - assert.False(t, r.IsValid("X-Amz-Meta-Star")) - assert.False(t, r.IsValid("Cache-Control")) -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index 434ac87..8104793 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -45,7 +45,7 @@ // If signing a request intended for HTTP2 server, and you're using Go 1.6.2 // through 1.7.4 you should use the URL.RawPath as the pre-escaped form of the // request URL. https://github.com/golang/go/issues/16847 points to a bug in -// Go pre 1.8 that failes to make HTTP2 requests using absolute URL in the HTTP +// Go pre 1.8 that fails to make HTTP2 requests using absolute URL in the HTTP // message. URL.Opaque generally will force Go to make requests with absolute URL. // URL.RawPath does not do this, but RawPath must be a valid escaping of Path // or url.EscapedPath will ignore the RawPath escaping. @@ -55,7 +55,6 @@ package v4 import ( - "bytes" "crypto/hmac" "crypto/sha256" "encoding/hex" @@ -72,6 +71,7 @@ import ( "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/internal/sdkio" "github.com/aws/aws-sdk-go/private/protocol/rest" ) @@ -98,25 +98,25 @@ var ignoredHeaders = rules{ var requiredSignedHeaders = rules{ whitelist{ mapRule{ - "Cache-Control": struct{}{}, - "Content-Disposition": struct{}{}, - "Content-Encoding": struct{}{}, - "Content-Language": struct{}{}, - "Content-Md5": struct{}{}, - "Content-Type": struct{}{}, - "Expires": struct{}{}, - "If-Match": struct{}{}, - "If-Modified-Since": struct{}{}, - "If-None-Match": struct{}{}, - "If-Unmodified-Since": struct{}{}, - "Range": struct{}{}, - "X-Amz-Acl": struct{}{}, - "X-Amz-Copy-Source": struct{}{}, - "X-Amz-Copy-Source-If-Match": struct{}{}, - "X-Amz-Copy-Source-If-Modified-Since": struct{}{}, - "X-Amz-Copy-Source-If-None-Match": struct{}{}, - "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, - "X-Amz-Copy-Source-Range": struct{}{}, + "Cache-Control": struct{}{}, + "Content-Disposition": struct{}{}, + "Content-Encoding": struct{}{}, + "Content-Language": struct{}{}, + "Content-Md5": struct{}{}, + "Content-Type": struct{}{}, + "Expires": struct{}{}, + "If-Match": struct{}{}, + "If-Modified-Since": struct{}{}, + "If-None-Match": struct{}{}, + "If-Unmodified-Since": struct{}{}, + "Range": struct{}{}, + "X-Amz-Acl": struct{}{}, + "X-Amz-Copy-Source": struct{}{}, + "X-Amz-Copy-Source-If-Match": struct{}{}, + "X-Amz-Copy-Source-If-Modified-Since": struct{}{}, + "X-Amz-Copy-Source-If-None-Match": struct{}{}, + "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, + "X-Amz-Copy-Source-Range": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, @@ -134,7 +134,9 @@ var requiredSignedHeaders = rules{ "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, "X-Amz-Storage-Class": struct{}{}, + "X-Amz-Tagging": struct{}{}, "X-Amz-Website-Redirect-Location": struct{}{}, + "X-Amz-Content-Sha256": struct{}{}, }, }, patterns{"X-Amz-Meta-"}, @@ -180,7 +182,7 @@ type Signer struct { // http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html DisableURIPathEscaping bool - // Disales the automatical setting of the HTTP request's Body field with the + // Disables the automatical setting of the HTTP request's Body field with the // io.ReadSeeker passed in to the signer. This is useful if you're using a // custom wrapper around the body for the io.ReadSeeker and want to preserve // the Body value on the Request.Body. @@ -269,7 +271,7 @@ type signingCtx struct { // "X-Amz-Content-Sha256" header with a precomputed value. The signer will // only compute the hash if the request header value is empty. func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, signTime time.Time) (http.Header, error) { - return v4.signWithBody(r, body, service, region, 0, signTime) + return v4.signWithBody(r, body, service, region, 0, false, signTime) } // Presign signs AWS v4 requests with the provided body, service name, region @@ -303,10 +305,10 @@ func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region strin // presigned request's signature you can set the "X-Amz-Content-Sha256" // HTTP header and that will be included in the request's signature. func (v4 Signer) Presign(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { - return v4.signWithBody(r, body, service, region, exp, signTime) + return v4.signWithBody(r, body, service, region, exp, true, signTime) } -func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { +func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, isPresign bool, signTime time.Time) (http.Header, error) { currentTimeFn := v4.currentTimeFn if currentTimeFn == nil { currentTimeFn = time.Now @@ -318,7 +320,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi Query: r.URL.Query(), Time: signTime, ExpireTime: exp, - isPresign: exp != 0, + isPresign: isPresign, ServiceName: service, Region: region, DisableURIPathEscaping: v4.DisableURIPathEscaping, @@ -340,8 +342,11 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi return http.Header{}, err } + ctx.sanitizeHostForHeader() ctx.assignAmzQueryValues() - ctx.build(v4.DisableHeaderHoisting) + if err := ctx.build(v4.DisableHeaderHoisting); err != nil { + return nil, err + } // If the request is not presigned the body should be attached to it. This // prevents the confusion of wanting to send a signed request without @@ -364,6 +369,10 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi return ctx.SignedHeaderVals, nil } +func (ctx *signingCtx) sanitizeHostForHeader() { + request.SanitizeHostForHeader(ctx.Request) +} + func (ctx *signingCtx) handlePresignRemoval() { if !ctx.isPresign { return @@ -402,7 +411,7 @@ var SignRequestHandler = request.NamedHandler{ } // SignSDKRequest signs an AWS request with the V4 signature. This -// request handler is bested used only with the SDK's built in service client's +// request handler should only be used with the SDK's built in service client's // API operation requests. // // This function should not be used on its on its own, but in conjunction with @@ -413,7 +422,7 @@ var SignRequestHandler = request.NamedHandler{ // If the credentials of the request's config are set to // credentials.AnonymousCredentials the request will not be signed. func SignSDKRequest(req *request.Request) { - signSDKRequestWithCurrTime(req, time.Now) + SignSDKRequestWithCurrentTime(req, time.Now) } // BuildNamedHandler will build a generic handler for signing. @@ -421,12 +430,15 @@ func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler return request.NamedHandler{ Name: name, Fn: func(req *request.Request) { - signSDKRequestWithCurrTime(req, time.Now, opts...) + SignSDKRequestWithCurrentTime(req, time.Now, opts...) }, } } -func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) { +// SignSDKRequestWithCurrentTime will sign the SDK's request using the time +// function passed in. Behaves the same as SignSDKRequest with the exception +// the request is signed with the value returned by the current time function. +func SignSDKRequestWithCurrentTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) { // If the request does not need to be signed ignore the signing of the // request if the AnonymousCredentials object is used. if req.Config.Credentials == credentials.AnonymousCredentials { @@ -462,13 +474,9 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time opt(v4) } - signingTime := req.Time - if !req.LastSignedAt.IsZero() { - signingTime = req.LastSignedAt - } - + curTime := curTimeFn() signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(), - name, region, req.ExpireTime, signingTime, + name, region, req.ExpireTime, req.ExpireTime > 0, curTime, ) if err != nil { req.Error = err @@ -477,7 +485,7 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time } req.SignedHeaderVals = signedHeaders - req.LastSignedAt = curTimeFn() + req.LastSignedAt = curTime } const logSignInfoMsg = `DEBUG: Request Signature: @@ -499,10 +507,14 @@ func (v4 *Signer) logSigningInfo(ctx *signingCtx) { v4.Logger.Log(msg) } -func (ctx *signingCtx) build(disableHeaderHoisting bool) { +func (ctx *signingCtx) build(disableHeaderHoisting bool) error { ctx.buildTime() // no depends ctx.buildCredentialString() // no depends + if err := ctx.buildBodyDigest(); err != nil { + return err + } + unsignedHeaders := ctx.Request.Header if ctx.isPresign { if !disableHeaderHoisting { @@ -514,7 +526,6 @@ func (ctx *signingCtx) build(disableHeaderHoisting bool) { } } - ctx.buildBodyDigest() ctx.buildCanonicalHeaders(ignoredHeaders, unsignedHeaders) ctx.buildCanonicalString() // depends on canon headers / signed headers ctx.buildStringToSign() // depends on canon string @@ -530,6 +541,8 @@ func (ctx *signingCtx) build(disableHeaderHoisting bool) { } ctx.Request.Header.Set("Authorization", strings.Join(parts, ", ")) } + + return nil } func (ctx *signingCtx) buildTime() { @@ -604,14 +617,18 @@ func (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) { headerValues := make([]string, len(headers)) for i, k := range headers { if k == "host" { - headerValues[i] = "host:" + ctx.Request.URL.Host + if ctx.Request.Host != "" { + headerValues[i] = "host:" + ctx.Request.Host + } else { + headerValues[i] = "host:" + ctx.Request.URL.Host + } } else { headerValues[i] = k + ":" + strings.Join(ctx.SignedHeaderVals[k], ",") } } - - ctx.canonicalHeaders = strings.Join(stripExcessSpaces(headerValues), "\n") + stripExcessSpaces(headerValues) + ctx.canonicalHeaders = strings.Join(headerValues, "\n") } func (ctx *signingCtx) buildCanonicalString() { @@ -652,21 +669,38 @@ func (ctx *signingCtx) buildSignature() { ctx.signature = hex.EncodeToString(signature) } -func (ctx *signingCtx) buildBodyDigest() { +func (ctx *signingCtx) buildBodyDigest() error { hash := ctx.Request.Header.Get("X-Amz-Content-Sha256") if hash == "" { - if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") { + includeSHA256Header := ctx.unsignedPayload || + ctx.ServiceName == "s3" || + ctx.ServiceName == "glacier" + + s3Presign := ctx.isPresign && ctx.ServiceName == "s3" + + if ctx.unsignedPayload || s3Presign { hash = "UNSIGNED-PAYLOAD" + includeSHA256Header = !s3Presign } else if ctx.Body == nil { hash = emptyStringSHA256 } else { - hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) + if !aws.IsReaderSeekable(ctx.Body) { + return fmt.Errorf("cannot use unseekable request body %T, for signed request with body", ctx.Body) + } + hashBytes, err := makeSha256Reader(ctx.Body) + if err != nil { + return err + } + hash = hex.EncodeToString(hashBytes) } - if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" { + + if includeSHA256Header { ctx.Request.Header.Set("X-Amz-Content-Sha256", hash) } } ctx.bodyDigest = hash + + return nil } // isRequestSigned returns if the request is currently signed or presigned @@ -704,58 +738,69 @@ func makeSha256(data []byte) []byte { return hash.Sum(nil) } -func makeSha256Reader(reader io.ReadSeeker) []byte { +func makeSha256Reader(reader io.ReadSeeker) (hashBytes []byte, err error) { hash := sha256.New() - start, _ := reader.Seek(0, 1) - defer reader.Seek(start, 0) + start, err := reader.Seek(0, sdkio.SeekCurrent) + if err != nil { + return nil, err + } + defer func() { + // ensure error is return if unable to seek back to start of payload. + _, err = reader.Seek(start, sdkio.SeekStart) + }() - io.Copy(hash, reader) - return hash.Sum(nil) -} + // Use CopyN to avoid allocating the 32KB buffer in io.Copy for bodies + // smaller than 32KB. Fall back to io.Copy if we fail to determine the size. + size, err := aws.SeekerLen(reader) + if err != nil { + io.Copy(hash, reader) + } else { + io.CopyN(hash, reader, size) + } -const doubleSpaces = " " + return hash.Sum(nil), nil +} -var doubleSpaceBytes = []byte(doubleSpaces) +const doubleSpace = " " -func stripExcessSpaces(headerVals []string) []string { - vals := make([]string, len(headerVals)) - for i, str := range headerVals { - // Trim leading and trailing spaces - trimmed := strings.TrimSpace(str) +// stripExcessSpaces will rewrite the passed in slice's string values to not +// contain multiple side-by-side spaces. +func stripExcessSpaces(vals []string) { + var j, k, l, m, spaces int + for i, str := range vals { + // Trim trailing spaces + for j = len(str) - 1; j >= 0 && str[j] == ' '; j-- { + } - idx := strings.Index(trimmed, doubleSpaces) - var buf []byte - for idx > -1 { - // Multiple adjacent spaces found - if buf == nil { - // first time create the buffer - buf = []byte(trimmed) - } + // Trim leading spaces + for k = 0; k < j && str[k] == ' '; k++ { + } + str = str[k : j+1] - stripToIdx := -1 - for j := idx + 1; j < len(buf); j++ { - if buf[j] != ' ' { - buf = append(buf[:idx+1], buf[j:]...) - stripToIdx = j - break - } - } + // Strip multiple spaces. + j = strings.Index(str, doubleSpace) + if j < 0 { + vals[i] = str + continue + } - if stripToIdx >= 0 { - idx = bytes.Index(buf[stripToIdx:], doubleSpaceBytes) - if idx >= 0 { - idx += stripToIdx + buf := []byte(str) + for k, m, l = j, j, len(buf); k < l; k++ { + if buf[k] == ' ' { + if spaces == 0 { + // First space. + buf[m] = buf[k] + m++ } + spaces++ } else { - idx = -1 + // End of multiple spaces. + spaces = 0 + buf[m] = buf[k] + m++ } } - if buf != nil { - vals[i] = string(buf) - } else { - vals[i] = trimmed - } + vals[i] = string(buf[:m]) } - return vals } 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 72763fd..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4_test.go +++ /dev/null @@ -1,497 +0,0 @@ -package v4 - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/assert" - - "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 TestStripExcessHeaders(t *testing.T) { - vals := []string{ - "123", - "1 2 3", - " 1 2 3", - "1 2 3", - "1 23", - "1 2 3", - "1 2 ", - " 1 2 ", - } - - expected := []string{ - "123", - "1 2 3", - "1 2 3", - "1 2 3", - "1 23", - "1 2 3", - "1 2", - "1 2", - } - - newVals := stripExcessSpaces(vals) - for i := 0; i < len(newVals); i++ { - assert.Equal(t, expected[i], newVals[i], "test: %d", i) - } -} - -func buildRequest(serviceName, region, body string) (*http.Request, io.ReadSeeker) { - endpoint := "https://" + serviceName + "." + region + ".amazonaws.com" - reader := strings.NewReader(body) - req, _ := http.NewRequest("POST", endpoint, reader) - req.URL.Opaque = "//example.org/bucket/key-._~,!@#$%^&*()" - req.Header.Add("X-Amz-Target", "prefix.Operation") - req.Header.Add("Content-Type", "application/x-amz-json-1.0") - req.Header.Add("Content-Length", string(len(body))) - req.Header.Add("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=!@#$%^&* (+)") - return req, reader -} - -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, time.Unix(0, 0)) - - expectedDate := "19700101T000000Z" - expectedHeaders := "content-length;content-type;host;x-amz-meta-other-header;x-amz-meta-other-header_with_underscore" - expectedSig := "ea7856749041f727690c580569738282e99c79355fe0d8f125d3b5535d2ece83" - expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request" - expectedTarget := "prefix.Operation" - - q := req.URL.Query() - assert.Equal(t, expectedSig, q.Get("X-Amz-Signature")) - assert.Equal(t, expectedCred, q.Get("X-Amz-Credential")) - assert.Equal(t, expectedHeaders, q.Get("X-Amz-SignedHeaders")) - assert.Equal(t, expectedDate, q.Get("X-Amz-Date")) - assert.Empty(t, q.Get("X-Amz-Meta-Other-Header")) - assert.Equal(t, expectedTarget, q.Get("X-Amz-Target")) -} - -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, time.Unix(0, 0)) - - expectedDate := "19700101T000000Z" - expectedHeaders := "content-length;content-type;host;x-amz-meta-other-header;x-amz-meta-other-header_with_underscore" - expectedSig := "fef6002062400bbf526d70f1a6456abc0fb2e213fe1416012737eebd42a62924" - expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request" - expectedTarget := "prefix.Operation" - - q := req.URL.Query() - assert.Equal(t, expectedSig, q.Get("X-Amz-Signature")) - assert.Equal(t, expectedCred, q.Get("X-Amz-Credential")) - assert.Equal(t, expectedHeaders, q.Get("X-Amz-SignedHeaders")) - assert.Equal(t, expectedDate, q.Get("X-Amz-Date")) - assert.Empty(t, q.Get("X-Amz-Meta-Other-Header")) - assert.Equal(t, expectedTarget, q.Get("X-Amz-Target")) -} - -func TestSignRequest(t *testing.T) { - req, body := buildRequest("dynamodb", "us-east-1", "{}") - signer := buildSigner() - signer.Sign(req, body, "dynamodb", "us-east-1", time.Unix(0, 0)) - - 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=ea766cabd2ec977d955a3c2bae1ae54f4515d70752f2207618396f20aa85bd21" - - q := req.Header - assert.Equal(t, expectedSig, q.Get("Authorization")) - assert.Equal(t, expectedDate, q.Get("X-Amz-Date")) -} - -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") - assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) -} - -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") - assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) -} - -func TestPresignEmptyBodyS3(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()) - hash := req.Header.Get("X-Amz-Content-Sha256") - assert.Equal(t, "UNSIGNED-PAYLOAD", hash) -} - -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") - assert.Equal(t, "PRECOMPUTED", hash) -} - -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() - assert.Empty(t, urlQ.Get("X-Amz-Signature")) - assert.Empty(t, urlQ.Get("X-Amz-Credential")) - assert.Empty(t, urlQ.Get("X-Amz-SignedHeaders")) - assert.Empty(t, urlQ.Get("X-Amz-Date")) - - hQ := r.HTTPRequest.Header - assert.Empty(t, hQ.Get("Authorization")) - assert.Empty(t, hQ.Get("X-Amz-Date")) -} - -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") - - signSDKRequestWithCurrTime(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) - }) - assert.NotEqual(t, sig, r.HTTPRequest.Header.Get("Authorization")) -} - -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") - - signSDKRequestWithCurrTime(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) - }) - assert.NotEqual(t, sig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature")) -} - -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 - } - } - assert.NotEmpty(t, origSignedHeaders) - assert.NotContains(t, origSignedHeaders, "authorization") - origSignedAt := r.LastSignedAt - - creds.Expire() - - signSDKRequestWithCurrTime(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") - assert.NotEqual(t, querySig, updatedQuerySig) - - var updatedSignedHeaders string - for _, p := range strings.Split(updatedQuerySig, ", ") { - if strings.HasPrefix(p, "SignedHeaders=") { - updatedSignedHeaders = p[len("SignedHeaders="):] - break - } - } - assert.NotEmpty(t, updatedSignedHeaders) - assert.NotContains(t, updatedQuerySig, "authorization") - assert.NotEqual(t, origSignedAt, r.LastSignedAt) -} - -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") - assert.NotEmpty(t, signedHeaders) - origSignedAt := r.LastSignedAt - - creds.Expire() - - signSDKRequestWithCurrTime(r, func() time.Time { - // Simulate the request occurred 15 minutes in the past - return time.Now().Add(-48 * time.Hour) - }) - assert.NotEqual(t, querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature")) - resignedHeaders := r.HTTPRequest.URL.Query().Get("X-Amz-SignedHeaders") - assert.Equal(t, signedHeaders, resignedHeaders) - assert.NotContains(t, signedHeaders, "x-amz-signedHeaders") - assert.NotEqual(t, origSignedAt, r.LastSignedAt) -} - -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 - - signSDKRequestWithCurrTime(r, func() time.Time { - // Simulate the request occurred 15 minutes in the past - return time.Now().Add(15 * time.Minute) - }) - assert.NotEqual(t, querySig, r.HTTPRequest.Header.Get("Authorization")) - assert.NotEqual(t, origSignedAt, r.LastSignedAt) -} - -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() - assert.NoError(t, err) - assert.Equal(t, expectBody, b) - w.WriteHeader(http.StatusOK) - })) - - req, err := http.NewRequest("POST", server.URL, nil) - - _, err = signer.Sign(req, bytes.NewReader(expectBody), "service", "region", time.Now()) - assert.NoError(t, err) - - resp, err := http.DefaultClient.Do(req) - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.StatusCode) -} - -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() - assert.NoError(t, err) - assert.Equal(t, len(expectBody), len(b)) - w.WriteHeader(http.StatusOK) - })) - - req, err := http.NewRequest("GET", server.URL, strings.NewReader("invalid body")) - - _, err = signer.Sign(req, nil, "service", "region", time.Now()) - req.ContentLength = 0 - - assert.NoError(t, err) - - resp, err := http.DefaultClient.Do(req) - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.StatusCode) -} - -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" - assert.Equal(t, expected, ctx.Request.URL.String()) -} - -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("expeect request body to not be chagned") - } -} - -func BenchmarkPresignRequest(b *testing.B) { - signer := buildSigner() - req, body := buildRequest("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 := buildRequest("dynamodb", "us-east-1", "{}") - for i := 0; i < b.N; i++ { - signer.Sign(req, body, "dynamodb", "us-east-1", time.Now()) - } -} - -func BenchmarkStripExcessSpaces(b *testing.B) { - vals := []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 `, - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - stripExcessSpaces(vals) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/types.go b/vendor/github.com/aws/aws-sdk-go/aws/types.go index 0e2d864..4550915 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/types.go @@ -3,15 +3,22 @@ package aws import ( "io" "sync" + + "github.com/aws/aws-sdk-go/internal/sdkio" ) -// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should -// only be used with an io.Reader that is also an io.Seeker. Doing so may -// cause request signature errors, or request body's not sent for GET, HEAD -// and DELETE HTTP methods. +// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Allows the +// SDK to accept an io.Reader that is not also an io.Seeker for unsigned +// streaming payload API operations. +// +// A ReadSeekCloser wrapping an nonseekable io.Reader used in an API +// operation's input will prevent that operation being retried in the case of +// network errors, and cause operation requests to fail if the operation +// requires payload signing. // -// Deprecated: Should only be used with io.ReadSeeker. If using for -// S3 PutObject to stream content use s3manager.Uploader instead. +// Note: If using With S3 PutObject to stream an object upload The SDK's S3 +// Upload manager (s3manager.Uploader) provides support for streaming with the +// ability to retry network errors. func ReadSeekCloser(r io.Reader) ReaderSeekerCloser { return ReaderSeekerCloser{r} } @@ -22,10 +29,27 @@ type ReaderSeekerCloser struct { r io.Reader } +// IsReaderSeekable returns if the underlying reader type can be seeked. A +// io.Reader might not actually be seekable if it is the ReaderSeekerCloser +// type. +func IsReaderSeekable(r io.Reader) bool { + switch v := r.(type) { + case ReaderSeekerCloser: + return v.IsSeeker() + case *ReaderSeekerCloser: + return v.IsSeeker() + case io.ReadSeeker: + return true + default: + return false + } +} + // Read reads from the reader up to size of p. The number of bytes read, and // error if it occurred will be returned. // -// If the reader is not an io.Reader zero bytes read, and nil error will be returned. +// If the reader is not an io.Reader zero bytes read, and nil error will be +// returned. // // Performs the same functionality as io.Reader Read func (r ReaderSeekerCloser) Read(p []byte) (int, error) { @@ -56,6 +80,71 @@ func (r ReaderSeekerCloser) IsSeeker() bool { return ok } +// HasLen returns the length of the underlying reader if the value implements +// the Len() int method. +func (r ReaderSeekerCloser) HasLen() (int, bool) { + type lenner interface { + Len() int + } + + if lr, ok := r.r.(lenner); ok { + return lr.Len(), true + } + + return 0, false +} + +// GetLen returns the length of the bytes remaining in the underlying reader. +// Checks first for Len(), then io.Seeker to determine the size of the +// underlying reader. +// +// Will return -1 if the length cannot be determined. +func (r ReaderSeekerCloser) GetLen() (int64, error) { + if l, ok := r.HasLen(); ok { + return int64(l), nil + } + + if s, ok := r.r.(io.Seeker); ok { + return seekerLen(s) + } + + return -1, nil +} + +// SeekerLen attempts to get the number of bytes remaining at the seeker's +// current position. Returns the number of bytes remaining or error. +func SeekerLen(s io.Seeker) (int64, error) { + // Determine if the seeker is actually seekable. ReaderSeekerCloser + // hides the fact that a io.Readers might not actually be seekable. + switch v := s.(type) { + case ReaderSeekerCloser: + return v.GetLen() + case *ReaderSeekerCloser: + return v.GetLen() + } + + return seekerLen(s) +} + +func seekerLen(s io.Seeker) (int64, error) { + curOffset, err := s.Seek(0, sdkio.SeekCurrent) + if err != nil { + return 0, err + } + + endOffset, err := s.Seek(0, sdkio.SeekEnd) + if err != nil { + return 0, err + } + + _, err = s.Seek(curOffset, sdkio.SeekStart) + if err != nil { + return 0, err + } + + return endOffset - curOffset, nil +} + // Close closes the ReaderSeekerCloser. // // If the ReaderSeekerCloser is not an io.Closer nothing will be done. 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 a7cd93b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/types_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package aws - -import ( - "math/rand" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestWriteAtBuffer(t *testing.T) { - b := &WriteAtBuffer{} - - n, err := b.WriteAt([]byte{1}, 0) - assert.NoError(t, err) - assert.Equal(t, 1, n) - - n, err = b.WriteAt([]byte{1, 1, 1}, 5) - assert.NoError(t, err) - assert.Equal(t, 3, n) - - n, err = b.WriteAt([]byte{2}, 1) - assert.NoError(t, err) - assert.Equal(t, 1, n) - - n, err = b.WriteAt([]byte{3}, 2) - assert.NoError(t, err) - assert.Equal(t, 1, n) - - assert.Equal(t, []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/url.go b/vendor/github.com/aws/aws-sdk-go/aws/url.go new file mode 100644 index 0000000..6192b24 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/url.go @@ -0,0 +1,12 @@ +// +build go1.8 + +package aws + +import "net/url" + +// URLHostname will extract the Hostname without port from the URL value. +// +// Wrapper of net/url#URL.Hostname for backwards Go version compatibility. +func URLHostname(url *url.URL) string { + return url.Hostname() +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go new file mode 100644 index 0000000..0210d27 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go @@ -0,0 +1,29 @@ +// +build !go1.8 + +package aws + +import ( + "net/url" + "strings" +) + +// URLHostname will extract the Hostname without port from the URL value. +// +// Copy of Go 1.8's net/url#URL.Hostname functionality. +func URLHostname(url *url.URL) string { + return stripPort(url.Host) + +} + +// stripPort is copy of Go 1.8 url#URL.Hostname functionality. +// https://golang.org/src/net/url/url.go +func stripPort(hostport string) string { + colon := strings.IndexByte(hostport, ':') + if colon == -1 { + return hostport + } + if i := strings.IndexByte(hostport, ']'); i != -1 { + return strings.TrimPrefix(hostport[:i], "[") + } + return hostport[:colon] +} 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 4e0410d..aa96a1a 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.8.7" +const SDKVersion = "1.26.3" diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/assert.go b/vendor/github.com/aws/aws-sdk-go/awstesting/assert.go deleted file mode 100644 index 5494dc7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/assert.go +++ /dev/null @@ -1,190 +0,0 @@ -package awstesting - -import ( - "encoding/json" - "encoding/xml" - "fmt" - "net/url" - "reflect" - "regexp" - "sort" - "strings" - "testing" -) - -// Match is a testing helper to test for testing error by comparing expected -// with a regular expression. -func Match(t *testing.T, regex, expected string) { - if !regexp.MustCompile(regex).Match([]byte(expected)) { - t.Errorf("%q\n\tdoes not match /%s/", expected, regex) - } -} - -// AssertURL verifies the expected URL is matches the actual. -func AssertURL(t *testing.T, expect, actual string, msgAndArgs ...interface{}) bool { - expectURL, err := url.Parse(expect) - if err != nil { - t.Errorf(errMsg("unable to parse expected URL", err, msgAndArgs)) - return false - } - actualURL, err := url.Parse(actual) - if err != nil { - t.Errorf(errMsg("unable to parse actual URL", err, msgAndArgs)) - return false - } - - equal(t, expectURL.Host, actualURL.Host, msgAndArgs...) - equal(t, expectURL.Scheme, actualURL.Scheme, msgAndArgs...) - equal(t, expectURL.Path, actualURL.Path, msgAndArgs...) - - return AssertQuery(t, expectURL.Query().Encode(), actualURL.Query().Encode(), msgAndArgs...) -} - -var queryMapKey = regexp.MustCompile("(.*?)\\.[0-9]+\\.key") - -// AssertQuery verifies the expect HTTP query string matches the actual. -func AssertQuery(t *testing.T, expect, actual string, msgAndArgs ...interface{}) bool { - expectQ, err := url.ParseQuery(expect) - if err != nil { - t.Errorf(errMsg("unable to parse expected Query", err, msgAndArgs)) - return false - } - actualQ, err := url.ParseQuery(actual) - if err != nil { - t.Errorf(errMsg("unable to parse actual Query", err, msgAndArgs)) - return false - } - - // Make sure the keys are the same - if !equal(t, queryValueKeys(expectQ), queryValueKeys(actualQ), msgAndArgs...) { - return false - } - - keys := map[string][]string{} - for key, v := range expectQ { - if queryMapKey.Match([]byte(key)) { - submatch := queryMapKey.FindStringSubmatch(key) - keys[submatch[1]] = append(keys[submatch[1]], v...) - } - } - - for k, v := range keys { - // clear all keys that have prefix - for key := range expectQ { - if strings.HasPrefix(key, k) { - delete(expectQ, key) - } - } - - sort.Strings(v) - for i, value := range v { - expectQ[fmt.Sprintf("%s.%d.key", k, i+1)] = []string{value} - } - } - - for k, expectQVals := range expectQ { - sort.Strings(expectQVals) - actualQVals := actualQ[k] - sort.Strings(actualQVals) - if !equal(t, expectQVals, actualQVals, msgAndArgs...) { - return false - } - } - - return true -} - -// AssertJSON verifies that the expect json string matches the actual. -func AssertJSON(t *testing.T, expect, actual string, msgAndArgs ...interface{}) bool { - expectVal := map[string]interface{}{} - if err := json.Unmarshal([]byte(expect), &expectVal); err != nil { - t.Errorf(errMsg("unable to parse expected JSON", err, msgAndArgs...)) - return false - } - - actualVal := map[string]interface{}{} - if err := json.Unmarshal([]byte(actual), &actualVal); err != nil { - t.Errorf(errMsg("unable to parse actual JSON", err, msgAndArgs...)) - return false - } - - return equal(t, expectVal, actualVal, msgAndArgs...) -} - -// AssertXML verifies that the expect xml string matches the actual. -func AssertXML(t *testing.T, expect, actual string, container interface{}, msgAndArgs ...interface{}) bool { - expectVal := container - if err := xml.Unmarshal([]byte(expect), &expectVal); err != nil { - t.Errorf(errMsg("unable to parse expected XML", err, msgAndArgs...)) - } - - actualVal := container - if err := xml.Unmarshal([]byte(actual), &actualVal); err != nil { - t.Errorf(errMsg("unable to parse actual XML", err, msgAndArgs...)) - } - return equal(t, expectVal, actualVal, msgAndArgs...) -} - -// objectsAreEqual determines if two objects are considered equal. -// -// This function does no assertion of any kind. -// -// Based on github.com/stretchr/testify/assert.ObjectsAreEqual -// Copied locally to prevent non-test build dependencies on testify -func objectsAreEqual(expected, actual interface{}) bool { - if expected == nil || actual == nil { - return expected == actual - } - - return reflect.DeepEqual(expected, actual) -} - -// Equal asserts that two objects are equal. -// -// assert.Equal(t, 123, 123, "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -// -// Based on github.com/stretchr/testify/assert.Equal -// Copied locally to prevent non-test build dependencies on testify -func equal(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{}) bool { - if !objectsAreEqual(expected, actual) { - t.Errorf("Not Equal:\n\t%#v (expected)\n\t%#v (actual), %s", - expected, actual, messageFromMsgAndArgs(msgAndArgs)) - return false - } - - return true -} - -func errMsg(baseMsg string, err error, msgAndArgs ...interface{}) string { - message := messageFromMsgAndArgs(msgAndArgs) - if message != "" { - message += ", " - } - return fmt.Sprintf("%s%s, %v", message, baseMsg, err) -} - -// Based on github.com/stretchr/testify/assert.messageFromMsgAndArgs -// Copied locally to prevent non-test build dependencies on testify -func messageFromMsgAndArgs(msgAndArgs []interface{}) string { - if len(msgAndArgs) == 0 || msgAndArgs == nil { - return "" - } - if len(msgAndArgs) == 1 { - return msgAndArgs[0].(string) - } - if len(msgAndArgs) > 1 { - return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) - } - return "" -} - -func queryValueKeys(v url.Values) []string { - keys := make([]string, 0, len(v)) - for k := range v { - keys = append(keys, k) - } - sort.Strings(keys) - return keys -} diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/assert_test.go b/vendor/github.com/aws/aws-sdk-go/awstesting/assert_test.go deleted file mode 100644 index f72abfb..0000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/assert_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package awstesting_test - -import ( - "encoding/xml" - "testing" - - "github.com/aws/aws-sdk-go/awstesting" -) - -func TestAssertJSON(t *testing.T) { - cases := []struct { - e, a string - asserts bool - }{ - { - e: `{"RecursiveStruct":{"RecursiveMap":{"foo":{"NoRecurse":"foo"},"bar":{"NoRecurse":"bar"}}}}`, - a: `{"RecursiveStruct":{"RecursiveMap":{"bar":{"NoRecurse":"bar"},"foo":{"NoRecurse":"foo"}}}}`, - asserts: true, - }, - } - - for i, c := range cases { - mockT := &testing.T{} - if awstesting.AssertJSON(mockT, c.e, c.a) != c.asserts { - t.Error("Assert JSON result was not expected.", i) - } - } -} - -func TestAssertXML(t *testing.T) { - cases := []struct { - e, a string - asserts bool - container struct { - XMLName xml.Name `xml:"OperationRequest"` - NS string `xml:"xmlns,attr"` - RecursiveStruct struct { - RecursiveMap struct { - Entries []struct { - XMLName xml.Name `xml:"entries"` - Key string `xml:"key"` - Value struct { - XMLName xml.Name `xml:"value"` - NoRecurse string - } - } - } - } - } - }{ - { - e: `foofoobarbar`, - a: `barbarfoofoo`, - asserts: true, - }, - } - - for i, c := range cases { - // mockT := &testing.T{} - if awstesting.AssertXML(t, c.e, c.a, c.container) != c.asserts { - t.Error("Assert XML result was not expected.", i) - } - } -} - -func TestAssertQuery(t *testing.T) { - cases := []struct { - e, a string - asserts bool - }{ - { - e: `Action=OperationName&Version=2014-01-01&Foo=val1&Bar=val2`, - a: `Action=OperationName&Version=2014-01-01&Foo=val2&Bar=val3`, - asserts: false, - }, - { - e: `Action=OperationName&Version=2014-01-01&Foo=val1&Bar=val2`, - a: `Action=OperationName&Version=2014-01-01&Foo=val1&Bar=val2`, - asserts: true, - }, - } - - for i, c := range cases { - mockT := &testing.T{} - if awstesting.AssertQuery(mockT, c.e, c.a) != c.asserts { - t.Error("Assert Query result was not expected.", i) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/client.go b/vendor/github.com/aws/aws-sdk-go/awstesting/client.go deleted file mode 100644 index 539639d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/client.go +++ /dev/null @@ -1,24 +0,0 @@ -package awstesting - -import ( - "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/defaults" -) - -// NewClient creates and initializes a generic service client for testing. -func NewClient(cfgs ...*aws.Config) *client.Client { - info := metadata.ClientInfo{ - Endpoint: "http://endpoint", - SigningName: "", - } - def := defaults.Get() - def.Config.MergeIn(cfgs...) - - if v := aws.StringValue(def.Config.Endpoint); len(v) > 0 { - info.Endpoint = v - } - - return client.New(*def.Config, info, def.Handlers) -} diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/mock/mock.go b/vendor/github.com/aws/aws-sdk-go/awstesting/mock/mock.go deleted file mode 100644 index 1bc9290..0000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/mock/mock.go +++ /dev/null @@ -1,45 +0,0 @@ -package mock - -import ( - "net/http" - "net/http/httptest" - - "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/session" -) - -// Session is a mock session which is used to hit the mock server -var Session = func() *session.Session { - // server is the mock server that simply writes a 200 status back to the client - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - })) - - return session.Must(session.NewSession(&aws.Config{ - DisableSSL: aws.Bool(true), - Endpoint: aws.String(server.URL), - })) -}() - -// NewMockClient creates and initializes a client that will connect to the -// mock server -func NewMockClient(cfgs ...*aws.Config) *client.Client { - c := Session.ClientConfig("Mock", cfgs...) - - svc := client.New( - *c.Config, - metadata.ClientInfo{ - ServiceName: "Mock", - SigningRegion: c.SigningRegion, - Endpoint: c.Endpoint, - APIVersion: "2015-12-08", - JSONVersion: "1.1", - TargetPrefix: "MockServer", - }, - c.Handlers, - ) - - return svc -} diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/unit/unit.go b/vendor/github.com/aws/aws-sdk-go/awstesting/unit/unit.go deleted file mode 100644 index 1c6e605..0000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/unit/unit.go +++ /dev/null @@ -1,13 +0,0 @@ -// Package unit performs initialization and validation for unit tests -package unit - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/session" -) - -// Session is a shared session for unit tests to use. -var Session = session.Must(session.NewSession(aws.NewConfig(). - WithCredentials(credentials.NewStaticCredentials("AKID", "SECRET", "SESSION")). - WithRegion("mock-region"))) diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/util.go b/vendor/github.com/aws/aws-sdk-go/awstesting/util.go deleted file mode 100644 index fde4dcc..0000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/util.go +++ /dev/null @@ -1,94 +0,0 @@ -package awstesting - -import ( - "io" - "time" - - "github.com/aws/aws-sdk-go/private/util" -) - -// ZeroReader is a io.Reader which will always write zeros to the byte slice provided. -type ZeroReader struct{} - -// Read fills the provided byte slice with zeros returning the number of bytes written. -func (r *ZeroReader) Read(b []byte) (int, error) { - for i := 0; i < len(b); i++ { - b[i] = 0 - } - return len(b), nil -} - -// ReadCloser is a io.ReadCloser for unit testing. -// Designed to test for leaks and whether a handle has -// been closed -type ReadCloser struct { - Size int - Closed bool - set bool - FillData func(bool, []byte, int, int) -} - -// Read will call FillData and fill it with whatever data needed. -// Decrements the size until zero, then return io.EOF. -func (r *ReadCloser) Read(b []byte) (int, error) { - if r.Closed { - return 0, io.EOF - } - - delta := len(b) - if delta > r.Size { - delta = r.Size - } - r.Size -= delta - - for i := 0; i < delta; i++ { - b[i] = 'a' - } - - if r.FillData != nil { - r.FillData(r.set, b, r.Size, delta) - } - r.set = true - - if r.Size > 0 { - return delta, nil - } - return delta, io.EOF -} - -// Close sets Closed to true and returns no error -func (r *ReadCloser) Close() error { - r.Closed = true - return nil -} - -// SortedKeys returns a sorted slice of keys of a map. -func SortedKeys(m map[string]interface{}) []string { - return util.SortedKeys(m) -} - -// A FakeContext provides a simple stub implementation of a Context -type FakeContext struct { - Error error - DoneCh chan struct{} -} - -// Deadline always will return not set -func (c *FakeContext) Deadline() (deadline time.Time, ok bool) { - return time.Time{}, false -} - -// Done returns a read channel for listening to the Done event -func (c *FakeContext) Done() <-chan struct{} { - return c.DoneCh -} - -// Err returns the error, is nil if not set. -func (c *FakeContext) Err() error { - return c.Error -} - -// Value ignores the Value and always returns nil -func (c *FakeContext) Value(key interface{}) interface{} { - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/awstesting/util_test.go b/vendor/github.com/aws/aws-sdk-go/awstesting/util_test.go deleted file mode 100644 index 4b03db0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/awstesting/util_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package awstesting_test - -import ( - "io" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/aws/aws-sdk-go/awstesting" -) - -func TestReadCloserClose(t *testing.T) { - rc := awstesting.ReadCloser{Size: 1} - err := rc.Close() - - assert.Nil(t, err) - assert.True(t, rc.Closed) - assert.Equal(t, rc.Size, 1) -} - -func TestReadCloserRead(t *testing.T) { - rc := awstesting.ReadCloser{Size: 5} - b := make([]byte, 2) - - n, err := rc.Read(b) - - assert.Nil(t, err) - assert.Equal(t, n, 2) - assert.False(t, rc.Closed) - assert.Equal(t, rc.Size, 3) - - err = rc.Close() - assert.Nil(t, err) - n, err = rc.Read(b) - assert.Equal(t, err, io.EOF) - assert.Equal(t, n, 0) -} - -func TestReadCloserReadAll(t *testing.T) { - rc := awstesting.ReadCloser{Size: 5} - b := make([]byte, 5) - - n, err := rc.Read(b) - - assert.Equal(t, err, io.EOF) - assert.Equal(t, n, 5) - assert.False(t, rc.Closed) - assert.Equal(t, rc.Size, 0) -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go new file mode 100644 index 0000000..e83a998 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go @@ -0,0 +1,120 @@ +package ini + +// ASTKind represents different states in the parse table +// and the type of AST that is being constructed +type ASTKind int + +// ASTKind* is used in the parse table to transition between +// the different states +const ( + ASTKindNone = ASTKind(iota) + ASTKindStart + ASTKindExpr + ASTKindEqualExpr + ASTKindStatement + ASTKindSkipStatement + ASTKindExprStatement + ASTKindSectionStatement + ASTKindNestedSectionStatement + ASTKindCompletedNestedSectionStatement + ASTKindCommentStatement + ASTKindCompletedSectionStatement +) + +func (k ASTKind) String() string { + switch k { + case ASTKindNone: + return "none" + case ASTKindStart: + return "start" + case ASTKindExpr: + return "expr" + case ASTKindStatement: + return "stmt" + case ASTKindSectionStatement: + return "section_stmt" + case ASTKindExprStatement: + return "expr_stmt" + case ASTKindCommentStatement: + return "comment" + case ASTKindNestedSectionStatement: + return "nested_section_stmt" + case ASTKindCompletedSectionStatement: + return "completed_stmt" + case ASTKindSkipStatement: + return "skip" + default: + return "" + } +} + +// AST interface allows us to determine what kind of node we +// are on and casting may not need to be necessary. +// +// The root is always the first node in Children +type AST struct { + Kind ASTKind + Root Token + RootToken bool + Children []AST +} + +func newAST(kind ASTKind, root AST, children ...AST) AST { + return AST{ + Kind: kind, + Children: append([]AST{root}, children...), + } +} + +func newASTWithRootToken(kind ASTKind, root Token, children ...AST) AST { + return AST{ + Kind: kind, + Root: root, + RootToken: true, + Children: children, + } +} + +// AppendChild will append to the list of children an AST has. +func (a *AST) AppendChild(child AST) { + a.Children = append(a.Children, child) +} + +// GetRoot will return the root AST which can be the first entry +// in the children list or a token. +func (a *AST) GetRoot() AST { + if a.RootToken { + return *a + } + + if len(a.Children) == 0 { + return AST{} + } + + return a.Children[0] +} + +// GetChildren will return the current AST's list of children +func (a *AST) GetChildren() []AST { + if len(a.Children) == 0 { + return []AST{} + } + + if a.RootToken { + return a.Children + } + + return a.Children[1:] +} + +// SetChildren will set and override all children of the AST. +func (a *AST) SetChildren(children []AST) { + if a.RootToken { + a.Children = children + } else { + a.Children = append(a.Children[:1], children...) + } +} + +// Start is used to indicate the starting state of the parse table. +var Start = newAST(ASTKindStart, AST{}) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go new file mode 100644 index 0000000..0895d53 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go @@ -0,0 +1,11 @@ +package ini + +var commaRunes = []rune(",") + +func isComma(b rune) bool { + return b == ',' +} + +func newCommaToken() Token { + return newToken(TokenComma, commaRunes, NoneType) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go new file mode 100644 index 0000000..0b76999 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go @@ -0,0 +1,35 @@ +package ini + +// isComment will return whether or not the next byte(s) is a +// comment. +func isComment(b []rune) bool { + if len(b) == 0 { + return false + } + + switch b[0] { + case ';': + return true + case '#': + return true + } + + return false +} + +// newCommentToken will create a comment token and +// return how many bytes were read. +func newCommentToken(b []rune) (Token, int, error) { + i := 0 + for ; i < len(b); i++ { + if b[i] == '\n' { + break + } + + if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { + break + } + } + + return newToken(TokenComment, b[:i], NoneType), i, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go new file mode 100644 index 0000000..25ce0fe --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go @@ -0,0 +1,29 @@ +// Package ini is an LL(1) parser for configuration files. +// +// Example: +// sections, err := ini.OpenFile("/path/to/file") +// if err != nil { +// panic(err) +// } +// +// profile := "foo" +// section, ok := sections.GetSection(profile) +// if !ok { +// fmt.Printf("section %q could not be found", profile) +// } +// +// Below is the BNF that describes this parser +// Grammar: +// stmt -> value stmt' +// stmt' -> epsilon | op stmt +// value -> number | string | boolean | quoted_string +// +// section -> [ section' +// section' -> value section_close +// section_close -> ] +// +// SkipState will skip (NL WS)+ +// +// comment -> # comment' | ; comment' +// comment' -> epsilon | value +package ini diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go new file mode 100644 index 0000000..04345a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go @@ -0,0 +1,4 @@ +package ini + +// emptyToken is used to satisfy the Token interface +var emptyToken = newToken(TokenNone, []rune{}, NoneType) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go new file mode 100644 index 0000000..91ba2a5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go @@ -0,0 +1,24 @@ +package ini + +// newExpression will return an expression AST. +// Expr represents an expression +// +// grammar: +// expr -> string | number +func newExpression(tok Token) AST { + return newASTWithRootToken(ASTKindExpr, tok) +} + +func newEqualExpr(left AST, tok Token) AST { + return newASTWithRootToken(ASTKindEqualExpr, tok, left) +} + +// EqualExprKey will return a LHS value in the equal expr +func EqualExprKey(ast AST) string { + children := ast.GetChildren() + if len(children) == 0 || ast.Kind != ASTKindEqualExpr { + return "" + } + + return string(children[0].Root.Raw()) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go new file mode 100644 index 0000000..8d462f7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go @@ -0,0 +1,17 @@ +// +build gofuzz + +package ini + +import ( + "bytes" +) + +func Fuzz(data []byte) int { + b := bytes.NewReader(data) + + if _, err := Parse(b); err != nil { + return 0 + } + + return 1 +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go new file mode 100644 index 0000000..3b0ca7a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go @@ -0,0 +1,51 @@ +package ini + +import ( + "io" + "os" + + "github.com/aws/aws-sdk-go/aws/awserr" +) + +// OpenFile takes a path to a given file, and will open and parse +// that file. +func OpenFile(path string) (Sections, error) { + f, err := os.Open(path) + if err != nil { + return Sections{}, awserr.New(ErrCodeUnableToReadFile, "unable to open file", err) + } + defer f.Close() + + return Parse(f) +} + +// Parse will parse the given file using the shared config +// visitor. +func Parse(f io.Reader) (Sections, error) { + tree, err := ParseAST(f) + if err != nil { + return Sections{}, err + } + + v := NewDefaultVisitor() + if err = Walk(tree, v); err != nil { + return Sections{}, err + } + + return v.Sections, nil +} + +// ParseBytes will parse the given bytes and return the parsed sections. +func ParseBytes(b []byte) (Sections, error) { + tree, err := ParseASTBytes(b) + if err != nil { + return Sections{}, err + } + + v := NewDefaultVisitor() + if err = Walk(tree, v); err != nil { + return Sections{}, err + } + + return v.Sections, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go new file mode 100644 index 0000000..582c024 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go @@ -0,0 +1,165 @@ +package ini + +import ( + "bytes" + "io" + "io/ioutil" + + "github.com/aws/aws-sdk-go/aws/awserr" +) + +const ( + // ErrCodeUnableToReadFile is used when a file is failed to be + // opened or read from. + ErrCodeUnableToReadFile = "FailedRead" +) + +// TokenType represents the various different tokens types +type TokenType int + +func (t TokenType) String() string { + switch t { + case TokenNone: + return "none" + case TokenLit: + return "literal" + case TokenSep: + return "sep" + case TokenOp: + return "op" + case TokenWS: + return "ws" + case TokenNL: + return "newline" + case TokenComment: + return "comment" + case TokenComma: + return "comma" + default: + return "" + } +} + +// TokenType enums +const ( + TokenNone = TokenType(iota) + TokenLit + TokenSep + TokenComma + TokenOp + TokenWS + TokenNL + TokenComment +) + +type iniLexer struct{} + +// Tokenize will return a list of tokens during lexical analysis of the +// io.Reader. +func (l *iniLexer) Tokenize(r io.Reader) ([]Token, error) { + b, err := ioutil.ReadAll(r) + if err != nil { + return nil, awserr.New(ErrCodeUnableToReadFile, "unable to read file", err) + } + + return l.tokenize(b) +} + +func (l *iniLexer) tokenize(b []byte) ([]Token, error) { + runes := bytes.Runes(b) + var err error + n := 0 + tokenAmount := countTokens(runes) + tokens := make([]Token, tokenAmount) + count := 0 + + for len(runes) > 0 && count < tokenAmount { + switch { + case isWhitespace(runes[0]): + tokens[count], n, err = newWSToken(runes) + case isComma(runes[0]): + tokens[count], n = newCommaToken(), 1 + case isComment(runes): + tokens[count], n, err = newCommentToken(runes) + case isNewline(runes): + tokens[count], n, err = newNewlineToken(runes) + case isSep(runes): + tokens[count], n, err = newSepToken(runes) + case isOp(runes): + tokens[count], n, err = newOpToken(runes) + default: + tokens[count], n, err = newLitToken(runes) + } + + if err != nil { + return nil, err + } + + count++ + + runes = runes[n:] + } + + return tokens[:count], nil +} + +func countTokens(runes []rune) int { + count, n := 0, 0 + var err error + + for len(runes) > 0 { + switch { + case isWhitespace(runes[0]): + _, n, err = newWSToken(runes) + case isComma(runes[0]): + _, n = newCommaToken(), 1 + case isComment(runes): + _, n, err = newCommentToken(runes) + case isNewline(runes): + _, n, err = newNewlineToken(runes) + case isSep(runes): + _, n, err = newSepToken(runes) + case isOp(runes): + _, n, err = newOpToken(runes) + default: + _, n, err = newLitToken(runes) + } + + if err != nil { + return 0 + } + + count++ + runes = runes[n:] + } + + return count + 1 +} + +// Token indicates a metadata about a given value. +type Token struct { + t TokenType + ValueType ValueType + base int + raw []rune +} + +var emptyValue = Value{} + +func newToken(t TokenType, raw []rune, v ValueType) Token { + return Token{ + t: t, + raw: raw, + ValueType: v, + } +} + +// Raw return the raw runes that were consumed +func (tok Token) Raw() []rune { + return tok.raw +} + +// Type returns the token type +func (tok Token) Type() TokenType { + return tok.t +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go new file mode 100644 index 0000000..cf9fad8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go @@ -0,0 +1,356 @@ +package ini + +import ( + "fmt" + "io" +) + +// State enums for the parse table +const ( + InvalidState = iota + // stmt -> value stmt' + StatementState + // stmt' -> MarkComplete | op stmt + StatementPrimeState + // value -> number | string | boolean | quoted_string + ValueState + // section -> [ section' + OpenScopeState + // section' -> value section_close + SectionState + // section_close -> ] + CloseScopeState + // SkipState will skip (NL WS)+ + SkipState + // SkipTokenState will skip any token and push the previous + // state onto the stack. + SkipTokenState + // comment -> # comment' | ; comment' + // comment' -> MarkComplete | value + CommentState + // MarkComplete state will complete statements and move that + // to the completed AST list + MarkCompleteState + // TerminalState signifies that the tokens have been fully parsed + TerminalState +) + +// parseTable is a state machine to dictate the grammar above. +var parseTable = map[ASTKind]map[TokenType]int{ + ASTKindStart: map[TokenType]int{ + TokenLit: StatementState, + TokenSep: OpenScopeState, + TokenWS: SkipTokenState, + TokenNL: SkipTokenState, + TokenComment: CommentState, + TokenNone: TerminalState, + }, + ASTKindCommentStatement: map[TokenType]int{ + TokenLit: StatementState, + TokenSep: OpenScopeState, + TokenWS: SkipTokenState, + TokenNL: SkipTokenState, + TokenComment: CommentState, + TokenNone: MarkCompleteState, + }, + ASTKindExpr: map[TokenType]int{ + TokenOp: StatementPrimeState, + TokenLit: ValueState, + TokenSep: OpenScopeState, + TokenWS: ValueState, + TokenNL: SkipState, + TokenComment: CommentState, + TokenNone: MarkCompleteState, + }, + ASTKindEqualExpr: map[TokenType]int{ + TokenLit: ValueState, + TokenWS: SkipTokenState, + TokenNL: SkipState, + }, + ASTKindStatement: map[TokenType]int{ + TokenLit: SectionState, + TokenSep: CloseScopeState, + TokenWS: SkipTokenState, + TokenNL: SkipTokenState, + TokenComment: CommentState, + TokenNone: MarkCompleteState, + }, + ASTKindExprStatement: map[TokenType]int{ + TokenLit: ValueState, + TokenSep: OpenScopeState, + TokenOp: ValueState, + TokenWS: ValueState, + TokenNL: MarkCompleteState, + TokenComment: CommentState, + TokenNone: TerminalState, + TokenComma: SkipState, + }, + ASTKindSectionStatement: map[TokenType]int{ + TokenLit: SectionState, + TokenOp: SectionState, + TokenSep: CloseScopeState, + TokenWS: SectionState, + TokenNL: SkipTokenState, + }, + ASTKindCompletedSectionStatement: map[TokenType]int{ + TokenWS: SkipTokenState, + TokenNL: SkipTokenState, + TokenLit: StatementState, + TokenSep: OpenScopeState, + TokenComment: CommentState, + TokenNone: MarkCompleteState, + }, + ASTKindSkipStatement: map[TokenType]int{ + TokenLit: StatementState, + TokenSep: OpenScopeState, + TokenWS: SkipTokenState, + TokenNL: SkipTokenState, + TokenComment: CommentState, + TokenNone: TerminalState, + }, +} + +// ParseAST will parse input from an io.Reader using +// an LL(1) parser. +func ParseAST(r io.Reader) ([]AST, error) { + lexer := iniLexer{} + tokens, err := lexer.Tokenize(r) + if err != nil { + return []AST{}, err + } + + return parse(tokens) +} + +// ParseASTBytes will parse input from a byte slice using +// an LL(1) parser. +func ParseASTBytes(b []byte) ([]AST, error) { + lexer := iniLexer{} + tokens, err := lexer.tokenize(b) + if err != nil { + return []AST{}, err + } + + return parse(tokens) +} + +func parse(tokens []Token) ([]AST, error) { + start := Start + stack := newParseStack(3, len(tokens)) + + stack.Push(start) + s := newSkipper() + +loop: + for stack.Len() > 0 { + k := stack.Pop() + + var tok Token + if len(tokens) == 0 { + // this occurs when all the tokens have been processed + // but reduction of what's left on the stack needs to + // occur. + tok = emptyToken + } else { + tok = tokens[0] + } + + step := parseTable[k.Kind][tok.Type()] + if s.ShouldSkip(tok) { + // being in a skip state with no tokens will break out of + // the parse loop since there is nothing left to process. + if len(tokens) == 0 { + break loop + } + // if should skip is true, we skip the tokens until should skip is set to false. + step = SkipTokenState + } + + switch step { + case TerminalState: + // Finished parsing. Push what should be the last + // statement to the stack. If there is anything left + // on the stack, an error in parsing has occurred. + if k.Kind != ASTKindStart { + stack.MarkComplete(k) + } + break loop + case SkipTokenState: + // When skipping a token, the previous state was popped off the stack. + // To maintain the correct state, the previous state will be pushed + // onto the stack. + stack.Push(k) + case StatementState: + if k.Kind != ASTKindStart { + stack.MarkComplete(k) + } + expr := newExpression(tok) + stack.Push(expr) + case StatementPrimeState: + if tok.Type() != TokenOp { + stack.MarkComplete(k) + continue + } + + if k.Kind != ASTKindExpr { + return nil, NewParseError( + fmt.Sprintf("invalid expression: expected Expr type, but found %T type", k), + ) + } + + k = trimSpaces(k) + expr := newEqualExpr(k, tok) + stack.Push(expr) + case ValueState: + // ValueState requires the previous state to either be an equal expression + // or an expression statement. + // + // This grammar occurs when the RHS is a number, word, or quoted string. + // equal_expr -> lit op equal_expr' + // equal_expr' -> number | string | quoted_string + // quoted_string -> " quoted_string' + // quoted_string' -> string quoted_string_end + // quoted_string_end -> " + // + // otherwise + // expr_stmt -> equal_expr (expr_stmt')* + // expr_stmt' -> ws S | op S | MarkComplete + // S -> equal_expr' expr_stmt' + switch k.Kind { + case ASTKindEqualExpr: + // assigning a value to some key + k.AppendChild(newExpression(tok)) + stack.Push(newExprStatement(k)) + case ASTKindExpr: + k.Root.raw = append(k.Root.raw, tok.Raw()...) + stack.Push(k) + case ASTKindExprStatement: + root := k.GetRoot() + children := root.GetChildren() + if len(children) == 0 { + return nil, NewParseError( + fmt.Sprintf("invalid expression: AST contains no children %s", k.Kind), + ) + } + + rhs := children[len(children)-1] + + if rhs.Root.ValueType != QuotedStringType { + rhs.Root.ValueType = StringType + rhs.Root.raw = append(rhs.Root.raw, tok.Raw()...) + + } + + children[len(children)-1] = rhs + k.SetChildren(children) + + stack.Push(k) + } + case OpenScopeState: + if !runeCompare(tok.Raw(), openBrace) { + return nil, NewParseError("expected '['") + } + // If OpenScopeState is not at the start, we must mark the previous ast as complete + // + // for example: if previous ast was a skip statement; + // we should mark it as complete before we create a new statement + if k.Kind != ASTKindStart { + stack.MarkComplete(k) + } + + stmt := newStatement() + stack.Push(stmt) + case CloseScopeState: + if !runeCompare(tok.Raw(), closeBrace) { + return nil, NewParseError("expected ']'") + } + + k = trimSpaces(k) + stack.Push(newCompletedSectionStatement(k)) + case SectionState: + var stmt AST + + switch k.Kind { + case ASTKindStatement: + // If there are multiple literals inside of a scope declaration, + // then the current token's raw value will be appended to the Name. + // + // This handles cases like [ profile default ] + // + // k will represent a SectionStatement with the children representing + // the label of the section + stmt = newSectionStatement(tok) + case ASTKindSectionStatement: + k.Root.raw = append(k.Root.raw, tok.Raw()...) + stmt = k + default: + return nil, NewParseError( + fmt.Sprintf("invalid statement: expected statement: %v", k.Kind), + ) + } + + stack.Push(stmt) + case MarkCompleteState: + if k.Kind != ASTKindStart { + stack.MarkComplete(k) + } + + if stack.Len() == 0 { + stack.Push(start) + } + case SkipState: + stack.Push(newSkipStatement(k)) + s.Skip() + case CommentState: + if k.Kind == ASTKindStart { + stack.Push(k) + } else { + stack.MarkComplete(k) + } + + stmt := newCommentStatement(tok) + stack.Push(stmt) + default: + return nil, NewParseError( + fmt.Sprintf("invalid state with ASTKind %v and TokenType %v", + k, tok.Type())) + } + + if len(tokens) > 0 { + tokens = tokens[1:] + } + } + + // this occurs when a statement has not been completed + if stack.top > 1 { + return nil, NewParseError(fmt.Sprintf("incomplete ini expression")) + } + + // returns a sublist which excludes the start symbol + return stack.List(), nil +} + +// trimSpaces will trim spaces on the left and right hand side of +// the literal. +func trimSpaces(k AST) AST { + // trim left hand side of spaces + for i := 0; i < len(k.Root.raw); i++ { + if !isWhitespace(k.Root.raw[i]) { + break + } + + k.Root.raw = k.Root.raw[1:] + i-- + } + + // trim right hand side of spaces + for i := len(k.Root.raw) - 1; i >= 0; i-- { + if !isWhitespace(k.Root.raw[i]) { + break + } + + k.Root.raw = k.Root.raw[:len(k.Root.raw)-1] + } + + return k +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go new file mode 100644 index 0000000..24df543 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go @@ -0,0 +1,324 @@ +package ini + +import ( + "fmt" + "strconv" + "strings" +) + +var ( + runesTrue = []rune("true") + runesFalse = []rune("false") +) + +var literalValues = [][]rune{ + runesTrue, + runesFalse, +} + +func isBoolValue(b []rune) bool { + for _, lv := range literalValues { + if isLitValue(lv, b) { + return true + } + } + return false +} + +func isLitValue(want, have []rune) bool { + if len(have) < len(want) { + return false + } + + for i := 0; i < len(want); i++ { + if want[i] != have[i] { + return false + } + } + + return true +} + +// isNumberValue will return whether not the leading characters in +// a byte slice is a number. A number is delimited by whitespace or +// the newline token. +// +// A number is defined to be in a binary, octal, decimal (int | float), hex format, +// or in scientific notation. +func isNumberValue(b []rune) bool { + negativeIndex := 0 + helper := numberHelper{} + needDigit := false + + for i := 0; i < len(b); i++ { + negativeIndex++ + + switch b[i] { + case '-': + if helper.IsNegative() || negativeIndex != 1 { + return false + } + helper.Determine(b[i]) + needDigit = true + continue + case 'e', 'E': + if err := helper.Determine(b[i]); err != nil { + return false + } + negativeIndex = 0 + needDigit = true + continue + case 'b': + if helper.numberFormat == hex { + break + } + fallthrough + case 'o', 'x': + needDigit = true + if i == 0 { + return false + } + + fallthrough + case '.': + if err := helper.Determine(b[i]); err != nil { + return false + } + needDigit = true + continue + } + + if i > 0 && (isNewline(b[i:]) || isWhitespace(b[i])) { + return !needDigit + } + + if !helper.CorrectByte(b[i]) { + return false + } + needDigit = false + } + + return !needDigit +} + +func isValid(b []rune) (bool, int, error) { + if len(b) == 0 { + // TODO: should probably return an error + return false, 0, nil + } + + return isValidRune(b[0]), 1, nil +} + +func isValidRune(r rune) bool { + return r != ':' && r != '=' && r != '[' && r != ']' && r != ' ' && r != '\n' +} + +// ValueType is an enum that will signify what type +// the Value is +type ValueType int + +func (v ValueType) String() string { + switch v { + case NoneType: + return "NONE" + case DecimalType: + return "FLOAT" + case IntegerType: + return "INT" + case StringType: + return "STRING" + case BoolType: + return "BOOL" + } + + return "" +} + +// ValueType enums +const ( + NoneType = ValueType(iota) + DecimalType + IntegerType + StringType + QuotedStringType + BoolType +) + +// Value is a union container +type Value struct { + Type ValueType + raw []rune + + integer int64 + decimal float64 + boolean bool + str string +} + +func newValue(t ValueType, base int, raw []rune) (Value, error) { + v := Value{ + Type: t, + raw: raw, + } + var err error + + switch t { + case DecimalType: + v.decimal, err = strconv.ParseFloat(string(raw), 64) + case IntegerType: + if base != 10 { + raw = raw[2:] + } + + v.integer, err = strconv.ParseInt(string(raw), base, 64) + case StringType: + v.str = string(raw) + case QuotedStringType: + v.str = string(raw[1 : len(raw)-1]) + case BoolType: + v.boolean = runeCompare(v.raw, runesTrue) + } + + // issue 2253 + // + // if the value trying to be parsed is too large, then we will use + // the 'StringType' and raw value instead. + if nerr, ok := err.(*strconv.NumError); ok && nerr.Err == strconv.ErrRange { + v.Type = StringType + v.str = string(raw) + err = nil + } + + return v, err +} + +// Append will append values and change the type to a string +// type. +func (v *Value) Append(tok Token) { + r := tok.Raw() + if v.Type != QuotedStringType { + v.Type = StringType + r = tok.raw[1 : len(tok.raw)-1] + } + if tok.Type() != TokenLit { + v.raw = append(v.raw, tok.Raw()...) + } else { + v.raw = append(v.raw, r...) + } +} + +func (v Value) String() string { + switch v.Type { + case DecimalType: + return fmt.Sprintf("decimal: %f", v.decimal) + case IntegerType: + return fmt.Sprintf("integer: %d", v.integer) + case StringType: + return fmt.Sprintf("string: %s", string(v.raw)) + case QuotedStringType: + return fmt.Sprintf("quoted string: %s", string(v.raw)) + case BoolType: + return fmt.Sprintf("bool: %t", v.boolean) + default: + return "union not set" + } +} + +func newLitToken(b []rune) (Token, int, error) { + n := 0 + var err error + + token := Token{} + if b[0] == '"' { + n, err = getStringValue(b) + if err != nil { + return token, n, err + } + + token = newToken(TokenLit, b[:n], QuotedStringType) + } else if isNumberValue(b) { + var base int + base, n, err = getNumericalValue(b) + if err != nil { + return token, 0, err + } + + value := b[:n] + vType := IntegerType + if contains(value, '.') || hasExponent(value) { + vType = DecimalType + } + token = newToken(TokenLit, value, vType) + token.base = base + } else if isBoolValue(b) { + n, err = getBoolValue(b) + + token = newToken(TokenLit, b[:n], BoolType) + } else { + n, err = getValue(b) + token = newToken(TokenLit, b[:n], StringType) + } + + return token, n, err +} + +// IntValue returns an integer value +func (v Value) IntValue() int64 { + return v.integer +} + +// FloatValue returns a float value +func (v Value) FloatValue() float64 { + return v.decimal +} + +// BoolValue returns a bool value +func (v Value) BoolValue() bool { + return v.boolean +} + +func isTrimmable(r rune) bool { + switch r { + case '\n', ' ': + return true + } + return false +} + +// StringValue returns the string value +func (v Value) StringValue() string { + switch v.Type { + case StringType: + return strings.TrimFunc(string(v.raw), isTrimmable) + case QuotedStringType: + // preserve all characters in the quotes + return string(removeEscapedCharacters(v.raw[1 : len(v.raw)-1])) + default: + return strings.TrimFunc(string(v.raw), isTrimmable) + } +} + +func contains(runes []rune, c rune) bool { + for i := 0; i < len(runes); i++ { + if runes[i] == c { + return true + } + } + + return false +} + +func runeCompare(v1 []rune, v2 []rune) bool { + if len(v1) != len(v2) { + return false + } + + for i := 0; i < len(v1); i++ { + if v1[i] != v2[i] { + return false + } + } + + return true +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go new file mode 100644 index 0000000..e52ac39 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go @@ -0,0 +1,30 @@ +package ini + +func isNewline(b []rune) bool { + if len(b) == 0 { + return false + } + + if b[0] == '\n' { + return true + } + + if len(b) < 2 { + return false + } + + return b[0] == '\r' && b[1] == '\n' +} + +func newNewlineToken(b []rune) (Token, int, error) { + i := 1 + if b[0] == '\r' && isNewline(b[1:]) { + i++ + } + + if !isNewline([]rune(b[:i])) { + return emptyToken, 0, NewParseError("invalid new line token") + } + + return newToken(TokenNL, b[:i], NoneType), i, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go new file mode 100644 index 0000000..a45c0bc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go @@ -0,0 +1,152 @@ +package ini + +import ( + "bytes" + "fmt" + "strconv" +) + +const ( + none = numberFormat(iota) + binary + octal + decimal + hex + exponent +) + +type numberFormat int + +// numberHelper is used to dictate what format a number is in +// and what to do for negative values. Since -1e-4 is a valid +// number, we cannot just simply check for duplicate negatives. +type numberHelper struct { + numberFormat numberFormat + + negative bool + negativeExponent bool +} + +func (b numberHelper) Exists() bool { + return b.numberFormat != none +} + +func (b numberHelper) IsNegative() bool { + return b.negative || b.negativeExponent +} + +func (b *numberHelper) Determine(c rune) error { + if b.Exists() { + return NewParseError(fmt.Sprintf("multiple number formats: 0%v", string(c))) + } + + switch c { + case 'b': + b.numberFormat = binary + case 'o': + b.numberFormat = octal + case 'x': + b.numberFormat = hex + case 'e', 'E': + b.numberFormat = exponent + case '-': + if b.numberFormat != exponent { + b.negative = true + } else { + b.negativeExponent = true + } + case '.': + b.numberFormat = decimal + default: + return NewParseError(fmt.Sprintf("invalid number character: %v", string(c))) + } + + return nil +} + +func (b numberHelper) CorrectByte(c rune) bool { + switch { + case b.numberFormat == binary: + if !isBinaryByte(c) { + return false + } + case b.numberFormat == octal: + if !isOctalByte(c) { + return false + } + case b.numberFormat == hex: + if !isHexByte(c) { + return false + } + case b.numberFormat == decimal: + if !isDigit(c) { + return false + } + case b.numberFormat == exponent: + if !isDigit(c) { + return false + } + case b.negativeExponent: + if !isDigit(c) { + return false + } + case b.negative: + if !isDigit(c) { + return false + } + default: + if !isDigit(c) { + return false + } + } + + return true +} + +func (b numberHelper) Base() int { + switch b.numberFormat { + case binary: + return 2 + case octal: + return 8 + case hex: + return 16 + default: + return 10 + } +} + +func (b numberHelper) String() string { + buf := bytes.Buffer{} + i := 0 + + switch b.numberFormat { + case binary: + i++ + buf.WriteString(strconv.Itoa(i) + ": binary format\n") + case octal: + i++ + buf.WriteString(strconv.Itoa(i) + ": octal format\n") + case hex: + i++ + buf.WriteString(strconv.Itoa(i) + ": hex format\n") + case exponent: + i++ + buf.WriteString(strconv.Itoa(i) + ": exponent format\n") + default: + i++ + buf.WriteString(strconv.Itoa(i) + ": integer format\n") + } + + if b.negative { + i++ + buf.WriteString(strconv.Itoa(i) + ": negative format\n") + } + + if b.negativeExponent { + i++ + buf.WriteString(strconv.Itoa(i) + ": negative exponent format\n") + } + + return buf.String() +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go new file mode 100644 index 0000000..8a84c7c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go @@ -0,0 +1,39 @@ +package ini + +import ( + "fmt" +) + +var ( + equalOp = []rune("=") + equalColonOp = []rune(":") +) + +func isOp(b []rune) bool { + if len(b) == 0 { + return false + } + + switch b[0] { + case '=': + return true + case ':': + return true + default: + return false + } +} + +func newOpToken(b []rune) (Token, int, error) { + tok := Token{} + + switch b[0] { + case '=': + tok = newToken(TokenOp, equalOp, NoneType) + case ':': + tok = newToken(TokenOp, equalColonOp, NoneType) + default: + return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0])) + } + return tok, 1, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go new file mode 100644 index 0000000..4572870 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go @@ -0,0 +1,43 @@ +package ini + +import "fmt" + +const ( + // ErrCodeParseError is returned when a parsing error + // has occurred. + ErrCodeParseError = "INIParseError" +) + +// ParseError is an error which is returned during any part of +// the parsing process. +type ParseError struct { + msg string +} + +// NewParseError will return a new ParseError where message +// is the description of the error. +func NewParseError(message string) *ParseError { + return &ParseError{ + msg: message, + } +} + +// Code will return the ErrCodeParseError +func (err *ParseError) Code() string { + return ErrCodeParseError +} + +// Message returns the error's message +func (err *ParseError) Message() string { + return err.msg +} + +// OrigError return nothing since there will never be any +// original error. +func (err *ParseError) OrigError() error { + return nil +} + +func (err *ParseError) Error() string { + return fmt.Sprintf("%s: %s", err.Code(), err.Message()) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go new file mode 100644 index 0000000..7f01cf7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go @@ -0,0 +1,60 @@ +package ini + +import ( + "bytes" + "fmt" +) + +// ParseStack is a stack that contains a container, the stack portion, +// and the list which is the list of ASTs that have been successfully +// parsed. +type ParseStack struct { + top int + container []AST + list []AST + index int +} + +func newParseStack(sizeContainer, sizeList int) ParseStack { + return ParseStack{ + container: make([]AST, sizeContainer), + list: make([]AST, sizeList), + } +} + +// Pop will return and truncate the last container element. +func (s *ParseStack) Pop() AST { + s.top-- + return s.container[s.top] +} + +// Push will add the new AST to the container +func (s *ParseStack) Push(ast AST) { + s.container[s.top] = ast + s.top++ +} + +// MarkComplete will append the AST to the list of completed statements +func (s *ParseStack) MarkComplete(ast AST) { + s.list[s.index] = ast + s.index++ +} + +// List will return the completed statements +func (s ParseStack) List() []AST { + return s.list[:s.index] +} + +// Len will return the length of the container +func (s *ParseStack) Len() int { + return s.top +} + +func (s ParseStack) String() string { + buf := bytes.Buffer{} + for i, node := range s.list { + buf.WriteString(fmt.Sprintf("%d: %v\n", i+1, node)) + } + + return buf.String() +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go new file mode 100644 index 0000000..f82095b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go @@ -0,0 +1,41 @@ +package ini + +import ( + "fmt" +) + +var ( + emptyRunes = []rune{} +) + +func isSep(b []rune) bool { + if len(b) == 0 { + return false + } + + switch b[0] { + case '[', ']': + return true + default: + return false + } +} + +var ( + openBrace = []rune("[") + closeBrace = []rune("]") +) + +func newSepToken(b []rune) (Token, int, error) { + tok := Token{} + + switch b[0] { + case '[': + tok = newToken(TokenSep, openBrace, NoneType) + case ']': + tok = newToken(TokenSep, closeBrace, NoneType) + default: + return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0])) + } + return tok, 1, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go new file mode 100644 index 0000000..da7a404 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go @@ -0,0 +1,45 @@ +package ini + +// skipper is used to skip certain blocks of an ini file. +// Currently skipper is used to skip nested blocks of ini +// files. See example below +// +// [ foo ] +// nested = ; this section will be skipped +// a=b +// c=d +// bar=baz ; this will be included +type skipper struct { + shouldSkip bool + TokenSet bool + prevTok Token +} + +func newSkipper() skipper { + return skipper{ + prevTok: emptyToken, + } +} + +func (s *skipper) ShouldSkip(tok Token) bool { + // should skip state will be modified only if previous token was new line (NL); + // and the current token is not WhiteSpace (WS). + if s.shouldSkip && + s.prevTok.Type() == TokenNL && + tok.Type() != TokenWS { + s.Continue() + return false + } + s.prevTok = tok + return s.shouldSkip +} + +func (s *skipper) Skip() { + s.shouldSkip = true +} + +func (s *skipper) Continue() { + s.shouldSkip = false + // empty token is assigned as we return to default state, when should skip is false + s.prevTok = emptyToken +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go new file mode 100644 index 0000000..18f3fe8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go @@ -0,0 +1,35 @@ +package ini + +// Statement is an empty AST mostly used for transitioning states. +func newStatement() AST { + return newAST(ASTKindStatement, AST{}) +} + +// SectionStatement represents a section AST +func newSectionStatement(tok Token) AST { + return newASTWithRootToken(ASTKindSectionStatement, tok) +} + +// ExprStatement represents a completed expression AST +func newExprStatement(ast AST) AST { + return newAST(ASTKindExprStatement, ast) +} + +// CommentStatement represents a comment in the ini definition. +// +// grammar: +// comment -> #comment' | ;comment' +// comment' -> epsilon | value +func newCommentStatement(tok Token) AST { + return newAST(ASTKindCommentStatement, newExpression(tok)) +} + +// CompletedSectionStatement represents a completed section +func newCompletedSectionStatement(ast AST) AST { + return newAST(ASTKindCompletedSectionStatement, ast) +} + +// SkipStatement is used to skip whole statements +func newSkipStatement(ast AST) AST { + return newAST(ASTKindSkipStatement, ast) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go new file mode 100644 index 0000000..305999d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go @@ -0,0 +1,284 @@ +package ini + +import ( + "fmt" +) + +// getStringValue will return a quoted string and the amount +// of bytes read +// +// an error will be returned if the string is not properly formatted +func getStringValue(b []rune) (int, error) { + if b[0] != '"' { + return 0, NewParseError("strings must start with '\"'") + } + + endQuote := false + i := 1 + + for ; i < len(b) && !endQuote; i++ { + if escaped := isEscaped(b[:i], b[i]); b[i] == '"' && !escaped { + endQuote = true + break + } else if escaped { + /*c, err := getEscapedByte(b[i]) + if err != nil { + return 0, err + } + + b[i-1] = c + b = append(b[:i], b[i+1:]...) + i--*/ + + continue + } + } + + if !endQuote { + return 0, NewParseError("missing '\"' in string value") + } + + return i + 1, nil +} + +// getBoolValue will return a boolean and the amount +// of bytes read +// +// an error will be returned if the boolean is not of a correct +// value +func getBoolValue(b []rune) (int, error) { + if len(b) < 4 { + return 0, NewParseError("invalid boolean value") + } + + n := 0 + for _, lv := range literalValues { + if len(lv) > len(b) { + continue + } + + if isLitValue(lv, b) { + n = len(lv) + } + } + + if n == 0 { + return 0, NewParseError("invalid boolean value") + } + + return n, nil +} + +// getNumericalValue will return a numerical string, the amount +// of bytes read, and the base of the number +// +// an error will be returned if the number is not of a correct +// value +func getNumericalValue(b []rune) (int, int, error) { + if !isDigit(b[0]) { + return 0, 0, NewParseError("invalid digit value") + } + + i := 0 + helper := numberHelper{} + +loop: + for negativeIndex := 0; i < len(b); i++ { + negativeIndex++ + + if !isDigit(b[i]) { + switch b[i] { + case '-': + if helper.IsNegative() || negativeIndex != 1 { + return 0, 0, NewParseError("parse error '-'") + } + + n := getNegativeNumber(b[i:]) + i += (n - 1) + helper.Determine(b[i]) + continue + case '.': + if err := helper.Determine(b[i]); err != nil { + return 0, 0, err + } + case 'e', 'E': + if err := helper.Determine(b[i]); err != nil { + return 0, 0, err + } + + negativeIndex = 0 + case 'b': + if helper.numberFormat == hex { + break + } + fallthrough + case 'o', 'x': + if i == 0 && b[i] != '0' { + return 0, 0, NewParseError("incorrect base format, expected leading '0'") + } + + if i != 1 { + return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string(b[i]), i)) + } + + if err := helper.Determine(b[i]); err != nil { + return 0, 0, err + } + default: + if isWhitespace(b[i]) { + break loop + } + + if isNewline(b[i:]) { + break loop + } + + if !(helper.numberFormat == hex && isHexByte(b[i])) { + if i+2 < len(b) && !isNewline(b[i:i+2]) { + return 0, 0, NewParseError("invalid numerical character") + } else if !isNewline([]rune{b[i]}) { + return 0, 0, NewParseError("invalid numerical character") + } + + break loop + } + } + } + } + + return helper.Base(), i, nil +} + +// isDigit will return whether or not something is an integer +func isDigit(b rune) bool { + return b >= '0' && b <= '9' +} + +func hasExponent(v []rune) bool { + return contains(v, 'e') || contains(v, 'E') +} + +func isBinaryByte(b rune) bool { + switch b { + case '0', '1': + return true + default: + return false + } +} + +func isOctalByte(b rune) bool { + switch b { + case '0', '1', '2', '3', '4', '5', '6', '7': + return true + default: + return false + } +} + +func isHexByte(b rune) bool { + if isDigit(b) { + return true + } + return (b >= 'A' && b <= 'F') || + (b >= 'a' && b <= 'f') +} + +func getValue(b []rune) (int, error) { + i := 0 + + for i < len(b) { + if isNewline(b[i:]) { + break + } + + if isOp(b[i:]) { + break + } + + valid, n, err := isValid(b[i:]) + if err != nil { + return 0, err + } + + if !valid { + break + } + + i += n + } + + return i, nil +} + +// getNegativeNumber will return a negative number from a +// byte slice. This will iterate through all characters until +// a non-digit has been found. +func getNegativeNumber(b []rune) int { + if b[0] != '-' { + return 0 + } + + i := 1 + for ; i < len(b); i++ { + if !isDigit(b[i]) { + return i + } + } + + return i +} + +// isEscaped will return whether or not the character is an escaped +// character. +func isEscaped(value []rune, b rune) bool { + if len(value) == 0 { + return false + } + + switch b { + case '\'': // single quote + case '"': // quote + case 'n': // newline + case 't': // tab + case '\\': // backslash + default: + return false + } + + return value[len(value)-1] == '\\' +} + +func getEscapedByte(b rune) (rune, error) { + switch b { + case '\'': // single quote + return '\'', nil + case '"': // quote + return '"', nil + case 'n': // newline + return '\n', nil + case 't': // table + return '\t', nil + case '\\': // backslash + return '\\', nil + default: + return b, NewParseError(fmt.Sprintf("invalid escaped character %c", b)) + } +} + +func removeEscapedCharacters(b []rune) []rune { + for i := 0; i < len(b); i++ { + if isEscaped(b[:i], b[i]) { + c, err := getEscapedByte(b[i]) + if err != nil { + return b + } + + b[i-1] = c + b = append(b[:i], b[i+1:]...) + i-- + } + } + + return b +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go new file mode 100644 index 0000000..94841c3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go @@ -0,0 +1,166 @@ +package ini + +import ( + "fmt" + "sort" +) + +// Visitor is an interface used by walkers that will +// traverse an array of ASTs. +type Visitor interface { + VisitExpr(AST) error + VisitStatement(AST) error +} + +// DefaultVisitor is used to visit statements and expressions +// and ensure that they are both of the correct format. +// In addition, upon visiting this will build sections and populate +// the Sections field which can be used to retrieve profile +// configuration. +type DefaultVisitor struct { + scope string + Sections Sections +} + +// NewDefaultVisitor return a DefaultVisitor +func NewDefaultVisitor() *DefaultVisitor { + return &DefaultVisitor{ + Sections: Sections{ + container: map[string]Section{}, + }, + } +} + +// VisitExpr visits expressions... +func (v *DefaultVisitor) VisitExpr(expr AST) error { + t := v.Sections.container[v.scope] + if t.values == nil { + t.values = values{} + } + + switch expr.Kind { + case ASTKindExprStatement: + opExpr := expr.GetRoot() + switch opExpr.Kind { + case ASTKindEqualExpr: + children := opExpr.GetChildren() + if len(children) <= 1 { + return NewParseError("unexpected token type") + } + + rhs := children[1] + + if rhs.Root.Type() != TokenLit { + return NewParseError("unexpected token type") + } + + key := EqualExprKey(opExpr) + v, err := newValue(rhs.Root.ValueType, rhs.Root.base, rhs.Root.Raw()) + if err != nil { + return err + } + + t.values[key] = v + default: + return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) + } + default: + return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) + } + + v.Sections.container[v.scope] = t + return nil +} + +// VisitStatement visits statements... +func (v *DefaultVisitor) VisitStatement(stmt AST) error { + switch stmt.Kind { + case ASTKindCompletedSectionStatement: + child := stmt.GetRoot() + if child.Kind != ASTKindSectionStatement { + return NewParseError(fmt.Sprintf("unsupported child statement: %T", child)) + } + + name := string(child.Root.Raw()) + v.Sections.container[name] = Section{} + v.scope = name + default: + return NewParseError(fmt.Sprintf("unsupported statement: %s", stmt.Kind)) + } + + return nil +} + +// Sections is a map of Section structures that represent +// a configuration. +type Sections struct { + container map[string]Section +} + +// GetSection will return section p. If section p does not exist, +// false will be returned in the second parameter. +func (t Sections) GetSection(p string) (Section, bool) { + v, ok := t.container[p] + return v, ok +} + +// values represents a map of union values. +type values map[string]Value + +// List will return a list of all sections that were successfully +// parsed. +func (t Sections) List() []string { + keys := make([]string, len(t.container)) + i := 0 + for k := range t.container { + keys[i] = k + i++ + } + + sort.Strings(keys) + return keys +} + +// Section contains a name and values. This represent +// a sectioned entry in a configuration file. +type Section struct { + Name string + values values +} + +// Has will return whether or not an entry exists in a given section +func (t Section) Has(k string) bool { + _, ok := t.values[k] + return ok +} + +// ValueType will returned what type the union is set to. If +// k was not found, the NoneType will be returned. +func (t Section) ValueType(k string) (ValueType, bool) { + v, ok := t.values[k] + return v.Type, ok +} + +// Bool returns a bool value at k +func (t Section) Bool(k string) bool { + return t.values[k].BoolValue() +} + +// Int returns an integer value at k +func (t Section) Int(k string) int64 { + return t.values[k].IntValue() +} + +// Float64 returns a float value at k +func (t Section) Float64(k string) float64 { + return t.values[k].FloatValue() +} + +// String returns the string value at k +func (t Section) String(k string) string { + _, ok := t.values[k] + if !ok { + return "" + } + return t.values[k].StringValue() +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go new file mode 100644 index 0000000..99915f7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go @@ -0,0 +1,25 @@ +package ini + +// Walk will traverse the AST using the v, the Visitor. +func Walk(tree []AST, v Visitor) error { + for _, node := range tree { + switch node.Kind { + case ASTKindExpr, + ASTKindExprStatement: + + if err := v.VisitExpr(node); err != nil { + return err + } + case ASTKindStatement, + ASTKindCompletedSectionStatement, + ASTKindNestedSectionStatement, + ASTKindCompletedNestedSectionStatement: + + if err := v.VisitStatement(node); err != nil { + return err + } + } + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go new file mode 100644 index 0000000..7ffb4ae --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go @@ -0,0 +1,24 @@ +package ini + +import ( + "unicode" +) + +// isWhitespace will return whether or not the character is +// a whitespace character. +// +// Whitespace is defined as a space or tab. +func isWhitespace(c rune) bool { + return unicode.IsSpace(c) && c != '\n' && c != '\r' +} + +func newWSToken(b []rune) (Token, int, error) { + i := 0 + for ; i < len(b); i++ { + if !isWhitespace(b[i]) { + break + } + } + + return newToken(TokenWS, b[:i], NoneType), i, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go new file mode 100644 index 0000000..6c44398 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/byte.go @@ -0,0 +1,12 @@ +package sdkio + +const ( + // Byte is 8 bits + Byte int64 = 1 + // KibiByte (KiB) is 1024 Bytes + KibiByte = Byte * 1024 + // MebiByte (MiB) is 1024 KiB + MebiByte = KibiByte * 1024 + // GibiByte (GiB) is 1024 MiB + GibiByte = MebiByte * 1024 +) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go new file mode 100644 index 0000000..5aa9137 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go @@ -0,0 +1,10 @@ +// +build !go1.7 + +package sdkio + +// Copy of Go 1.7 io package's Seeker constants. +const ( + SeekStart = 0 // seek relative to the origin of the file + SeekCurrent = 1 // seek relative to the current offset + SeekEnd = 2 // seek relative to the end +) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go new file mode 100644 index 0000000..e5f0056 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go @@ -0,0 +1,12 @@ +// +build go1.7 + +package sdkio + +import "io" + +// Alias for Go 1.7 io package Seeker constants +const ( + SeekStart = io.SeekStart // seek relative to the origin of the file + SeekCurrent = io.SeekCurrent // seek relative to the current offset + SeekEnd = io.SeekEnd // seek relative to the end +) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go new file mode 100644 index 0000000..44898ee --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor.go @@ -0,0 +1,15 @@ +// +build go1.10 + +package sdkmath + +import "math" + +// Round returns the nearest integer, rounding half away from zero. +// +// Special cases are: +// Round(±0) = ±0 +// Round(±Inf) = ±Inf +// Round(NaN) = NaN +func Round(x float64) float64 { + return math.Round(x) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go new file mode 100644 index 0000000..810ec7f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkmath/floor_go1.9.go @@ -0,0 +1,56 @@ +// +build !go1.10 + +package sdkmath + +import "math" + +// Copied from the Go standard library's (Go 1.12) math/floor.go for use in +// Go version prior to Go 1.10. +const ( + uvone = 0x3FF0000000000000 + mask = 0x7FF + shift = 64 - 11 - 1 + bias = 1023 + signMask = 1 << 63 + fracMask = 1<= 0.5 { + // return t + Copysign(1, x) + // } + // return t + // } + bits := math.Float64bits(x) + e := uint(bits>>shift) & mask + if e < bias { + // Round abs(x) < 1 including denormals. + bits &= signMask // +-0 + if e == bias-1 { + bits |= uvone // +-1 + } + } else if e < bias+shift { + // Round any abs(x) >= 1 containing a fractional component [0,1). + // + // Numbers with larger exponents are returned unchanged since they + // must be either an integer, infinity, or NaN. + const half = 1 << (shift - 1) + e -= bias + bits += half >> e + bits &^= fracMask >> e + } + return math.Float64frombits(bits) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go new file mode 100644 index 0000000..0c9802d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go @@ -0,0 +1,29 @@ +package sdkrand + +import ( + "math/rand" + "sync" + "time" +) + +// lockedSource is a thread-safe implementation of rand.Source +type lockedSource struct { + lk sync.Mutex + src rand.Source +} + +func (r *lockedSource) Int63() (n int64) { + r.lk.Lock() + n = r.src.Int63() + r.lk.Unlock() + return +} + +func (r *lockedSource) Seed(seed int64) { + r.lk.Lock() + r.src.Seed(seed) + r.lk.Unlock() +} + +// SeededRand is a new RNG using a thread safe implementation of rand.Source +var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go new file mode 100644 index 0000000..f4651da --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read.go @@ -0,0 +1,11 @@ +// +build go1.6 + +package sdkrand + +import "math/rand" + +// Read provides the stub for math.Rand.Read method support for go version's +// 1.6 and greater. +func Read(r *rand.Rand, p []byte) (int, error) { + return r.Read(p) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go new file mode 100644 index 0000000..b1d93a3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/read_1_5.go @@ -0,0 +1,24 @@ +// +build !go1.6 + +package sdkrand + +import "math/rand" + +// Read backfills Go 1.6's math.Rand.Reader for Go 1.5 +func Read(r *rand.Rand, p []byte) (n int, err error) { + // Copy of Go standard libraries math package's read function not added to + // standard library until Go 1.6. + var pos int8 + var val int64 + for n = 0; n < len(p); n++ { + if pos == 0 { + val = r.Int63() + pos = 7 + } + p[n] = byte(val) + val >>= 8 + pos-- + } + + return n, err +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go new file mode 100644 index 0000000..38ea61a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go @@ -0,0 +1,23 @@ +package sdkuri + +import ( + "path" + "strings" +) + +// PathJoin will join the elements of the path delimited by the "/" +// character. Similar to path.Join with the exception the trailing "/" +// character is preserved if present. +func PathJoin(elems ...string) string { + if len(elems) == 0 { + return "" + } + + hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/") + str := path.Join(elems...) + if hasTrailing && str != "/" { + str += "/" + } + + return str +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go new file mode 100644 index 0000000..7da8a49 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go @@ -0,0 +1,12 @@ +package shareddefaults + +const ( + // ECSCredsProviderEnvVar is an environmental variable key used to + // determine which path needs to be hit. + ECSCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" +) + +// ECSContainerCredentialsURI is the endpoint to retrieve container +// credentials. This can be overridden to test to ensure the credential process +// is behaving correctly. +var ECSContainerCredentialsURI = "http://169.254.170.2" diff --git a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go new file mode 100644 index 0000000..ebcbc2b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go @@ -0,0 +1,40 @@ +package shareddefaults + +import ( + "os" + "path/filepath" + "runtime" +) + +// SharedCredentialsFilename returns the SDK's default file path +// for the shared credentials file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/credentials +// - Windows: %USERPROFILE%\.aws\credentials +func SharedCredentialsFilename() string { + return filepath.Join(UserHomeDir(), ".aws", "credentials") +} + +// SharedConfigFilename returns the SDK's default file path for +// the shared config file. +// +// Builds the shared config file path based on the OS's platform. +// +// - Linux/Unix: $HOME/.aws/config +// - Windows: %USERPROFILE%\.aws\config +func SharedConfigFilename() string { + return filepath.Join(UserHomeDir(), ".aws", "config") +} + +// UserHomeDir returns the home directory for the user the process is +// running under. +func UserHomeDir() string { + if runtime.GOOS == "windows" { // Windows + return os.Getenv("USERPROFILE") + } + + // *nix + return os.Getenv("HOME") +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go deleted file mode 100644 index eedc5bd..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go +++ /dev/null @@ -1,35 +0,0 @@ -// Package ec2query provides serialization of AWS EC2 requests and responses. -package ec2query - -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/ec2.json build_test.go - -import ( - "net/url" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" -) - -// BuildHandler is a named request handler for building ec2query protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.ec2query.Build", Fn: Build} - -// Build builds a request for the EC2 protocol. -func Build(r *request.Request) { - body := url.Values{ - "Action": {r.Operation.Name}, - "Version": {r.ClientInfo.APIVersion}, - } - if err := queryutil.Parse(body, r.Params, true); err != nil { - r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err) - } - - if r.ExpireTime == 0 { - r.HTTPRequest.Method = "POST" - r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") - r.SetBufferBody([]byte(body.Encode())) - } else { // This is a pre-signed request - r.HTTPRequest.Method = "GET" - r.HTTPRequest.URL.RawQuery = body.Encode() - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go deleted file mode 100644 index e135b93..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_bench_test.go +++ /dev/null @@ -1,85 +0,0 @@ -// +build bench - -package ec2query_test - -import ( - "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/private/protocol/ec2query" - "github.com/aws/aws-sdk-go/service/ec2" -) - -func BenchmarkEC2QueryBuild_Complex_ec2AuthorizeSecurityGroupEgress(b *testing.B) { - params := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupId: aws.String("String"), // Required - CidrIp: aws.String("String"), - DryRun: aws.Bool(true), - FromPort: aws.Int64(1), - IpPermissions: []*ec2.IpPermission{ - { // Required - FromPort: aws.Int64(1), - IpProtocol: aws.String("String"), - IpRanges: []*ec2.IpRange{ - { // Required - CidrIp: aws.String("String"), - }, - // More values... - }, - PrefixListIds: []*ec2.PrefixListId{ - { // Required - PrefixListId: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Int64(1), - UserIdGroupPairs: []*ec2.UserIdGroupPair{ - { // Required - GroupId: aws.String("String"), - GroupName: aws.String("String"), - UserId: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IpProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerId: aws.String("String"), - ToPort: aws.Int64(1), - } - - benchEC2QueryBuild(b, "AuthorizeSecurityGroupEgress", params) -} - -func BenchmarkEC2QueryBuild_Simple_ec2AttachNetworkInterface(b *testing.B) { - params := &ec2.AttachNetworkInterfaceInput{ - DeviceIndex: aws.Int64(1), // Required - InstanceId: aws.String("String"), // Required - NetworkInterfaceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - - benchEC2QueryBuild(b, "AttachNetworkInterface", params) -} - -func benchEC2QueryBuild(b *testing.B, opName string, params interface{}) { - svc := awstesting.NewClient() - svc.ServiceName = "ec2" - svc.APIVersion = "2015-04-15" - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(&request.Operation{ - Name: opName, - HTTPMethod: "POST", - HTTPPath: "/", - }, params, nil) - ec2query.Build(r) - if r.Error != nil { - b.Fatal("Unexpected error", r.Error) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go deleted file mode 100644 index b3080c2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build_test.go +++ /dev/null @@ -1,1695 +0,0 @@ -package ec2query_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/ec2query" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService1ProtocolTest { - svc := &InputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService1TestShapeInputService1TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Bar *string `type:"string"` - - Foo *string `type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *InputService1TestShapeInputService1TestCaseOperation1Input) SetBar(v string) *InputService1TestShapeInputService1TestCaseOperation1Input { - s.Bar = &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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService2ProtocolTest { - svc := &InputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - Bar *string `locationName:"barLocationName" type:"string"` - - Foo *string `type:"string"` - - Yuck *string `locationName:"yuckLocationName" queryName:"yuckQueryName" type:"string"` -} - -// SetBar sets the Bar field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetBar(v string) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.Bar = &v - return s -} - -// SetFoo sets the Foo field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetFoo(v string) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.Foo = &v - return s -} - -// SetYuck sets the Yuck field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetYuck(v string) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.Yuck = &v - return s -} - -type InputService2TestShapeInputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService3ProtocolTest { - svc := &InputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService3TestShapeInputService3TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - StructArg *InputService3TestShapeStructType `locationName:"Struct" type:"structure"` -} - -// SetStructArg sets the StructArg field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation1Input) SetStructArg(v *InputService3TestShapeStructType) *InputService3TestShapeInputService3TestCaseOperation1Input { - s.StructArg = v - return s -} - -type InputService3TestShapeInputService3TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService3TestShapeStructType struct { - _ struct{} `type:"structure"` - - ScalarArg *string `locationName:"Scalar" type:"string"` -} - -// SetScalarArg sets the ScalarArg field's value. -func (s *InputService3TestShapeStructType) SetScalarArg(v string) *InputService3TestShapeStructType { - s.ScalarArg = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService4ProtocolTest { - svc := &InputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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{} `type:"structure"` - - ListArg []*string `type:"list"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListArg(v []*string) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.ListArg = v - return s -} - -type InputService4TestShapeInputService4TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService5ProtocolTest { - svc := &InputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - ListArg []*string `locationName:"ListMemberName" locationNameList:"item" type:"list"` -} - -// SetListArg sets the ListArg field's value. -func (s *InputService5TestShapeInputService5TestCaseOperation1Input) SetListArg(v []*string) *InputService5TestShapeInputService5TestCaseOperation1Input { - s.ListArg = v - return s -} - -type InputService5TestShapeInputService5TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService6ProtocolTest { - svc := &InputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 `locationName:"ListMemberName" queryName:"ListQueryName" 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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService7ProtocolTest { - svc := &InputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - // BlobArg is automatically base64 encoded/decoded by the SDK. - BlobArg []byte `type:"blob"` -} - -// SetBlobArg sets the BlobArg field's value. -func (s *InputService7TestShapeInputService7TestCaseOperation1Input) SetBlobArg(v []byte) *InputService7TestShapeInputService7TestCaseOperation1Input { - s.BlobArg = v - return s -} - -type InputService7TestShapeInputService7TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService8ProtocolTest { - svc := &InputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// SetTimeArg sets the TimeArg field's value. -func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetTimeArg(v time.Time) *InputService8TestShapeInputService8TestCaseOperation1Input { - s.TimeArg = &v - return s -} - -type InputService8TestShapeInputService8TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService9ProtocolTest { - svc := &InputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -const opInputService9TestCaseOperation2 = "OperationName" - -// InputService9TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService9TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService9TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService9TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService9TestCaseOperation2Request method. -// req, resp := client.InputService9TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService9ProtocolTest) InputService9TestCaseOperation2Request(input *InputService9TestShapeInputService9TestCaseOperation1Input) (req *request.Request, output *InputService9TestShapeInputService9TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService9TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService9TestShapeInputService9TestCaseOperation1Input{} - } - - output = &InputService9TestShapeInputService9TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService9TestCaseOperation2 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 InputService9TestCaseOperation2 for usage and error information. -func (c *InputService9ProtocolTest) InputService9TestCaseOperation2(input *InputService9TestShapeInputService9TestCaseOperation1Input) (*InputService9TestShapeInputService9TestCaseOperation2Output, error) { - req, out := c.InputService9TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService9TestCaseOperation2WithContext is the same as InputService9TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService9TestCaseOperation2 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) InputService9TestCaseOperation2WithContext(ctx aws.Context, input *InputService9TestShapeInputService9TestCaseOperation1Input, opts ...request.Option) (*InputService9TestShapeInputService9TestCaseOperation2Output, error) { - req, out := c.InputService9TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService9TestShapeInputService9TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetToken(v string) *InputService9TestShapeInputService9TestCaseOperation1Input { - s.Token = &v - return s -} - -type InputService9TestShapeInputService9TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService9TestShapeInputService9TestCaseOperation2Output 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 - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService2ProtocolTestStructureWithLocationNameAndQueryNameAppliedToMembersCase1(t *testing.T) { - svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService2TestShapeInputService2TestCaseOperation1Input{ - Bar: aws.String("val2"), - Foo: aws.String("val1"), - Yuck: aws.String("val3"), - } - req, _ := svc.InputService2TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&BarLocationName=val2&Foo=val1&Version=2014-01-01&yuckQueryName=val3`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService3ProtocolTestNestedStructureMembersCase1(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation1Input{ - StructArg: &InputService3TestShapeStructType{ - ScalarArg: aws.String("foo"), - }, - } - req, _ := svc.InputService3TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&Struct.Scalar=foo&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService4ProtocolTestListTypesCase1(t *testing.T) { - svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService4TestShapeInputService4TestCaseOperation1Input{ - ListArg: []*string{ - aws.String("foo"), - aws.String("bar"), - aws.String("baz"), - }, - } - req, _ := svc.InputService4TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListArg.1=foo&ListArg.2=bar&ListArg.3=baz&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService5ProtocolTestListWithLocationNameAppliedToMemberCase1(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation1Input{ - ListArg: []*string{ - aws.String("a"), - aws.String("b"), - aws.String("c"), - }, - } - req, _ := svc.InputService5TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListMemberName.1=a&ListMemberName.2=b&ListMemberName.3=c&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService6ProtocolTestListWithLocationNameAndQueryNameCase1(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 - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&ListQueryName.1=a&ListQueryName.2=b&ListQueryName.3=c&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService7ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { - svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService7TestShapeInputService7TestCaseOperation1Input{ - BlobArg: []byte("foo"), - } - req, _ := svc.InputService7TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService8ProtocolTestTimestampValuesCase1(t *testing.T) { - svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService8TestShapeInputService8TestCaseOperation1Input{ - TimeArg: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService8TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService9ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService9TestShapeInputService9TestCaseOperation1Input{ - Token: aws.String("abc123"), - } - req, _ := svc.InputService9TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService9ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService9TestShapeInputService9TestCaseOperation1Input{} - req, _ := svc.InputService9TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - ec2query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go deleted file mode 100644 index 095e97c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go +++ /dev/null @@ -1,63 +0,0 @@ -package ec2query - -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/ec2.json unmarshal_test.go - -import ( - "encoding/xml" - "io" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" -) - -// UnmarshalHandler is a named request handler for unmarshaling ec2query protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.ec2query.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling ec2query protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.ec2query.UnmarshalMeta", Fn: UnmarshalMeta} - -// UnmarshalErrorHandler is a named request handler for unmarshaling ec2query protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.ec2query.UnmarshalError", Fn: UnmarshalError} - -// Unmarshal unmarshals a response body for the EC2 protocol. -func Unmarshal(r *request.Request) { - defer r.HTTPResponse.Body.Close() - if r.DataFilled() { - decoder := xml.NewDecoder(r.HTTPResponse.Body) - err := xmlutil.UnmarshalXML(r.Data, decoder, "") - if err != nil { - r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err) - return - } - } -} - -// UnmarshalMeta unmarshals response headers for the EC2 protocol. -func UnmarshalMeta(r *request.Request) { - // TODO implement unmarshaling of request IDs -} - -type xmlErrorResponse struct { - XMLName xml.Name `xml:"Response"` - Code string `xml:"Errors>Error>Code"` - Message string `xml:"Errors>Error>Message"` - RequestID string `xml:"RequestID"` -} - -// UnmarshalError unmarshals a response error for the EC2 protocol. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - resp := &xmlErrorResponse{} - err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) - if err != nil && err != io.EOF { - r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err) - } else { - r.Error = awserr.NewRequestFailure( - awserr.New(resp.Code, resp.Message, nil), - r.HTTPResponse.StatusCode, - resp.RequestID, - ) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go deleted file mode 100644 index 3e4e02d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal_test.go +++ /dev/null @@ -1,1572 +0,0 @@ -package ec2query_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/ec2query" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService1ProtocolTest { - svc := &OutputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - 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 -} - -// SetTrueBool sets the TrueBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetTrueBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.TrueBool = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService2ProtocolTest { - svc := &OutputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService3ProtocolTest { - svc := &OutputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService4ProtocolTest { - svc := &OutputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService5ProtocolTest { - svc := &OutputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService6ProtocolTest { - svc := &OutputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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]*OutputService6TestShapeStructureType `type:"map"` -} - -// SetMap sets the Map field's value. -func (s *OutputService6TestShapeOutputService6TestCaseOperation1Output) SetMap(v map[string]*OutputService6TestShapeStructureType) *OutputService6TestShapeOutputService6TestCaseOperation1Output { - s.Map = v - return s -} - -type OutputService6TestShapeStructureType struct { - _ struct{} `type:"structure"` - - Foo *string `locationName:"foo" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService6TestShapeStructureType) SetFoo(v string) *OutputService6TestShapeStructureType { - s.Foo = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService7ProtocolTest { - svc := &OutputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService8ProtocolTest { - svc := &OutputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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" flattened:"true"` -} - -// SetMap sets the Map field's value. -func (s *OutputService8TestShapeOutputService8TestCaseOperation1Output) SetMap(v map[string]*string) *OutputService8TestShapeOutputService8TestCaseOperation1Output { - s.Map = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService9ProtocolTest { - svc := &OutputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - Foo *string `type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService9TestShapeOutputService9TestCaseOperation1Output) SetFoo(v string) *OutputService9TestShapeOutputService9TestCaseOperation1Output { - s.Foo = &v - return s -} - -// -// 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.3200arequest-id")) - req, out := svc.OutputService1TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.Char) - assert.Equal(t, 1.3, *out.Double) - assert.Equal(t, false, *out.FalseBool) - assert.Equal(t, 1.2, *out.Float) - assert.Equal(t, int64(200), *out.Long) - assert.Equal(t, int64(123), *out.Num) - assert.Equal(t, "myname", *out.Str) - assert.Equal(t, true, *out.TrueBool) - -} - -func TestOutputService2ProtocolTestBlobCase1(t *testing.T) { - svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("dmFsdWU=requestid")) - req, out := svc.OutputService2TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "value", string(out.Blob)) - -} - -func TestOutputService3ProtocolTestListsCase1(t *testing.T) { - svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc123requestid")) - req, out := svc.OutputService3TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -func TestOutputService4ProtocolTestListWithCustomMemberNameCase1(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 - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -func TestOutputService5ProtocolTestFlattenedListCase1(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 - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -func TestOutputService6ProtocolTestNormalMapCase1(t *testing.T) { - svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) - req, out := svc.OutputService6TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"].Foo) - assert.Equal(t, "bar", *out.Map["qux"].Foo) - -} - -func TestOutputService7ProtocolTestFlattenedMapCase1(t *testing.T) { - svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) - req, out := svc.OutputService7TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"]) - assert.Equal(t, "bar", *out.Map["qux"]) - -} - -func TestOutputService8ProtocolTestNamedMapCase1(t *testing.T) { - svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("quxbarbazbamrequestid")) - req, out := svc.OutputService8TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"]) - assert.Equal(t, "bar", *out.Map["qux"]) - -} - -func TestOutputService9ProtocolTestEmptyStringCase1(t *testing.T) { - svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("requestid")) - req, out := svc.OutputService9TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - ec2query.UnmarshalMeta(req) - ec2query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "", *out.Foo) - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go new file mode 100644 index 0000000..d7d42db --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go @@ -0,0 +1,68 @@ +package protocol + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws/request" +) + +// ValidateEndpointHostHandler is a request handler that will validate the +// request endpoint's hosts is a valid RFC 3986 host. +var ValidateEndpointHostHandler = request.NamedHandler{ + Name: "awssdk.protocol.ValidateEndpointHostHandler", + Fn: func(r *request.Request) { + err := ValidateEndpointHost(r.Operation.Name, r.HTTPRequest.URL.Host) + if err != nil { + r.Error = err + } + }, +} + +// ValidateEndpointHost validates that the host string passed in is a valid RFC +// 3986 host. Returns error if the host is not valid. +func ValidateEndpointHost(opName, host string) error { + paramErrs := request.ErrInvalidParams{Context: opName} + labels := strings.Split(host, ".") + + for i, label := range labels { + if i == len(labels)-1 && len(label) == 0 { + // Allow trailing dot for FQDN hosts. + continue + } + + if !ValidHostLabel(label) { + paramErrs.Add(request.NewErrParamFormat( + "endpoint host label", "[a-zA-Z0-9-]{1,63}", label)) + } + } + + if len(host) > 255 { + paramErrs.Add(request.NewErrParamMaxLen( + "endpoint host", 255, host, + )) + } + + if paramErrs.Len() > 0 { + return paramErrs + } + return nil +} + +// ValidHostLabel returns if the label is a valid RFC 3986 host label. +func ValidHostLabel(label string) bool { + if l := len(label); l == 0 || l > 63 { + return false + } + for _, r := range label { + switch { + case r >= '0' && r <= '9': + case r >= 'A' && r <= 'Z': + case r >= 'a' && r <= 'z': + case r == '-': + default: + return false + } + } + + return true +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go new file mode 100644 index 0000000..915b0fc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go @@ -0,0 +1,54 @@ +package protocol + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// HostPrefixHandlerName is the handler name for the host prefix request +// handler. +const HostPrefixHandlerName = "awssdk.endpoint.HostPrefixHandler" + +// NewHostPrefixHandler constructs a build handler +func NewHostPrefixHandler(prefix string, labelsFn func() map[string]string) request.NamedHandler { + builder := HostPrefixBuilder{ + Prefix: prefix, + LabelsFn: labelsFn, + } + + return request.NamedHandler{ + Name: HostPrefixHandlerName, + Fn: builder.Build, + } +} + +// HostPrefixBuilder provides the request handler to expand and prepend +// the host prefix into the operation's request endpoint host. +type HostPrefixBuilder struct { + Prefix string + LabelsFn func() map[string]string +} + +// Build updates the passed in Request with the HostPrefix template expanded. +func (h HostPrefixBuilder) Build(r *request.Request) { + if aws.BoolValue(r.Config.DisableEndpointHostPrefix) { + return + } + + var labels map[string]string + if h.LabelsFn != nil { + labels = h.LabelsFn() + } + + prefix := h.Prefix + for name, value := range labels { + prefix = strings.Replace(prefix, "{"+name+"}", value, -1) + } + + r.HTTPRequest.URL.Host = prefix + r.HTTPRequest.URL.Host + if len(r.HTTPRequest.Host) > 0 { + r.HTTPRequest.Host = prefix + r.HTTPRequest.Host + } +} 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 b6ea235..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/idempotency_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package protocol_test - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/stretchr/testify/assert" -) - -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)) - assert.Equal(t, c.CanSet, canSet, "Expect case %d can set to match", i) - } -} - -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)) - assert.NotEmpty(t, v.Field(0).Interface(), "Expect case %d to be set", i) - } -} - -func TestUUIDVersion4(t *testing.T) { - uuid := protocol.UUIDVersion4(make([]byte, 16)) - assert.Equal(t, `00000000-0000-4000-8000-000000000000`, uuid) - - b := make([]byte, 16) - for i := 0; i < len(b); i++ { - b[i] = 1 - } - uuid = protocol.UUIDVersion4(b) - assert.Equal(t, `01010101-0101-4101-8101-010101010101`, uuid) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go index 6efe43d..864fb67 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go @@ -12,6 +12,7 @@ import ( "strconv" "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/private/protocol" ) @@ -49,7 +50,10 @@ func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) err t = "list" } case reflect.Map: - t = "map" + // cannot be a JSONValue map + if _, ok := value.Interface().(aws.JSONValue); !ok { + t = "map" + } } } @@ -210,14 +214,21 @@ func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) erro } buf.Write(strconv.AppendFloat(scratch[:0], f, 'f', -1, 64)) default: - switch value.Type() { - case timeType: - converted := v.Interface().(*time.Time) + switch converted := value.Interface().(type) { + case time.Time: + format := tag.Get("timestampFormat") + if len(format) == 0 { + format = protocol.UnixTimeFormatName + } - buf.Write(strconv.AppendInt(scratch[:0], converted.UTC().Unix(), 10)) - case byteSliceType: + ts := protocol.FormatTime(format, converted) + if format != protocol.UnixTimeFormatName { + ts = `"` + ts + `"` + } + + buf.WriteString(ts) + case []byte: if !value.IsNil() { - converted := value.Interface().([]byte) buf.WriteByte('"') if len(converted) < 1024 { // for small buffers, using Encode directly is much faster. @@ -233,6 +244,12 @@ func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) erro } buf.WriteByte('"') } + case aws.JSONValue: + str, err := protocol.EncodeJSONValue(converted, protocol.QuotedEscape) + if err != nil { + return fmt.Errorf("unable to encode JSONValue, %v", err) + } + buf.WriteString(str) default: return fmt.Errorf("unsupported JSON value %v (%s)", value.Interface(), value.Type()) } 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 e86f424..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build_test.go +++ /dev/null @@ -1,109 +0,0 @@ -package jsonutil_test - -import ( - "encoding/json" - "testing" - "time" - - "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" - "github.com/stretchr/testify/assert" -) - -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 != "" { - assert.Error(t, err) - assert.Contains(t, err.Error(), test.err) - } else { - assert.NoError(t, err) - assert.Equal(t, string(out), test.out) - } - } -} - -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/json/jsonutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go index fea5356..ea0da79 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go @@ -1,29 +1,47 @@ package jsonutil import ( + "bytes" "encoding/base64" "encoding/json" "fmt" "io" - "io/ioutil" "reflect" "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/private/protocol" ) -// UnmarshalJSON reads a stream and unmarshals the results in object v. -func UnmarshalJSON(v interface{}, stream io.Reader) error { - var out interface{} +// UnmarshalJSONError unmarshal's the reader's JSON document into the passed in +// type. The value to unmarshal the json document into must be a pointer to the +// type. +func UnmarshalJSONError(v interface{}, stream io.Reader) error { + var errBuf bytes.Buffer + body := io.TeeReader(stream, &errBuf) - b, err := ioutil.ReadAll(stream) + err := json.NewDecoder(body).Decode(v) if err != nil { - return err + msg := "failed decoding error message" + if err == io.EOF { + msg = "error message missing" + err = nil + } + return awserr.NewUnmarshalError(err, msg, errBuf.Bytes()) } - if len(b) == 0 { - return nil - } + return nil +} + +// UnmarshalJSON reads a stream and unmarshals the results in object v. +func UnmarshalJSON(v interface{}, stream io.Reader) error { + var out interface{} - if err := json.Unmarshal(b, &out); err != nil { + err := json.NewDecoder(stream).Decode(&out) + if err == io.EOF { + return nil + } else if err != nil { return err } @@ -50,7 +68,10 @@ func unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) t = "list" } case reflect.Map: - t = "map" + // cannot be a JSONValue map + if _, ok := value.Interface().(aws.JSONValue); !ok { + t = "map" + } } } @@ -166,9 +187,6 @@ func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) } func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error { - errf := func() error { - return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) - } switch d := data.(type) { case nil: @@ -183,8 +201,26 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa return err } value.Set(reflect.ValueOf(b)) + case *time.Time: + format := tag.Get("timestampFormat") + if len(format) == 0 { + format = protocol.ISO8601TimeFormatName + } + + t, err := protocol.ParseTime(format, d) + if err != nil { + return err + } + value.Set(reflect.ValueOf(&t)) + case aws.JSONValue: + // No need to use escaping as the value is a non-quoted string. + v, err := protocol.DecodeJSONValue(d, protocol.NoEscape) + if err != nil { + return err + } + value.Set(reflect.ValueOf(v)) default: - return errf() + return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) } case float64: switch value.Interface().(type) { @@ -194,17 +230,18 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa case *float64: value.Set(reflect.ValueOf(&d)) case *time.Time: + // Time unmarshaled from a float64 can only be epoch seconds t := time.Unix(int64(d), 0).UTC() value.Set(reflect.ValueOf(&t)) default: - return errf() + return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) } case bool: switch value.Interface().(type) { case *bool: value.Set(reflect.ValueOf(&d)) default: - return errf() + return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) } default: return fmt.Errorf("unsupported JSON value (%v)", data) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_bench_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_bench_test.go deleted file mode 100644 index 563caa0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_bench_test.go +++ /dev/null @@ -1,71 +0,0 @@ -// +build bench - -package jsonrpc_test - -import ( - "bytes" - "encoding/json" - "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/private/protocol/json/jsonutil" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" -) - -func BenchmarkJSONRPCBuild_Simple_dynamodbPutItem(b *testing.B) { - svc := awstesting.NewClient() - - params := getDynamodbPutItemParams(b) - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(&request.Operation{Name: "Operation"}, params, nil) - jsonrpc.Build(r) - if r.Error != nil { - b.Fatal("Unexpected error", r.Error) - } - } -} - -func BenchmarkJSONUtilBuild_Simple_dynamodbPutItem(b *testing.B) { - svc := awstesting.NewClient() - - params := getDynamodbPutItemParams(b) - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(&request.Operation{Name: "Operation"}, params, nil) - _, err := jsonutil.BuildJSON(r.Params) - if err != nil { - b.Fatal("Unexpected error", err) - } - } -} - -func BenchmarkEncodingJSONMarshal_Simple_dynamodbPutItem(b *testing.B) { - params := getDynamodbPutItemParams(b) - - for i := 0; i < b.N; i++ { - buf := &bytes.Buffer{} - encoder := json.NewEncoder(buf) - if err := encoder.Encode(params); err != nil { - b.Fatal("Unexpected error", err) - } - } -} - -func getDynamodbPutItemParams(b *testing.B) *dynamodb.PutItemInput { - av, err := dynamodbattribute.ConvertToMap(struct { - Key string - Data string - }{Key: "MyKey", Data: "MyData"}) - if err != nil { - b.Fatal("benchPutItem, expect no ConvertToMap errors", err) - } - return &dynamodb.PutItemInput{ - Item: av, - TableName: aws.String("tablename"), - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_test.go deleted file mode 100644 index 35e817c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/build_test.go +++ /dev/null @@ -1,2038 +0,0 @@ -package jsonrpc_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/jsonrpc" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService1ProtocolTest { - svc := &InputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.foo", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation1Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService1TestShapeInputService1TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Name *string `type:"string"` -} - -// 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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService2ProtocolTest { - svc := &InputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.foo", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - TimeArg *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// SetTimeArg sets the TimeArg field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetTimeArg(v time.Time) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.TimeArg = &v - return s -} - -type InputService2TestShapeInputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService3ProtocolTest { - svc := &InputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.foo", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService3TestShapeInputService3TestCaseOperation2Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService3TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation2Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService3TestShapeInputService3TestCaseOperation2Input) (*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 *InputService3TestShapeInputService3TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 InputService3TestShapeInputService3TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService3TestShapeInputService3TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - // BlobArg is automatically base64 encoded/decoded by the SDK. - BlobArg []byte `type:"blob"` - - BlobMap map[string][]byte `type:"map"` -} - -// SetBlobArg sets the BlobArg field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation2Input) SetBlobArg(v []byte) *InputService3TestShapeInputService3TestCaseOperation2Input { - s.BlobArg = v - return s -} - -// SetBlobMap sets the BlobMap field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation2Input) SetBlobMap(v map[string][]byte) *InputService3TestShapeInputService3TestCaseOperation2Input { - s.BlobMap = v - return s -} - -type InputService3TestShapeInputService3TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService4ProtocolTest { - svc := &InputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.foo", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/", - } - - if input == nil { - input = &InputService4TestShapeInputService4TestCaseOperation1Input{} - } - - output = &InputService4TestShapeInputService4TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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{} `type:"structure"` - - ListParam [][]byte `type:"list"` -} - -// SetListParam sets the ListParam field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetListParam(v [][]byte) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.ListParam = v - return s -} - -type InputService4TestShapeInputService4TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService5ProtocolTest { - svc := &InputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.foo", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService5TestShapeInputService5TestCaseOperation2Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation2Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService5TestShapeInputService5TestCaseOperation2Input) (*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 *InputService5TestShapeInputService5TestCaseOperation2Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation1Output, error) { - req, out := c.InputService5TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService5TestCaseOperation2 = "OperationName" - -// InputService5TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService5TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService5TestCaseOperation2Request method. -// req, resp := client.InputService5TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation2Request(input *InputService5TestShapeInputService5TestCaseOperation2Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation2Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService5TestCaseOperation2 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 InputService5TestCaseOperation2 for usage and error information. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation2(input *InputService5TestShapeInputService5TestCaseOperation2Input) (*InputService5TestShapeInputService5TestCaseOperation2Output, error) { - req, out := c.InputService5TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService5TestCaseOperation2WithContext is the same as InputService5TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService5TestCaseOperation2 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) InputService5TestCaseOperation2WithContext(ctx aws.Context, input *InputService5TestShapeInputService5TestCaseOperation2Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation2Output, error) { - req, out := c.InputService5TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService5TestCaseOperation3 = "OperationName" - -// InputService5TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService5TestCaseOperation3 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService5TestCaseOperation3Request method. -// req, resp := client.InputService5TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation3Request(input *InputService5TestShapeInputService5TestCaseOperation2Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation3, - HTTPPath: "/", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation2Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService5TestCaseOperation3 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 InputService5TestCaseOperation3 for usage and error information. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation3(input *InputService5TestShapeInputService5TestCaseOperation2Input) (*InputService5TestShapeInputService5TestCaseOperation3Output, error) { - req, out := c.InputService5TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService5TestCaseOperation3WithContext is the same as InputService5TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService5TestCaseOperation3 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) InputService5TestCaseOperation3WithContext(ctx aws.Context, input *InputService5TestShapeInputService5TestCaseOperation2Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation3Output, error) { - req, out := c.InputService5TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService5TestCaseOperation4 = "OperationName" - -// InputService5TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService5TestCaseOperation4 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation4 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation4 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService5TestCaseOperation4Request method. -// req, resp := client.InputService5TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation4Request(input *InputService5TestShapeInputService5TestCaseOperation2Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation4, - HTTPPath: "/", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation2Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService5TestCaseOperation4 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 InputService5TestCaseOperation4 for usage and error information. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation4(input *InputService5TestShapeInputService5TestCaseOperation2Input) (*InputService5TestShapeInputService5TestCaseOperation4Output, error) { - req, out := c.InputService5TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService5TestCaseOperation4WithContext is the same as InputService5TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService5TestCaseOperation4 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) InputService5TestCaseOperation4WithContext(ctx aws.Context, input *InputService5TestShapeInputService5TestCaseOperation2Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation4Output, error) { - req, out := c.InputService5TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService5TestCaseOperation5 = "OperationName" - -// InputService5TestCaseOperation5Request generates a "aws/request.Request" representing the -// client's request for the InputService5TestCaseOperation5 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation5 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation5 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService5TestCaseOperation5Request method. -// req, resp := client.InputService5TestCaseOperation5Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation5Request(input *InputService5TestShapeInputService5TestCaseOperation2Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation5Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation5, - HTTPPath: "/", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation2Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation5Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService5TestCaseOperation5 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 InputService5TestCaseOperation5 for usage and error information. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation5(input *InputService5TestShapeInputService5TestCaseOperation2Input) (*InputService5TestShapeInputService5TestCaseOperation5Output, error) { - req, out := c.InputService5TestCaseOperation5Request(input) - return out, req.Send() -} - -// InputService5TestCaseOperation5WithContext is the same as InputService5TestCaseOperation5 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService5TestCaseOperation5 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) InputService5TestCaseOperation5WithContext(ctx aws.Context, input *InputService5TestShapeInputService5TestCaseOperation2Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation5Output, error) { - req, out := c.InputService5TestCaseOperation5Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService5TestCaseOperation6 = "OperationName" - -// InputService5TestCaseOperation6Request generates a "aws/request.Request" representing the -// client's request for the InputService5TestCaseOperation6 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation6 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation6 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService5TestCaseOperation6Request method. -// req, resp := client.InputService5TestCaseOperation6Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService5ProtocolTest) InputService5TestCaseOperation6Request(input *InputService5TestShapeInputService5TestCaseOperation2Input) (req *request.Request, output *InputService5TestShapeInputService5TestCaseOperation6Output) { - op := &request.Operation{ - Name: opInputService5TestCaseOperation6, - HTTPPath: "/", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation2Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation6Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService5TestCaseOperation6 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 InputService5TestCaseOperation6 for usage and error information. -func (c *InputService5ProtocolTest) InputService5TestCaseOperation6(input *InputService5TestShapeInputService5TestCaseOperation2Input) (*InputService5TestShapeInputService5TestCaseOperation6Output, error) { - req, out := c.InputService5TestCaseOperation6Request(input) - return out, req.Send() -} - -// InputService5TestCaseOperation6WithContext is the same as InputService5TestCaseOperation6 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService5TestCaseOperation6 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) InputService5TestCaseOperation6WithContext(ctx aws.Context, input *InputService5TestShapeInputService5TestCaseOperation2Input, opts ...request.Option) (*InputService5TestShapeInputService5TestCaseOperation6Output, error) { - req, out := c.InputService5TestCaseOperation6Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService5TestShapeInputService5TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService5TestShapeInputService5TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService5TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService5TestShapeInputService5TestCaseOperation2Input) SetRecursiveStruct(v *InputService5TestShapeRecursiveStructType) *InputService5TestShapeInputService5TestCaseOperation2Input { - s.RecursiveStruct = v - return s -} - -type InputService5TestShapeInputService5TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService5TestShapeInputService5TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService5TestShapeInputService5TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -type InputService5TestShapeInputService5TestCaseOperation5Output struct { - _ struct{} `type:"structure"` -} - -type InputService5TestShapeInputService5TestCaseOperation6Output struct { - _ struct{} `type:"structure"` -} - -type InputService5TestShapeRecursiveStructType struct { - _ struct{} `type:"structure"` - - NoRecurse *string `type:"string"` - - RecursiveList []*InputService5TestShapeRecursiveStructType `type:"list"` - - RecursiveMap map[string]*InputService5TestShapeRecursiveStructType `type:"map"` - - RecursiveStruct *InputService5TestShapeRecursiveStructType `type:"structure"` -} - -// SetNoRecurse sets the NoRecurse field's value. -func (s *InputService5TestShapeRecursiveStructType) SetNoRecurse(v string) *InputService5TestShapeRecursiveStructType { - s.NoRecurse = &v - return s -} - -// SetRecursiveList sets the RecursiveList field's value. -func (s *InputService5TestShapeRecursiveStructType) SetRecursiveList(v []*InputService5TestShapeRecursiveStructType) *InputService5TestShapeRecursiveStructType { - s.RecursiveList = v - return s -} - -// SetRecursiveMap sets the RecursiveMap field's value. -func (s *InputService5TestShapeRecursiveStructType) SetRecursiveMap(v map[string]*InputService5TestShapeRecursiveStructType) *InputService5TestShapeRecursiveStructType { - s.RecursiveMap = v - return s -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService5TestShapeRecursiveStructType) SetRecursiveStruct(v *InputService5TestShapeRecursiveStructType) *InputService5TestShapeRecursiveStructType { - s.RecursiveStruct = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService6ProtocolTest { - svc := &InputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.foo", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/", - } - - if input == nil { - input = &InputService6TestShapeInputService6TestCaseOperation1Input{} - } - - output = &InputService6TestShapeInputService6TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - Map map[string]*string `type:"map"` -} - -// SetMap sets the Map field's value. -func (s *InputService6TestShapeInputService6TestCaseOperation1Input) SetMap(v map[string]*string) *InputService6TestShapeInputService6TestCaseOperation1Input { - s.Map = v - return s -} - -type InputService6TestShapeInputService6TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService7ProtocolTest { - svc := &InputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService7TestShapeInputService7TestCaseOperation2Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService7TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService7TestShapeInputService7TestCaseOperation2Input{} - } - - output = &InputService7TestShapeInputService7TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService7TestShapeInputService7TestCaseOperation2Input) (*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 *InputService7TestShapeInputService7TestCaseOperation2Input, opts ...request.Option) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { - req, out := c.InputService7TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService7TestCaseOperation2 = "OperationName" - -// InputService7TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService7TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService7TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService7TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService7TestCaseOperation2Request method. -// req, resp := client.InputService7TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation2Request(input *InputService7TestShapeInputService7TestCaseOperation2Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService7TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService7TestShapeInputService7TestCaseOperation2Input{} - } - - output = &InputService7TestShapeInputService7TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService7TestCaseOperation2 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 InputService7TestCaseOperation2 for usage and error information. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation2(input *InputService7TestShapeInputService7TestCaseOperation2Input) (*InputService7TestShapeInputService7TestCaseOperation2Output, error) { - req, out := c.InputService7TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService7TestCaseOperation2WithContext is the same as InputService7TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService7TestCaseOperation2 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) InputService7TestCaseOperation2WithContext(ctx aws.Context, input *InputService7TestShapeInputService7TestCaseOperation2Input, opts ...request.Option) (*InputService7TestShapeInputService7TestCaseOperation2Output, error) { - req, out := c.InputService7TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService7TestShapeInputService7TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService7TestShapeInputService7TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService7TestShapeInputService7TestCaseOperation2Input) SetToken(v string) *InputService7TestShapeInputService7TestCaseOperation2Input { - s.Token = &v - return s -} - -type InputService7TestShapeInputService7TestCaseOperation2Output 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{ - Name: aws.String("myname"), - } - req, _ := svc.InputService1TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Name":"myname"}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService2ProtocolTestTimestampValuesCase1(t *testing.T) { - svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService2TestShapeInputService2TestCaseOperation1Input{ - TimeArg: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService2TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"TimeArg":1422172800}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService3ProtocolTestBase64EncodedBlobsCase1(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation2Input{ - BlobArg: []byte("foo"), - } - req, _ := svc.InputService3TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"BlobArg":"Zm9v"}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService3ProtocolTestBase64EncodedBlobsCase2(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation2Input{ - BlobMap: map[string][]byte{ - "key1": []byte("foo"), - "key2": []byte("bar"), - }, - } - req, _ := svc.InputService3TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"BlobMap":{"key1":"Zm9v","key2":"YmFy"}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService4ProtocolTestNestedBlobsCase1(t *testing.T) { - svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService4TestShapeInputService4TestCaseOperation1Input{ - ListParam: [][]byte{ - []byte("foo"), - []byte("bar"), - }, - } - req, _ := svc.InputService4TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"ListParam":["Zm9v","YmFy"]}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService5ProtocolTestRecursiveShapesCase1(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation2Input{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - } - req, _ := svc.InputService5TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"NoRecurse":"foo"}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService5ProtocolTestRecursiveShapesCase2(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation2Input{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - } - req, _ := svc.InputService5TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveStruct":{"NoRecurse":"foo"}}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService5ProtocolTestRecursiveShapesCase3(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation2Input{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - }, - }, - } - req, _ := svc.InputService5TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveStruct":{"RecursiveStruct":{"RecursiveStruct":{"NoRecurse":"foo"}}}}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService5ProtocolTestRecursiveShapesCase4(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation2Input{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - RecursiveList: []*InputService5TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - NoRecurse: aws.String("bar"), - }, - }, - }, - } - req, _ := svc.InputService5TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveList":[{"NoRecurse":"foo"},{"NoRecurse":"bar"}]}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService5ProtocolTestRecursiveShapesCase5(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation2Input{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - RecursiveList: []*InputService5TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - NoRecurse: aws.String("bar"), - }, - }, - }, - }, - } - req, _ := svc.InputService5TestCaseOperation5Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveList":[{"NoRecurse":"foo"},{"RecursiveStruct":{"NoRecurse":"bar"}}]}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService5ProtocolTestRecursiveShapesCase6(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation2Input{ - RecursiveStruct: &InputService5TestShapeRecursiveStructType{ - RecursiveMap: map[string]*InputService5TestShapeRecursiveStructType{ - "bar": { - NoRecurse: aws.String("bar"), - }, - "foo": { - NoRecurse: aws.String("foo"), - }, - }, - }, - } - req, _ := svc.InputService5TestCaseOperation6Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveMap":{"foo":{"NoRecurse":"foo"},"bar":{"NoRecurse":"bar"}}}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService6ProtocolTestEmptyMapsCase1(t *testing.T) { - svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService6TestShapeInputService6TestCaseOperation1Input{ - Map: map[string]*string{}, - } - req, _ := svc.InputService6TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Map":{}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "application/x-amz-json-1.1", r.Header.Get("Content-Type")) - assert.Equal(t, "com.amazonaws.foo.OperationName", r.Header.Get("X-Amz-Target")) - -} - -func TestInputService7ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService7TestShapeInputService7TestCaseOperation2Input{ - Token: aws.String("abc123"), - } - req, _ := svc.InputService7TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Token":"abc123"}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService7ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService7TestShapeInputService7TestCaseOperation2Input{} - req, _ := svc.InputService7TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - jsonrpc.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Token":"00000000-0000-4000-8000-000000000000"}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go deleted file mode 100644 index 56af4dc..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go +++ /dev/null @@ -1,111 +0,0 @@ -// Package jsonrpc provides JSON RPC utilities for serialization of AWS -// requests and responses. -package jsonrpc - -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/json.json build_test.go -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/json.json unmarshal_test.go - -import ( - "encoding/json" - "io/ioutil" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -var emptyJSON = []byte("{}") - -// BuildHandler is a named request handler for building jsonrpc protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.jsonrpc.Build", Fn: Build} - -// UnmarshalHandler is a named request handler for unmarshaling jsonrpc protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.jsonrpc.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling jsonrpc protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.jsonrpc.UnmarshalMeta", Fn: UnmarshalMeta} - -// UnmarshalErrorHandler is a named request handler for unmarshaling jsonrpc protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.jsonrpc.UnmarshalError", Fn: UnmarshalError} - -// Build builds a JSON payload for a JSON RPC request. -func Build(req *request.Request) { - var buf []byte - var err error - if req.ParamsFilled() { - buf, err = jsonutil.BuildJSON(req.Params) - if err != nil { - req.Error = awserr.New("SerializationError", "failed encoding JSON RPC request", err) - return - } - } else { - buf = emptyJSON - } - - if req.ClientInfo.TargetPrefix != "" || string(buf) != "{}" { - req.SetBufferBody(buf) - } - - if req.ClientInfo.TargetPrefix != "" { - target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name - req.HTTPRequest.Header.Add("X-Amz-Target", target) - } - if req.ClientInfo.JSONVersion != "" { - jsonVersion := req.ClientInfo.JSONVersion - req.HTTPRequest.Header.Add("Content-Type", "application/x-amz-json-"+jsonVersion) - } -} - -// Unmarshal unmarshals a response for a JSON RPC service. -func Unmarshal(req *request.Request) { - defer req.HTTPResponse.Body.Close() - if req.DataFilled() { - err := jsonutil.UnmarshalJSON(req.Data, req.HTTPResponse.Body) - if err != nil { - req.Error = awserr.New("SerializationError", "failed decoding JSON RPC response", err) - } - } - return -} - -// UnmarshalMeta unmarshals headers from a response for a JSON RPC service. -func UnmarshalMeta(req *request.Request) { - rest.UnmarshalMeta(req) -} - -// UnmarshalError unmarshals an error response for a JSON RPC service. -func UnmarshalError(req *request.Request) { - defer req.HTTPResponse.Body.Close() - bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body) - if err != nil { - req.Error = awserr.New("SerializationError", "failed reading JSON RPC error response", err) - return - } - if len(bodyBytes) == 0 { - req.Error = awserr.NewRequestFailure( - awserr.New("SerializationError", req.HTTPResponse.Status, nil), - req.HTTPResponse.StatusCode, - "", - ) - return - } - var jsonErr jsonErrorResponse - if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil { - req.Error = awserr.New("SerializationError", "failed decoding JSON RPC error response", err) - return - } - - codes := strings.SplitN(jsonErr.Code, "#", 2) - req.Error = awserr.NewRequestFailure( - awserr.New(codes[len(codes)-1], jsonErr.Message, nil), - req.HTTPResponse.StatusCode, - req.RequestID, - ) -} - -type jsonErrorResponse struct { - Code string `json:"__type"` - Message string `json:"message"` -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_test.go deleted file mode 100644 index 7540f02..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_test.go +++ /dev/null @@ -1,1238 +0,0 @@ -package jsonrpc_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/jsonrpc" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService1ProtocolTest { - svc := &OutputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 `type:"integer"` - - Str *string `type:"string"` - - 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 -} - -// SetTrueBool sets the TrueBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetTrueBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.TrueBool = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService2ProtocolTest { - svc := &OutputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 OutputService2TestShapeBlobContainer struct { - _ struct{} `type:"structure"` - - // Foo is automatically base64 encoded/decoded by the SDK. - Foo []byte `locationName:"foo" type:"blob"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService2TestShapeBlobContainer) SetFoo(v []byte) *OutputService2TestShapeBlobContainer { - s.Foo = v - return s -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - // BlobMember is automatically base64 encoded/decoded by the SDK. - BlobMember []byte `type:"blob"` - - StructMember *OutputService2TestShapeBlobContainer `type:"structure"` -} - -// SetBlobMember sets the BlobMember field's value. -func (s *OutputService2TestShapeOutputService2TestCaseOperation1Output) SetBlobMember(v []byte) *OutputService2TestShapeOutputService2TestCaseOperation1Output { - s.BlobMember = v - return s -} - -// SetStructMember sets the StructMember field's value. -func (s *OutputService2TestShapeOutputService2TestCaseOperation1Output) SetStructMember(v *OutputService2TestShapeBlobContainer) *OutputService2TestShapeOutputService2TestCaseOperation1Output { - s.StructMember = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService3ProtocolTest { - svc := &OutputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - StructMember *OutputService3TestShapeTimeContainer `type:"structure"` - - TimeMember *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// SetStructMember sets the StructMember field's value. -func (s *OutputService3TestShapeOutputService3TestCaseOperation1Output) SetStructMember(v *OutputService3TestShapeTimeContainer) *OutputService3TestShapeOutputService3TestCaseOperation1Output { - s.StructMember = v - return s -} - -// SetTimeMember sets the TimeMember field's value. -func (s *OutputService3TestShapeOutputService3TestCaseOperation1Output) SetTimeMember(v time.Time) *OutputService3TestShapeOutputService3TestCaseOperation1Output { - s.TimeMember = &v - return s -} - -type OutputService3TestShapeTimeContainer struct { - _ struct{} `type:"structure"` - - Foo *time.Time `locationName:"foo" type:"timestamp" timestampFormat:"unix"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService3TestShapeTimeContainer) SetFoo(v time.Time) *OutputService3TestShapeTimeContainer { - s.Foo = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService4ProtocolTest { - svc := &OutputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *OutputService4TestShapeOutputService4TestCaseOperation2Output) { - op := &request.Operation{ - Name: opOutputService4TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService4TestShapeOutputService4TestCaseOperation1Input{} - } - - output = &OutputService4TestShapeOutputService4TestCaseOperation2Output{} - 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) (*OutputService4TestShapeOutputService4TestCaseOperation2Output, 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) (*OutputService4TestShapeOutputService4TestCaseOperation2Output, error) { - req, out := c.OutputService4TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opOutputService4TestCaseOperation2 = "OperationName" - -// OutputService4TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the OutputService4TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService4TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService4TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the OutputService4TestCaseOperation2Request method. -// req, resp := client.OutputService4TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation2Request(input *OutputService4TestShapeOutputService4TestCaseOperation2Input) (req *request.Request, output *OutputService4TestShapeOutputService4TestCaseOperation2Output) { - op := &request.Operation{ - Name: opOutputService4TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService4TestShapeOutputService4TestCaseOperation2Input{} - } - - output = &OutputService4TestShapeOutputService4TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - return -} - -// OutputService4TestCaseOperation2 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 OutputService4TestCaseOperation2 for usage and error information. -func (c *OutputService4ProtocolTest) OutputService4TestCaseOperation2(input *OutputService4TestShapeOutputService4TestCaseOperation2Input) (*OutputService4TestShapeOutputService4TestCaseOperation2Output, error) { - req, out := c.OutputService4TestCaseOperation2Request(input) - return out, req.Send() -} - -// OutputService4TestCaseOperation2WithContext is the same as OutputService4TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See OutputService4TestCaseOperation2 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) OutputService4TestCaseOperation2WithContext(ctx aws.Context, input *OutputService4TestShapeOutputService4TestCaseOperation2Input, opts ...request.Option) (*OutputService4TestShapeOutputService4TestCaseOperation2Output, error) { - req, out := c.OutputService4TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type OutputService4TestShapeOutputService4TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService4TestShapeOutputService4TestCaseOperation2Input struct { - _ struct{} `type:"structure"` -} - -type OutputService4TestShapeOutputService4TestCaseOperation2Output struct { - _ struct{} `type:"structure"` - - ListMember []*string `type:"list"` - - ListMemberMap []map[string]*string `type:"list"` - - ListMemberStruct []*OutputService4TestShapeStructType `type:"list"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService4TestShapeOutputService4TestCaseOperation2Output) SetListMember(v []*string) *OutputService4TestShapeOutputService4TestCaseOperation2Output { - s.ListMember = v - return s -} - -// SetListMemberMap sets the ListMemberMap field's value. -func (s *OutputService4TestShapeOutputService4TestCaseOperation2Output) SetListMemberMap(v []map[string]*string) *OutputService4TestShapeOutputService4TestCaseOperation2Output { - s.ListMemberMap = v - return s -} - -// SetListMemberStruct sets the ListMemberStruct field's value. -func (s *OutputService4TestShapeOutputService4TestCaseOperation2Output) SetListMemberStruct(v []*OutputService4TestShapeStructType) *OutputService4TestShapeOutputService4TestCaseOperation2Output { - s.ListMemberStruct = v - return s -} - -type OutputService4TestShapeStructType struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService5ProtocolTest { - svc := &OutputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - MapMember map[string][]*int64 `type:"map"` -} - -// SetMapMember sets the MapMember field's value. -func (s *OutputService5TestShapeOutputService5TestCaseOperation1Output) SetMapMember(v map[string][]*int64) *OutputService5TestShapeOutputService5TestCaseOperation1Output { - s.MapMember = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService6ProtocolTest { - svc := &OutputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // 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) - - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - StrType *string `type:"string"` -} - -// SetStrType sets the StrType field's value. -func (s *OutputService6TestShapeOutputService6TestCaseOperation1Output) SetStrType(v string) *OutputService6TestShapeOutputService6TestCaseOperation1Output { - s.StrType = &v - return s -} - -// -// Tests begin here -// - -func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\"}")) - req, out := svc.OutputService1TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - jsonrpc.UnmarshalMeta(req) - jsonrpc.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.Char) - assert.Equal(t, 1.3, *out.Double) - assert.Equal(t, false, *out.FalseBool) - assert.Equal(t, 1.2, *out.Float) - assert.Equal(t, int64(200), *out.Long) - assert.Equal(t, int64(123), *out.Num) - assert.Equal(t, "myname", *out.Str) - assert.Equal(t, true, *out.TrueBool) - -} - -func TestOutputService2ProtocolTestBlobMembersCase1(t *testing.T) { - svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}")) - req, out := svc.OutputService2TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - jsonrpc.UnmarshalMeta(req) - jsonrpc.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "hi!", string(out.BlobMember)) - assert.Equal(t, "there!", string(out.StructMember.Foo)) - -} - -func TestOutputService3ProtocolTestTimestampMembersCase1(t *testing.T) { - svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"TimeMember\": 1398796238, \"StructMember\": {\"foo\": 1398796238}}")) - req, out := svc.OutputService3TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - jsonrpc.UnmarshalMeta(req) - jsonrpc.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Foo.String()) - assert.Equal(t, time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeMember.String()) - -} - -func TestOutputService4ProtocolTestListsCase1(t *testing.T) { - svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"ListMember\": [\"a\", \"b\"]}")) - req, out := svc.OutputService4TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - jsonrpc.UnmarshalMeta(req) - jsonrpc.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.ListMember[0]) - assert.Equal(t, "b", *out.ListMember[1]) - -} - -func TestOutputService4ProtocolTestListsCase2(t *testing.T) { - svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"ListMember\": [\"a\", null], \"ListMemberMap\": [{}, null, null, {}], \"ListMemberStruct\": [{}, null, null, {}]}")) - req, out := svc.OutputService4TestCaseOperation2Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - jsonrpc.UnmarshalMeta(req) - jsonrpc.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.ListMember[0]) - assert.Nil(t, out.ListMember[1]) - assert.Nil(t, out.ListMemberMap[1]) - assert.Nil(t, out.ListMemberMap[2]) - assert.Nil(t, out.ListMemberStruct[1]) - assert.Nil(t, out.ListMemberStruct[2]) - -} - -func TestOutputService5ProtocolTestMapsCase1(t *testing.T) { - svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}")) - req, out := svc.OutputService5TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - jsonrpc.UnmarshalMeta(req) - jsonrpc.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, int64(1), *out.MapMember["a"][0]) - assert.Equal(t, int64(2), *out.MapMember["a"][1]) - assert.Equal(t, int64(3), *out.MapMember["b"][0]) - assert.Equal(t, int64(4), *out.MapMember["b"][1]) - -} - -func TestOutputService6ProtocolTestIgnoresExtraDataCase1(t *testing.T) { - svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"foo\": \"bar\"}")) - req, out := svc.OutputService6TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - jsonrpc.UnmarshalMeta(req) - jsonrpc.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue.go new file mode 100644 index 0000000..776d110 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue.go @@ -0,0 +1,76 @@ +package protocol + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "strconv" + + "github.com/aws/aws-sdk-go/aws" +) + +// EscapeMode is the mode that should be use for escaping a value +type EscapeMode uint + +// The modes for escaping a value before it is marshaled, and unmarshaled. +const ( + NoEscape EscapeMode = iota + Base64Escape + QuotedEscape +) + +// EncodeJSONValue marshals the value into a JSON string, and optionally base64 +// encodes the string before returning it. +// +// Will panic if the escape mode is unknown. +func EncodeJSONValue(v aws.JSONValue, escape EscapeMode) (string, error) { + b, err := json.Marshal(v) + if err != nil { + return "", err + } + + switch escape { + case NoEscape: + return string(b), nil + case Base64Escape: + return base64.StdEncoding.EncodeToString(b), nil + case QuotedEscape: + return strconv.Quote(string(b)), nil + } + + panic(fmt.Sprintf("EncodeJSONValue called with unknown EscapeMode, %v", escape)) +} + +// DecodeJSONValue will attempt to decode the string input as a JSONValue. +// Optionally decoding base64 the value first before JSON unmarshaling. +// +// Will panic if the escape mode is unknown. +func DecodeJSONValue(v string, escape EscapeMode) (aws.JSONValue, error) { + var b []byte + var err error + + switch escape { + case NoEscape: + b = []byte(v) + case Base64Escape: + b, err = base64.StdEncoding.DecodeString(v) + case QuotedEscape: + var u string + u, err = strconv.Unquote(v) + b = []byte(u) + default: + panic(fmt.Sprintf("DecodeJSONValue called with unknown EscapeMode, %v", escape)) + } + + if err != nil { + return nil, err + } + + m := aws.JSONValue{} + err = json.Unmarshal(b, &m) + if err != nil { + return nil, err + } + + return m, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go new file mode 100644 index 0000000..e21614a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go @@ -0,0 +1,81 @@ +package protocol + +import ( + "io" + "io/ioutil" + "net/http" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" +) + +// PayloadUnmarshaler provides the interface for unmarshaling a payload's +// reader into a SDK shape. +type PayloadUnmarshaler interface { + UnmarshalPayload(io.Reader, interface{}) error +} + +// HandlerPayloadUnmarshal implements the PayloadUnmarshaler from a +// HandlerList. This provides the support for unmarshaling a payload reader to +// a shape without needing a SDK request first. +type HandlerPayloadUnmarshal struct { + Unmarshalers request.HandlerList +} + +// UnmarshalPayload unmarshals the io.Reader payload into the SDK shape using +// the Unmarshalers HandlerList provided. Returns an error if unable +// unmarshaling fails. +func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) error { + req := &request.Request{ + HTTPRequest: &http.Request{}, + HTTPResponse: &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(r), + }, + Data: v, + } + + h.Unmarshalers.Run(req) + + return req.Error +} + +// PayloadMarshaler provides the interface for marshaling a SDK shape into and +// io.Writer. +type PayloadMarshaler interface { + MarshalPayload(io.Writer, interface{}) error +} + +// HandlerPayloadMarshal implements the PayloadMarshaler from a HandlerList. +// This provides support for marshaling a SDK shape into an io.Writer without +// needing a SDK request first. +type HandlerPayloadMarshal struct { + Marshalers request.HandlerList +} + +// MarshalPayload marshals the SDK shape into the io.Writer using the +// Marshalers HandlerList provided. Returns an error if unable if marshal +// fails. +func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error { + req := request.New( + aws.Config{}, + metadata.ClientInfo{}, + request.Handlers{}, + nil, + &request.Operation{HTTPMethod: "GET"}, + v, + nil, + ) + + h.Marshalers.Run(req) + + if req.Error != nil { + return req.Error + } + + io.Copy(w, req.GetBody()) + + return nil +} 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 6ba4412..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol_test.go +++ /dev/null @@ -1,203 +0,0 @@ -package protocol_test - -import ( - "fmt" - "net/http" - "net/url" - "testing" - - "github.com/stretchr/testify/assert" - - "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) { - if !set { - copy(b, []byte("")) - } - if size == 0 { - copy(b[delta-len(""):], []byte("")) - } -} - -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 { - assert.NotNil(t, req.Error) - } else { - fmt.Println(req.Error) - assert.Nil(t, req.Error) - } - - assert.Equal(t, reader.Closed, result.closed) - assert.Equal(t, reader.Size, result.size) -} - -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.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go index 18169f0..0cb99eb 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go @@ -21,11 +21,11 @@ func Build(r *request.Request) { "Version": {r.ClientInfo.APIVersion}, } if err := queryutil.Parse(body, r.Params, false); err != nil { - r.Error = awserr.New("SerializationError", "failed encoding Query request", err) + r.Error = awserr.New(request.ErrCodeSerialization, "failed encoding Query request", err) return } - if r.ExpireTime == 0 { + if !r.IsPresigned() { r.HTTPRequest.Method = "POST" r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") r.SetBufferBody([]byte(body.Encode())) 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 32f4036..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build_test.go +++ /dev/null @@ -1,3362 +0,0 @@ -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" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService1ProtocolTest { - svc := &InputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService1TestShapeInputService1TestCaseOperation3Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation3Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService1TestShapeInputService1TestCaseOperation3Input) (*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 *InputService1TestShapeInputService1TestCaseOperation3Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService1TestShapeInputService1TestCaseOperation3Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation3Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService1TestShapeInputService1TestCaseOperation3Input) (*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 *InputService1TestShapeInputService1TestCaseOperation3Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 InputService1TestShapeInputService1TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService2ProtocolTest { - svc := &InputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService3ProtocolTest { - svc := &InputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService3TestShapeInputService3TestCaseOperation2Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService3TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation2Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService3TestShapeInputService3TestCaseOperation2Input) (*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 *InputService3TestShapeInputService3TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService4ProtocolTest { - svc := &InputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService4TestShapeInputService4TestCaseOperation2Input) (req *request.Request, output *InputService4TestShapeInputService4TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService4TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService4TestShapeInputService4TestCaseOperation2Input{} - } - - output = &InputService4TestShapeInputService4TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService4TestShapeInputService4TestCaseOperation2Input) (*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 *InputService4TestShapeInputService4TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService4TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService4TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService5ProtocolTest { - svc := &InputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService6ProtocolTest { - svc := &InputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService7ProtocolTest { - svc := &InputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService8ProtocolTest { - svc := &InputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService9ProtocolTest { - svc := &InputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService10ProtocolTest { - svc := &InputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice10protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService10TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService10TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService11ProtocolTest { - svc := &InputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice11protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService11TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService11TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - TimeArg *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// SetTimeArg sets the TimeArg field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetTimeArg(v time.Time) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.TimeArg = &v - return s -} - -type InputService11TestShapeInputService11TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService12ProtocolTest { - svc := &InputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice12protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService12TestShapeInputService12TestCaseOperation4Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation4Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService12TestShapeInputService12TestCaseOperation4Input) (*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 *InputService12TestShapeInputService12TestCaseOperation4Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation1Output, error) { - req, out := c.InputService12TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService12TestCaseOperation2 = "OperationName" - -// InputService12TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService12TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService12TestCaseOperation2Request method. -// req, resp := client.InputService12TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService12ProtocolTest) InputService12TestCaseOperation2Request(input *InputService12TestShapeInputService12TestCaseOperation4Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation2, - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation4Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService12TestCaseOperation2 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 InputService12TestCaseOperation2 for usage and error information. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation2(input *InputService12TestShapeInputService12TestCaseOperation4Input) (*InputService12TestShapeInputService12TestCaseOperation2Output, error) { - req, out := c.InputService12TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService12TestCaseOperation2WithContext is the same as InputService12TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService12TestCaseOperation2 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) InputService12TestCaseOperation2WithContext(ctx aws.Context, input *InputService12TestShapeInputService12TestCaseOperation4Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation2Output, error) { - req, out := c.InputService12TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService12TestCaseOperation3 = "OperationName" - -// InputService12TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService12TestCaseOperation3 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService12TestCaseOperation3Request method. -// req, resp := client.InputService12TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService12ProtocolTest) InputService12TestCaseOperation3Request(input *InputService12TestShapeInputService12TestCaseOperation4Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation3, - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation4Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService12TestCaseOperation3 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 InputService12TestCaseOperation3 for usage and error information. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation3(input *InputService12TestShapeInputService12TestCaseOperation4Input) (*InputService12TestShapeInputService12TestCaseOperation3Output, error) { - req, out := c.InputService12TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService12TestCaseOperation3WithContext is the same as InputService12TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService12TestCaseOperation3 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) InputService12TestCaseOperation3WithContext(ctx aws.Context, input *InputService12TestShapeInputService12TestCaseOperation4Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation3Output, error) { - req, out := c.InputService12TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService12TestCaseOperation4 = "OperationName" - -// InputService12TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService12TestCaseOperation4 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation4 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation4 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService12TestCaseOperation4Request method. -// req, resp := client.InputService12TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService12ProtocolTest) InputService12TestCaseOperation4Request(input *InputService12TestShapeInputService12TestCaseOperation4Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation4, - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation4Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService12TestCaseOperation4 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 InputService12TestCaseOperation4 for usage and error information. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation4(input *InputService12TestShapeInputService12TestCaseOperation4Input) (*InputService12TestShapeInputService12TestCaseOperation4Output, error) { - req, out := c.InputService12TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService12TestCaseOperation4WithContext is the same as InputService12TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService12TestCaseOperation4 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) InputService12TestCaseOperation4WithContext(ctx aws.Context, input *InputService12TestShapeInputService12TestCaseOperation4Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation4Output, error) { - req, out := c.InputService12TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService12TestCaseOperation5 = "OperationName" - -// InputService12TestCaseOperation5Request generates a "aws/request.Request" representing the -// client's request for the InputService12TestCaseOperation5 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation5 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation5 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService12TestCaseOperation5Request method. -// req, resp := client.InputService12TestCaseOperation5Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService12ProtocolTest) InputService12TestCaseOperation5Request(input *InputService12TestShapeInputService12TestCaseOperation4Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation5Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation5, - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation4Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation5Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService12TestCaseOperation5 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 InputService12TestCaseOperation5 for usage and error information. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation5(input *InputService12TestShapeInputService12TestCaseOperation4Input) (*InputService12TestShapeInputService12TestCaseOperation5Output, error) { - req, out := c.InputService12TestCaseOperation5Request(input) - return out, req.Send() -} - -// InputService12TestCaseOperation5WithContext is the same as InputService12TestCaseOperation5 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService12TestCaseOperation5 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) InputService12TestCaseOperation5WithContext(ctx aws.Context, input *InputService12TestShapeInputService12TestCaseOperation4Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation5Output, error) { - req, out := c.InputService12TestCaseOperation5Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService12TestCaseOperation6 = "OperationName" - -// InputService12TestCaseOperation6Request generates a "aws/request.Request" representing the -// client's request for the InputService12TestCaseOperation6 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation6 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation6 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService12TestCaseOperation6Request method. -// req, resp := client.InputService12TestCaseOperation6Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService12ProtocolTest) InputService12TestCaseOperation6Request(input *InputService12TestShapeInputService12TestCaseOperation4Input) (req *request.Request, output *InputService12TestShapeInputService12TestCaseOperation6Output) { - op := &request.Operation{ - Name: opInputService12TestCaseOperation6, - HTTPPath: "/", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation4Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation6Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService12TestCaseOperation6 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 InputService12TestCaseOperation6 for usage and error information. -func (c *InputService12ProtocolTest) InputService12TestCaseOperation6(input *InputService12TestShapeInputService12TestCaseOperation4Input) (*InputService12TestShapeInputService12TestCaseOperation6Output, error) { - req, out := c.InputService12TestCaseOperation6Request(input) - return out, req.Send() -} - -// InputService12TestCaseOperation6WithContext is the same as InputService12TestCaseOperation6 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService12TestCaseOperation6 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) InputService12TestCaseOperation6WithContext(ctx aws.Context, input *InputService12TestShapeInputService12TestCaseOperation4Input, opts ...request.Option) (*InputService12TestShapeInputService12TestCaseOperation6Output, error) { - req, out := c.InputService12TestCaseOperation6Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService12TestShapeInputService12TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService12TestShapeInputService12TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService12TestShapeInputService12TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService12TestShapeInputService12TestCaseOperation4Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService12TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation4Input) SetRecursiveStruct(v *InputService12TestShapeRecursiveStructType) *InputService12TestShapeInputService12TestCaseOperation4Input { - s.RecursiveStruct = v - return s -} - -type InputService12TestShapeInputService12TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -type InputService12TestShapeInputService12TestCaseOperation5Output struct { - _ struct{} `type:"structure"` -} - -type InputService12TestShapeInputService12TestCaseOperation6Output struct { - _ struct{} `type:"structure"` -} - -type InputService12TestShapeRecursiveStructType struct { - _ struct{} `type:"structure"` - - NoRecurse *string `type:"string"` - - RecursiveList []*InputService12TestShapeRecursiveStructType `type:"list"` - - RecursiveMap map[string]*InputService12TestShapeRecursiveStructType `type:"map"` - - RecursiveStruct *InputService12TestShapeRecursiveStructType `type:"structure"` -} - -// SetNoRecurse sets the NoRecurse field's value. -func (s *InputService12TestShapeRecursiveStructType) SetNoRecurse(v string) *InputService12TestShapeRecursiveStructType { - s.NoRecurse = &v - return s -} - -// SetRecursiveList sets the RecursiveList field's value. -func (s *InputService12TestShapeRecursiveStructType) SetRecursiveList(v []*InputService12TestShapeRecursiveStructType) *InputService12TestShapeRecursiveStructType { - s.RecursiveList = v - return s -} - -// SetRecursiveMap sets the RecursiveMap field's value. -func (s *InputService12TestShapeRecursiveStructType) SetRecursiveMap(v map[string]*InputService12TestShapeRecursiveStructType) *InputService12TestShapeRecursiveStructType { - s.RecursiveMap = v - return s -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService12TestShapeRecursiveStructType) SetRecursiveStruct(v *InputService12TestShapeRecursiveStructType) *InputService12TestShapeRecursiveStructType { - s.RecursiveStruct = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService13ProtocolTest { - svc := &InputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice13protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService13TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService13TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService13TestShapeInputService13TestCaseOperation2Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation2Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService13TestShapeInputService13TestCaseOperation2Input) (*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 *InputService13TestShapeInputService13TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService13TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService13TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation2Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService13TestShapeInputService13TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeInputService13TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation2Input) SetToken(v string) *InputService13TestShapeInputService13TestCaseOperation2Input { - s.Token = &v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// -// Tests begin here -// - -func TestInputService1ProtocolTestScalarMembersCase1(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService1TestShapeInputService1TestCaseOperation3Input{ - Bar: aws.String("val2"), - Foo: aws.String("val1"), - } - req, _ := svc.InputService1TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 := &InputService1TestShapeInputService1TestCaseOperation3Input{ - Baz: aws.Bool(true), - } - req, _ := svc.InputService1TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 := &InputService3TestShapeInputService3TestCaseOperation2Input{ - ListArg: []*string{ - aws.String("foo"), - aws.String("bar"), - aws.String("baz"), - }, - } - req, _ := svc.InputService3TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 := &InputService4TestShapeInputService4TestCaseOperation2Input{ - ListArg: []*string{ - aws.String("a"), - aws.String("b"), - aws.String("c"), - }, - ScalarArg: aws.String("foo"), - } - req, _ := svc.InputService4TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService11ProtocolTestTimestampValuesCase1(t *testing.T) { - svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService11TestShapeInputService11TestCaseOperation1Input{ - TimeArg: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService11TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertQuery(t, `Action=OperationName&TimeArg=2015-01-25T08%3A00%3A00Z&Version=2014-01-01`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService12ProtocolTestRecursiveShapesCase1(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation4Input{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - } - req, _ := svc.InputService12TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService12ProtocolTestRecursiveShapesCase2(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation4Input{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - } - req, _ := svc.InputService12TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService12ProtocolTestRecursiveShapesCase3(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation4Input{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - }, - }, - } - req, _ := svc.InputService12TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService12ProtocolTestRecursiveShapesCase4(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation4Input{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - RecursiveList: []*InputService12TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - NoRecurse: aws.String("bar"), - }, - }, - }, - } - req, _ := svc.InputService12TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService12ProtocolTestRecursiveShapesCase5(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation4Input{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - RecursiveList: []*InputService12TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - NoRecurse: aws.String("bar"), - }, - }, - }, - }, - } - req, _ := svc.InputService12TestCaseOperation5Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService12ProtocolTestRecursiveShapesCase6(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation4Input{ - RecursiveStruct: &InputService12TestShapeRecursiveStructType{ - RecursiveMap: map[string]*InputService12TestShapeRecursiveStructType{ - "bar": { - NoRecurse: aws.String("bar"), - }, - "foo": { - NoRecurse: aws.String("foo"), - }, - }, - }, - } - req, _ := svc.InputService12TestCaseOperation6Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService13ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation2Input{ - Token: aws.String("abc123"), - } - req, _ := svc.InputService13TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 TestInputService13ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation2Input{} - req, _ := svc.InputService13TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - query.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - 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 - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go index 524ca95..75866d0 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go @@ -121,6 +121,10 @@ func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string return nil } + if _, ok := value.Interface().([]byte); ok { + return q.parseScalar(v, value, prefix, tag) + } + // check for unflattened list member if !q.isEC2 && tag.Get("flattened") == "" { if listName := tag.Get("locationNameList"); listName == "" { @@ -229,7 +233,12 @@ func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, ta v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32)) case time.Time: const ISO8601UTC = "2006-01-02T15:04:05Z" - v.Set(name, value.UTC().Format(ISO8601UTC)) + format := tag.Get("timestampFormat") + if len(format) == 0 { + format = protocol.ISO8601TimeFormatName + } + + v.Set(name, protocol.FormatTime(format, value)) default: return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name()) } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go index e0f4d5a..f69c1ef 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go @@ -23,7 +23,11 @@ func Unmarshal(r *request.Request) { decoder := xml.NewDecoder(r.HTTPResponse.Body) err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") if err != nil { - r.Error = awserr.New("SerializationError", "failed decoding Query response", err) + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, "failed decoding Query response", err), + r.HTTPResponse.StatusCode, + r.RequestID, + ) return } } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go index f214296..831b011 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go @@ -2,65 +2,68 @@ package query import ( "encoding/xml" - "io/ioutil" + "fmt" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" ) +// UnmarshalErrorHandler is a name request handler to unmarshal request errors +var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError} + type xmlErrorResponse struct { - XMLName xml.Name `xml:"ErrorResponse"` - Code string `xml:"Error>Code"` - Message string `xml:"Error>Message"` - RequestID string `xml:"RequestId"` + Code string `xml:"Error>Code"` + Message string `xml:"Error>Message"` + RequestID string `xml:"RequestId"` } -type xmlServiceUnavailableResponse struct { - XMLName xml.Name `xml:"ServiceUnavailableException"` +type xmlResponseError struct { + xmlErrorResponse } -// UnmarshalErrorHandler is a name request handler to unmarshal request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError} +func (e *xmlResponseError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + const svcUnavailableTagName = "ServiceUnavailableException" + const errorResponseTagName = "ErrorResponse" + + switch start.Name.Local { + case svcUnavailableTagName: + e.Code = svcUnavailableTagName + e.Message = "service is unavailable" + return d.Skip() + + case errorResponseTagName: + return d.DecodeElement(&e.xmlErrorResponse, &start) + + default: + return fmt.Errorf("unknown error response tag, %v", start) + } +} // UnmarshalError unmarshals an error response for an AWS Query service. func UnmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() - bodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body) + var respErr xmlResponseError + err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body) if err != nil { - r.Error = awserr.New("SerializationError", "failed to read from query HTTP response body", err) - return - } - - // First check for specific error - resp := xmlErrorResponse{} - decodeErr := xml.Unmarshal(bodyBytes, &resp) - if decodeErr == nil { - reqID := resp.RequestID - if reqID == "" { - reqID = r.RequestID - } r.Error = awserr.NewRequestFailure( - awserr.New(resp.Code, resp.Message, nil), + awserr.New(request.ErrCodeSerialization, + "failed to unmarshal error message", err), r.HTTPResponse.StatusCode, - reqID, + r.RequestID, ) return } - // Check for unhandled error - servUnavailResp := xmlServiceUnavailableResponse{} - unavailErr := xml.Unmarshal(bodyBytes, &servUnavailResp) - if unavailErr == nil { - r.Error = awserr.NewRequestFailure( - awserr.New("ServiceUnavailableException", "service is unavailable", nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return + reqID := respErr.RequestID + if len(reqID) == 0 { + reqID = r.RequestID } - // Failed to retrieve any error message from the response body - r.Error = awserr.New("SerializationError", - "failed to decode query XML error response", decodeErr) + r.Error = awserr.NewRequestFailure( + awserr.New(respErr.Code, respErr.Message, nil), + r.HTTPResponse.StatusCode, + reqID, + ) } 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 2908b61..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_test.go +++ /dev/null @@ -1,2616 +0,0 @@ -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" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService1ProtocolTest { - svc := &OutputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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" timestampFormat:"iso8601"` - - 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService2ProtocolTest { - svc := &OutputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService3ProtocolTest { - svc := &OutputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService4ProtocolTest { - svc := &OutputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService5ProtocolTest { - svc := &OutputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService6ProtocolTest { - svc := &OutputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService7ProtocolTest { - svc := &OutputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService8ProtocolTest { - svc := &OutputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService9ProtocolTest { - svc := &OutputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService10ProtocolTest { - svc := &OutputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice10protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService10TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService10TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService11ProtocolTest { - svc := &OutputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice11protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService11TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService11TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService12ProtocolTest { - svc := &OutputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice12protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService12TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService12TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService13ProtocolTest { - svc := &OutputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice13protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService13TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService13TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService14ProtocolTest { - svc := &OutputService14ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice14protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService14TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService14TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService15ProtocolTest { - svc := &OutputService15ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice15protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService15TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService15TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// -// 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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.Char) - assert.Equal(t, 1.3, *out.Double) - assert.Equal(t, false, *out.FalseBool) - assert.Equal(t, 1.2, *out.Float) - assert.Equal(t, int64(200), *out.Long) - assert.Equal(t, int64(123), *out.Num) - assert.Equal(t, "myname", *out.Str) - assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String()) - assert.Equal(t, true, *out.TrueBool) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "myname", *out.Str) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "value", string(out.Blob)) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "firstbar", *out.List[0].Bar) - assert.Equal(t, "firstbaz", *out.List[0].Baz) - assert.Equal(t, "firstfoo", *out.List[0].Foo) - assert.Equal(t, "secondbar", *out.List[1].Bar) - assert.Equal(t, "secondbaz", *out.List[1].Baz) - assert.Equal(t, "secondfoo", *out.List[1].Foo) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "firstbar", *out.List[0].Bar) - assert.Equal(t, "firstbaz", *out.List[0].Baz) - assert.Equal(t, "firstfoo", *out.List[0].Foo) - assert.Equal(t, "secondbar", *out.List[1].Bar) - assert.Equal(t, "secondbaz", *out.List[1].Baz) - assert.Equal(t, "secondfoo", *out.List[1].Foo) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.List[0]) - assert.Equal(t, "b", *out.List[1]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"].Foo) - assert.Equal(t, "bar", *out.Map["qux"].Foo) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"]) - assert.Equal(t, "bar", *out.Map["qux"]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bar", *out.Map["qux"]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"]) - assert.Equal(t, "bar", *out.Map["qux"]) - -} - -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 - query.UnmarshalMeta(req) - query.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "", *out.Foo) - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go index 7161835..1301b14 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go @@ -4,7 +4,6 @@ package rest import ( "bytes" "encoding/base64" - "encoding/json" "fmt" "io" "net/http" @@ -18,16 +17,16 @@ import ( "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/private/protocol" ) -// RFC822 returns an RFC822 formatted timestamp for AWS protocols -const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT" - // Whether the byte value can be sent without escaping in AWS URLs var noEscape [256]bool var errValueNotSet = fmt.Errorf("value not set") +var byteSliceType = reflect.TypeOf([]byte{}) + func init() { for i := 0; i < len(noEscape); i++ { // AWS expects every character except these to be escaped @@ -97,6 +96,14 @@ func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bo continue } + // Support the ability to customize values to be marshaled as a + // blob even though they were modeled as a string. Required for S3 + // API operations like SSECustomerKey is modeled as stirng but + // required to be base64 encoded in request. + if field.Tag.Get("marshal-as") == "blob" { + m = m.Convert(byteSliceType) + } + var err error switch field.Tag.Get("location") { case "headers": // header maps @@ -140,7 +147,7 @@ func buildBody(r *request.Request, v reflect.Value) { case string: r.SetStringBody(reader) default: - r.Error = awserr.New("SerializationError", + r.Error = awserr.New(request.ErrCodeSerialization, "failed to encode REST request", fmt.Errorf("unknown payload type %s", payload.Type())) } @@ -155,9 +162,12 @@ func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect. if err == errValueNotSet { return nil } else if err != nil { - return awserr.New("SerializationError", "failed to encode REST request", err) + return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) } + name = strings.TrimSpace(name) + str = strings.TrimSpace(str) + header.Add(name, str) return nil @@ -170,11 +180,13 @@ func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) if err == errValueNotSet { continue } else if err != nil { - return awserr.New("SerializationError", "failed to encode REST request", err) + return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) } + keyStr := strings.TrimSpace(key.String()) + str = strings.TrimSpace(str) - header.Add(prefix+key.String(), str) + header.Add(prefix+keyStr, str) } return nil } @@ -184,7 +196,7 @@ func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) e if err == errValueNotSet { return nil } else if err != nil { - return awserr.New("SerializationError", "failed to encode REST request", err) + return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) } u.Path = strings.Replace(u.Path, "{"+name+"}", value, -1) @@ -217,7 +229,7 @@ func buildQueryString(query url.Values, v reflect.Value, name string, tag reflec if err == errValueNotSet { return nil } else if err != nil { - return awserr.New("SerializationError", "failed to encode REST request", err) + return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err) } query.Set(name, str) } @@ -252,13 +264,12 @@ func EscapePath(path string, encodeSep bool) string { return buf.String() } -func convertType(v reflect.Value, tag reflect.StructTag) (string, error) { +func convertType(v reflect.Value, tag reflect.StructTag) (str string, err error) { v = reflect.Indirect(v) if !v.IsValid() { return "", errValueNotSet } - var str string switch value := v.Interface().(type) { case string: str = value @@ -271,19 +282,28 @@ func convertType(v reflect.Value, tag reflect.StructTag) (string, error) { case float64: str = strconv.FormatFloat(value, 'f', -1, 64) case time.Time: - str = value.UTC().Format(RFC822) + format := tag.Get("timestampFormat") + if len(format) == 0 { + format = protocol.RFC822TimeFormatName + if tag.Get("location") == "querystring" { + format = protocol.ISO8601TimeFormatName + } + } + str = protocol.FormatTime(format, value) case aws.JSONValue: - b, err := json.Marshal(value) - if err != nil { - return "", err + if len(value) == 0 { + return "", errValueNotSet } + escaping := protocol.NoEscape if tag.Get("location") == "header" { - str = base64.StdEncoding.EncodeToString(b) - } else { - str = string(b) + escaping = protocol.Base64Escape + } + str, err = protocol.EncodeJSONValue(value, escaping) + if err != nil { + return "", fmt.Errorf("unable to encode JSONValue, %v", err) } default: - err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) + err := fmt.Errorf("unsupported value for param %v (%s)", v.Interface(), v.Type()) return "", err } return str, nil 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/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go index 7a779ee..74e361e 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go @@ -3,7 +3,6 @@ package rest import ( "bytes" "encoding/base64" - "encoding/json" "fmt" "io" "io/ioutil" @@ -16,6 +15,7 @@ import ( "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/private/protocol" ) // UnmarshalHandler is a named request handler for unmarshaling rest protocol requests @@ -57,7 +57,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) { defer r.HTTPResponse.Body.Close() b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = awserr.New("SerializationError", "failed to decode REST response", err) + r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } else { payload.Set(reflect.ValueOf(b)) } @@ -65,7 +65,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) { defer r.HTTPResponse.Body.Close() b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = awserr.New("SerializationError", "failed to decode REST response", err) + r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } else { str := string(b) payload.Set(reflect.ValueOf(&str)) @@ -77,7 +77,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) { case "io.ReadSeeker": b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = awserr.New("SerializationError", + r.Error = awserr.New(request.ErrCodeSerialization, "failed to read response body", err) return } @@ -85,7 +85,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) { default: io.Copy(ioutil.Discard, r.HTTPResponse.Body) defer r.HTTPResponse.Body.Close() - r.Error = awserr.New("SerializationError", + r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", fmt.Errorf("unknown payload type %s", payload.Type())) } @@ -115,14 +115,14 @@ func unmarshalLocationElements(r *request.Request, v reflect.Value) { case "header": err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag) if err != nil { - r.Error = awserr.New("SerializationError", "failed to decode REST response", err) + r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) break } case "headers": prefix := field.Tag.Get("locationName") err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix) if err != nil { - r.Error = awserr.New("SerializationError", "failed to decode REST response", err) + r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) break } } @@ -146,6 +146,9 @@ func unmarshalStatusCode(v reflect.Value, statusCode int) { } func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error { + if len(headers) == 0 { + return nil + } switch r.Interface().(type) { case map[string]*string: // we only support string map value types out := map[string]*string{} @@ -155,19 +158,28 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) err out[k[len(prefix):]] = &v[0] } } - r.Set(reflect.ValueOf(out)) + if len(out) != 0 { + r.Set(reflect.ValueOf(out)) + } + } return nil } func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { - isJSONValue := tag.Get("type") == "jsonvalue" - if isJSONValue { + switch tag.Get("type") { + case "jsonvalue": if len(header) == 0 { return nil } - } else if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { - return nil + case "blob": + if len(header) == 0 { + return nil + } + default: + if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { + return nil + } } switch v.Interface().(type) { @@ -178,7 +190,7 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro if err != nil { return err } - v.Set(reflect.ValueOf(&b)) + v.Set(reflect.ValueOf(b)) case *bool: b, err := strconv.ParseBool(header) if err != nil { @@ -198,23 +210,21 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro } v.Set(reflect.ValueOf(&f)) case *time.Time: - t, err := time.Parse(RFC822, header) + format := tag.Get("timestampFormat") + if len(format) == 0 { + format = protocol.RFC822TimeFormatName + } + t, err := protocol.ParseTime(format, header) if err != nil { return err } v.Set(reflect.ValueOf(&t)) case aws.JSONValue: - b := []byte(header) - var err error + escaping := protocol.NoEscape if tag.Get("location") == "header" { - b, err = base64.StdEncoding.DecodeString(header) - if err != nil { - return err - } + escaping = protocol.Base64Escape } - - m := aws.JSONValue{} - err = json.Unmarshal(b, &m) + m, err := protocol.DecodeJSONValue(header, escaping) if err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_bench_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_bench_test.go deleted file mode 100644 index 31e1d6c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_bench_test.go +++ /dev/null @@ -1,356 +0,0 @@ -// +build bench - -package restjson_test - -import ( - "bytes" - "encoding/json" - "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/private/protocol/rest" - "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/service/elastictranscoder" -) - -func BenchmarkRESTJSONBuild_Complex_elastictranscoderCreateJobInput(b *testing.B) { - svc := awstesting.NewClient() - svc.ServiceName = "elastictranscoder" - svc.APIVersion = "2012-09-25" - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(&request.Operation{Name: "CreateJobInput"}, restjsonBuildParms, nil) - restjson.Build(r) - if r.Error != nil { - b.Fatal("Unexpected error", r.Error) - } - } -} - -func BenchmarkRESTBuild_Complex_elastictranscoderCreateJobInput(b *testing.B) { - svc := awstesting.NewClient() - svc.ServiceName = "elastictranscoder" - svc.APIVersion = "2012-09-25" - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(&request.Operation{Name: "CreateJobInput"}, restjsonBuildParms, nil) - rest.Build(r) - if r.Error != nil { - b.Fatal("Unexpected error", r.Error) - } - } -} - -func BenchmarkEncodingJSONMarshal_Complex_elastictranscoderCreateJobInput(b *testing.B) { - params := restjsonBuildParms - - for i := 0; i < b.N; i++ { - buf := &bytes.Buffer{} - encoder := json.NewEncoder(buf) - if err := encoder.Encode(params); err != nil { - b.Fatal("Unexpected error", err) - } - } -} - -func BenchmarkRESTJSONBuild_Simple_elastictranscoderListJobsByPipeline(b *testing.B) { - svc := awstesting.NewClient() - svc.ServiceName = "elastictranscoder" - svc.APIVersion = "2012-09-25" - - params := &elastictranscoder.ListJobsByPipelineInput{ - PipelineId: aws.String("Id"), // Required - Ascending: aws.String("Ascending"), - PageToken: aws.String("Id"), - } - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(&request.Operation{Name: "ListJobsByPipeline"}, params, nil) - restjson.Build(r) - if r.Error != nil { - b.Fatal("Unexpected error", r.Error) - } - } -} - -func BenchmarkRESTBuild_Simple_elastictranscoderListJobsByPipeline(b *testing.B) { - svc := awstesting.NewClient() - svc.ServiceName = "elastictranscoder" - svc.APIVersion = "2012-09-25" - - params := &elastictranscoder.ListJobsByPipelineInput{ - PipelineId: aws.String("Id"), // Required - Ascending: aws.String("Ascending"), - PageToken: aws.String("Id"), - } - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(&request.Operation{Name: "ListJobsByPipeline"}, params, nil) - rest.Build(r) - if r.Error != nil { - b.Fatal("Unexpected error", r.Error) - } - } -} - -func BenchmarkEncodingJSONMarshal_Simple_elastictranscoderListJobsByPipeline(b *testing.B) { - params := &elastictranscoder.ListJobsByPipelineInput{ - PipelineId: aws.String("Id"), // Required - Ascending: aws.String("Ascending"), - PageToken: aws.String("Id"), - } - - for i := 0; i < b.N; i++ { - buf := &bytes.Buffer{} - encoder := json.NewEncoder(buf) - if err := encoder.Encode(params); err != nil { - b.Fatal("Unexpected error", err) - } - } -} - -var restjsonBuildParms = &elastictranscoder.CreateJobInput{ - Input: &elastictranscoder.JobInput{ // Required - AspectRatio: aws.String("AspectRatio"), - Container: aws.String("JobContainer"), - DetectedProperties: &elastictranscoder.DetectedProperties{ - DurationMillis: aws.Int64(1), - FileSize: aws.Int64(1), - FrameRate: aws.String("FloatString"), - Height: aws.Int64(1), - Width: aws.Int64(1), - }, - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - FrameRate: aws.String("FrameRate"), - Interlaced: aws.String("Interlaced"), - Key: aws.String("Key"), - Resolution: aws.String("Resolution"), - }, - PipelineId: aws.String("Id"), // Required - Output: &elastictranscoder.CreateJobOutput{ - AlbumArt: &elastictranscoder.JobAlbumArt{ - Artwork: []*elastictranscoder.Artwork{ - { // Required - AlbumArtFormat: aws.String("JpgOrPng"), - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - MaxHeight: aws.String("DigitsOrAuto"), - MaxWidth: aws.String("DigitsOrAuto"), - PaddingPolicy: aws.String("PaddingPolicy"), - SizingPolicy: aws.String("SizingPolicy"), - }, - // More values... - }, - MergePolicy: aws.String("MergePolicy"), - }, - Captions: &elastictranscoder.Captions{ - CaptionFormats: []*elastictranscoder.CaptionFormat{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Format: aws.String("CaptionFormatFormat"), - Pattern: aws.String("CaptionFormatPattern"), - }, - // More values... - }, - CaptionSources: []*elastictranscoder.CaptionSource{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("Key"), - Label: aws.String("Name"), - Language: aws.String("Key"), - TimeOffset: aws.String("TimeOffset"), - }, - // More values... - }, - MergePolicy: aws.String("CaptionMergePolicy"), - }, - Composition: []*elastictranscoder.Clip{ - { // Required - TimeSpan: &elastictranscoder.TimeSpan{ - Duration: aws.String("Time"), - StartTime: aws.String("Time"), - }, - }, - // More values... - }, - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("Key"), - PresetId: aws.String("Id"), - Rotate: aws.String("Rotate"), - SegmentDuration: aws.String("FloatString"), - ThumbnailEncryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - ThumbnailPattern: aws.String("ThumbnailPattern"), - Watermarks: []*elastictranscoder.JobWatermark{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - PresetWatermarkId: aws.String("PresetWatermarkId"), - }, - // More values... - }, - }, - OutputKeyPrefix: aws.String("Key"), - Outputs: []*elastictranscoder.CreateJobOutput{ - { // Required - AlbumArt: &elastictranscoder.JobAlbumArt{ - Artwork: []*elastictranscoder.Artwork{ - { // Required - AlbumArtFormat: aws.String("JpgOrPng"), - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - MaxHeight: aws.String("DigitsOrAuto"), - MaxWidth: aws.String("DigitsOrAuto"), - PaddingPolicy: aws.String("PaddingPolicy"), - SizingPolicy: aws.String("SizingPolicy"), - }, - // More values... - }, - MergePolicy: aws.String("MergePolicy"), - }, - Captions: &elastictranscoder.Captions{ - CaptionFormats: []*elastictranscoder.CaptionFormat{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Format: aws.String("CaptionFormatFormat"), - Pattern: aws.String("CaptionFormatPattern"), - }, - // More values... - }, - CaptionSources: []*elastictranscoder.CaptionSource{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("Key"), - Label: aws.String("Name"), - Language: aws.String("Key"), - TimeOffset: aws.String("TimeOffset"), - }, - // More values... - }, - MergePolicy: aws.String("CaptionMergePolicy"), - }, - Composition: []*elastictranscoder.Clip{ - { // Required - TimeSpan: &elastictranscoder.TimeSpan{ - Duration: aws.String("Time"), - StartTime: aws.String("Time"), - }, - }, - // More values... - }, - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("Key"), - PresetId: aws.String("Id"), - Rotate: aws.String("Rotate"), - SegmentDuration: aws.String("FloatString"), - ThumbnailEncryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - ThumbnailPattern: aws.String("ThumbnailPattern"), - Watermarks: []*elastictranscoder.JobWatermark{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - PresetWatermarkId: aws.String("PresetWatermarkId"), - }, - // More values... - }, - }, - // More values... - }, - Playlists: []*elastictranscoder.CreateJobPlaylist{ - { // Required - Format: aws.String("PlaylistFormat"), - HlsContentProtection: &elastictranscoder.HlsContentProtection{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - KeyStoragePolicy: aws.String("KeyStoragePolicy"), - LicenseAcquisitionUrl: aws.String("ZeroTo512String"), - Method: aws.String("HlsContentProtectionMethod"), - }, - Name: aws.String("Filename"), - OutputKeys: []*string{ - aws.String("Key"), // Required - // More values... - }, - PlayReadyDrm: &elastictranscoder.PlayReadyDrm{ - Format: aws.String("PlayReadyDrmFormatString"), - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("NonEmptyBase64EncodedString"), - KeyId: aws.String("KeyIdGuid"), - KeyMd5: aws.String("NonEmptyBase64EncodedString"), - LicenseAcquisitionUrl: aws.String("OneTo512String"), - }, - }, - // More values... - }, - UserMetadata: map[string]*string{ - "Key": aws.String("String"), // Required - // More values... - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_test.go deleted file mode 100644 index e4cfc4e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/build_test.go +++ /dev/null @@ -1,4976 +0,0 @@ -package restjson_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/restjson" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService1ProtocolTest { - svc := &InputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/2014-01-01/jobs", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation1Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService1TestShapeInputService1TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService2ProtocolTest { - svc := &InputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService2TestShapeInputService2TestCaseOperation1Input{} - } - - output = &InputService2TestShapeInputService2TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - PipelineId *string `location:"uri" type:"string"` -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService2TestShapeInputService2TestCaseOperation1Input) SetPipelineId(v string) *InputService2TestShapeInputService2TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -type InputService2TestShapeInputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService3ProtocolTest { - svc := &InputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation1Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService3TestShapeInputService3TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Foo *string `location:"uri" locationName:"PipelineId" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService3TestShapeInputService3TestCaseOperation1Input) SetFoo(v string) *InputService3TestShapeInputService3TestCaseOperation1Input { - s.Foo = &v - return s -} - -type InputService3TestShapeInputService3TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService4ProtocolTest { - svc := &InputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService4TestShapeInputService4TestCaseOperation1Input{} - } - - output = &InputService4TestShapeInputService4TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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{} `type:"structure"` - - Items []*string `location:"querystring" locationName:"item" type:"list"` -} - -// SetItems sets the Items field's value. -func (s *InputService4TestShapeInputService4TestCaseOperation1Input) SetItems(v []*string) *InputService4TestShapeInputService4TestCaseOperation1Input { - s.Items = v - return s -} - -type InputService4TestShapeInputService4TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService5ProtocolTest { - svc := &InputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService5TestShapeInputService5TestCaseOperation1Input{} - } - - output = &InputService5TestShapeInputService5TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - PipelineId *string `location:"uri" type:"string"` - - QueryDoc map[string]*string `location:"querystring" type:"map"` -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService5TestShapeInputService5TestCaseOperation1Input) SetPipelineId(v string) *InputService5TestShapeInputService5TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -// SetQueryDoc sets the QueryDoc field's value. -func (s *InputService5TestShapeInputService5TestCaseOperation1Input) SetQueryDoc(v map[string]*string) *InputService5TestShapeInputService5TestCaseOperation1Input { - s.QueryDoc = v - return s -} - -type InputService5TestShapeInputService5TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService6ProtocolTest { - svc := &InputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService6TestShapeInputService6TestCaseOperation1Input{} - } - - output = &InputService6TestShapeInputService6TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - PipelineId *string `location:"uri" type:"string"` - - QueryDoc map[string][]*string `location:"querystring" type:"map"` -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService6TestShapeInputService6TestCaseOperation1Input) SetPipelineId(v string) *InputService6TestShapeInputService6TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -// SetQueryDoc sets the QueryDoc field's value. -func (s *InputService6TestShapeInputService6TestCaseOperation1Input) SetQueryDoc(v map[string][]*string) *InputService6TestShapeInputService6TestCaseOperation1Input { - s.QueryDoc = v - return s -} - -type InputService6TestShapeInputService6TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService7ProtocolTest { - svc := &InputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService7TestShapeInputService7TestCaseOperation2Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService7TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService7TestShapeInputService7TestCaseOperation2Input{} - } - - output = &InputService7TestShapeInputService7TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService7TestShapeInputService7TestCaseOperation2Input) (*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 *InputService7TestShapeInputService7TestCaseOperation2Input, opts ...request.Option) (*InputService7TestShapeInputService7TestCaseOperation1Output, error) { - req, out := c.InputService7TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService7TestCaseOperation2 = "OperationName" - -// InputService7TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService7TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService7TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService7TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService7TestCaseOperation2Request method. -// req, resp := client.InputService7TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService7ProtocolTest) InputService7TestCaseOperation2Request(input *InputService7TestShapeInputService7TestCaseOperation2Input) (req *request.Request, output *InputService7TestShapeInputService7TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService7TestCaseOperation2, - HTTPMethod: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService7TestShapeInputService7TestCaseOperation2Input{} - } - - output = &InputService7TestShapeInputService7TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService7TestCaseOperation2 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 InputService7TestCaseOperation2 for usage and error information. -func (c *InputService7ProtocolTest) InputService7TestCaseOperation2(input *InputService7TestShapeInputService7TestCaseOperation2Input) (*InputService7TestShapeInputService7TestCaseOperation2Output, error) { - req, out := c.InputService7TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService7TestCaseOperation2WithContext is the same as InputService7TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService7TestCaseOperation2 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) InputService7TestCaseOperation2WithContext(ctx aws.Context, input *InputService7TestShapeInputService7TestCaseOperation2Input, opts ...request.Option) (*InputService7TestShapeInputService7TestCaseOperation2Output, error) { - req, out := c.InputService7TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService7TestShapeInputService7TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService7TestShapeInputService7TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - BoolQuery *bool `location:"querystring" locationName:"bool-query" type:"boolean"` -} - -// SetBoolQuery sets the BoolQuery field's value. -func (s *InputService7TestShapeInputService7TestCaseOperation2Input) SetBoolQuery(v bool) *InputService7TestShapeInputService7TestCaseOperation2Input { - s.BoolQuery = &v - return s -} - -type InputService7TestShapeInputService7TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService8ProtocolTest { - svc := &InputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService8TestShapeInputService8TestCaseOperation1Input{} - } - - output = &InputService8TestShapeInputService8TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - Ascending *string `location:"querystring" locationName:"Ascending" type:"string"` - - PageToken *string `location:"querystring" locationName:"PageToken" type:"string"` - - PipelineId *string `location:"uri" locationName:"PipelineId" type:"string"` -} - -// SetAscending sets the Ascending field's value. -func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetAscending(v string) *InputService8TestShapeInputService8TestCaseOperation1Input { - s.Ascending = &v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetPageToken(v string) *InputService8TestShapeInputService8TestCaseOperation1Input { - s.PageToken = &v - return s -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService8TestShapeInputService8TestCaseOperation1Input) SetPipelineId(v string) *InputService8TestShapeInputService8TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -type InputService8TestShapeInputService8TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService9ProtocolTest { - svc := &InputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService9TestShapeInputService9TestCaseOperation1Input{} - } - - output = &InputService9TestShapeInputService9TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - Ascending *string `location:"querystring" locationName:"Ascending" type:"string"` - - Config *InputService9TestShapeStructType `type:"structure"` - - PageToken *string `location:"querystring" locationName:"PageToken" type:"string"` - - PipelineId *string `location:"uri" locationName:"PipelineId" type:"string"` -} - -// SetAscending sets the Ascending field's value. -func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetAscending(v string) *InputService9TestShapeInputService9TestCaseOperation1Input { - s.Ascending = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetConfig(v *InputService9TestShapeStructType) *InputService9TestShapeInputService9TestCaseOperation1Input { - s.Config = v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetPageToken(v string) *InputService9TestShapeInputService9TestCaseOperation1Input { - s.PageToken = &v - return s -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService9TestShapeInputService9TestCaseOperation1Input) SetPipelineId(v string) *InputService9TestShapeInputService9TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -type InputService9TestShapeInputService9TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService9TestShapeStructType struct { - _ struct{} `type:"structure"` - - A *string `type:"string"` - - B *string `type:"string"` -} - -// SetA sets the A field's value. -func (s *InputService9TestShapeStructType) SetA(v string) *InputService9TestShapeStructType { - s.A = &v - return s -} - -// SetB sets the B field's value. -func (s *InputService9TestShapeStructType) SetB(v string) *InputService9TestShapeStructType { - s.B = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService10ProtocolTest { - svc := &InputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice10protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService10TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService10TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService10TestShapeInputService10TestCaseOperation1Input{} - } - - output = &InputService10TestShapeInputService10TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - Ascending *string `location:"querystring" locationName:"Ascending" type:"string"` - - Checksum *string `location:"header" locationName:"x-amz-checksum" type:"string"` - - Config *InputService10TestShapeStructType `type:"structure"` - - PageToken *string `location:"querystring" locationName:"PageToken" type:"string"` - - PipelineId *string `location:"uri" locationName:"PipelineId" type:"string"` -} - -// SetAscending sets the Ascending field's value. -func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetAscending(v string) *InputService10TestShapeInputService10TestCaseOperation1Input { - s.Ascending = &v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetChecksum(v string) *InputService10TestShapeInputService10TestCaseOperation1Input { - s.Checksum = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetConfig(v *InputService10TestShapeStructType) *InputService10TestShapeInputService10TestCaseOperation1Input { - s.Config = v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetPageToken(v string) *InputService10TestShapeInputService10TestCaseOperation1Input { - s.PageToken = &v - return s -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService10TestShapeInputService10TestCaseOperation1Input) SetPipelineId(v string) *InputService10TestShapeInputService10TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -type InputService10TestShapeInputService10TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService10TestShapeStructType struct { - _ struct{} `type:"structure"` - - A *string `type:"string"` - - B *string `type:"string"` -} - -// SetA sets the A field's value. -func (s *InputService10TestShapeStructType) SetA(v string) *InputService10TestShapeStructType { - s.A = &v - return s -} - -// SetB sets the B field's value. -func (s *InputService10TestShapeStructType) SetB(v string) *InputService10TestShapeStructType { - s.B = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService11ProtocolTest { - svc := &InputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice11protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService11TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService11TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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/vaults/{vaultName}/archives", - } - - if input == nil { - input = &InputService11TestShapeInputService11TestCaseOperation1Input{} - } - - output = &InputService11TestShapeInputService11TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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" payload:"Body"` - - Body io.ReadSeeker `locationName:"body" type:"blob"` - - Checksum *string `location:"header" locationName:"x-amz-sha256-tree-hash" type:"string"` - - // VaultName is a required field - VaultName *string `location:"uri" locationName:"vaultName" type:"string" required:"true"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService11TestShapeInputService11TestCaseOperation1Input"} - if s.VaultName == nil { - invalidParams.Add(request.NewErrParamRequired("VaultName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetBody(v io.ReadSeeker) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.Body = v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetChecksum(v string) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.Checksum = &v - return s -} - -// SetVaultName sets the VaultName field's value. -func (s *InputService11TestShapeInputService11TestCaseOperation1Input) SetVaultName(v string) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.VaultName = &v - return s -} - -type InputService11TestShapeInputService11TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService12ProtocolTest { - svc := &InputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice12protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/2014-01-01/{Foo}", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation1Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - // Bar is automatically base64 encoded/decoded by the SDK. - Bar []byte `type:"blob"` - - // Foo is a required field - Foo *string `location:"uri" locationName:"Foo" type:"string" required:"true"` -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputService12TestShapeInputService12TestCaseOperation1Input"} - if s.Foo == nil { - invalidParams.Add(request.NewErrParamRequired("Foo")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBar sets the Bar field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) SetBar(v []byte) *InputService12TestShapeInputService12TestCaseOperation1Input { - s.Bar = v - return s -} - -// SetFoo sets the Foo field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) SetFoo(v string) *InputService12TestShapeInputService12TestCaseOperation1Input { - s.Foo = &v - return s -} - -type InputService12TestShapeInputService12TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService13ProtocolTest { - svc := &InputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice13protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService13TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService13TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation1Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService13TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService13TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService13TestShapeInputService13TestCaseOperation1Input) (req *request.Request, output *InputService13TestShapeInputService13TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService13TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation1Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService13TestShapeInputService13TestCaseOperation1Input) (*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 *InputService13TestShapeInputService13TestCaseOperation1Input, opts ...request.Option) (*InputService13TestShapeInputService13TestCaseOperation2Output, error) { - req, out := c.InputService13TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService13TestShapeInputService13TestCaseOperation1Input struct { - _ struct{} `type:"structure" payload:"Foo"` - - Foo []byte `locationName:"foo" type:"blob"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation1Input) SetFoo(v []byte) *InputService13TestShapeInputService13TestCaseOperation1Input { - s.Foo = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService13TestShapeInputService13TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService14ProtocolTest { - svc := &InputService14ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice14protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService14TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService14TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService14TestShapeInputService14TestCaseOperation2Input) (req *request.Request, output *InputService14TestShapeInputService14TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService14TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService14TestShapeInputService14TestCaseOperation2Input{} - } - - output = &InputService14TestShapeInputService14TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService14TestShapeInputService14TestCaseOperation2Input) (*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 *InputService14TestShapeInputService14TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService14TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService14TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 InputService14TestShapeFooShape struct { - _ struct{} `locationName:"foo" type:"structure"` - - Baz *string `locationName:"baz" type:"string"` -} - -// SetBaz sets the Baz field's value. -func (s *InputService14TestShapeFooShape) SetBaz(v string) *InputService14TestShapeFooShape { - s.Baz = &v - return s -} - -type InputService14TestShapeInputService14TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService14TestShapeInputService14TestCaseOperation2Input struct { - _ struct{} `type:"structure" payload:"Foo"` - - Foo *InputService14TestShapeFooShape `locationName:"foo" type:"structure"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService14TestShapeInputService14TestCaseOperation2Input) SetFoo(v *InputService14TestShapeFooShape) *InputService14TestShapeInputService14TestCaseOperation2Input { - s.Foo = v - return s -} - -type InputService14TestShapeInputService14TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService15ProtocolTest { - svc := &InputService15ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice15protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService15TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService15TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService15TestShapeInputService15TestCaseOperation2Input) (req *request.Request, output *InputService15TestShapeInputService15TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService15TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation2Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService15TestShapeInputService15TestCaseOperation2Input) (*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 *InputService15TestShapeInputService15TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService15TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService15TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/path?abc=mno", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation2Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService15TestShapeInputService15TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService15TestShapeInputService15TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - Foo *string `location:"querystring" locationName:"param-name" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation2Input) SetFoo(v string) *InputService15TestShapeInputService15TestCaseOperation2Input { - s.Foo = &v - return s -} - -type InputService15TestShapeInputService15TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService16ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService16ProtocolTest { - svc := &InputService16ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice16protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService16TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService16TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService16TestShapeInputService16TestCaseOperation2Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService16TestShapeInputService16TestCaseOperation2Input) (*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 *InputService16TestShapeInputService16TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService16TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService16TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -const opInputService16TestCaseOperation3 = "OperationName" - -// InputService16TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation3 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService16TestCaseOperation3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService16TestCaseOperation3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService16TestCaseOperation3Request method. -// req, resp := client.InputService16TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation3Request(input *InputService16TestShapeInputService16TestCaseOperation2Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation3, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService16TestCaseOperation3 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 InputService16TestCaseOperation3 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation3(input *InputService16TestShapeInputService16TestCaseOperation2Input) (*InputService16TestShapeInputService16TestCaseOperation3Output, error) { - req, out := c.InputService16TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation3WithContext is the same as InputService16TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation3 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) InputService16TestCaseOperation3WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation2Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation3Output, error) { - req, out := c.InputService16TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService16TestCaseOperation4 = "OperationName" - -// InputService16TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation4 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService16TestCaseOperation4 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService16TestCaseOperation4 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService16TestCaseOperation4Request method. -// req, resp := client.InputService16TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation4Request(input *InputService16TestShapeInputService16TestCaseOperation2Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation4, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService16TestCaseOperation4 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 InputService16TestCaseOperation4 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation4(input *InputService16TestShapeInputService16TestCaseOperation2Input) (*InputService16TestShapeInputService16TestCaseOperation4Output, error) { - req, out := c.InputService16TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation4WithContext is the same as InputService16TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation4 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) InputService16TestCaseOperation4WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation2Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation4Output, error) { - req, out := c.InputService16TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService16TestCaseOperation5 = "OperationName" - -// InputService16TestCaseOperation5Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation5 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService16TestCaseOperation5 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService16TestCaseOperation5 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService16TestCaseOperation5Request method. -// req, resp := client.InputService16TestCaseOperation5Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation5Request(input *InputService16TestShapeInputService16TestCaseOperation2Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation5Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation5, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation5Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService16TestCaseOperation5 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 InputService16TestCaseOperation5 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation5(input *InputService16TestShapeInputService16TestCaseOperation2Input) (*InputService16TestShapeInputService16TestCaseOperation5Output, error) { - req, out := c.InputService16TestCaseOperation5Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation5WithContext is the same as InputService16TestCaseOperation5 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation5 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) InputService16TestCaseOperation5WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation2Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation5Output, error) { - req, out := c.InputService16TestCaseOperation5Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService16TestCaseOperation6 = "OperationName" - -// InputService16TestCaseOperation6Request generates a "aws/request.Request" representing the -// client's request for the InputService16TestCaseOperation6 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService16TestCaseOperation6 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService16TestCaseOperation6 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService16TestCaseOperation6Request method. -// req, resp := client.InputService16TestCaseOperation6Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService16ProtocolTest) InputService16TestCaseOperation6Request(input *InputService16TestShapeInputService16TestCaseOperation2Input) (req *request.Request, output *InputService16TestShapeInputService16TestCaseOperation6Output) { - op := &request.Operation{ - Name: opInputService16TestCaseOperation6, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService16TestShapeInputService16TestCaseOperation2Input{} - } - - output = &InputService16TestShapeInputService16TestCaseOperation6Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService16TestCaseOperation6 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 InputService16TestCaseOperation6 for usage and error information. -func (c *InputService16ProtocolTest) InputService16TestCaseOperation6(input *InputService16TestShapeInputService16TestCaseOperation2Input) (*InputService16TestShapeInputService16TestCaseOperation6Output, error) { - req, out := c.InputService16TestCaseOperation6Request(input) - return out, req.Send() -} - -// InputService16TestCaseOperation6WithContext is the same as InputService16TestCaseOperation6 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService16TestCaseOperation6 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) InputService16TestCaseOperation6WithContext(ctx aws.Context, input *InputService16TestShapeInputService16TestCaseOperation2Input, opts ...request.Option) (*InputService16TestShapeInputService16TestCaseOperation6Output, error) { - req, out := c.InputService16TestCaseOperation6Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService16TestShapeInputService16TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeInputService16TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - RecursiveStruct *InputService16TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService16TestShapeInputService16TestCaseOperation2Input) SetRecursiveStruct(v *InputService16TestShapeRecursiveStructType) *InputService16TestShapeInputService16TestCaseOperation2Input { - s.RecursiveStruct = v - return s -} - -type InputService16TestShapeInputService16TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeInputService16TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeInputService16TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeInputService16TestCaseOperation5Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeInputService16TestCaseOperation6Output struct { - _ struct{} `type:"structure"` -} - -type InputService16TestShapeRecursiveStructType struct { - _ struct{} `type:"structure"` - - NoRecurse *string `type:"string"` - - RecursiveList []*InputService16TestShapeRecursiveStructType `type:"list"` - - RecursiveMap map[string]*InputService16TestShapeRecursiveStructType `type:"map"` - - RecursiveStruct *InputService16TestShapeRecursiveStructType `type:"structure"` -} - -// SetNoRecurse sets the NoRecurse field's value. -func (s *InputService16TestShapeRecursiveStructType) SetNoRecurse(v string) *InputService16TestShapeRecursiveStructType { - s.NoRecurse = &v - return s -} - -// SetRecursiveList sets the RecursiveList field's value. -func (s *InputService16TestShapeRecursiveStructType) SetRecursiveList(v []*InputService16TestShapeRecursiveStructType) *InputService16TestShapeRecursiveStructType { - s.RecursiveList = v - return s -} - -// SetRecursiveMap sets the RecursiveMap field's value. -func (s *InputService16TestShapeRecursiveStructType) SetRecursiveMap(v map[string]*InputService16TestShapeRecursiveStructType) *InputService16TestShapeRecursiveStructType { - s.RecursiveMap = v - return s -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService16TestShapeRecursiveStructType) SetRecursiveStruct(v *InputService16TestShapeRecursiveStructType) *InputService16TestShapeRecursiveStructType { - s.RecursiveStruct = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService17ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService17ProtocolTest { - svc := &InputService17ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice17protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService17TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService17TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService17TestShapeInputService17TestCaseOperation2Input) (req *request.Request, output *InputService17TestShapeInputService17TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService17TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService17TestShapeInputService17TestCaseOperation2Input{} - } - - output = &InputService17TestShapeInputService17TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService17TestShapeInputService17TestCaseOperation2Input) (*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 *InputService17TestShapeInputService17TestCaseOperation2Input, opts ...request.Option) (*InputService17TestShapeInputService17TestCaseOperation1Output, error) { - req, out := c.InputService17TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService17TestCaseOperation2 = "OperationName" - -// InputService17TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService17TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService17TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService17TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService17TestCaseOperation2Request method. -// req, resp := client.InputService17TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService17ProtocolTest) InputService17TestCaseOperation2Request(input *InputService17TestShapeInputService17TestCaseOperation2Input) (req *request.Request, output *InputService17TestShapeInputService17TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService17TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService17TestShapeInputService17TestCaseOperation2Input{} - } - - output = &InputService17TestShapeInputService17TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService17TestCaseOperation2 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 InputService17TestCaseOperation2 for usage and error information. -func (c *InputService17ProtocolTest) InputService17TestCaseOperation2(input *InputService17TestShapeInputService17TestCaseOperation2Input) (*InputService17TestShapeInputService17TestCaseOperation2Output, error) { - req, out := c.InputService17TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService17TestCaseOperation2WithContext is the same as InputService17TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService17TestCaseOperation2 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) InputService17TestCaseOperation2WithContext(ctx aws.Context, input *InputService17TestShapeInputService17TestCaseOperation2Input, opts ...request.Option) (*InputService17TestShapeInputService17TestCaseOperation2Output, error) { - req, out := c.InputService17TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService17TestShapeInputService17TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService17TestShapeInputService17TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - TimeArg *time.Time `type:"timestamp" timestampFormat:"unix"` - - TimeArgInHeader *time.Time `location:"header" locationName:"x-amz-timearg" type:"timestamp" timestampFormat:"rfc822"` -} - -// SetTimeArg sets the TimeArg field's value. -func (s *InputService17TestShapeInputService17TestCaseOperation2Input) SetTimeArg(v time.Time) *InputService17TestShapeInputService17TestCaseOperation2Input { - s.TimeArg = &v - return s -} - -// SetTimeArgInHeader sets the TimeArgInHeader field's value. -func (s *InputService17TestShapeInputService17TestCaseOperation2Input) SetTimeArgInHeader(v time.Time) *InputService17TestShapeInputService17TestCaseOperation2Input { - s.TimeArgInHeader = &v - return s -} - -type InputService17TestShapeInputService17TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService18ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService18ProtocolTest { - svc := &InputService18ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice18protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService18TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService18TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/path", - } - - if input == nil { - input = &InputService18TestShapeInputService18TestCaseOperation1Input{} - } - - output = &InputService18TestShapeInputService18TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService18TestShapeInputService18TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - TimeArg *time.Time `locationName:"timestamp_location" type:"timestamp" timestampFormat:"unix"` -} - -// SetTimeArg sets the TimeArg field's value. -func (s *InputService18TestShapeInputService18TestCaseOperation1Input) SetTimeArg(v time.Time) *InputService18TestShapeInputService18TestCaseOperation1Input { - s.TimeArg = &v - return s -} - -type InputService18TestShapeInputService18TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService19ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService19ProtocolTest { - svc := &InputService19ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice19protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService19TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService19TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService19TestShapeInputService19TestCaseOperation1Input struct { - _ struct{} `type:"structure" payload:"Foo"` - - Foo *string `locationName:"foo" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService19TestShapeInputService19TestCaseOperation1Input) SetFoo(v string) *InputService19TestShapeInputService19TestCaseOperation1Input { - s.Foo = &v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService20ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService20ProtocolTest { - svc := &InputService20ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice20protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService20TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService20TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/path", - } - - if input == nil { - input = &InputService20TestShapeInputService20TestCaseOperation1Input{} - } - - output = &InputService20TestShapeInputService20TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -const opInputService20TestCaseOperation2 = "OperationName" - -// InputService20TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService20TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService20TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService20TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService20TestCaseOperation2Request method. -// req, resp := client.InputService20TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService20ProtocolTest) InputService20TestCaseOperation2Request(input *InputService20TestShapeInputService20TestCaseOperation1Input) (req *request.Request, output *InputService20TestShapeInputService20TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService20TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService20TestShapeInputService20TestCaseOperation1Input{} - } - - output = &InputService20TestShapeInputService20TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService20TestCaseOperation2 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 InputService20TestCaseOperation2 for usage and error information. -func (c *InputService20ProtocolTest) InputService20TestCaseOperation2(input *InputService20TestShapeInputService20TestCaseOperation1Input) (*InputService20TestShapeInputService20TestCaseOperation2Output, error) { - req, out := c.InputService20TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService20TestCaseOperation2WithContext is the same as InputService20TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService20TestCaseOperation2 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) InputService20TestCaseOperation2WithContext(ctx aws.Context, input *InputService20TestShapeInputService20TestCaseOperation1Input, opts ...request.Option) (*InputService20TestShapeInputService20TestCaseOperation2Output, error) { - req, out := c.InputService20TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService20TestShapeInputService20TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Token *string `type:"string" idempotencyToken:"true"` -} - -// SetToken sets the Token field's value. -func (s *InputService20TestShapeInputService20TestCaseOperation1Input) SetToken(v string) *InputService20TestShapeInputService20TestCaseOperation1Input { - s.Token = &v - return s -} - -type InputService20TestShapeInputService20TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService20TestShapeInputService20TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService21ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService21ProtocolTest { - svc := &InputService21ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice21protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2014-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService21TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService21TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService21TestShapeInputService21TestCaseOperation1Input{} - } - - output = &InputService21TestShapeInputService21TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -const opInputService21TestCaseOperation2 = "OperationName" - -// InputService21TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService21TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService21TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService21TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService21TestCaseOperation2Request method. -// req, resp := client.InputService21TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService21ProtocolTest) InputService21TestCaseOperation2Request(input *InputService21TestShapeInputService21TestCaseOperation1Input) (req *request.Request, output *InputService21TestShapeInputService21TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService21TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService21TestShapeInputService21TestCaseOperation1Input{} - } - - output = &InputService21TestShapeInputService21TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restjson.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService21TestCaseOperation2 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 InputService21TestCaseOperation2 for usage and error information. -func (c *InputService21ProtocolTest) InputService21TestCaseOperation2(input *InputService21TestShapeInputService21TestCaseOperation1Input) (*InputService21TestShapeInputService21TestCaseOperation2Output, error) { - req, out := c.InputService21TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService21TestCaseOperation2WithContext is the same as InputService21TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService21TestCaseOperation2 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) InputService21TestCaseOperation2WithContext(ctx aws.Context, input *InputService21TestShapeInputService21TestCaseOperation1Input, opts ...request.Option) (*InputService21TestShapeInputService21TestCaseOperation2Output, error) { - req, out := c.InputService21TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService21TestShapeInputService21TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Attr aws.JSONValue `location:"header" locationName:"X-Amz-Foo" type:"jsonvalue"` -} - -// SetAttr sets the Attr field's value. -func (s *InputService21TestShapeInputService21TestCaseOperation1Input) SetAttr(v aws.JSONValue) *InputService21TestShapeInputService21TestCaseOperation1Input { - s.Attr = v - return s -} - -type InputService21TestShapeInputService21TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService21TestShapeInputService21TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// -// Tests begin here -// - -func TestInputService1ProtocolTestNoParametersCase1(t *testing.T) { - svc := NewInputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - req, _ := svc.InputService1TestCaseOperation1Request(nil) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobs", r.URL.String()) - - // assert headers - -} - -func TestInputService2ProtocolTestURIParameterOnlyWithNoLocationNameCase1(t *testing.T) { - svc := NewInputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService2TestShapeInputService2TestCaseOperation1Input{ - PipelineId: aws.String("foo"), - } - req, _ := svc.InputService2TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/foo", r.URL.String()) - - // assert headers - -} - -func TestInputService3ProtocolTestURIParameterOnlyWithLocationNameCase1(t *testing.T) { - svc := NewInputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService3TestShapeInputService3TestCaseOperation1Input{ - Foo: aws.String("bar"), - } - req, _ := svc.InputService3TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/bar", r.URL.String()) - - // assert headers - -} - -func TestInputService4ProtocolTestQuerystringListOfStringsCase1(t *testing.T) { - svc := NewInputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService4TestShapeInputService4TestCaseOperation1Input{ - Items: []*string{ - aws.String("value1"), - aws.String("value2"), - }, - } - req, _ := svc.InputService4TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?item=value1&item=value2", r.URL.String()) - - // assert headers - -} - -func TestInputService5ProtocolTestStringToStringMapsInQuerystringCase1(t *testing.T) { - svc := NewInputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService5TestShapeInputService5TestCaseOperation1Input{ - PipelineId: aws.String("foo"), - QueryDoc: map[string]*string{ - "bar": aws.String("baz"), - "fizz": aws.String("buzz"), - }, - } - req, _ := svc.InputService5TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/foo?bar=baz&fizz=buzz", r.URL.String()) - - // assert headers - -} - -func TestInputService6ProtocolTestStringToStringListMapsInQuerystringCase1(t *testing.T) { - svc := NewInputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService6TestShapeInputService6TestCaseOperation1Input{ - PipelineId: aws.String("id"), - QueryDoc: map[string][]*string{ - "fizz": { - aws.String("buzz"), - aws.String("pop"), - }, - "foo": { - aws.String("bar"), - aws.String("baz"), - }, - }, - } - req, _ := svc.InputService6TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, 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 TestInputService7ProtocolTestBooleanInQuerystringCase1(t *testing.T) { - svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService7TestShapeInputService7TestCaseOperation2Input{ - BoolQuery: aws.Bool(true), - } - req, _ := svc.InputService7TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?bool-query=true", r.URL.String()) - - // assert headers - -} - -func TestInputService7ProtocolTestBooleanInQuerystringCase2(t *testing.T) { - svc := NewInputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService7TestShapeInputService7TestCaseOperation2Input{ - BoolQuery: aws.Bool(false), - } - req, _ := svc.InputService7TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?bool-query=false", r.URL.String()) - - // assert headers - -} - -func TestInputService8ProtocolTestURIParameterAndQuerystringParamsCase1(t *testing.T) { - svc := NewInputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService8TestShapeInputService8TestCaseOperation1Input{ - Ascending: aws.String("true"), - PageToken: aws.String("bar"), - PipelineId: aws.String("foo"), - } - req, _ := svc.InputService8TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/foo?Ascending=true&PageToken=bar", r.URL.String()) - - // assert headers - -} - -func TestInputService9ProtocolTestURIParameterQuerystringParamsAndJSONBodyCase1(t *testing.T) { - svc := NewInputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService9TestShapeInputService9TestCaseOperation1Input{ - Ascending: aws.String("true"), - Config: &InputService9TestShapeStructType{ - A: aws.String("one"), - B: aws.String("two"), - }, - PageToken: aws.String("bar"), - PipelineId: aws.String("foo"), - } - req, _ := svc.InputService9TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Config":{"A":"one","B":"two"}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/foo?Ascending=true&PageToken=bar", r.URL.String()) - - // assert headers - -} - -func TestInputService10ProtocolTestURIParameterQuerystringParamsHeadersAndJSONBodyCase1(t *testing.T) { - svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService10TestShapeInputService10TestCaseOperation1Input{ - Ascending: aws.String("true"), - Checksum: aws.String("12345"), - Config: &InputService10TestShapeStructType{ - A: aws.String("one"), - B: aws.String("two"), - }, - PageToken: aws.String("bar"), - PipelineId: aws.String("foo"), - } - req, _ := svc.InputService10TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Config":{"A":"one","B":"two"}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/foo?Ascending=true&PageToken=bar", r.URL.String()) - - // assert headers - assert.Equal(t, "12345", r.Header.Get("x-amz-checksum")) - -} - -func TestInputService11ProtocolTestStreamingPayloadCase1(t *testing.T) { - svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService11TestShapeInputService11TestCaseOperation1Input{ - Body: bytes.NewReader([]byte("contents")), - Checksum: aws.String("foo"), - VaultName: aws.String("name"), - } - req, _ := svc.InputService11TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, `contents`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/vaults/name/archives", r.URL.String()) - - // assert headers - assert.Equal(t, "foo", r.Header.Get("x-amz-sha256-tree-hash")) - -} - -func TestInputService12ProtocolTestSerializeBlobsInBodyCase1(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation1Input{ - Bar: []byte("Blob param"), - Foo: aws.String("foo_name"), - } - req, _ := svc.InputService12TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Bar":"QmxvYiBwYXJhbQ=="}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/foo_name", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestBlobPayloadCase1(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation1Input{ - Foo: []byte("bar"), - } - req, _ := svc.InputService13TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, `bar`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestBlobPayloadCase2(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation1Input{} - req, _ := svc.InputService13TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService14ProtocolTestStructurePayloadCase1(t *testing.T) { - svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService14TestShapeInputService14TestCaseOperation2Input{ - Foo: &InputService14TestShapeFooShape{ - Baz: aws.String("bar"), - }, - } - req, _ := svc.InputService14TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"baz":"bar"}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService14ProtocolTestStructurePayloadCase2(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 - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService15ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase1(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation2Input{} - req, _ := svc.InputService15TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService15ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase2(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation2Input{ - Foo: aws.String(""), - } - req, _ := svc.InputService15TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?abc=mno¶m-name=", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestRecursiveShapesCase1(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - } - req, _ := svc.InputService16TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"NoRecurse":"foo"}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestRecursiveShapesCase2(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - } - req, _ := svc.InputService16TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveStruct":{"NoRecurse":"foo"}}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestRecursiveShapesCase3(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - }, - }, - } - req, _ := svc.InputService16TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveStruct":{"RecursiveStruct":{"RecursiveStruct":{"NoRecurse":"foo"}}}}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestRecursiveShapesCase4(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - RecursiveList: []*InputService16TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - NoRecurse: aws.String("bar"), - }, - }, - }, - } - req, _ := svc.InputService16TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveList":[{"NoRecurse":"foo"},{"NoRecurse":"bar"}]}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestRecursiveShapesCase5(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - RecursiveList: []*InputService16TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - NoRecurse: aws.String("bar"), - }, - }, - }, - }, - } - req, _ := svc.InputService16TestCaseOperation5Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveList":[{"NoRecurse":"foo"},{"RecursiveStruct":{"NoRecurse":"bar"}}]}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestRecursiveShapesCase6(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation2Input{ - RecursiveStruct: &InputService16TestShapeRecursiveStructType{ - RecursiveMap: map[string]*InputService16TestShapeRecursiveStructType{ - "bar": { - NoRecurse: aws.String("bar"), - }, - "foo": { - NoRecurse: aws.String("foo"), - }, - }, - }, - } - req, _ := svc.InputService16TestCaseOperation6Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"RecursiveStruct":{"RecursiveMap":{"foo":{"NoRecurse":"foo"},"bar":{"NoRecurse":"bar"}}}}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService17ProtocolTestTimestampValuesCase1(t *testing.T) { - svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService17TestShapeInputService17TestCaseOperation2Input{ - TimeArg: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService17TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"TimeArg":1422172800}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService17ProtocolTestTimestampValuesCase2(t *testing.T) { - svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService17TestShapeInputService17TestCaseOperation2Input{ - TimeArgInHeader: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService17TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - assert.Equal(t, "Sun, 25 Jan 2015 08:00:00 GMT", r.Header.Get("x-amz-timearg")) - -} - -func TestInputService18ProtocolTestNamedLocationsInJSONBodyCase1(t *testing.T) { - svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService18TestShapeInputService18TestCaseOperation1Input{ - TimeArg: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService18TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"timestamp_location":1422172800}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService19ProtocolTestStringPayloadCase1(t *testing.T) { - svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService19TestShapeInputService19TestCaseOperation1Input{ - Foo: aws.String("bar"), - } - req, _ := svc.InputService19TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - assert.Equal(t, `bar`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService20ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - svc := NewInputService20ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService20TestShapeInputService20TestCaseOperation1Input{ - Token: aws.String("abc123"), - } - req, _ := svc.InputService20TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Token":"abc123"}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService20ProtocolTestIdempotencyTokenAutoFillCase2(t *testing.T) { - svc := NewInputService20ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService20TestShapeInputService20TestCaseOperation1Input{} - req, _ := svc.InputService20TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body, _ := ioutil.ReadAll(r.Body) - awstesting.AssertJSON(t, `{"Token":"00000000-0000-4000-8000-000000000000"}`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService21ProtocolTestJSONValueTraitCase1(t *testing.T) { - svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService21TestShapeInputService21TestCaseOperation1Input{} - input.Attr = aws.JSONValue{"Foo": "Bar"} - req, _ := svc.InputService21TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "eyJGb28iOiJCYXIifQ==", r.Header.Get("X-Amz-Foo")) - -} - -func TestInputService21ProtocolTestJSONValueTraitCase2(t *testing.T) { - svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService21TestShapeInputService21TestCaseOperation1Input{} - req, _ := svc.InputService21TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restjson.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go deleted file mode 100644 index b1d5294..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/restjson.go +++ /dev/null @@ -1,92 +0,0 @@ -// Package restjson provides RESTful JSON serialization of AWS -// requests and responses. -package restjson - -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/rest-json.json build_test.go -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/rest-json.json unmarshal_test.go - -import ( - "encoding/json" - "io/ioutil" - "strings" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -// BuildHandler is a named request handler for building restjson protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.restjson.Build", Fn: Build} - -// UnmarshalHandler is a named request handler for unmarshaling restjson protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.restjson.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling restjson protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalMeta", Fn: UnmarshalMeta} - -// UnmarshalErrorHandler is a named request handler for unmarshaling restjson protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalError", Fn: UnmarshalError} - -// Build builds a request for the REST JSON protocol. -func Build(r *request.Request) { - rest.Build(r) - - if t := rest.PayloadType(r.Params); t == "structure" || t == "" { - jsonrpc.Build(r) - } -} - -// Unmarshal unmarshals a response body for the REST JSON protocol. -func Unmarshal(r *request.Request) { - if t := rest.PayloadType(r.Data); t == "structure" || t == "" { - jsonrpc.Unmarshal(r) - } else { - rest.Unmarshal(r) - } -} - -// UnmarshalMeta unmarshals response headers for the REST JSON protocol. -func UnmarshalMeta(r *request.Request) { - rest.UnmarshalMeta(r) -} - -// UnmarshalError unmarshals a response error for the REST JSON protocol. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - code := r.HTTPResponse.Header.Get("X-Amzn-Errortype") - bodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.New("SerializationError", "failed reading REST JSON error response", err) - return - } - if len(bodyBytes) == 0 { - r.Error = awserr.NewRequestFailure( - awserr.New("SerializationError", r.HTTPResponse.Status, nil), - r.HTTPResponse.StatusCode, - "", - ) - return - } - var jsonErr jsonErrorResponse - if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil { - r.Error = awserr.New("SerializationError", "failed decoding REST JSON error response", err) - return - } - - if code == "" { - code = jsonErr.Code - } - - code = strings.SplitN(code, ":", 2)[0] - r.Error = awserr.NewRequestFailure( - awserr.New(code, jsonErr.Message, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) -} - -type jsonErrorResponse struct { - Code string `json:"code"` - Message string `json:"message"` -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_test.go deleted file mode 100644 index ae9e9ee..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_test.go +++ /dev/null @@ -1,2160 +0,0 @@ -package restjson_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/restjson" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/util" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService1ProtocolTest { - svc := &OutputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - ImaHeader *string `location:"header" type:"string"` - - ImaHeaderLocation *string `location:"header" locationName:"X-Foo" type:"string"` - - Long *int64 `type:"long"` - - Num *int64 `type:"integer"` - - Status *int64 `location:"statusCode" type:"integer"` - - Str *string `type:"string"` - - 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 -} - -// 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 -} - -// SetStatus sets the Status field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetStatus(v int64) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Status = &v - return s -} - -// SetStr sets the Str field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetStr(v string) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.Str = &v - return s -} - -// SetTrueBool sets the TrueBool field's value. -func (s *OutputService1TestShapeOutputService1TestCaseOperation1Output) SetTrueBool(v bool) *OutputService1TestShapeOutputService1TestCaseOperation1Output { - s.TrueBool = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService2ProtocolTest { - svc := &OutputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 OutputService2TestShapeBlobContainer struct { - _ struct{} `type:"structure"` - - // Foo is automatically base64 encoded/decoded by the SDK. - Foo []byte `locationName:"foo" type:"blob"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService2TestShapeBlobContainer) SetFoo(v []byte) *OutputService2TestShapeBlobContainer { - s.Foo = v - return s -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService2TestShapeOutputService2TestCaseOperation1Output struct { - _ struct{} `type:"structure"` - - // BlobMember is automatically base64 encoded/decoded by the SDK. - BlobMember []byte `type:"blob"` - - StructMember *OutputService2TestShapeBlobContainer `type:"structure"` -} - -// SetBlobMember sets the BlobMember field's value. -func (s *OutputService2TestShapeOutputService2TestCaseOperation1Output) SetBlobMember(v []byte) *OutputService2TestShapeOutputService2TestCaseOperation1Output { - s.BlobMember = v - return s -} - -// SetStructMember sets the StructMember field's value. -func (s *OutputService2TestShapeOutputService2TestCaseOperation1Output) SetStructMember(v *OutputService2TestShapeBlobContainer) *OutputService2TestShapeOutputService2TestCaseOperation1Output { - s.StructMember = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService3ProtocolTest { - svc := &OutputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - StructMember *OutputService3TestShapeTimeContainer `type:"structure"` - - TimeMember *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// SetStructMember sets the StructMember field's value. -func (s *OutputService3TestShapeOutputService3TestCaseOperation1Output) SetStructMember(v *OutputService3TestShapeTimeContainer) *OutputService3TestShapeOutputService3TestCaseOperation1Output { - s.StructMember = v - return s -} - -// SetTimeMember sets the TimeMember field's value. -func (s *OutputService3TestShapeOutputService3TestCaseOperation1Output) SetTimeMember(v time.Time) *OutputService3TestShapeOutputService3TestCaseOperation1Output { - s.TimeMember = &v - return s -} - -type OutputService3TestShapeTimeContainer struct { - _ struct{} `type:"structure"` - - Foo *time.Time `locationName:"foo" type:"timestamp" timestampFormat:"unix"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService3TestShapeTimeContainer) SetFoo(v time.Time) *OutputService3TestShapeTimeContainer { - s.Foo = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService4ProtocolTest { - svc := &OutputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService5ProtocolTest { - svc := &OutputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 []*OutputService5TestShapeSingleStruct `type:"list"` -} - -// SetListMember sets the ListMember field's value. -func (s *OutputService5TestShapeOutputService5TestCaseOperation1Output) SetListMember(v []*OutputService5TestShapeSingleStruct) *OutputService5TestShapeOutputService5TestCaseOperation1Output { - s.ListMember = v - return s -} - -type OutputService5TestShapeSingleStruct struct { - _ struct{} `type:"structure"` - - Foo *string `type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService5TestShapeSingleStruct) SetFoo(v string) *OutputService5TestShapeSingleStruct { - s.Foo = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService6ProtocolTest { - svc := &OutputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - MapMember map[string][]*int64 `type:"map"` -} - -// SetMapMember sets the MapMember field's value. -func (s *OutputService6TestShapeOutputService6TestCaseOperation1Output) SetMapMember(v map[string][]*int64) *OutputService6TestShapeOutputService6TestCaseOperation1Output { - s.MapMember = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService7ProtocolTest { - svc := &OutputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - MapMember map[string]*time.Time `type:"map"` -} - -// SetMapMember sets the MapMember field's value. -func (s *OutputService7TestShapeOutputService7TestCaseOperation1Output) SetMapMember(v map[string]*time.Time) *OutputService7TestShapeOutputService7TestCaseOperation1Output { - s.MapMember = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService8ProtocolTest { - svc := &OutputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - StrType *string `type:"string"` -} - -// SetStrType sets the StrType field's value. -func (s *OutputService8TestShapeOutputService8TestCaseOperation1Output) SetStrType(v string) *OutputService8TestShapeOutputService8TestCaseOperation1Output { - s.StrType = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService9ProtocolTest { - svc := &OutputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - AllHeaders map[string]*string `location:"headers" type:"map"` - - PrefixedHeaders map[string]*string `location:"headers" locationName:"X-" type:"map"` -} - -// SetAllHeaders sets the AllHeaders field's value. -func (s *OutputService9TestShapeOutputService9TestCaseOperation1Output) SetAllHeaders(v map[string]*string) *OutputService9TestShapeOutputService9TestCaseOperation1Output { - s.AllHeaders = v - return s -} - -// SetPrefixedHeaders sets the PrefixedHeaders field's value. -func (s *OutputService9TestShapeOutputService9TestCaseOperation1Output) SetPrefixedHeaders(v map[string]*string) *OutputService9TestShapeOutputService9TestCaseOperation1Output { - s.PrefixedHeaders = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService10ProtocolTest { - svc := &OutputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice10protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService10TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService10TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 OutputService10TestShapeBodyStructure struct { - _ struct{} `type:"structure"` - - Foo *string `type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *OutputService10TestShapeBodyStructure) SetFoo(v string) *OutputService10TestShapeBodyStructure { - s.Foo = &v - return s -} - -type OutputService10TestShapeOutputService10TestCaseOperation1Input struct { - _ struct{} `type:"structure"` -} - -type OutputService10TestShapeOutputService10TestCaseOperation1Output struct { - _ struct{} `type:"structure" payload:"Data"` - - Data *OutputService10TestShapeBodyStructure `type:"structure"` - - Header *string `location:"header" locationName:"X-Foo" type:"string"` -} - -// SetData sets the Data field's value. -func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetData(v *OutputService10TestShapeBodyStructure) *OutputService10TestShapeOutputService10TestCaseOperation1Output { - s.Data = v - return s -} - -// SetHeader sets the Header field's value. -func (s *OutputService10TestShapeOutputService10TestCaseOperation1Output) SetHeader(v string) *OutputService10TestShapeOutputService10TestCaseOperation1Output { - s.Header = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService11ProtocolTest { - svc := &OutputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice11protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService11TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService11TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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" payload:"Stream"` - - Stream []byte `type:"blob"` -} - -// SetStream sets the Stream field's value. -func (s *OutputService11TestShapeOutputService11TestCaseOperation1Output) SetStream(v []byte) *OutputService11TestShapeOutputService11TestCaseOperation1Output { - s.Stream = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService12ProtocolTest { - svc := &OutputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice12protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService12TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService12TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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"` - - Attr aws.JSONValue `location:"header" locationName:"X-Amz-Foo" type:"jsonvalue"` -} - -// SetAttr sets the Attr field's value. -func (s *OutputService12TestShapeOutputService12TestCaseOperation1Output) SetAttr(v aws.JSONValue) *OutputService12TestShapeOutputService12TestCaseOperation1Output { - s.Attr = v - return s -} - -// -// Tests begin here -// - -func TestOutputService1ProtocolTestScalarMembersCase1(t *testing.T) { - svc := NewOutputService1ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\"}")) - req, out := svc.OutputService1TestCaseOperation1Request(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 - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.Char) - assert.Equal(t, 1.3, *out.Double) - assert.Equal(t, false, *out.FalseBool) - assert.Equal(t, 1.2, *out.Float) - assert.Equal(t, "test", *out.ImaHeader) - assert.Equal(t, "abc", *out.ImaHeaderLocation) - assert.Equal(t, int64(200), *out.Long) - assert.Equal(t, int64(123), *out.Num) - assert.Equal(t, int64(200), *out.Status) - assert.Equal(t, "myname", *out.Str) - assert.Equal(t, true, *out.TrueBool) - -} - -func TestOutputService2ProtocolTestBlobMembersCase1(t *testing.T) { - svc := NewOutputService2ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}")) - req, out := svc.OutputService2TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "hi!", string(out.BlobMember)) - assert.Equal(t, "there!", string(out.StructMember.Foo)) - -} - -func TestOutputService3ProtocolTestTimestampMembersCase1(t *testing.T) { - svc := NewOutputService3ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"TimeMember\": 1398796238, \"StructMember\": {\"foo\": 1398796238}}")) - req, out := svc.OutputService3TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, time.Unix(1.398796238e+09, 0).UTC().String(), out.StructMember.Foo.String()) - assert.Equal(t, time.Unix(1.398796238e+09, 0).UTC().String(), out.TimeMember.String()) - -} - -func TestOutputService4ProtocolTestListsCase1(t *testing.T) { - svc := NewOutputService4ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"ListMember\": [\"a\", \"b\"]}")) - req, out := svc.OutputService4TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.ListMember[0]) - assert.Equal(t, "b", *out.ListMember[1]) - -} - -func TestOutputService5ProtocolTestListsWithStructureMemberCase1(t *testing.T) { - svc := NewOutputService5ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"ListMember\": [{\"Foo\": \"a\"}, {\"Foo\": \"b\"}]}")) - req, out := svc.OutputService5TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.ListMember[0].Foo) - assert.Equal(t, "b", *out.ListMember[1].Foo) - -} - -func TestOutputService6ProtocolTestMapsCase1(t *testing.T) { - svc := NewOutputService6ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}")) - req, out := svc.OutputService6TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, int64(1), *out.MapMember["a"][0]) - assert.Equal(t, int64(2), *out.MapMember["a"][1]) - assert.Equal(t, int64(3), *out.MapMember["b"][0]) - assert.Equal(t, int64(4), *out.MapMember["b"][1]) - -} - -func TestOutputService7ProtocolTestComplexMapValuesCase1(t *testing.T) { - svc := NewOutputService7ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"MapMember\": {\"a\": 1398796238, \"b\": 1398796238}}")) - req, out := svc.OutputService7TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, time.Unix(1.398796238e+09, 0).UTC().String(), out.MapMember["a"].String()) - assert.Equal(t, time.Unix(1.398796238e+09, 0).UTC().String(), out.MapMember["b"].String()) - -} - -func TestOutputService8ProtocolTestIgnoresExtraDataCase1(t *testing.T) { - svc := NewOutputService8ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"foo\": \"bar\"}")) - req, out := svc.OutputService8TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - -} - -func TestOutputService9ProtocolTestSupportsHeaderMapsCase1(t *testing.T) { - svc := NewOutputService9ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{}")) - req, out := svc.OutputService9TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("Content-Length", "10") - req.HTTPResponse.Header.Set("X-Bam", "boo") - req.HTTPResponse.Header.Set("X-Foo", "bar") - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "10", *out.AllHeaders["Content-Length"]) - assert.Equal(t, "boo", *out.AllHeaders["X-Bam"]) - assert.Equal(t, "bar", *out.AllHeaders["X-Foo"]) - assert.Equal(t, "boo", *out.PrefixedHeaders["Bam"]) - assert.Equal(t, "bar", *out.PrefixedHeaders["Foo"]) - -} - -func TestOutputService10ProtocolTestJSONPayloadCase1(t *testing.T) { - svc := NewOutputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("{\"Foo\": \"abc\"}")) - req, out := svc.OutputService10TestCaseOperation1Request(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 - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.Data.Foo) - assert.Equal(t, "baz", *out.Header) - -} - -func TestOutputService11ProtocolTestStreamingPayloadCase1(t *testing.T) { - svc := NewOutputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("abc")) - req, out := svc.OutputService11TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", string(out.Stream)) - -} - -func TestOutputService12ProtocolTestJSONValueTraitCase1(t *testing.T) { - svc := NewOutputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - - buf := bytes.NewReader([]byte("")) - req, out := svc.OutputService12TestCaseOperation1Request(nil) - req.HTTPResponse = &http.Response{StatusCode: 200, Body: ioutil.NopCloser(buf), Header: http.Header{}} - - // set headers - req.HTTPResponse.Header.Set("X-Amz-Foo", "eyJGb28iOiJCYXIifQ==") - - // unmarshal response - restjson.UnmarshalMeta(req) - restjson.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - reflect.DeepEqual(out.Attr, map[string]interface{}{"Foo": "Bar"}) -} 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 0817167..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_bench_test.go +++ /dev/null @@ -1,246 +0,0 @@ -// +build bench - -package restxml_test - -import ( - "testing" - - "bytes" - "encoding/xml" - "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/private/protocol/restxml" - "github.com/aws/aws-sdk-go/service/cloudfront" -) - -func BenchmarkRESTXMLBuild_Complex_cloudfrontCreateDistribution(b *testing.B) { - params := restxmlBuildCreateDistroParms - - op := &request.Operation{ - Name: "CreateDistribution", - HTTPMethod: "POST", - HTTPPath: "/2015-04-17/distribution/{DistributionId}/invalidation", - } - - benchRESTXMLBuild(b, op, params) -} - -func BenchmarkRESTXMLBuild_Simple_cloudfrontDeleteStreamingDistribution(b *testing.B) { - params := &cloudfront.DeleteDistributionInput{ - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } - op := &request.Operation{ - Name: "DeleteStreamingDistribution", - HTTPMethod: "DELETE", - HTTPPath: "/2015-04-17/streaming-distribution/{Id}", - } - benchRESTXMLBuild(b, op, params) -} - -func BenchmarkEncodingXMLMarshal_Simple_cloudfrontDeleteStreamingDistribution(b *testing.B) { - params := &cloudfront.DeleteDistributionInput{ - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } - - 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, op *request.Operation, params interface{}) { - svc := awstesting.NewClient() - svc.ServiceName = "cloudfront" - svc.APIVersion = "2015-04-17" - - for i := 0; i < b.N; i++ { - r := svc.NewRequest(op, params, nil) - restxml.Build(r) - if r.Error != nil { - b.Fatal("Unexpected error", r.Error) - } - } -} - -var restxmlBuildCreateDistroParms = &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"), - }, - }, -} 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 65cb7b8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/build_test.go +++ /dev/null @@ -1,5821 +0,0 @@ -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" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService1ProtocolTest { - svc := &InputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService1TestShapeInputService1TestCaseOperation1Input) (req *request.Request, output *InputService1TestShapeInputService1TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService1TestCaseOperation2, - HTTPMethod: "PUT", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService1TestShapeInputService1TestCaseOperation1Input{} - } - - output = &InputService1TestShapeInputService1TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService1TestShapeInputService1TestCaseOperation1Input) (*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 *InputService1TestShapeInputService1TestCaseOperation1Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService1TestCaseOperation3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService1TestCaseOperation3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 InputService1TestShapeInputService1TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation3Input struct { - _ struct{} `type:"structure"` -} - -type InputService1TestShapeInputService1TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService2ProtocolTest { - svc := &InputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService3ProtocolTest { - svc := &InputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService3TestShapeInputService3TestCaseOperation2Input) (req *request.Request, output *InputService3TestShapeInputService3TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService3TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/2014-01-01/hostedzone", - } - - if input == nil { - input = &InputService3TestShapeInputService3TestCaseOperation2Input{} - } - - output = &InputService3TestShapeInputService3TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService3TestShapeInputService3TestCaseOperation2Input) (*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 *InputService3TestShapeInputService3TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService3TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService3TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService4ProtocolTest { - svc := &InputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService5ProtocolTest { - svc := &InputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService6ProtocolTest { - svc := &InputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService7ProtocolTest { - svc := &InputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService8ProtocolTest { - svc := &InputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService9ProtocolTest { - svc := &InputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService10ProtocolTest { - svc := &InputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice10protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService10TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService10TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - T *time.Time `locationName:"t" type:"timestamp" timestampFormat:"iso8601"` -} - -// SetB sets the B field's value. -func (s *InputService10TestShapeStructureShape) SetB(v []byte) *InputService10TestShapeStructureShape { - s.B = v - return s -} - -// SetT sets the T field's value. -func (s *InputService10TestShapeStructureShape) SetT(v time.Time) *InputService10TestShapeStructureShape { - s.T = &v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService11ProtocolTest { - svc := &InputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice11protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService11TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService11TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/", - } - - if input == nil { - input = &InputService11TestShapeInputService11TestCaseOperation1Input{} - } - - output = &InputService11TestShapeInputService11TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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:"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 *InputService11TestShapeInputService11TestCaseOperation1Input) SetFoo(v map[string]*string) *InputService11TestShapeInputService11TestCaseOperation1Input { - s.Foo = v - return s -} - -type InputService11TestShapeInputService11TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService12ProtocolTest { - svc := &InputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice12protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService12TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService12TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService12TestShapeInputService12TestCaseOperation1Input{} - } - - output = &InputService12TestShapeInputService12TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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"` - - Items []*string `location:"querystring" locationName:"item" type:"list"` -} - -// SetItems sets the Items field's value. -func (s *InputService12TestShapeInputService12TestCaseOperation1Input) SetItems(v []*string) *InputService12TestShapeInputService12TestCaseOperation1Input { - s.Items = v - return s -} - -type InputService12TestShapeInputService12TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService13ProtocolTest { - svc := &InputService13ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice13protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService13TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService13TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "/2014-01-01/jobsByPipeline/{PipelineId}", - } - - if input == nil { - input = &InputService13TestShapeInputService13TestCaseOperation1Input{} - } - - output = &InputService13TestShapeInputService13TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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{} `type:"structure"` - - PipelineId *string `location:"uri" type:"string"` - - QueryDoc map[string]*string `location:"querystring" type:"map"` -} - -// SetPipelineId sets the PipelineId field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation1Input) SetPipelineId(v string) *InputService13TestShapeInputService13TestCaseOperation1Input { - s.PipelineId = &v - return s -} - -// SetQueryDoc sets the QueryDoc field's value. -func (s *InputService13TestShapeInputService13TestCaseOperation1Input) SetQueryDoc(v map[string]*string) *InputService13TestShapeInputService13TestCaseOperation1Input { - s.QueryDoc = v - return s -} - -type InputService13TestShapeInputService13TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService14ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService14ProtocolTest { - svc := &InputService14ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice14protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService14TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService14TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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{} `type:"structure"` - - PipelineId *string `location:"uri" type:"string"` - - QueryDoc map[string][]*string `location:"querystring" type:"map"` -} - -// 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"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService15ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService15ProtocolTest { - svc := &InputService15ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice15protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService15TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService15TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService15TestShapeInputService15TestCaseOperation2Input) (req *request.Request, output *InputService15TestShapeInputService15TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService15TestCaseOperation1, - HTTPMethod: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation2Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService15TestShapeInputService15TestCaseOperation2Input) (*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 *InputService15TestShapeInputService15TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService15TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService15TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService15TestShapeInputService15TestCaseOperation2Input{} - } - - output = &InputService15TestShapeInputService15TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService15TestShapeInputService15TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService15TestShapeInputService15TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - BoolQuery *bool `location:"querystring" locationName:"bool-query" type:"boolean"` -} - -// SetBoolQuery sets the BoolQuery field's value. -func (s *InputService15TestShapeInputService15TestCaseOperation2Input) SetBoolQuery(v bool) *InputService15TestShapeInputService15TestCaseOperation2Input { - s.BoolQuery = &v - return s -} - -type InputService15TestShapeInputService15TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService16ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService16ProtocolTest { - svc := &InputService16ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice16protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService16TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService16TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService16TestShapeInputService16TestCaseOperation1Input struct { - _ struct{} `type:"structure" payload:"Foo"` - - Foo *string `locationName:"foo" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService16TestShapeInputService16TestCaseOperation1Input) SetFoo(v string) *InputService16TestShapeInputService16TestCaseOperation1Input { - s.Foo = &v - return s -} - -type InputService16TestShapeInputService16TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService17ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService17ProtocolTest { - svc := &InputService17ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice17protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService17TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService17TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService17TestShapeInputService17TestCaseOperation2Input) (req *request.Request, output *InputService17TestShapeInputService17TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService17TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService17TestShapeInputService17TestCaseOperation2Input{} - } - - output = &InputService17TestShapeInputService17TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService17TestShapeInputService17TestCaseOperation2Input) (*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 *InputService17TestShapeInputService17TestCaseOperation2Input, opts ...request.Option) (*InputService17TestShapeInputService17TestCaseOperation1Output, error) { - req, out := c.InputService17TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService17TestCaseOperation2 = "OperationName" - -// InputService17TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService17TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService17TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService17TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService17TestCaseOperation2Request method. -// req, resp := client.InputService17TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService17ProtocolTest) InputService17TestCaseOperation2Request(input *InputService17TestShapeInputService17TestCaseOperation2Input) (req *request.Request, output *InputService17TestShapeInputService17TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService17TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService17TestShapeInputService17TestCaseOperation2Input{} - } - - output = &InputService17TestShapeInputService17TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService17TestCaseOperation2 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 InputService17TestCaseOperation2 for usage and error information. -func (c *InputService17ProtocolTest) InputService17TestCaseOperation2(input *InputService17TestShapeInputService17TestCaseOperation2Input) (*InputService17TestShapeInputService17TestCaseOperation2Output, error) { - req, out := c.InputService17TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService17TestCaseOperation2WithContext is the same as InputService17TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService17TestCaseOperation2 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) InputService17TestCaseOperation2WithContext(ctx aws.Context, input *InputService17TestShapeInputService17TestCaseOperation2Input, opts ...request.Option) (*InputService17TestShapeInputService17TestCaseOperation2Output, error) { - req, out := c.InputService17TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService17TestShapeInputService17TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService17TestShapeInputService17TestCaseOperation2Input struct { - _ struct{} `type:"structure" payload:"Foo"` - - Foo []byte `locationName:"foo" type:"blob"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService17TestShapeInputService17TestCaseOperation2Input) SetFoo(v []byte) *InputService17TestShapeInputService17TestCaseOperation2Input { - s.Foo = v - return s -} - -type InputService17TestShapeInputService17TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService18ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService18ProtocolTest { - svc := &InputService18ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice18protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService18TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService18TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService18TestShapeInputService18TestCaseOperation4Input) (req *request.Request, output *InputService18TestShapeInputService18TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService18TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService18TestShapeInputService18TestCaseOperation4Input{} - } - - output = &InputService18TestShapeInputService18TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService18TestShapeInputService18TestCaseOperation4Input) (*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 *InputService18TestShapeInputService18TestCaseOperation4Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService18TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService18TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService18TestShapeInputService18TestCaseOperation4Input) (req *request.Request, output *InputService18TestShapeInputService18TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService18TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService18TestShapeInputService18TestCaseOperation4Input{} - } - - output = &InputService18TestShapeInputService18TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService18TestShapeInputService18TestCaseOperation4Input) (*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 *InputService18TestShapeInputService18TestCaseOperation4Input, opts ...request.Option) (*InputService18TestShapeInputService18TestCaseOperation2Output, error) { - req, out := c.InputService18TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService18TestCaseOperation3 = "OperationName" - -// InputService18TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService18TestCaseOperation3 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService18TestCaseOperation3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService18TestCaseOperation3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService18TestCaseOperation3Request method. -// req, resp := client.InputService18TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService18ProtocolTest) InputService18TestCaseOperation3Request(input *InputService18TestShapeInputService18TestCaseOperation4Input) (req *request.Request, output *InputService18TestShapeInputService18TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService18TestCaseOperation3, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService18TestShapeInputService18TestCaseOperation4Input{} - } - - output = &InputService18TestShapeInputService18TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService18TestCaseOperation3 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 InputService18TestCaseOperation3 for usage and error information. -func (c *InputService18ProtocolTest) InputService18TestCaseOperation3(input *InputService18TestShapeInputService18TestCaseOperation4Input) (*InputService18TestShapeInputService18TestCaseOperation3Output, error) { - req, out := c.InputService18TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService18TestCaseOperation3WithContext is the same as InputService18TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService18TestCaseOperation3 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) InputService18TestCaseOperation3WithContext(ctx aws.Context, input *InputService18TestShapeInputService18TestCaseOperation4Input, opts ...request.Option) (*InputService18TestShapeInputService18TestCaseOperation3Output, error) { - req, out := c.InputService18TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService18TestCaseOperation4 = "OperationName" - -// InputService18TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService18TestCaseOperation4 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService18TestCaseOperation4 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService18TestCaseOperation4 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService18TestCaseOperation4Request method. -// req, resp := client.InputService18TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService18ProtocolTest) InputService18TestCaseOperation4Request(input *InputService18TestShapeInputService18TestCaseOperation4Input) (req *request.Request, output *InputService18TestShapeInputService18TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService18TestCaseOperation4, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InputService18TestShapeInputService18TestCaseOperation4Input{} - } - - output = &InputService18TestShapeInputService18TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService18TestCaseOperation4 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 InputService18TestCaseOperation4 for usage and error information. -func (c *InputService18ProtocolTest) InputService18TestCaseOperation4(input *InputService18TestShapeInputService18TestCaseOperation4Input) (*InputService18TestShapeInputService18TestCaseOperation4Output, error) { - req, out := c.InputService18TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService18TestCaseOperation4WithContext is the same as InputService18TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService18TestCaseOperation4 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) InputService18TestCaseOperation4WithContext(ctx aws.Context, input *InputService18TestShapeInputService18TestCaseOperation4Input, opts ...request.Option) (*InputService18TestShapeInputService18TestCaseOperation4Output, error) { - req, out := c.InputService18TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService18TestShapeFooShape struct { - _ struct{} `locationName:"foo" type:"structure"` - - Baz *string `locationName:"baz" type:"string"` -} - -// SetBaz sets the Baz field's value. -func (s *InputService18TestShapeFooShape) SetBaz(v string) *InputService18TestShapeFooShape { - s.Baz = &v - return s -} - -type InputService18TestShapeInputService18TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService18TestShapeInputService18TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService18TestShapeInputService18TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService18TestShapeInputService18TestCaseOperation4Input struct { - _ struct{} `type:"structure" payload:"Foo"` - - Foo *InputService18TestShapeFooShape `locationName:"foo" type:"structure"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService18TestShapeInputService18TestCaseOperation4Input) SetFoo(v *InputService18TestShapeFooShape) *InputService18TestShapeInputService18TestCaseOperation4Input { - s.Foo = v - return s -} - -type InputService18TestShapeInputService18TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService19ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService19ProtocolTest { - svc := &InputService19ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice19protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService19TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService19TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService19TestShapeGrant struct { - _ struct{} `locationName:"Grant" type:"structure"` - - Grantee *InputService19TestShapeGrantee `type:"structure"` -} - -// SetGrantee sets the Grantee field's value. -func (s *InputService19TestShapeGrant) SetGrantee(v *InputService19TestShapeGrantee) *InputService19TestShapeGrant { - s.Grantee = v - return s -} - -type InputService19TestShapeGrantee 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 *InputService19TestShapeGrantee) SetEmailAddress(v string) *InputService19TestShapeGrantee { - s.EmailAddress = &v - return s -} - -// SetType sets the Type field's value. -func (s *InputService19TestShapeGrantee) SetType(v string) *InputService19TestShapeGrantee { - s.Type = &v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation1Input struct { - _ struct{} `type:"structure" payload:"Grant"` - - Grant *InputService19TestShapeGrant `locationName:"Grant" type:"structure"` -} - -// SetGrant sets the Grant field's value. -func (s *InputService19TestShapeInputService19TestCaseOperation1Input) SetGrant(v *InputService19TestShapeGrant) *InputService19TestShapeInputService19TestCaseOperation1Input { - s.Grant = v - return s -} - -type InputService19TestShapeInputService19TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService20ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService20ProtocolTest { - svc := &InputService20ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice20protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService20TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService20TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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: "GET", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &InputService20TestShapeInputService20TestCaseOperation1Input{} - } - - output = &InputService20TestShapeInputService20TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 InputService20TestShapeInputService20TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - Bucket *string `location:"uri" type:"string"` - - Key *string `location:"uri" type:"string"` -} - -// SetBucket sets the Bucket field's value. -func (s *InputService20TestShapeInputService20TestCaseOperation1Input) SetBucket(v string) *InputService20TestShapeInputService20TestCaseOperation1Input { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *InputService20TestShapeInputService20TestCaseOperation1Input) SetKey(v string) *InputService20TestShapeInputService20TestCaseOperation1Input { - s.Key = &v - return s -} - -type InputService20TestShapeInputService20TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService21ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService21ProtocolTest { - svc := &InputService21ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice21protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService21TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService21TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService21TestShapeInputService21TestCaseOperation2Input) (req *request.Request, output *InputService21TestShapeInputService21TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService21TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService21TestShapeInputService21TestCaseOperation2Input{} - } - - output = &InputService21TestShapeInputService21TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService21TestShapeInputService21TestCaseOperation2Input) (*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 *InputService21TestShapeInputService21TestCaseOperation2Input, opts ...request.Option) (*InputService21TestShapeInputService21TestCaseOperation1Output, error) { - req, out := c.InputService21TestCaseOperation1Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService21TestCaseOperation2 = "OperationName" - -// InputService21TestCaseOperation2Request generates a "aws/request.Request" representing the -// client's request for the InputService21TestCaseOperation2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService21TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService21TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService21TestCaseOperation2Request method. -// req, resp := client.InputService21TestCaseOperation2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService21ProtocolTest) InputService21TestCaseOperation2Request(input *InputService21TestShapeInputService21TestCaseOperation2Input) (req *request.Request, output *InputService21TestShapeInputService21TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService21TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path?abc=mno", - } - - if input == nil { - input = &InputService21TestShapeInputService21TestCaseOperation2Input{} - } - - output = &InputService21TestShapeInputService21TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService21TestCaseOperation2 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 InputService21TestCaseOperation2 for usage and error information. -func (c *InputService21ProtocolTest) InputService21TestCaseOperation2(input *InputService21TestShapeInputService21TestCaseOperation2Input) (*InputService21TestShapeInputService21TestCaseOperation2Output, error) { - req, out := c.InputService21TestCaseOperation2Request(input) - return out, req.Send() -} - -// InputService21TestCaseOperation2WithContext is the same as InputService21TestCaseOperation2 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService21TestCaseOperation2 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) InputService21TestCaseOperation2WithContext(ctx aws.Context, input *InputService21TestShapeInputService21TestCaseOperation2Input, opts ...request.Option) (*InputService21TestShapeInputService21TestCaseOperation2Output, error) { - req, out := c.InputService21TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService21TestShapeInputService21TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService21TestShapeInputService21TestCaseOperation2Input struct { - _ struct{} `type:"structure"` - - Foo *string `location:"querystring" locationName:"param-name" type:"string"` -} - -// SetFoo sets the Foo field's value. -func (s *InputService21TestShapeInputService21TestCaseOperation2Input) SetFoo(v string) *InputService21TestShapeInputService21TestCaseOperation2Input { - s.Foo = &v - return s -} - -type InputService21TestShapeInputService21TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService22ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService22ProtocolTest { - svc := &InputService22ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice22protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService22TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService22TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService22TestShapeInputService22TestCaseOperation4Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation4Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService22TestShapeInputService22TestCaseOperation4Input) (*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 *InputService22TestShapeInputService22TestCaseOperation4Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService22TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService22TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService22TestShapeInputService22TestCaseOperation4Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation2Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation2, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation4Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation2Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService22TestShapeInputService22TestCaseOperation4Input) (*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 *InputService22TestShapeInputService22TestCaseOperation4Input, opts ...request.Option) (*InputService22TestShapeInputService22TestCaseOperation2Output, error) { - req, out := c.InputService22TestCaseOperation2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService22TestCaseOperation3 = "OperationName" - -// InputService22TestCaseOperation3Request generates a "aws/request.Request" representing the -// client's request for the InputService22TestCaseOperation3 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService22TestCaseOperation3 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService22TestCaseOperation3 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService22TestCaseOperation3Request method. -// req, resp := client.InputService22TestCaseOperation3Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService22ProtocolTest) InputService22TestCaseOperation3Request(input *InputService22TestShapeInputService22TestCaseOperation4Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation3Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation3, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation4Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation3Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService22TestCaseOperation3 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 InputService22TestCaseOperation3 for usage and error information. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation3(input *InputService22TestShapeInputService22TestCaseOperation4Input) (*InputService22TestShapeInputService22TestCaseOperation3Output, error) { - req, out := c.InputService22TestCaseOperation3Request(input) - return out, req.Send() -} - -// InputService22TestCaseOperation3WithContext is the same as InputService22TestCaseOperation3 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService22TestCaseOperation3 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) InputService22TestCaseOperation3WithContext(ctx aws.Context, input *InputService22TestShapeInputService22TestCaseOperation4Input, opts ...request.Option) (*InputService22TestShapeInputService22TestCaseOperation3Output, error) { - req, out := c.InputService22TestCaseOperation3Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService22TestCaseOperation4 = "OperationName" - -// InputService22TestCaseOperation4Request generates a "aws/request.Request" representing the -// client's request for the InputService22TestCaseOperation4 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService22TestCaseOperation4 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService22TestCaseOperation4 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService22TestCaseOperation4Request method. -// req, resp := client.InputService22TestCaseOperation4Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService22ProtocolTest) InputService22TestCaseOperation4Request(input *InputService22TestShapeInputService22TestCaseOperation4Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation4Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation4, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation4Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation4Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService22TestCaseOperation4 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 InputService22TestCaseOperation4 for usage and error information. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation4(input *InputService22TestShapeInputService22TestCaseOperation4Input) (*InputService22TestShapeInputService22TestCaseOperation4Output, error) { - req, out := c.InputService22TestCaseOperation4Request(input) - return out, req.Send() -} - -// InputService22TestCaseOperation4WithContext is the same as InputService22TestCaseOperation4 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService22TestCaseOperation4 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) InputService22TestCaseOperation4WithContext(ctx aws.Context, input *InputService22TestShapeInputService22TestCaseOperation4Input, opts ...request.Option) (*InputService22TestShapeInputService22TestCaseOperation4Output, error) { - req, out := c.InputService22TestCaseOperation4Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService22TestCaseOperation5 = "OperationName" - -// InputService22TestCaseOperation5Request generates a "aws/request.Request" representing the -// client's request for the InputService22TestCaseOperation5 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService22TestCaseOperation5 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService22TestCaseOperation5 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService22TestCaseOperation5Request method. -// req, resp := client.InputService22TestCaseOperation5Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService22ProtocolTest) InputService22TestCaseOperation5Request(input *InputService22TestShapeInputService22TestCaseOperation4Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation5Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation5, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation4Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation5Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService22TestCaseOperation5 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 InputService22TestCaseOperation5 for usage and error information. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation5(input *InputService22TestShapeInputService22TestCaseOperation4Input) (*InputService22TestShapeInputService22TestCaseOperation5Output, error) { - req, out := c.InputService22TestCaseOperation5Request(input) - return out, req.Send() -} - -// InputService22TestCaseOperation5WithContext is the same as InputService22TestCaseOperation5 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService22TestCaseOperation5 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) InputService22TestCaseOperation5WithContext(ctx aws.Context, input *InputService22TestShapeInputService22TestCaseOperation4Input, opts ...request.Option) (*InputService22TestShapeInputService22TestCaseOperation5Output, error) { - req, out := c.InputService22TestCaseOperation5Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInputService22TestCaseOperation6 = "OperationName" - -// InputService22TestCaseOperation6Request generates a "aws/request.Request" representing the -// client's request for the InputService22TestCaseOperation6 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService22TestCaseOperation6 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService22TestCaseOperation6 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the InputService22TestCaseOperation6Request method. -// req, resp := client.InputService22TestCaseOperation6Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *InputService22ProtocolTest) InputService22TestCaseOperation6Request(input *InputService22TestShapeInputService22TestCaseOperation4Input) (req *request.Request, output *InputService22TestShapeInputService22TestCaseOperation6Output) { - op := &request.Operation{ - Name: opInputService22TestCaseOperation6, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService22TestShapeInputService22TestCaseOperation4Input{} - } - - output = &InputService22TestShapeInputService22TestCaseOperation6Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// InputService22TestCaseOperation6 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 InputService22TestCaseOperation6 for usage and error information. -func (c *InputService22ProtocolTest) InputService22TestCaseOperation6(input *InputService22TestShapeInputService22TestCaseOperation4Input) (*InputService22TestShapeInputService22TestCaseOperation6Output, error) { - req, out := c.InputService22TestCaseOperation6Request(input) - return out, req.Send() -} - -// InputService22TestCaseOperation6WithContext is the same as InputService22TestCaseOperation6 with the addition of -// the ability to pass a context and additional request options. -// -// See InputService22TestCaseOperation6 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) InputService22TestCaseOperation6WithContext(ctx aws.Context, input *InputService22TestShapeInputService22TestCaseOperation4Input, opts ...request.Option) (*InputService22TestShapeInputService22TestCaseOperation6Output, error) { - req, out := c.InputService22TestCaseOperation6Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InputService22TestShapeInputService22TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService22TestShapeInputService22TestCaseOperation2Output struct { - _ struct{} `type:"structure"` -} - -type InputService22TestShapeInputService22TestCaseOperation3Output struct { - _ struct{} `type:"structure"` -} - -type InputService22TestShapeInputService22TestCaseOperation4Input struct { - _ struct{} `locationName:"OperationRequest" type:"structure" xmlURI:"https://foo/"` - - RecursiveStruct *InputService22TestShapeRecursiveStructType `type:"structure"` -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService22TestShapeInputService22TestCaseOperation4Input) SetRecursiveStruct(v *InputService22TestShapeRecursiveStructType) *InputService22TestShapeInputService22TestCaseOperation4Input { - s.RecursiveStruct = v - return s -} - -type InputService22TestShapeInputService22TestCaseOperation4Output struct { - _ struct{} `type:"structure"` -} - -type InputService22TestShapeInputService22TestCaseOperation5Output struct { - _ struct{} `type:"structure"` -} - -type InputService22TestShapeInputService22TestCaseOperation6Output struct { - _ struct{} `type:"structure"` -} - -type InputService22TestShapeRecursiveStructType struct { - _ struct{} `type:"structure"` - - NoRecurse *string `type:"string"` - - RecursiveList []*InputService22TestShapeRecursiveStructType `type:"list"` - - RecursiveMap map[string]*InputService22TestShapeRecursiveStructType `type:"map"` - - RecursiveStruct *InputService22TestShapeRecursiveStructType `type:"structure"` -} - -// SetNoRecurse sets the NoRecurse field's value. -func (s *InputService22TestShapeRecursiveStructType) SetNoRecurse(v string) *InputService22TestShapeRecursiveStructType { - s.NoRecurse = &v - return s -} - -// SetRecursiveList sets the RecursiveList field's value. -func (s *InputService22TestShapeRecursiveStructType) SetRecursiveList(v []*InputService22TestShapeRecursiveStructType) *InputService22TestShapeRecursiveStructType { - s.RecursiveList = v - return s -} - -// SetRecursiveMap sets the RecursiveMap field's value. -func (s *InputService22TestShapeRecursiveStructType) SetRecursiveMap(v map[string]*InputService22TestShapeRecursiveStructType) *InputService22TestShapeRecursiveStructType { - s.RecursiveMap = v - return s -} - -// SetRecursiveStruct sets the RecursiveStruct field's value. -func (s *InputService22TestShapeRecursiveStructType) SetRecursiveStruct(v *InputService22TestShapeRecursiveStructType) *InputService22TestShapeRecursiveStructType { - s.RecursiveStruct = v - return s -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService23ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService23ProtocolTest { - svc := &InputService23ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice23protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService23TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService23TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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() -} - -type InputService23TestShapeInputService23TestCaseOperation1Input struct { - _ struct{} `type:"structure"` - - TimeArgInHeader *time.Time `location:"header" locationName:"x-amz-timearg" type:"timestamp" timestampFormat:"rfc822"` -} - -// SetTimeArgInHeader sets the TimeArgInHeader field's value. -func (s *InputService23TestShapeInputService23TestCaseOperation1Input) SetTimeArgInHeader(v time.Time) *InputService23TestShapeInputService23TestCaseOperation1Input { - s.TimeArgInHeader = &v - return s -} - -type InputService23TestShapeInputService23TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newInputService24ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *InputService24ProtocolTest { - svc := &InputService24ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "inputservice24protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService24TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService24TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *InputService24TestShapeInputService24TestCaseOperation2Input) (req *request.Request, output *InputService24TestShapeInputService24TestCaseOperation1Output) { - op := &request.Operation{ - Name: opInputService24TestCaseOperation1, - HTTPMethod: "POST", - HTTPPath: "/path", - } - - if input == nil { - input = &InputService24TestShapeInputService24TestCaseOperation2Input{} - } - - output = &InputService24TestShapeInputService24TestCaseOperation1Output{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 *InputService24TestShapeInputService24TestCaseOperation2Input) (*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 *InputService24TestShapeInputService24TestCaseOperation2Input, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See InputService24TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the InputService24TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(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 InputService24TestShapeInputService24TestCaseOperation1Output struct { - _ struct{} `type:"structure"` -} - -type InputService24TestShapeInputService24TestCaseOperation2Input struct { - _ struct{} `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"` -} - -// -// 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `barfoo`, util.Trim(string(body)), InputService1TestShapeInputService1TestCaseOperation1Input{}) - - // 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 := &InputService1TestShapeInputService1TestCaseOperation1Input{ - Description: aws.String("bar"), - Name: aws.String("foo"), - } - req, _ := svc.InputService1TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `barfoo`, util.Trim(string(body)), InputService1TestShapeInputService1TestCaseOperation1Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `true3false1.2`, util.Trim(string(body)), InputService2TestShapeInputService2TestCaseOperation1Input{}) - - // 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 := &InputService3TestShapeInputService3TestCaseOperation2Input{ - Description: aws.String("baz"), - SubStructure: &InputService3TestShapeSubStructure{ - Bar: aws.String("b"), - Foo: aws.String("a"), - }, - } - req, _ := svc.InputService3TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `bazba`, util.Trim(string(body)), InputService3TestShapeInputService3TestCaseOperation2Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `baza`, util.Trim(string(body)), InputService3TestShapeInputService3TestCaseOperation2Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `baz`, util.Trim(string(body)), InputService4TestShapeInputService4TestCaseOperation1Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(string(body)), InputService5TestShapeInputService5TestCaseOperation1Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(string(body)), InputService6TestShapeInputService6TestCaseOperation1Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(string(body)), InputService7TestShapeInputService7TestCaseOperation1Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(string(body)), InputService8TestShapeInputService8TestCaseOperation1Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `onetwothree`, util.Trim(string(body)), InputService9TestShapeInputService9TestCaseOperation1Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService10ProtocolTestBlobAndTimestampShapesCase1(t *testing.T) { - svc := NewInputService10ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService10TestShapeInputService10TestCaseOperation1Input{ - StructureParam: &InputService10TestShapeStructureShape{ - B: []byte("foo"), - T: aws.Time(time.Unix(1422172800, 0)), - }, - } - req, _ := svc.InputService10TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `Zm9v2015-01-25T08:00:00Z`, util.Trim(string(body)), InputService10TestShapeInputService10TestCaseOperation1Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/hostedzone", r.URL.String()) - - // assert headers - -} - -func TestInputService11ProtocolTestHeaderMapsCase1(t *testing.T) { - svc := NewInputService11ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService11TestShapeInputService11TestCaseOperation1Input{ - Foo: map[string]*string{ - "a": aws.String("b"), - "c": aws.String("d"), - }, - } - req, _ := svc.InputService11TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - assert.Equal(t, "b", r.Header.Get("x-foo-a")) - assert.Equal(t, "d", r.Header.Get("x-foo-c")) - -} - -func TestInputService12ProtocolTestQuerystringListOfStringsCase1(t *testing.T) { - svc := NewInputService12ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService12TestShapeInputService12TestCaseOperation1Input{ - Items: []*string{ - aws.String("value1"), - aws.String("value2"), - }, - } - req, _ := svc.InputService12TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?item=value1&item=value2", r.URL.String()) - - // assert headers - -} - -func TestInputService13ProtocolTestStringToStringMapsInQuerystringCase1(t *testing.T) { - svc := NewInputService13ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService13TestShapeInputService13TestCaseOperation1Input{ - PipelineId: aws.String("foo"), - QueryDoc: map[string]*string{ - "bar": aws.String("baz"), - "fizz": aws.String("buzz"), - }, - } - req, _ := svc.InputService13TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/2014-01-01/jobsByPipeline/foo?bar=baz&fizz=buzz", r.URL.String()) - - // assert headers - -} - -func TestInputService14ProtocolTestStringToStringListMapsInQuerystringCase1(t *testing.T) { - svc := NewInputService14ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService14TestShapeInputService14TestCaseOperation1Input{ - PipelineId: aws.String("id"), - QueryDoc: map[string][]*string{ - "fizz": { - aws.String("buzz"), - aws.String("pop"), - }, - "foo": { - aws.String("bar"), - aws.String("baz"), - }, - }, - } - req, _ := svc.InputService14TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, 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 TestInputService15ProtocolTestBooleanInQuerystringCase1(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation2Input{ - BoolQuery: aws.Bool(true), - } - req, _ := svc.InputService15TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?bool-query=true", r.URL.String()) - - // assert headers - -} - -func TestInputService15ProtocolTestBooleanInQuerystringCase2(t *testing.T) { - svc := NewInputService15ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService15TestShapeInputService15TestCaseOperation2Input{ - BoolQuery: aws.Bool(false), - } - req, _ := svc.InputService15TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?bool-query=false", r.URL.String()) - - // assert headers - -} - -func TestInputService16ProtocolTestStringPayloadCase1(t *testing.T) { - svc := NewInputService16ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService16TestShapeInputService16TestCaseOperation1Input{ - Foo: aws.String("bar"), - } - req, _ := svc.InputService16TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - assert.Equal(t, `bar`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService17ProtocolTestBlobPayloadCase1(t *testing.T) { - svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService17TestShapeInputService17TestCaseOperation2Input{ - Foo: []byte("bar"), - } - req, _ := svc.InputService17TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - assert.Equal(t, `bar`, util.Trim(string(body))) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService17ProtocolTestBlobPayloadCase2(t *testing.T) { - svc := NewInputService17ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService17TestShapeInputService17TestCaseOperation2Input{} - req, _ := svc.InputService17TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService18ProtocolTestStructurePayloadCase1(t *testing.T) { - svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService18TestShapeInputService18TestCaseOperation4Input{ - Foo: &InputService18TestShapeFooShape{ - Baz: aws.String("bar"), - }, - } - req, _ := svc.InputService18TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `bar`, util.Trim(string(body)), InputService18TestShapeInputService18TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService18ProtocolTestStructurePayloadCase2(t *testing.T) { - svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService18TestShapeInputService18TestCaseOperation4Input{} - req, _ := svc.InputService18TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService18ProtocolTestStructurePayloadCase3(t *testing.T) { - svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService18TestShapeInputService18TestCaseOperation4Input{ - Foo: &InputService18TestShapeFooShape{}, - } - req, _ := svc.InputService18TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, ``, util.Trim(string(body)), InputService18TestShapeInputService18TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService18ProtocolTestStructurePayloadCase4(t *testing.T) { - svc := NewInputService18ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService18TestShapeInputService18TestCaseOperation4Input{} - req, _ := svc.InputService18TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService19ProtocolTestXMLAttributeCase1(t *testing.T) { - svc := NewInputService19ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService19TestShapeInputService19TestCaseOperation1Input{ - Grant: &InputService19TestShapeGrant{ - Grantee: &InputService19TestShapeGrantee{ - EmailAddress: aws.String("foo@example.com"), - Type: aws.String("CanonicalUser"), - }, - }, - } - req, _ := svc.InputService19TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo@example.com`, util.Trim(string(body)), InputService19TestShapeInputService19TestCaseOperation1Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/", r.URL.String()) - - // assert headers - -} - -func TestInputService20ProtocolTestGreedyKeysCase1(t *testing.T) { - svc := NewInputService20ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService20TestShapeInputService20TestCaseOperation1Input{ - Bucket: aws.String("my/bucket"), - Key: aws.String("testing /123"), - } - req, _ := svc.InputService20TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/my%2Fbucket/testing%20/123", r.URL.String()) - - // assert headers - -} - -func TestInputService21ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase1(t *testing.T) { - svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService21TestShapeInputService21TestCaseOperation2Input{} - req, _ := svc.InputService21TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService21ProtocolTestOmitsNullQueryParamsButSerializesEmptyStringsCase2(t *testing.T) { - svc := NewInputService21ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService21TestShapeInputService21TestCaseOperation2Input{ - Foo: aws.String(""), - } - req, _ := svc.InputService21TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path?abc=mno¶m-name=", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestRecursiveShapesCase1(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation4Input{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - } - req, _ := svc.InputService22TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo`, util.Trim(string(body)), InputService22TestShapeInputService22TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestRecursiveShapesCase2(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation4Input{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - } - req, _ := svc.InputService22TestCaseOperation2Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo`, util.Trim(string(body)), InputService22TestShapeInputService22TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestRecursiveShapesCase3(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation4Input{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - NoRecurse: aws.String("foo"), - }, - }, - }, - }, - } - req, _ := svc.InputService22TestCaseOperation3Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foo`, util.Trim(string(body)), InputService22TestShapeInputService22TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestRecursiveShapesCase4(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation4Input{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - RecursiveList: []*InputService22TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - NoRecurse: aws.String("bar"), - }, - }, - }, - } - req, _ := svc.InputService22TestCaseOperation4Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foobar`, util.Trim(string(body)), InputService22TestShapeInputService22TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestRecursiveShapesCase5(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation4Input{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - RecursiveList: []*InputService22TestShapeRecursiveStructType{ - { - NoRecurse: aws.String("foo"), - }, - { - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - NoRecurse: aws.String("bar"), - }, - }, - }, - }, - } - req, _ := svc.InputService22TestCaseOperation5Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foobar`, util.Trim(string(body)), InputService22TestShapeInputService22TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService22ProtocolTestRecursiveShapesCase6(t *testing.T) { - svc := NewInputService22ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService22TestShapeInputService22TestCaseOperation4Input{ - RecursiveStruct: &InputService22TestShapeRecursiveStructType{ - RecursiveMap: map[string]*InputService22TestShapeRecursiveStructType{ - "bar": { - NoRecurse: aws.String("bar"), - }, - "foo": { - NoRecurse: aws.String("foo"), - }, - }, - }, - } - req, _ := svc.InputService22TestCaseOperation6Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `foofoobarbar`, util.Trim(string(body)), InputService22TestShapeInputService22TestCaseOperation4Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} - -func TestInputService23ProtocolTestTimestampInHeaderCase1(t *testing.T) { - svc := NewInputService23ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService23TestShapeInputService23TestCaseOperation1Input{ - TimeArgInHeader: aws.Time(time.Unix(1422172800, 0)), - } - req, _ := svc.InputService23TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - assert.Equal(t, "Sun, 25 Jan 2015 08:00:00 GMT", r.Header.Get("x-amz-timearg")) - -} - -func TestInputService24ProtocolTestIdempotencyTokenAutoFillCase1(t *testing.T) { - svc := NewInputService24ProtocolTest(unit.Session, &aws.Config{Endpoint: aws.String("https://test")}) - input := &InputService24TestShapeInputService24TestCaseOperation2Input{ - Token: aws.String("abc123"), - } - req, _ := svc.InputService24TestCaseOperation1Request(input) - r := req.HTTPRequest - - // build request - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `abc123`, util.Trim(string(body)), InputService24TestShapeInputService24TestCaseOperation2Input{}) - - // 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 - restxml.Build(req) - assert.NoError(t, req.Error) - - // assert body - assert.NotNil(t, r.Body) - body := util.SortXML(r.Body) - awstesting.AssertXML(t, `00000000-0000-4000-8000-000000000000`, util.Trim(string(body)), InputService24TestShapeInputService24TestCaseOperation2Input{}) - - // assert URL - awstesting.AssertURL(t, "https://test/path", r.URL.String()) - - // assert headers - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go deleted file mode 100644 index 7bdf4c8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go +++ /dev/null @@ -1,69 +0,0 @@ -// Package restxml provides RESTful XML serialization of AWS -// requests and responses. -package restxml - -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/rest-xml.json build_test.go -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/rest-xml.json unmarshal_test.go - -import ( - "bytes" - "encoding/xml" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "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/xml/xmlutil" -) - -// BuildHandler is a named request handler for building restxml protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.restxml.Build", Fn: Build} - -// UnmarshalHandler is a named request handler for unmarshaling restxml protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.restxml.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling restxml protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalMeta", Fn: UnmarshalMeta} - -// UnmarshalErrorHandler is a named request handler for unmarshaling restxml protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalError", Fn: UnmarshalError} - -// Build builds a request payload for the REST XML protocol. -func Build(r *request.Request) { - rest.Build(r) - - if t := rest.PayloadType(r.Params); t == "structure" || t == "" { - var buf bytes.Buffer - err := xmlutil.BuildXML(r.Params, xml.NewEncoder(&buf)) - if err != nil { - r.Error = awserr.New("SerializationError", "failed to encode rest XML request", err) - return - } - r.SetBufferBody(buf.Bytes()) - } -} - -// Unmarshal unmarshals a payload response for the REST XML protocol. -func Unmarshal(r *request.Request) { - if t := rest.PayloadType(r.Data); t == "structure" || t == "" { - defer r.HTTPResponse.Body.Close() - decoder := xml.NewDecoder(r.HTTPResponse.Body) - err := xmlutil.UnmarshalXML(r.Data, decoder, "") - if err != nil { - r.Error = awserr.New("SerializationError", "failed to decode REST XML response", err) - return - } - } else { - rest.Unmarshal(r) - } -} - -// UnmarshalMeta unmarshals response headers for the REST XML protocol. -func UnmarshalMeta(r *request.Request) { - rest.UnmarshalMeta(r) -} - -// UnmarshalError unmarshals a response error for the REST XML protocol. -func UnmarshalError(r *request.Request) { - query.UnmarshalError(r) -} 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 9404bb7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/unmarshal_test.go +++ /dev/null @@ -1,2289 +0,0 @@ -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" - "github.com/stretchr/testify/assert" -) - -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{} -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService1ProtocolTest { - svc := &OutputService1ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice1protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService1TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService1TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 *OutputService1TestShapeOutputService1TestCaseOperation2Output) { - op := &request.Operation{ - Name: opOutputService1TestCaseOperation1, - HTTPPath: "/", - } - - if input == nil { - input = &OutputService1TestShapeOutputService1TestCaseOperation1Input{} - } - - output = &OutputService1TestShapeOutputService1TestCaseOperation2Output{} - 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) (*OutputService1TestShapeOutputService1TestCaseOperation2Output, 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) (*OutputService1TestShapeOutputService1TestCaseOperation2Output, 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService1TestCaseOperation2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService1TestCaseOperation2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 OutputService1TestShapeOutputService1TestCaseOperation2Input struct { - _ struct{} `type:"structure"` -} - -type OutputService1TestShapeOutputService1TestCaseOperation2Output struct { - _ struct{} `type:"structure"` - - 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" timestampFormat:"iso8601"` - - TrueBool *bool `type:"boolean"` -} - -// 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService2ProtocolTest { - svc := &OutputService2ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice2protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService2TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService2TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService3ProtocolTest { - svc := &OutputService3ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice3protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService3TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService3TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService4ProtocolTest { - svc := &OutputService4ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice4protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService4TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService4TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService5ProtocolTest { - svc := &OutputService5ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice5protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService5TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService5TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService6ProtocolTest { - svc := &OutputService6ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice6protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService6TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService6TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService7ProtocolTest { - svc := &OutputService7ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice7protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService7TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService7TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService8ProtocolTest { - svc := &OutputService8ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice8protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService8TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService8TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService9ProtocolTest { - svc := &OutputService9ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice9protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService9TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService9TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService10ProtocolTest { - svc := &OutputService10ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice10protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService10TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService10TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService11ProtocolTest { - svc := &OutputService11ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice11protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService11TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService11TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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" timestampFormat:"iso8601"` - - 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 -} - -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client'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: -// // 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.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OutputService12ProtocolTest { - svc := &OutputService12ProtocolTest{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "outputservice12protocoltest", - SigningName: signingName, - SigningRegion: signingRegion, - 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 can be used to capture response data after the request's "Send" method -// is called. -// -// See OutputService12TestCaseOperation1 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the OutputService12TestCaseOperation1 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // 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 -} - -// -// 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:00Z")) - req, out := svc.OutputService1TestCaseOperation1Request(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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.Char) - assert.Equal(t, 1.3, *out.Double) - assert.Equal(t, false, *out.FalseBool) - assert.Equal(t, 1.2, *out.Float) - assert.Equal(t, "test", *out.ImaHeader) - assert.Equal(t, "abc", *out.ImaHeaderLocation) - assert.Equal(t, int64(200), *out.Long) - assert.Equal(t, int64(123), *out.Num) - assert.Equal(t, "myname", *out.Str) - assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String()) - assert.Equal(t, true, *out.TrueBool) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.Char) - assert.Equal(t, 1.3, *out.Double) - assert.Equal(t, false, *out.FalseBool) - assert.Equal(t, 1.2, *out.Float) - assert.Equal(t, "test", *out.ImaHeader) - assert.Equal(t, "abc", *out.ImaHeaderLocation) - assert.Equal(t, int64(200), *out.Long) - assert.Equal(t, int64(123), *out.Num) - assert.Equal(t, "", *out.Str) - assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String()) - assert.Equal(t, true, *out.TrueBool) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "value", string(out.Blob)) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.ListMember[0]) - assert.Equal(t, "123", *out.ListMember[1]) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"].Foo) - assert.Equal(t, "bar", *out.Map["qux"].Foo) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"]) - assert.Equal(t, "bar", *out.Map["qux"]) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "bam", *out.Map["baz"]) - assert.Equal(t, "bar", *out.Map["qux"]) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", *out.Data.Foo) - assert.Equal(t, "baz", *out.Header) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "abc", string(out.Stream)) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "a", *out.Char) - assert.Equal(t, 1.5, *out.Double) - assert.Equal(t, false, *out.FalseBool) - assert.Equal(t, 1.5, *out.Float) - assert.Equal(t, int64(1), *out.Integer) - assert.Equal(t, int64(100), *out.Long) - assert.Equal(t, "string", *out.Str) - assert.Equal(t, time.Unix(1.4221728e+09, 0).UTC().String(), out.Timestamp.String()) - assert.Equal(t, true, *out.TrueBool) - -} - -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 - restxml.UnmarshalMeta(req) - restxml.Unmarshal(req) - assert.NoError(t, req.Error) - - // assert response - assert.NotNil(t, out) // ensure out variable is used - assert.Equal(t, "", *out.Foo) - -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go new file mode 100644 index 0000000..05d4ff5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go @@ -0,0 +1,84 @@ +package protocol + +import ( + "math" + "strconv" + "time" + + "github.com/aws/aws-sdk-go/internal/sdkmath" +) + +// Names of time formats supported by the SDK +const ( + RFC822TimeFormatName = "rfc822" + ISO8601TimeFormatName = "iso8601" + UnixTimeFormatName = "unixTimestamp" +) + +// Time formats supported by the SDK +// Output time is intended to not contain decimals +const ( + // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT + RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" + + // This format is used for output time without seconds precision + RFC822OutputTimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" + + // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z + ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z" + + // This format is used for output time without seconds precision + ISO8601OutputTimeFormat = "2006-01-02T15:04:05Z" +) + +// IsKnownTimestampFormat returns if the timestamp format name +// is know to the SDK's protocols. +func IsKnownTimestampFormat(name string) bool { + switch name { + case RFC822TimeFormatName: + fallthrough + case ISO8601TimeFormatName: + fallthrough + case UnixTimeFormatName: + return true + default: + return false + } +} + +// FormatTime returns a string value of the time. +func FormatTime(name string, t time.Time) string { + t = t.UTC() + + switch name { + case RFC822TimeFormatName: + return t.Format(RFC822OutputTimeFormat) + case ISO8601TimeFormatName: + return t.Format(ISO8601OutputTimeFormat) + case UnixTimeFormatName: + return strconv.FormatInt(t.Unix(), 10) + default: + panic("unknown timestamp format name, " + name) + } +} + +// ParseTime attempts to parse the time given the format. Returns +// the time if it was able to be parsed, and fails otherwise. +func ParseTime(formatName, value string) (time.Time, error) { + switch formatName { + case RFC822TimeFormatName: + return time.Parse(RFC822TimeFormat, value) + case ISO8601TimeFormatName: + return time.Parse(ISO8601TimeFormat, value) + case UnixTimeFormatName: + v, err := strconv.ParseFloat(value, 64) + _, dec := math.Modf(v) + dec = sdkmath.Round(dec*1e3) / 1e3 //Rounds 0.1229999 to 0.123 + if err != nil { + return time.Time{}, err + } + return time.Unix(int64(v), int64(dec*(1e9))), nil + default: + panic("unknown timestamp format name, " + 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 2733e99..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package protocol_test - -import ( - "net/http" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/stretchr/testify/assert" -) - -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) - assert.NoError(t, r.Error) - assert.Equal(t, 0, b.Len()) - assert.True(t, b.Closed) -} - -func TestUnmarshalDrainBodyNoBody(t *testing.T) { - r := &request.Request{HTTPResponse: &http.Response{}} - - protocol.UnmarshalDiscardBody(r) - assert.NoError(t, r.Error) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go index c74c191..cf981fe 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go @@ -13,9 +13,13 @@ import ( "github.com/aws/aws-sdk-go/private/protocol" ) -// BuildXML will serialize params into an xml.Encoder. -// Error will be returned if the serialization of any of the params or nested values fails. +// BuildXML will serialize params into an xml.Encoder. Error will be returned +// if the serialization of any of the params or nested values fails. func BuildXML(params interface{}, e *xml.Encoder) error { + return buildXML(params, e, false) +} + +func buildXML(params interface{}, e *xml.Encoder, sorted bool) error { b := xmlBuilder{encoder: e, namespaces: map[string]string{}} root := NewXMLElement(xml.Name{}) if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil { @@ -23,7 +27,7 @@ func BuildXML(params interface{}, e *xml.Encoder) error { } for _, c := range root.Children { for _, v := range c { - return StructToXML(e, v, false) + return StructToXML(e, v, sorted) } } return nil @@ -83,15 +87,13 @@ func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag refle } } -// buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested +// buildStruct adds a struct and its fields to the current XMLNode. All fields and any nested // types are converted to XMLNodes also. func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { if !value.IsValid() { return nil } - fieldAdded := false - // unwrap payloads if payload := tag.Get("payload"); payload != "" { field, _ := value.Type().FieldByName(payload) @@ -119,6 +121,8 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl child.Attr = append(child.Attr, ns) } + var payloadFields, nonPayloadFields int + t := value.Type() for i := 0; i < value.NumField(); i++ { member := elemOf(value.Field(i)) @@ -131,11 +135,12 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl continue } - mTag := field.Tag if mTag.Get("location") != "" { // skip non-body members + nonPayloadFields++ continue } + payloadFields++ if protocol.CanSetIdempotencyToken(value.Field(i), field) { token := protocol.GetIdempotencyToken() @@ -150,11 +155,11 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl if err := b.buildValue(member, child, mTag); err != nil { return err } - - fieldAdded = true } - if fieldAdded { // only append this child if we have one ore more valid members + // Only case where the child shape is not added is if the shape only contains + // non-payload fields, e.g headers/query. + if !(payloadFields == 0 && nonPayloadFields > 0) { current.AddChild(child) } @@ -279,8 +284,12 @@ func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag refl case float32: str = strconv.FormatFloat(float64(converted), 'f', -1, 32) case time.Time: - const ISO8601UTC = "2006-01-02T15:04:05Z" - str = converted.UTC().Format(ISO8601UTC) + format := tag.Get("timestampFormat") + if len(format) == 0 { + format = protocol.ISO8601TimeFormatName + } + + str = protocol.FormatTime(format, converted) default: return fmt.Errorf("unsupported value for param %s: %v (%s)", tag.Get("locationName"), value.Interface(), value.Type().Name()) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go new file mode 100644 index 0000000..c1a5118 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/sort.go @@ -0,0 +1,32 @@ +package xmlutil + +import ( + "encoding/xml" + "strings" +) + +type xmlAttrSlice []xml.Attr + +func (x xmlAttrSlice) Len() int { + return len(x) +} + +func (x xmlAttrSlice) Less(i, j int) bool { + spaceI, spaceJ := x[i].Name.Space, x[j].Name.Space + localI, localJ := x[i].Name.Local, x[j].Name.Local + valueI, valueJ := x[i].Value, x[j].Value + + spaceCmp := strings.Compare(spaceI, spaceJ) + localCmp := strings.Compare(localI, localJ) + valueCmp := strings.Compare(valueI, valueJ) + + if spaceCmp == -1 || (spaceCmp == 0 && (localCmp == -1 || (localCmp == 0 && valueCmp == -1))) { + return true + } + + return false +} + +func (x xmlAttrSlice) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go index 64b6ddd..7108d38 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go @@ -1,6 +1,7 @@ package xmlutil import ( + "bytes" "encoding/base64" "encoding/xml" "fmt" @@ -9,13 +10,36 @@ import ( "strconv" "strings" "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/private/protocol" ) +// UnmarshalXMLError unmarshals the XML error from the stream into the value +// type specified. The value must be a pointer. If the message fails to +// unmarshal, the message content will be included in the returned error as a +// awserr.UnmarshalError. +func UnmarshalXMLError(v interface{}, stream io.Reader) error { + var errBuf bytes.Buffer + body := io.TeeReader(stream, &errBuf) + + err := xml.NewDecoder(body).Decode(v) + if err != nil && err != io.EOF { + return awserr.NewUnmarshalError(err, + "failed to unmarshal error message", errBuf.Bytes()) + } + + return nil +} + // UnmarshalXML deserializes an xml.Decoder into the container v. V // needs to match the shape of the XML expected to be decoded. // If the shape doesn't match unmarshaling will fail. func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error { - n, _ := XMLToStruct(d, nil) + n, err := XMLToStruct(d, nil) + if err != nil { + return err + } if n.Children != nil { for _, root := range n.Children { for _, c := range root { @@ -23,7 +47,7 @@ func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error { c = wrappedChild[0] // pull out wrapped element } - err := parse(reflect.ValueOf(v), c, "") + err = parse(reflect.ValueOf(v), c, "") if err != nil { if err == io.EOF { return nil @@ -49,9 +73,15 @@ func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { if t == "" { switch rtype.Kind() { case reflect.Struct: - t = "structure" + // also it can't be a time object + if _, ok := r.Interface().(*time.Time); !ok { + t = "structure" + } case reflect.Slice: - t = "list" + // also it can't be a byte slice + if _, ok := r.Interface().([]byte); !ok { + t = "list" + } case reflect.Map: t = "map" } @@ -244,8 +274,12 @@ func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { } r.Set(reflect.ValueOf(&v)) case *time.Time: - const ISO8601UTC = "2006-01-02T15:04:05Z" - t, err := time.Parse(ISO8601UTC, node.Text) + format := tag.Get("timestampFormat") + if len(format) == 0 { + format = protocol.ISO8601TimeFormatName + } + + t, err := protocol.ParseTime(format, node.Text) if err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go index 3112512..42f7164 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go @@ -29,6 +29,7 @@ func NewXMLElement(name xml.Name) *XMLNode { // AddChild adds child to the XMLNode. func (n *XMLNode) AddChild(child *XMLNode) { + child.parent = n if _, ok := n.Children[child.Name.Local]; !ok { n.Children[child.Name.Local] = []*XMLNode{} } @@ -40,11 +41,16 @@ func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) { out := &XMLNode{} for { tok, err := d.Token() - if tok == nil || err == io.EOF { - break - } if err != nil { - return out, err + if err == io.EOF { + break + } else { + return out, err + } + } + + if tok == nil { + break } switch typed := tok.(type) { @@ -113,7 +119,18 @@ func (n *XMLNode) findElem(name string) (string, bool) { // StructToXML writes an XMLNode to a xml.Encoder as tokens. func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { - e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr}) + // Sort Attributes + attrs := node.Attr + if sorted { + sortedAttrs := make([]xml.Attr, len(attrs)) + for _, k := range node.Attr { + sortedAttrs = append(sortedAttrs, k) + } + sort.Sort(xmlAttrSlice(sortedAttrs)) + attrs = sortedAttrs + } + + e.EncodeToken(xml.StartElement{Name: node.Name, Attr: attrs}) if node.Text != "" { e.EncodeToken(xml.CharData([]byte(node.Text))) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct_test.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct_test.go deleted file mode 100644 index d1fd21f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package xmlutil_test - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestUnmarshal(t *testing.T) { - xmlVal := []byte(` - foo-iduserfoo-iduserFULL_CONTROL< - /AccessControlPolicy>`) - - var server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write(xmlVal) - })) - - sess := unit.Session - sess.Config.Endpoint = &server.URL - sess.Config.S3ForcePathStyle = aws.Bool(true) - svc := s3.New(sess) - - out, err := svc.GetBucketAcl(&s3.GetBucketAclInput{ - Bucket: aws.String("foo"), - }) - - assert.NoError(t, err) - - expected := &s3.GetBucketAclOutput{ - Grants: []*s3.Grant{ - { - Grantee: &s3.Grantee{ - DisplayName: aws.String("user"), - ID: aws.String("foo-id"), - Type: aws.String("type"), - }, - Permission: aws.String("FULL_CONTROL"), - }, - }, - - Owner: &s3.Owner{ - DisplayName: aws.String("user"), - ID: aws.String("foo-id"), - }, - } - assert.Equal(t, expected, out) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/util/sort_keys.go b/vendor/github.com/aws/aws-sdk-go/private/util/sort_keys.go deleted file mode 100644 index 4800056..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/util/sort_keys.go +++ /dev/null @@ -1,14 +0,0 @@ -package util - -import "sort" - -// SortedKeys returns a sorted slice of keys of a map. -func SortedKeys(m map[string]interface{}) []string { - i, sorted := 0, make([]string, len(m)) - for k := range m { - sorted[i] = k - i++ - } - sort.Strings(sorted) - return sorted -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/util/util.go b/vendor/github.com/aws/aws-sdk-go/private/util/util.go deleted file mode 100644 index 5f2dab2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/private/util/util.go +++ /dev/null @@ -1,109 +0,0 @@ -package util - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "reflect" - "regexp" - "strings" - - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" -) - -// GoFmt returns the Go formated string of the input. -// -// Panics if the format fails. -func GoFmt(buf string) string { - formatted, err := format.Source([]byte(buf)) - if err != nil { - panic(fmt.Errorf("%s\nOriginal code:\n%s", err.Error(), buf)) - } - return string(formatted) -} - -var reTrim = regexp.MustCompile(`\s{2,}`) - -// Trim removes all leading and trailing white space. -// -// All consecutive spaces will be reduced to a single space. -func Trim(s string) string { - return strings.TrimSpace(reTrim.ReplaceAllString(s, " ")) -} - -// Capitalize capitalizes the first character of the string. -func Capitalize(s string) string { - if len(s) == 1 { - return strings.ToUpper(s) - } - return strings.ToUpper(s[0:1]) + s[1:] -} - -// SortXML sorts the reader's XML elements -func SortXML(r io.Reader) string { - var buf bytes.Buffer - d := xml.NewDecoder(r) - root, _ := xmlutil.XMLToStruct(d, nil) - e := xml.NewEncoder(&buf) - xmlutil.StructToXML(e, root, true) - return buf.String() -} - -// PrettyPrint generates a human readable representation of the value v. -// All values of v are recursively found and pretty printed also. -func PrettyPrint(v interface{}) string { - value := reflect.ValueOf(v) - switch value.Kind() { - case reflect.Struct: - str := fullName(value.Type()) + "{\n" - for i := 0; i < value.NumField(); i++ { - l := string(value.Type().Field(i).Name[0]) - if strings.ToUpper(l) == l { - str += value.Type().Field(i).Name + ": " - str += PrettyPrint(value.Field(i).Interface()) - str += ",\n" - } - } - str += "}" - return str - case reflect.Map: - str := "map[" + fullName(value.Type().Key()) + "]" + fullName(value.Type().Elem()) + "{\n" - for _, k := range value.MapKeys() { - str += "\"" + k.String() + "\": " - str += PrettyPrint(value.MapIndex(k).Interface()) - str += ",\n" - } - str += "}" - return str - case reflect.Ptr: - if e := value.Elem(); e.IsValid() { - return "&" + PrettyPrint(e.Interface()) - } - return "nil" - case reflect.Slice: - str := "[]" + fullName(value.Type().Elem()) + "{\n" - for i := 0; i < value.Len(); i++ { - str += PrettyPrint(value.Index(i).Interface()) - str += ",\n" - } - str += "}" - return str - default: - return fmt.Sprintf("%#v", v) - } -} - -func pkgName(t reflect.Type) string { - pkg := t.PkgPath() - c := strings.Split(pkg, "/") - return c[len(c)-1] -} - -func fullName(t reflect.Type) string { - if pkg := pkgName(t); pkg != "" { - return pkg + "." + t.Name() - } - return t.Name() -} diff --git a/vendor/github.com/aws/aws-sdk-go/sdk.go b/vendor/github.com/aws/aws-sdk-go/sdk.go deleted file mode 100644 index afa465a..0000000 --- a/vendor/github.com/aws/aws-sdk-go/sdk.go +++ /dev/null @@ -1,7 +0,0 @@ -// Package sdk is the official AWS SDK for the Go programming language. -// -// See our Developer Guide for information for on getting started and using -// the SDK. -// -// https://github.com/aws/aws-sdk-go/wiki -package sdk diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go deleted file mode 100644 index f0168c0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go +++ /dev/null @@ -1,10442 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cloudfront provides a client for Amazon CloudFront. -package cloudfront - -import ( - "fmt" - "time" - - "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/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -const opCreateCloudFrontOriginAccessIdentity = "CreateCloudFrontOriginAccessIdentity2017_03_25" - -// CreateCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the -// client's request for the CreateCloudFrontOriginAccessIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCloudFrontOriginAccessIdentity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCloudFrontOriginAccessIdentity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateCloudFrontOriginAccessIdentityRequest method. -// req, resp := client.CreateCloudFrontOriginAccessIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentity -func (c *CloudFront) CreateCloudFrontOriginAccessIdentityRequest(input *CreateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *CreateCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opCreateCloudFrontOriginAccessIdentity, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/origin-access-identity/cloudfront", - } - - if input == nil { - input = &CreateCloudFrontOriginAccessIdentityInput{} - } - - output = &CreateCloudFrontOriginAccessIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCloudFrontOriginAccessIdentity API operation for Amazon CloudFront. -// -// Creates a new origin access identity. If you're using Amazon S3 for your -// origin, you can use an origin access identity to require users to access -// your content using a CloudFront URL instead of the Amazon S3 URL. For more -// information about how to use origin access identities, see Serving Private -// Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) -// in the Amazon CloudFront Developer Guide. -// -// 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 Amazon CloudFront's -// API operation CreateCloudFrontOriginAccessIdentity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOriginAccessIdentityAlreadyExists "OriginAccessIdentityAlreadyExists" -// If the CallerReference is a value you already sent in a previous request -// to create an identity but the content of the CloudFrontOriginAccessIdentityConfig -// is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists -// error. -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeTooManyCloudFrontOriginAccessIdentities "TooManyCloudFrontOriginAccessIdentities" -// Processing your request would cause you to exceed the maximum number of origin -// access identities allowed. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentity -func (c *CloudFront) CreateCloudFrontOriginAccessIdentity(input *CreateCloudFrontOriginAccessIdentityInput) (*CreateCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input) - return out, req.Send() -} - -// CreateCloudFrontOriginAccessIdentityWithContext is the same as CreateCloudFrontOriginAccessIdentity with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCloudFrontOriginAccessIdentity 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 *CloudFront) CreateCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *CreateCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*CreateCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.CreateCloudFrontOriginAccessIdentityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDistribution = "CreateDistribution2017_03_25" - -// CreateDistributionRequest generates a "aws/request.Request" representing the -// client's request for the CreateDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDistributionRequest method. -// req, resp := client.CreateDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistribution -func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) (req *request.Request, output *CreateDistributionOutput) { - op := &request.Operation{ - Name: opCreateDistribution, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/distribution", - } - - if input == nil { - input = &CreateDistributionInput{} - } - - output = &CreateDistributionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDistribution API operation for Amazon CloudFront. -// -// Creates a new web distribution. Send a POST request to the /CloudFront API -// version/distribution/distribution ID resource. -// -// 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 Amazon CloudFront's -// API operation CreateDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists" -// -// * ErrCodeDistributionAlreadyExists "DistributionAlreadyExists" -// The caller reference you attempted to create the distribution with is associated -// with another distribution. -// -// * ErrCodeInvalidOrigin "InvalidOrigin" -// The Amazon S3 origin server specified does not refer to a valid Amazon S3 -// bucket. -// -// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity" -// The origin access identity is not valid or doesn't exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners" -// Your request contains more trusted signers than are allowed per distribution. -// -// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist" -// One or more of your trusted signers do not exist. -// -// * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate" -// -// * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion" -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeTooManyDistributionCNAMEs "TooManyDistributionCNAMEs" -// Your request contains more CNAMEs than are allowed per distribution. -// -// * ErrCodeTooManyDistributions "TooManyDistributions" -// Processing your request would cause you to exceed the maximum number of distributions -// allowed. -// -// * ErrCodeInvalidDefaultRootObject "InvalidDefaultRootObject" -// The default root object file name is too big or contains an invalid character. -// -// * ErrCodeInvalidRelativePath "InvalidRelativePath" -// The relative path is too big, is not URL-encoded, or does not begin with -// a slash (/). -// -// * ErrCodeInvalidErrorCode "InvalidErrorCode" -// -// * ErrCodeInvalidResponseCode "InvalidResponseCode" -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidRequiredProtocol "InvalidRequiredProtocol" -// This operation requires the HTTPS protocol. Ensure that you specify the HTTPS -// protocol in your request, or omit the RequiredProtocols element from your -// distribution configuration. -// -// * ErrCodeNoSuchOrigin "NoSuchOrigin" -// No origin exists with the specified Origin Id. -// -// * ErrCodeTooManyOrigins "TooManyOrigins" -// You cannot create more origins for the distribution. -// -// * ErrCodeTooManyCacheBehaviors "TooManyCacheBehaviors" -// You cannot create more cache behaviors for the distribution. -// -// * ErrCodeTooManyCookieNamesInWhiteList "TooManyCookieNamesInWhiteList" -// Your request contains more cookie names in the whitelist than are allowed -// per cache behavior. -// -// * ErrCodeInvalidForwardCookies "InvalidForwardCookies" -// Your request contains forward cookies option which doesn't match with the -// expectation for the whitelisted list of cookie names. Either list of cookie -// names has been specified when not allowed or list of cookie names is missing -// when expected. -// -// * ErrCodeTooManyHeadersInForwardedValues "TooManyHeadersInForwardedValues" -// -// * ErrCodeInvalidHeadersForS3Origin "InvalidHeadersForS3Origin" -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// * ErrCodeTooManyCertificates "TooManyCertificates" -// You cannot create anymore custom SSL/TLS certificates. -// -// * ErrCodeInvalidLocationCode "InvalidLocationCode" -// -// * ErrCodeInvalidGeoRestrictionParameter "InvalidGeoRestrictionParameter" -// -// * ErrCodeInvalidProtocolSettings "InvalidProtocolSettings" -// You cannot specify SSLv3 as the minimum protocol version if you only want -// to support only clients that support Server Name Indication (SNI). -// -// * ErrCodeInvalidTTLOrder "InvalidTTLOrder" -// -// * ErrCodeInvalidWebACLId "InvalidWebACLId" -// -// * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders" -// -// * ErrCodeTooManyQueryStringParameters "TooManyQueryStringParameters" -// -// * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters" -// -// * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations" -// Processing your request would cause the maximum number of distributions with -// Lambda function associations per owner to be exceeded. -// -// * ErrCodeTooManyLambdaFunctionAssociations "TooManyLambdaFunctionAssociations" -// Your request contains more Lambda function associations than are allowed -// per distribution. -// -// * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation" -// The specified Lambda function association is invalid. -// -// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout" -// -// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistribution -func (c *CloudFront) CreateDistribution(input *CreateDistributionInput) (*CreateDistributionOutput, error) { - req, out := c.CreateDistributionRequest(input) - return out, req.Send() -} - -// CreateDistributionWithContext is the same as CreateDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDistribution 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 *CloudFront) CreateDistributionWithContext(ctx aws.Context, input *CreateDistributionInput, opts ...request.Option) (*CreateDistributionOutput, error) { - req, out := c.CreateDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDistributionWithTags = "CreateDistributionWithTags2017_03_25" - -// CreateDistributionWithTagsRequest generates a "aws/request.Request" representing the -// client's request for the CreateDistributionWithTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDistributionWithTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDistributionWithTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDistributionWithTagsRequest method. -// req, resp := client.CreateDistributionWithTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTags -func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistributionWithTagsInput) (req *request.Request, output *CreateDistributionWithTagsOutput) { - op := &request.Operation{ - Name: opCreateDistributionWithTags, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/distribution?WithTags", - } - - if input == nil { - input = &CreateDistributionWithTagsInput{} - } - - output = &CreateDistributionWithTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDistributionWithTags API operation for Amazon CloudFront. -// -// Create a new distribution with tags. -// -// 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 Amazon CloudFront's -// API operation CreateDistributionWithTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists" -// -// * ErrCodeDistributionAlreadyExists "DistributionAlreadyExists" -// The caller reference you attempted to create the distribution with is associated -// with another distribution. -// -// * ErrCodeInvalidOrigin "InvalidOrigin" -// The Amazon S3 origin server specified does not refer to a valid Amazon S3 -// bucket. -// -// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity" -// The origin access identity is not valid or doesn't exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners" -// Your request contains more trusted signers than are allowed per distribution. -// -// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist" -// One or more of your trusted signers do not exist. -// -// * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate" -// -// * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion" -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeTooManyDistributionCNAMEs "TooManyDistributionCNAMEs" -// Your request contains more CNAMEs than are allowed per distribution. -// -// * ErrCodeTooManyDistributions "TooManyDistributions" -// Processing your request would cause you to exceed the maximum number of distributions -// allowed. -// -// * ErrCodeInvalidDefaultRootObject "InvalidDefaultRootObject" -// The default root object file name is too big or contains an invalid character. -// -// * ErrCodeInvalidRelativePath "InvalidRelativePath" -// The relative path is too big, is not URL-encoded, or does not begin with -// a slash (/). -// -// * ErrCodeInvalidErrorCode "InvalidErrorCode" -// -// * ErrCodeInvalidResponseCode "InvalidResponseCode" -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidRequiredProtocol "InvalidRequiredProtocol" -// This operation requires the HTTPS protocol. Ensure that you specify the HTTPS -// protocol in your request, or omit the RequiredProtocols element from your -// distribution configuration. -// -// * ErrCodeNoSuchOrigin "NoSuchOrigin" -// No origin exists with the specified Origin Id. -// -// * ErrCodeTooManyOrigins "TooManyOrigins" -// You cannot create more origins for the distribution. -// -// * ErrCodeTooManyCacheBehaviors "TooManyCacheBehaviors" -// You cannot create more cache behaviors for the distribution. -// -// * ErrCodeTooManyCookieNamesInWhiteList "TooManyCookieNamesInWhiteList" -// Your request contains more cookie names in the whitelist than are allowed -// per cache behavior. -// -// * ErrCodeInvalidForwardCookies "InvalidForwardCookies" -// Your request contains forward cookies option which doesn't match with the -// expectation for the whitelisted list of cookie names. Either list of cookie -// names has been specified when not allowed or list of cookie names is missing -// when expected. -// -// * ErrCodeTooManyHeadersInForwardedValues "TooManyHeadersInForwardedValues" -// -// * ErrCodeInvalidHeadersForS3Origin "InvalidHeadersForS3Origin" -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// * ErrCodeTooManyCertificates "TooManyCertificates" -// You cannot create anymore custom SSL/TLS certificates. -// -// * ErrCodeInvalidLocationCode "InvalidLocationCode" -// -// * ErrCodeInvalidGeoRestrictionParameter "InvalidGeoRestrictionParameter" -// -// * ErrCodeInvalidProtocolSettings "InvalidProtocolSettings" -// You cannot specify SSLv3 as the minimum protocol version if you only want -// to support only clients that support Server Name Indication (SNI). -// -// * ErrCodeInvalidTTLOrder "InvalidTTLOrder" -// -// * ErrCodeInvalidWebACLId "InvalidWebACLId" -// -// * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders" -// -// * ErrCodeInvalidTagging "InvalidTagging" -// -// * ErrCodeTooManyQueryStringParameters "TooManyQueryStringParameters" -// -// * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters" -// -// * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations" -// Processing your request would cause the maximum number of distributions with -// Lambda function associations per owner to be exceeded. -// -// * ErrCodeTooManyLambdaFunctionAssociations "TooManyLambdaFunctionAssociations" -// Your request contains more Lambda function associations than are allowed -// per distribution. -// -// * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation" -// The specified Lambda function association is invalid. -// -// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout" -// -// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTags -func (c *CloudFront) CreateDistributionWithTags(input *CreateDistributionWithTagsInput) (*CreateDistributionWithTagsOutput, error) { - req, out := c.CreateDistributionWithTagsRequest(input) - return out, req.Send() -} - -// CreateDistributionWithTagsWithContext is the same as CreateDistributionWithTags with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDistributionWithTags 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 *CloudFront) CreateDistributionWithTagsWithContext(ctx aws.Context, input *CreateDistributionWithTagsInput, opts ...request.Option) (*CreateDistributionWithTagsOutput, error) { - req, out := c.CreateDistributionWithTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateInvalidation = "CreateInvalidation2017_03_25" - -// CreateInvalidationRequest generates a "aws/request.Request" representing the -// client's request for the CreateInvalidation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInvalidation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInvalidation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInvalidationRequest method. -// req, resp := client.CreateInvalidationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidation -func (c *CloudFront) CreateInvalidationRequest(input *CreateInvalidationInput) (req *request.Request, output *CreateInvalidationOutput) { - op := &request.Operation{ - Name: opCreateInvalidation, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/distribution/{DistributionId}/invalidation", - } - - if input == nil { - input = &CreateInvalidationInput{} - } - - output = &CreateInvalidationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInvalidation API operation for Amazon CloudFront. -// -// Create a new invalidation. -// -// 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 Amazon CloudFront's -// API operation CreateInvalidation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeNoSuchDistribution "NoSuchDistribution" -// The specified distribution does not exist. -// -// * ErrCodeBatchTooLarge "BatchTooLarge" -// -// * ErrCodeTooManyInvalidationsInProgress "TooManyInvalidationsInProgress" -// You have exceeded the maximum number of allowable InProgress invalidation -// batch requests, or invalidation objects. -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidation -func (c *CloudFront) CreateInvalidation(input *CreateInvalidationInput) (*CreateInvalidationOutput, error) { - req, out := c.CreateInvalidationRequest(input) - return out, req.Send() -} - -// CreateInvalidationWithContext is the same as CreateInvalidation with the addition of -// the ability to pass a context and additional request options. -// -// See CreateInvalidation 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 *CloudFront) CreateInvalidationWithContext(ctx aws.Context, input *CreateInvalidationInput, opts ...request.Option) (*CreateInvalidationOutput, error) { - req, out := c.CreateInvalidationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateStreamingDistribution = "CreateStreamingDistribution2017_03_25" - -// CreateStreamingDistributionRequest generates a "aws/request.Request" representing the -// client's request for the CreateStreamingDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStreamingDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStreamingDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStreamingDistributionRequest method. -// req, resp := client.CreateStreamingDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistribution -func (c *CloudFront) CreateStreamingDistributionRequest(input *CreateStreamingDistributionInput) (req *request.Request, output *CreateStreamingDistributionOutput) { - op := &request.Operation{ - Name: opCreateStreamingDistribution, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/streaming-distribution", - } - - if input == nil { - input = &CreateStreamingDistributionInput{} - } - - output = &CreateStreamingDistributionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStreamingDistribution API operation for Amazon CloudFront. -// -// Creates a new RMTP distribution. An RTMP distribution is similar to a web -// distribution, but an RTMP distribution streams media files using the Adobe -// Real-Time Messaging Protocol (RTMP) instead of serving files using HTTP. -// -// To create a new web distribution, submit a POST request to the CloudFront -// API version/distribution resource. The request body must include a document -// with a StreamingDistributionConfig element. The response echoes the StreamingDistributionConfig -// element and returns other information about the RTMP distribution. -// -// To get the status of your request, use the GET StreamingDistribution API -// action. When the value of Enabled is true and the value of Status is Deployed, -// your distribution is ready. A distribution usually deploys in less than 15 -// minutes. -// -// For more information about web distributions, see Working with RTMP Distributions -// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-rtmp.html) -// in the Amazon CloudFront Developer Guide. -// -// Beginning with the 2012-05-05 version of the CloudFront API, we made substantial -// changes to the format of the XML document that you include in the request -// body when you create or update a web distribution or an RTMP distribution, -// and when you invalidate objects. With previous versions of the API, we discovered -// that it was too easy to accidentally delete one or more values for an element -// that accepts multiple values, for example, CNAMEs and trusted signers. Our -// changes for the 2012-05-05 release are intended to prevent these accidental -// deletions and to notify you when there's a mismatch between the number of -// values you say you're specifying in the Quantity element and the number of -// values specified. -// -// 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 Amazon CloudFront's -// API operation CreateStreamingDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists" -// -// * ErrCodeStreamingDistributionAlreadyExists "StreamingDistributionAlreadyExists" -// -// * ErrCodeInvalidOrigin "InvalidOrigin" -// The Amazon S3 origin server specified does not refer to a valid Amazon S3 -// bucket. -// -// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity" -// The origin access identity is not valid or doesn't exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners" -// Your request contains more trusted signers than are allowed per distribution. -// -// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist" -// One or more of your trusted signers do not exist. -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeTooManyStreamingDistributionCNAMEs "TooManyStreamingDistributionCNAMEs" -// -// * ErrCodeTooManyStreamingDistributions "TooManyStreamingDistributions" -// Processing your request would cause you to exceed the maximum number of streaming -// distributions allowed. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistribution -func (c *CloudFront) CreateStreamingDistribution(input *CreateStreamingDistributionInput) (*CreateStreamingDistributionOutput, error) { - req, out := c.CreateStreamingDistributionRequest(input) - return out, req.Send() -} - -// CreateStreamingDistributionWithContext is the same as CreateStreamingDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See CreateStreamingDistribution 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 *CloudFront) CreateStreamingDistributionWithContext(ctx aws.Context, input *CreateStreamingDistributionInput, opts ...request.Option) (*CreateStreamingDistributionOutput, error) { - req, out := c.CreateStreamingDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateStreamingDistributionWithTags = "CreateStreamingDistributionWithTags2017_03_25" - -// CreateStreamingDistributionWithTagsRequest generates a "aws/request.Request" representing the -// client's request for the CreateStreamingDistributionWithTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStreamingDistributionWithTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStreamingDistributionWithTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStreamingDistributionWithTagsRequest method. -// req, resp := client.CreateStreamingDistributionWithTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTags -func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStreamingDistributionWithTagsInput) (req *request.Request, output *CreateStreamingDistributionWithTagsOutput) { - op := &request.Operation{ - Name: opCreateStreamingDistributionWithTags, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/streaming-distribution?WithTags", - } - - if input == nil { - input = &CreateStreamingDistributionWithTagsInput{} - } - - output = &CreateStreamingDistributionWithTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStreamingDistributionWithTags API operation for Amazon CloudFront. -// -// Create a new streaming distribution with tags. -// -// 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 Amazon CloudFront's -// API operation CreateStreamingDistributionWithTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists" -// -// * ErrCodeStreamingDistributionAlreadyExists "StreamingDistributionAlreadyExists" -// -// * ErrCodeInvalidOrigin "InvalidOrigin" -// The Amazon S3 origin server specified does not refer to a valid Amazon S3 -// bucket. -// -// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity" -// The origin access identity is not valid or doesn't exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners" -// Your request contains more trusted signers than are allowed per distribution. -// -// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist" -// One or more of your trusted signers do not exist. -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeTooManyStreamingDistributionCNAMEs "TooManyStreamingDistributionCNAMEs" -// -// * ErrCodeTooManyStreamingDistributions "TooManyStreamingDistributions" -// Processing your request would cause you to exceed the maximum number of streaming -// distributions allowed. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// * ErrCodeInvalidTagging "InvalidTagging" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTags -func (c *CloudFront) CreateStreamingDistributionWithTags(input *CreateStreamingDistributionWithTagsInput) (*CreateStreamingDistributionWithTagsOutput, error) { - req, out := c.CreateStreamingDistributionWithTagsRequest(input) - return out, req.Send() -} - -// CreateStreamingDistributionWithTagsWithContext is the same as CreateStreamingDistributionWithTags with the addition of -// the ability to pass a context and additional request options. -// -// See CreateStreamingDistributionWithTags 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 *CloudFront) CreateStreamingDistributionWithTagsWithContext(ctx aws.Context, input *CreateStreamingDistributionWithTagsInput, opts ...request.Option) (*CreateStreamingDistributionWithTagsOutput, error) { - req, out := c.CreateStreamingDistributionWithTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCloudFrontOriginAccessIdentity = "DeleteCloudFrontOriginAccessIdentity2017_03_25" - -// DeleteCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCloudFrontOriginAccessIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCloudFrontOriginAccessIdentity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCloudFrontOriginAccessIdentity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCloudFrontOriginAccessIdentityRequest method. -// req, resp := client.DeleteCloudFrontOriginAccessIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentity -func (c *CloudFront) DeleteCloudFrontOriginAccessIdentityRequest(input *DeleteCloudFrontOriginAccessIdentityInput) (req *request.Request, output *DeleteCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opDeleteCloudFrontOriginAccessIdentity, - HTTPMethod: "DELETE", - HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}", - } - - if input == nil { - input = &DeleteCloudFrontOriginAccessIdentityInput{} - } - - output = &DeleteCloudFrontOriginAccessIdentityOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCloudFrontOriginAccessIdentity API operation for Amazon CloudFront. -// -// Delete an origin access identity. -// -// 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 Amazon CloudFront's -// API operation DeleteCloudFrontOriginAccessIdentity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeInvalidIfMatchVersion "InvalidIfMatchVersion" -// The If-Match version is missing or not valid for the distribution. -// -// * ErrCodeNoSuchCloudFrontOriginAccessIdentity "NoSuchCloudFrontOriginAccessIdentity" -// The specified origin access identity does not exist. -// -// * ErrCodePreconditionFailed "PreconditionFailed" -// The precondition given in one or more of the request-header fields evaluated -// to false. -// -// * ErrCodeOriginAccessIdentityInUse "OriginAccessIdentityInUse" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentity -func (c *CloudFront) DeleteCloudFrontOriginAccessIdentity(input *DeleteCloudFrontOriginAccessIdentityInput) (*DeleteCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input) - return out, req.Send() -} - -// DeleteCloudFrontOriginAccessIdentityWithContext is the same as DeleteCloudFrontOriginAccessIdentity with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCloudFrontOriginAccessIdentity 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 *CloudFront) DeleteCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *DeleteCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*DeleteCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.DeleteCloudFrontOriginAccessIdentityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDistribution = "DeleteDistribution2017_03_25" - -// DeleteDistributionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDistributionRequest method. -// req, resp := client.DeleteDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistribution -func (c *CloudFront) DeleteDistributionRequest(input *DeleteDistributionInput) (req *request.Request, output *DeleteDistributionOutput) { - op := &request.Operation{ - Name: opDeleteDistribution, - HTTPMethod: "DELETE", - HTTPPath: "/2017-03-25/distribution/{Id}", - } - - if input == nil { - input = &DeleteDistributionInput{} - } - - output = &DeleteDistributionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDistribution API operation for Amazon CloudFront. -// -// Delete a distribution. -// -// 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 Amazon CloudFront's -// API operation DeleteDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeDistributionNotDisabled "DistributionNotDisabled" -// -// * ErrCodeInvalidIfMatchVersion "InvalidIfMatchVersion" -// The If-Match version is missing or not valid for the distribution. -// -// * ErrCodeNoSuchDistribution "NoSuchDistribution" -// The specified distribution does not exist. -// -// * ErrCodePreconditionFailed "PreconditionFailed" -// The precondition given in one or more of the request-header fields evaluated -// to false. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistribution -func (c *CloudFront) DeleteDistribution(input *DeleteDistributionInput) (*DeleteDistributionOutput, error) { - req, out := c.DeleteDistributionRequest(input) - return out, req.Send() -} - -// DeleteDistributionWithContext is the same as DeleteDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDistribution 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 *CloudFront) DeleteDistributionWithContext(ctx aws.Context, input *DeleteDistributionInput, opts ...request.Option) (*DeleteDistributionOutput, error) { - req, out := c.DeleteDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteStreamingDistribution = "DeleteStreamingDistribution2017_03_25" - -// DeleteStreamingDistributionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStreamingDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteStreamingDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteStreamingDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteStreamingDistributionRequest method. -// req, resp := client.DeleteStreamingDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistribution -func (c *CloudFront) DeleteStreamingDistributionRequest(input *DeleteStreamingDistributionInput) (req *request.Request, output *DeleteStreamingDistributionOutput) { - op := &request.Operation{ - Name: opDeleteStreamingDistribution, - HTTPMethod: "DELETE", - HTTPPath: "/2017-03-25/streaming-distribution/{Id}", - } - - if input == nil { - input = &DeleteStreamingDistributionInput{} - } - - output = &DeleteStreamingDistributionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteStreamingDistribution API operation for Amazon CloudFront. -// -// Delete a streaming distribution. To delete an RTMP distribution using the -// CloudFront API, perform the following steps. -// -// To delete an RTMP distribution using the CloudFront API: -// -// Disable the RTMP distribution. -// -// Submit a GET Streaming Distribution Config request to get the current configuration -// and the Etag header for the distribution. -// -// Update the XML document that was returned in the response to your GET Streaming -// Distribution Config request to change the value of Enabled to false. -// -// Submit a PUT Streaming Distribution Config request to update the configuration -// for your distribution. In the request body, include the XML document that -// you updated in Step 3. Then set the value of the HTTP If-Match header to -// the value of the ETag header that CloudFront returned when you submitted -// the GET Streaming Distribution Config request in Step 2. -// -// Review the response to the PUT Streaming Distribution Config request to confirm -// that the distribution was successfully disabled. -// -// Submit a GET Streaming Distribution Config request to confirm that your changes -// have propagated. When propagation is complete, the value of Status is Deployed. -// -// Submit a DELETE Streaming Distribution request. Set the value of the HTTP -// If-Match header to the value of the ETag header that CloudFront returned -// when you submitted the GET Streaming Distribution Config request in Step -// 2. -// -// Review the response to your DELETE Streaming Distribution request to confirm -// that the distribution was successfully deleted. -// -// For information about deleting a distribution using the CloudFront console, -// see Deleting a Distribution (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToDeleteDistribution.html) -// in the Amazon CloudFront Developer Guide. -// -// 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 Amazon CloudFront's -// API operation DeleteStreamingDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeStreamingDistributionNotDisabled "StreamingDistributionNotDisabled" -// -// * ErrCodeInvalidIfMatchVersion "InvalidIfMatchVersion" -// The If-Match version is missing or not valid for the distribution. -// -// * ErrCodeNoSuchStreamingDistribution "NoSuchStreamingDistribution" -// The specified streaming distribution does not exist. -// -// * ErrCodePreconditionFailed "PreconditionFailed" -// The precondition given in one or more of the request-header fields evaluated -// to false. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistribution -func (c *CloudFront) DeleteStreamingDistribution(input *DeleteStreamingDistributionInput) (*DeleteStreamingDistributionOutput, error) { - req, out := c.DeleteStreamingDistributionRequest(input) - return out, req.Send() -} - -// DeleteStreamingDistributionWithContext is the same as DeleteStreamingDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteStreamingDistribution 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 *CloudFront) DeleteStreamingDistributionWithContext(ctx aws.Context, input *DeleteStreamingDistributionInput, opts ...request.Option) (*DeleteStreamingDistributionOutput, error) { - req, out := c.DeleteStreamingDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCloudFrontOriginAccessIdentity = "GetCloudFrontOriginAccessIdentity2017_03_25" - -// GetCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the -// client's request for the GetCloudFrontOriginAccessIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetCloudFrontOriginAccessIdentity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCloudFrontOriginAccessIdentity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetCloudFrontOriginAccessIdentityRequest method. -// req, resp := client.GetCloudFrontOriginAccessIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentity -func (c *CloudFront) GetCloudFrontOriginAccessIdentityRequest(input *GetCloudFrontOriginAccessIdentityInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opGetCloudFrontOriginAccessIdentity, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}", - } - - if input == nil { - input = &GetCloudFrontOriginAccessIdentityInput{} - } - - output = &GetCloudFrontOriginAccessIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCloudFrontOriginAccessIdentity API operation for Amazon CloudFront. -// -// Get the information about an origin access identity. -// -// 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 Amazon CloudFront's -// API operation GetCloudFrontOriginAccessIdentity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchCloudFrontOriginAccessIdentity "NoSuchCloudFrontOriginAccessIdentity" -// The specified origin access identity does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentity -func (c *CloudFront) GetCloudFrontOriginAccessIdentity(input *GetCloudFrontOriginAccessIdentityInput) (*GetCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.GetCloudFrontOriginAccessIdentityRequest(input) - return out, req.Send() -} - -// GetCloudFrontOriginAccessIdentityWithContext is the same as GetCloudFrontOriginAccessIdentity with the addition of -// the ability to pass a context and additional request options. -// -// See GetCloudFrontOriginAccessIdentity 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 *CloudFront) GetCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *GetCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*GetCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.GetCloudFrontOriginAccessIdentityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCloudFrontOriginAccessIdentityConfig = "GetCloudFrontOriginAccessIdentityConfig2017_03_25" - -// GetCloudFrontOriginAccessIdentityConfigRequest generates a "aws/request.Request" representing the -// client's request for the GetCloudFrontOriginAccessIdentityConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetCloudFrontOriginAccessIdentityConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCloudFrontOriginAccessIdentityConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetCloudFrontOriginAccessIdentityConfigRequest method. -// req, resp := client.GetCloudFrontOriginAccessIdentityConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfig -func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfigRequest(input *GetCloudFrontOriginAccessIdentityConfigInput) (req *request.Request, output *GetCloudFrontOriginAccessIdentityConfigOutput) { - op := &request.Operation{ - Name: opGetCloudFrontOriginAccessIdentityConfig, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}/config", - } - - if input == nil { - input = &GetCloudFrontOriginAccessIdentityConfigInput{} - } - - output = &GetCloudFrontOriginAccessIdentityConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCloudFrontOriginAccessIdentityConfig API operation for Amazon CloudFront. -// -// Get the configuration information about an origin access identity. -// -// 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 Amazon CloudFront's -// API operation GetCloudFrontOriginAccessIdentityConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchCloudFrontOriginAccessIdentity "NoSuchCloudFrontOriginAccessIdentity" -// The specified origin access identity does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfig -func (c *CloudFront) GetCloudFrontOriginAccessIdentityConfig(input *GetCloudFrontOriginAccessIdentityConfigInput) (*GetCloudFrontOriginAccessIdentityConfigOutput, error) { - req, out := c.GetCloudFrontOriginAccessIdentityConfigRequest(input) - return out, req.Send() -} - -// GetCloudFrontOriginAccessIdentityConfigWithContext is the same as GetCloudFrontOriginAccessIdentityConfig with the addition of -// the ability to pass a context and additional request options. -// -// See GetCloudFrontOriginAccessIdentityConfig 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 *CloudFront) GetCloudFrontOriginAccessIdentityConfigWithContext(ctx aws.Context, input *GetCloudFrontOriginAccessIdentityConfigInput, opts ...request.Option) (*GetCloudFrontOriginAccessIdentityConfigOutput, error) { - req, out := c.GetCloudFrontOriginAccessIdentityConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDistribution = "GetDistribution2017_03_25" - -// GetDistributionRequest generates a "aws/request.Request" representing the -// client's request for the GetDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDistributionRequest method. -// req, resp := client.GetDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistribution -func (c *CloudFront) GetDistributionRequest(input *GetDistributionInput) (req *request.Request, output *GetDistributionOutput) { - op := &request.Operation{ - Name: opGetDistribution, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/distribution/{Id}", - } - - if input == nil { - input = &GetDistributionInput{} - } - - output = &GetDistributionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDistribution API operation for Amazon CloudFront. -// -// Get the information about a distribution. -// -// 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 Amazon CloudFront's -// API operation GetDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDistribution "NoSuchDistribution" -// The specified distribution does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistribution -func (c *CloudFront) GetDistribution(input *GetDistributionInput) (*GetDistributionOutput, error) { - req, out := c.GetDistributionRequest(input) - return out, req.Send() -} - -// GetDistributionWithContext is the same as GetDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See GetDistribution 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 *CloudFront) GetDistributionWithContext(ctx aws.Context, input *GetDistributionInput, opts ...request.Option) (*GetDistributionOutput, error) { - req, out := c.GetDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDistributionConfig = "GetDistributionConfig2017_03_25" - -// GetDistributionConfigRequest generates a "aws/request.Request" representing the -// client's request for the GetDistributionConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetDistributionConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetDistributionConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetDistributionConfigRequest method. -// req, resp := client.GetDistributionConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfig -func (c *CloudFront) GetDistributionConfigRequest(input *GetDistributionConfigInput) (req *request.Request, output *GetDistributionConfigOutput) { - op := &request.Operation{ - Name: opGetDistributionConfig, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/distribution/{Id}/config", - } - - if input == nil { - input = &GetDistributionConfigInput{} - } - - output = &GetDistributionConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDistributionConfig API operation for Amazon CloudFront. -// -// Get the configuration information about a distribution. -// -// 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 Amazon CloudFront's -// API operation GetDistributionConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDistribution "NoSuchDistribution" -// The specified distribution does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfig -func (c *CloudFront) GetDistributionConfig(input *GetDistributionConfigInput) (*GetDistributionConfigOutput, error) { - req, out := c.GetDistributionConfigRequest(input) - return out, req.Send() -} - -// GetDistributionConfigWithContext is the same as GetDistributionConfig with the addition of -// the ability to pass a context and additional request options. -// -// See GetDistributionConfig 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 *CloudFront) GetDistributionConfigWithContext(ctx aws.Context, input *GetDistributionConfigInput, opts ...request.Option) (*GetDistributionConfigOutput, error) { - req, out := c.GetDistributionConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetInvalidation = "GetInvalidation2017_03_25" - -// GetInvalidationRequest generates a "aws/request.Request" representing the -// client's request for the GetInvalidation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetInvalidation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetInvalidation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetInvalidationRequest method. -// req, resp := client.GetInvalidationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidation -func (c *CloudFront) GetInvalidationRequest(input *GetInvalidationInput) (req *request.Request, output *GetInvalidationOutput) { - op := &request.Operation{ - Name: opGetInvalidation, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/distribution/{DistributionId}/invalidation/{Id}", - } - - if input == nil { - input = &GetInvalidationInput{} - } - - output = &GetInvalidationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInvalidation API operation for Amazon CloudFront. -// -// Get the information about an invalidation. -// -// 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 Amazon CloudFront's -// API operation GetInvalidation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchInvalidation "NoSuchInvalidation" -// The specified invalidation does not exist. -// -// * ErrCodeNoSuchDistribution "NoSuchDistribution" -// The specified distribution does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidation -func (c *CloudFront) GetInvalidation(input *GetInvalidationInput) (*GetInvalidationOutput, error) { - req, out := c.GetInvalidationRequest(input) - return out, req.Send() -} - -// GetInvalidationWithContext is the same as GetInvalidation with the addition of -// the ability to pass a context and additional request options. -// -// See GetInvalidation 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 *CloudFront) GetInvalidationWithContext(ctx aws.Context, input *GetInvalidationInput, opts ...request.Option) (*GetInvalidationOutput, error) { - req, out := c.GetInvalidationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetStreamingDistribution = "GetStreamingDistribution2017_03_25" - -// GetStreamingDistributionRequest generates a "aws/request.Request" representing the -// client's request for the GetStreamingDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetStreamingDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetStreamingDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetStreamingDistributionRequest method. -// req, resp := client.GetStreamingDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistribution -func (c *CloudFront) GetStreamingDistributionRequest(input *GetStreamingDistributionInput) (req *request.Request, output *GetStreamingDistributionOutput) { - op := &request.Operation{ - Name: opGetStreamingDistribution, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/streaming-distribution/{Id}", - } - - if input == nil { - input = &GetStreamingDistributionInput{} - } - - output = &GetStreamingDistributionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStreamingDistribution API operation for Amazon CloudFront. -// -// Gets information about a specified RTMP distribution, including the distribution -// configuration. -// -// 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 Amazon CloudFront's -// API operation GetStreamingDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchStreamingDistribution "NoSuchStreamingDistribution" -// The specified streaming distribution does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistribution -func (c *CloudFront) GetStreamingDistribution(input *GetStreamingDistributionInput) (*GetStreamingDistributionOutput, error) { - req, out := c.GetStreamingDistributionRequest(input) - return out, req.Send() -} - -// GetStreamingDistributionWithContext is the same as GetStreamingDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See GetStreamingDistribution 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 *CloudFront) GetStreamingDistributionWithContext(ctx aws.Context, input *GetStreamingDistributionInput, opts ...request.Option) (*GetStreamingDistributionOutput, error) { - req, out := c.GetStreamingDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetStreamingDistributionConfig = "GetStreamingDistributionConfig2017_03_25" - -// GetStreamingDistributionConfigRequest generates a "aws/request.Request" representing the -// client's request for the GetStreamingDistributionConfig operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetStreamingDistributionConfig for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetStreamingDistributionConfig method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetStreamingDistributionConfigRequest method. -// req, resp := client.GetStreamingDistributionConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfig -func (c *CloudFront) GetStreamingDistributionConfigRequest(input *GetStreamingDistributionConfigInput) (req *request.Request, output *GetStreamingDistributionConfigOutput) { - op := &request.Operation{ - Name: opGetStreamingDistributionConfig, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/streaming-distribution/{Id}/config", - } - - if input == nil { - input = &GetStreamingDistributionConfigInput{} - } - - output = &GetStreamingDistributionConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStreamingDistributionConfig API operation for Amazon CloudFront. -// -// Get the configuration information about a streaming distribution. -// -// 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 Amazon CloudFront's -// API operation GetStreamingDistributionConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchStreamingDistribution "NoSuchStreamingDistribution" -// The specified streaming distribution does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfig -func (c *CloudFront) GetStreamingDistributionConfig(input *GetStreamingDistributionConfigInput) (*GetStreamingDistributionConfigOutput, error) { - req, out := c.GetStreamingDistributionConfigRequest(input) - return out, req.Send() -} - -// GetStreamingDistributionConfigWithContext is the same as GetStreamingDistributionConfig with the addition of -// the ability to pass a context and additional request options. -// -// See GetStreamingDistributionConfig 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 *CloudFront) GetStreamingDistributionConfigWithContext(ctx aws.Context, input *GetStreamingDistributionConfigInput, opts ...request.Option) (*GetStreamingDistributionConfigOutput, error) { - req, out := c.GetStreamingDistributionConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCloudFrontOriginAccessIdentities = "ListCloudFrontOriginAccessIdentities2017_03_25" - -// ListCloudFrontOriginAccessIdentitiesRequest generates a "aws/request.Request" representing the -// client's request for the ListCloudFrontOriginAccessIdentities operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListCloudFrontOriginAccessIdentities for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListCloudFrontOriginAccessIdentities method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListCloudFrontOriginAccessIdentitiesRequest method. -// req, resp := client.ListCloudFrontOriginAccessIdentitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentities -func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesRequest(input *ListCloudFrontOriginAccessIdentitiesInput) (req *request.Request, output *ListCloudFrontOriginAccessIdentitiesOutput) { - op := &request.Operation{ - Name: opListCloudFrontOriginAccessIdentities, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/origin-access-identity/cloudfront", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"CloudFrontOriginAccessIdentityList.NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "CloudFrontOriginAccessIdentityList.IsTruncated", - }, - } - - if input == nil { - input = &ListCloudFrontOriginAccessIdentitiesInput{} - } - - output = &ListCloudFrontOriginAccessIdentitiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCloudFrontOriginAccessIdentities API operation for Amazon CloudFront. -// -// Lists origin access identities. -// -// 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 Amazon CloudFront's -// API operation ListCloudFrontOriginAccessIdentities for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentities -func (c *CloudFront) ListCloudFrontOriginAccessIdentities(input *ListCloudFrontOriginAccessIdentitiesInput) (*ListCloudFrontOriginAccessIdentitiesOutput, error) { - req, out := c.ListCloudFrontOriginAccessIdentitiesRequest(input) - return out, req.Send() -} - -// ListCloudFrontOriginAccessIdentitiesWithContext is the same as ListCloudFrontOriginAccessIdentities with the addition of -// the ability to pass a context and additional request options. -// -// See ListCloudFrontOriginAccessIdentities 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 *CloudFront) ListCloudFrontOriginAccessIdentitiesWithContext(ctx aws.Context, input *ListCloudFrontOriginAccessIdentitiesInput, opts ...request.Option) (*ListCloudFrontOriginAccessIdentitiesOutput, error) { - req, out := c.ListCloudFrontOriginAccessIdentitiesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCloudFrontOriginAccessIdentitiesPages iterates over the pages of a ListCloudFrontOriginAccessIdentities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCloudFrontOriginAccessIdentities method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCloudFrontOriginAccessIdentities operation. -// pageNum := 0 -// err := client.ListCloudFrontOriginAccessIdentitiesPages(params, -// func(page *ListCloudFrontOriginAccessIdentitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPages(input *ListCloudFrontOriginAccessIdentitiesInput, fn func(*ListCloudFrontOriginAccessIdentitiesOutput, bool) bool) error { - return c.ListCloudFrontOriginAccessIdentitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCloudFrontOriginAccessIdentitiesPagesWithContext same as ListCloudFrontOriginAccessIdentitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CloudFront) ListCloudFrontOriginAccessIdentitiesPagesWithContext(ctx aws.Context, input *ListCloudFrontOriginAccessIdentitiesInput, fn func(*ListCloudFrontOriginAccessIdentitiesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCloudFrontOriginAccessIdentitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCloudFrontOriginAccessIdentitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCloudFrontOriginAccessIdentitiesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListDistributions = "ListDistributions2017_03_25" - -// ListDistributionsRequest generates a "aws/request.Request" representing the -// client's request for the ListDistributions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDistributions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDistributions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDistributionsRequest method. -// req, resp := client.ListDistributionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributions -func (c *CloudFront) ListDistributionsRequest(input *ListDistributionsInput) (req *request.Request, output *ListDistributionsOutput) { - op := &request.Operation{ - Name: opListDistributions, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/distribution", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"DistributionList.NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "DistributionList.IsTruncated", - }, - } - - if input == nil { - input = &ListDistributionsInput{} - } - - output = &ListDistributionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDistributions API operation for Amazon CloudFront. -// -// List distributions. -// -// 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 Amazon CloudFront's -// API operation ListDistributions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributions -func (c *CloudFront) ListDistributions(input *ListDistributionsInput) (*ListDistributionsOutput, error) { - req, out := c.ListDistributionsRequest(input) - return out, req.Send() -} - -// ListDistributionsWithContext is the same as ListDistributions with the addition of -// the ability to pass a context and additional request options. -// -// See ListDistributions 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 *CloudFront) ListDistributionsWithContext(ctx aws.Context, input *ListDistributionsInput, opts ...request.Option) (*ListDistributionsOutput, error) { - req, out := c.ListDistributionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDistributionsPages iterates over the pages of a ListDistributions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDistributions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDistributions operation. -// pageNum := 0 -// err := client.ListDistributionsPages(params, -// func(page *ListDistributionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListDistributionsPages(input *ListDistributionsInput, fn func(*ListDistributionsOutput, bool) bool) error { - return c.ListDistributionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDistributionsPagesWithContext same as ListDistributionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CloudFront) ListDistributionsPagesWithContext(ctx aws.Context, input *ListDistributionsInput, fn func(*ListDistributionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDistributionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDistributionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDistributionsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListDistributionsByWebACLId = "ListDistributionsByWebACLId2017_03_25" - -// ListDistributionsByWebACLIdRequest generates a "aws/request.Request" representing the -// client's request for the ListDistributionsByWebACLId operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDistributionsByWebACLId for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDistributionsByWebACLId method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDistributionsByWebACLIdRequest method. -// req, resp := client.ListDistributionsByWebACLIdRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLId -func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributionsByWebACLIdInput) (req *request.Request, output *ListDistributionsByWebACLIdOutput) { - op := &request.Operation{ - Name: opListDistributionsByWebACLId, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/distributionsByWebACLId/{WebACLId}", - } - - if input == nil { - input = &ListDistributionsByWebACLIdInput{} - } - - output = &ListDistributionsByWebACLIdOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDistributionsByWebACLId API operation for Amazon CloudFront. -// -// List the distributions that are associated with a specified AWS WAF web ACL. -// -// 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 Amazon CloudFront's -// API operation ListDistributionsByWebACLId for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidWebACLId "InvalidWebACLId" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLId -func (c *CloudFront) ListDistributionsByWebACLId(input *ListDistributionsByWebACLIdInput) (*ListDistributionsByWebACLIdOutput, error) { - req, out := c.ListDistributionsByWebACLIdRequest(input) - return out, req.Send() -} - -// ListDistributionsByWebACLIdWithContext is the same as ListDistributionsByWebACLId with the addition of -// the ability to pass a context and additional request options. -// -// See ListDistributionsByWebACLId 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 *CloudFront) ListDistributionsByWebACLIdWithContext(ctx aws.Context, input *ListDistributionsByWebACLIdInput, opts ...request.Option) (*ListDistributionsByWebACLIdOutput, error) { - req, out := c.ListDistributionsByWebACLIdRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListInvalidations = "ListInvalidations2017_03_25" - -// ListInvalidationsRequest generates a "aws/request.Request" representing the -// client's request for the ListInvalidations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListInvalidations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListInvalidations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListInvalidationsRequest method. -// req, resp := client.ListInvalidationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidations -func (c *CloudFront) ListInvalidationsRequest(input *ListInvalidationsInput) (req *request.Request, output *ListInvalidationsOutput) { - op := &request.Operation{ - Name: opListInvalidations, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/distribution/{DistributionId}/invalidation", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"InvalidationList.NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "InvalidationList.IsTruncated", - }, - } - - if input == nil { - input = &ListInvalidationsInput{} - } - - output = &ListInvalidationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInvalidations API operation for Amazon CloudFront. -// -// Lists invalidation batches. -// -// 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 Amazon CloudFront's -// API operation ListInvalidations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeNoSuchDistribution "NoSuchDistribution" -// The specified distribution does not exist. -// -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidations -func (c *CloudFront) ListInvalidations(input *ListInvalidationsInput) (*ListInvalidationsOutput, error) { - req, out := c.ListInvalidationsRequest(input) - return out, req.Send() -} - -// ListInvalidationsWithContext is the same as ListInvalidations with the addition of -// the ability to pass a context and additional request options. -// -// See ListInvalidations 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 *CloudFront) ListInvalidationsWithContext(ctx aws.Context, input *ListInvalidationsInput, opts ...request.Option) (*ListInvalidationsOutput, error) { - req, out := c.ListInvalidationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListInvalidationsPages iterates over the pages of a ListInvalidations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInvalidations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListInvalidations operation. -// pageNum := 0 -// err := client.ListInvalidationsPages(params, -// func(page *ListInvalidationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListInvalidationsPages(input *ListInvalidationsInput, fn func(*ListInvalidationsOutput, bool) bool) error { - return c.ListInvalidationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInvalidationsPagesWithContext same as ListInvalidationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CloudFront) ListInvalidationsPagesWithContext(ctx aws.Context, input *ListInvalidationsInput, fn func(*ListInvalidationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListInvalidationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListInvalidationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInvalidationsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListStreamingDistributions = "ListStreamingDistributions2017_03_25" - -// ListStreamingDistributionsRequest generates a "aws/request.Request" representing the -// client's request for the ListStreamingDistributions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListStreamingDistributions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListStreamingDistributions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListStreamingDistributionsRequest method. -// req, resp := client.ListStreamingDistributionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributions -func (c *CloudFront) ListStreamingDistributionsRequest(input *ListStreamingDistributionsInput) (req *request.Request, output *ListStreamingDistributionsOutput) { - op := &request.Operation{ - Name: opListStreamingDistributions, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/streaming-distribution", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"StreamingDistributionList.NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "StreamingDistributionList.IsTruncated", - }, - } - - if input == nil { - input = &ListStreamingDistributionsInput{} - } - - output = &ListStreamingDistributionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStreamingDistributions API operation for Amazon CloudFront. -// -// List streaming distributions. -// -// 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 Amazon CloudFront's -// API operation ListStreamingDistributions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributions -func (c *CloudFront) ListStreamingDistributions(input *ListStreamingDistributionsInput) (*ListStreamingDistributionsOutput, error) { - req, out := c.ListStreamingDistributionsRequest(input) - return out, req.Send() -} - -// ListStreamingDistributionsWithContext is the same as ListStreamingDistributions with the addition of -// the ability to pass a context and additional request options. -// -// See ListStreamingDistributions 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 *CloudFront) ListStreamingDistributionsWithContext(ctx aws.Context, input *ListStreamingDistributionsInput, opts ...request.Option) (*ListStreamingDistributionsOutput, error) { - req, out := c.ListStreamingDistributionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListStreamingDistributionsPages iterates over the pages of a ListStreamingDistributions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStreamingDistributions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListStreamingDistributions operation. -// pageNum := 0 -// err := client.ListStreamingDistributionsPages(params, -// func(page *ListStreamingDistributionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CloudFront) ListStreamingDistributionsPages(input *ListStreamingDistributionsInput, fn func(*ListStreamingDistributionsOutput, bool) bool) error { - return c.ListStreamingDistributionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStreamingDistributionsPagesWithContext same as ListStreamingDistributionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CloudFront) ListStreamingDistributionsPagesWithContext(ctx aws.Context, input *ListStreamingDistributionsInput, fn func(*ListStreamingDistributionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListStreamingDistributionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListStreamingDistributionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamingDistributionsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource2017_03_25" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsForResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsForResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResource -func (c *CloudFront) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/2017-03-25/tagging", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon CloudFront. -// -// List tags for a CloudFront resource. -// -// 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 Amazon CloudFront's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidTagging "InvalidTagging" -// -// * ErrCodeNoSuchResource "NoSuchResource" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResource -func (c *CloudFront) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *CloudFront) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource2017_03_25" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TagResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TagResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResource -func (c *CloudFront) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/tagging?Operation=Tag", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon CloudFront. -// -// Add tags to a CloudFront resource. -// -// 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 Amazon CloudFront's -// API operation TagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidTagging "InvalidTagging" -// -// * ErrCodeNoSuchResource "NoSuchResource" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResource -func (c *CloudFront) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *CloudFront) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource2017_03_25" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UntagResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UntagResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResource -func (c *CloudFront) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/2017-03-25/tagging?Operation=Untag", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon CloudFront. -// -// Remove tags from a CloudFront resource. -// -// 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 Amazon CloudFront's -// API operation UntagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidTagging "InvalidTagging" -// -// * ErrCodeNoSuchResource "NoSuchResource" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResource -func (c *CloudFront) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *CloudFront) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCloudFrontOriginAccessIdentity = "UpdateCloudFrontOriginAccessIdentity2017_03_25" - -// UpdateCloudFrontOriginAccessIdentityRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCloudFrontOriginAccessIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateCloudFrontOriginAccessIdentity for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateCloudFrontOriginAccessIdentity method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateCloudFrontOriginAccessIdentityRequest method. -// req, resp := client.UpdateCloudFrontOriginAccessIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentity -func (c *CloudFront) UpdateCloudFrontOriginAccessIdentityRequest(input *UpdateCloudFrontOriginAccessIdentityInput) (req *request.Request, output *UpdateCloudFrontOriginAccessIdentityOutput) { - op := &request.Operation{ - Name: opUpdateCloudFrontOriginAccessIdentity, - HTTPMethod: "PUT", - HTTPPath: "/2017-03-25/origin-access-identity/cloudfront/{Id}/config", - } - - if input == nil { - input = &UpdateCloudFrontOriginAccessIdentityInput{} - } - - output = &UpdateCloudFrontOriginAccessIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCloudFrontOriginAccessIdentity API operation for Amazon CloudFront. -// -// Update an origin access identity. -// -// 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 Amazon CloudFront's -// API operation UpdateCloudFrontOriginAccessIdentity for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeIllegalUpdate "IllegalUpdate" -// Origin and CallerReference cannot be updated. -// -// * ErrCodeInvalidIfMatchVersion "InvalidIfMatchVersion" -// The If-Match version is missing or not valid for the distribution. -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeNoSuchCloudFrontOriginAccessIdentity "NoSuchCloudFrontOriginAccessIdentity" -// The specified origin access identity does not exist. -// -// * ErrCodePreconditionFailed "PreconditionFailed" -// The precondition given in one or more of the request-header fields evaluated -// to false. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentity -func (c *CloudFront) UpdateCloudFrontOriginAccessIdentity(input *UpdateCloudFrontOriginAccessIdentityInput) (*UpdateCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.UpdateCloudFrontOriginAccessIdentityRequest(input) - return out, req.Send() -} - -// UpdateCloudFrontOriginAccessIdentityWithContext is the same as UpdateCloudFrontOriginAccessIdentity with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCloudFrontOriginAccessIdentity 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 *CloudFront) UpdateCloudFrontOriginAccessIdentityWithContext(ctx aws.Context, input *UpdateCloudFrontOriginAccessIdentityInput, opts ...request.Option) (*UpdateCloudFrontOriginAccessIdentityOutput, error) { - req, out := c.UpdateCloudFrontOriginAccessIdentityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDistribution = "UpdateDistribution2017_03_25" - -// UpdateDistributionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateDistributionRequest method. -// req, resp := client.UpdateDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistribution -func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) (req *request.Request, output *UpdateDistributionOutput) { - op := &request.Operation{ - Name: opUpdateDistribution, - HTTPMethod: "PUT", - HTTPPath: "/2017-03-25/distribution/{Id}/config", - } - - if input == nil { - input = &UpdateDistributionInput{} - } - - output = &UpdateDistributionOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDistribution API operation for Amazon CloudFront. -// -// Update a distribution. -// -// 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 Amazon CloudFront's -// API operation UpdateDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists" -// -// * ErrCodeIllegalUpdate "IllegalUpdate" -// Origin and CallerReference cannot be updated. -// -// * ErrCodeInvalidIfMatchVersion "InvalidIfMatchVersion" -// The If-Match version is missing or not valid for the distribution. -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeNoSuchDistribution "NoSuchDistribution" -// The specified distribution does not exist. -// -// * ErrCodePreconditionFailed "PreconditionFailed" -// The precondition given in one or more of the request-header fields evaluated -// to false. -// -// * ErrCodeTooManyDistributionCNAMEs "TooManyDistributionCNAMEs" -// Your request contains more CNAMEs than are allowed per distribution. -// -// * ErrCodeInvalidDefaultRootObject "InvalidDefaultRootObject" -// The default root object file name is too big or contains an invalid character. -// -// * ErrCodeInvalidRelativePath "InvalidRelativePath" -// The relative path is too big, is not URL-encoded, or does not begin with -// a slash (/). -// -// * ErrCodeInvalidErrorCode "InvalidErrorCode" -// -// * ErrCodeInvalidResponseCode "InvalidResponseCode" -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity" -// The origin access identity is not valid or doesn't exist. -// -// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners" -// Your request contains more trusted signers than are allowed per distribution. -// -// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist" -// One or more of your trusted signers do not exist. -// -// * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate" -// -// * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion" -// -// * ErrCodeInvalidRequiredProtocol "InvalidRequiredProtocol" -// This operation requires the HTTPS protocol. Ensure that you specify the HTTPS -// protocol in your request, or omit the RequiredProtocols element from your -// distribution configuration. -// -// * ErrCodeNoSuchOrigin "NoSuchOrigin" -// No origin exists with the specified Origin Id. -// -// * ErrCodeTooManyOrigins "TooManyOrigins" -// You cannot create more origins for the distribution. -// -// * ErrCodeTooManyCacheBehaviors "TooManyCacheBehaviors" -// You cannot create more cache behaviors for the distribution. -// -// * ErrCodeTooManyCookieNamesInWhiteList "TooManyCookieNamesInWhiteList" -// Your request contains more cookie names in the whitelist than are allowed -// per cache behavior. -// -// * ErrCodeInvalidForwardCookies "InvalidForwardCookies" -// Your request contains forward cookies option which doesn't match with the -// expectation for the whitelisted list of cookie names. Either list of cookie -// names has been specified when not allowed or list of cookie names is missing -// when expected. -// -// * ErrCodeTooManyHeadersInForwardedValues "TooManyHeadersInForwardedValues" -// -// * ErrCodeInvalidHeadersForS3Origin "InvalidHeadersForS3Origin" -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// * ErrCodeTooManyCertificates "TooManyCertificates" -// You cannot create anymore custom SSL/TLS certificates. -// -// * ErrCodeInvalidLocationCode "InvalidLocationCode" -// -// * ErrCodeInvalidGeoRestrictionParameter "InvalidGeoRestrictionParameter" -// -// * ErrCodeInvalidTTLOrder "InvalidTTLOrder" -// -// * ErrCodeInvalidWebACLId "InvalidWebACLId" -// -// * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders" -// -// * ErrCodeTooManyQueryStringParameters "TooManyQueryStringParameters" -// -// * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters" -// -// * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations" -// Processing your request would cause the maximum number of distributions with -// Lambda function associations per owner to be exceeded. -// -// * ErrCodeTooManyLambdaFunctionAssociations "TooManyLambdaFunctionAssociations" -// Your request contains more Lambda function associations than are allowed -// per distribution. -// -// * ErrCodeInvalidLambdaFunctionAssociation "InvalidLambdaFunctionAssociation" -// The specified Lambda function association is invalid. -// -// * ErrCodeInvalidOriginReadTimeout "InvalidOriginReadTimeout" -// -// * ErrCodeInvalidOriginKeepaliveTimeout "InvalidOriginKeepaliveTimeout" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistribution -func (c *CloudFront) UpdateDistribution(input *UpdateDistributionInput) (*UpdateDistributionOutput, error) { - req, out := c.UpdateDistributionRequest(input) - return out, req.Send() -} - -// UpdateDistributionWithContext is the same as UpdateDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDistribution 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 *CloudFront) UpdateDistributionWithContext(ctx aws.Context, input *UpdateDistributionInput, opts ...request.Option) (*UpdateDistributionOutput, error) { - req, out := c.UpdateDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateStreamingDistribution = "UpdateStreamingDistribution2017_03_25" - -// UpdateStreamingDistributionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStreamingDistribution operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateStreamingDistribution for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateStreamingDistribution method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateStreamingDistributionRequest method. -// req, resp := client.UpdateStreamingDistributionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistribution -func (c *CloudFront) UpdateStreamingDistributionRequest(input *UpdateStreamingDistributionInput) (req *request.Request, output *UpdateStreamingDistributionOutput) { - op := &request.Operation{ - Name: opUpdateStreamingDistribution, - HTTPMethod: "PUT", - HTTPPath: "/2017-03-25/streaming-distribution/{Id}/config", - } - - if input == nil { - input = &UpdateStreamingDistributionInput{} - } - - output = &UpdateStreamingDistributionOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateStreamingDistribution API operation for Amazon CloudFront. -// -// Update a streaming distribution. -// -// 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 Amazon CloudFront's -// API operation UpdateStreamingDistribution for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDenied "AccessDenied" -// Access denied. -// -// * ErrCodeCNAMEAlreadyExists "CNAMEAlreadyExists" -// -// * ErrCodeIllegalUpdate "IllegalUpdate" -// Origin and CallerReference cannot be updated. -// -// * ErrCodeInvalidIfMatchVersion "InvalidIfMatchVersion" -// The If-Match version is missing or not valid for the distribution. -// -// * ErrCodeMissingBody "MissingBody" -// This operation requires a body. Ensure that the body is present and the Content-Type -// header is set. -// -// * ErrCodeNoSuchStreamingDistribution "NoSuchStreamingDistribution" -// The specified streaming distribution does not exist. -// -// * ErrCodePreconditionFailed "PreconditionFailed" -// The precondition given in one or more of the request-header fields evaluated -// to false. -// -// * ErrCodeTooManyStreamingDistributionCNAMEs "TooManyStreamingDistributionCNAMEs" -// -// * ErrCodeInvalidArgument "InvalidArgument" -// The argument is invalid. -// -// * ErrCodeInvalidOriginAccessIdentity "InvalidOriginAccessIdentity" -// The origin access identity is not valid or doesn't exist. -// -// * ErrCodeTooManyTrustedSigners "TooManyTrustedSigners" -// Your request contains more trusted signers than are allowed per distribution. -// -// * ErrCodeTrustedSignerDoesNotExist "TrustedSignerDoesNotExist" -// One or more of your trusted signers do not exist. -// -// * ErrCodeInconsistentQuantities "InconsistentQuantities" -// The value of Quantity and the size of Items do not match. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistribution -func (c *CloudFront) UpdateStreamingDistribution(input *UpdateStreamingDistributionInput) (*UpdateStreamingDistributionOutput, error) { - req, out := c.UpdateStreamingDistributionRequest(input) - return out, req.Send() -} - -// UpdateStreamingDistributionWithContext is the same as UpdateStreamingDistribution with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateStreamingDistribution 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 *CloudFront) UpdateStreamingDistributionWithContext(ctx aws.Context, input *UpdateStreamingDistributionInput, opts ...request.Option) (*UpdateStreamingDistributionOutput, error) { - req, out := c.UpdateStreamingDistributionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// A complex type that lists the AWS accounts, if any, that you included in -// the TrustedSigners complex type for this distribution. These are the accounts -// that you want to allow to create signed URLs for private content. -// -// The Signer complex type lists the AWS account number of the trusted signer -// or self if the signer is the AWS account that created the distribution. The -// Signer element also includes the IDs of any active CloudFront key pairs that -// are associated with the trusted signer's AWS account. If no KeyPairId element -// appears for a Signer, that signer can't create signed URLs. -// -// For more information, see Serving Private Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ActiveTrustedSigners -type ActiveTrustedSigners struct { - _ struct{} `type:"structure"` - - // Enabled is true if any of the AWS accounts listed in the TrustedSigners complex - // type for this RTMP distribution have active CloudFront key pairs. If not, - // Enabled is false. - // - // For more information, see ActiveTrustedSigners. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // A complex type that contains one Signer complex type for each trusted signer - // that is specified in the TrustedSigners complex type. - // - // For more information, see ActiveTrustedSigners. - Items []*Signer `locationNameList:"Signer" type:"list"` - - // A complex type that contains one Signer complex type for each trusted signer - // specified in the TrustedSigners complex type. - // - // For more information, see ActiveTrustedSigners. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s ActiveTrustedSigners) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActiveTrustedSigners) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *ActiveTrustedSigners) SetEnabled(v bool) *ActiveTrustedSigners { - s.Enabled = &v - return s -} - -// SetItems sets the Items field's value. -func (s *ActiveTrustedSigners) SetItems(v []*Signer) *ActiveTrustedSigners { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *ActiveTrustedSigners) SetQuantity(v int64) *ActiveTrustedSigners { - s.Quantity = &v - return s -} - -// A complex type that contains information about CNAMEs (alternate domain names), -// if any, for this distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Aliases -type Aliases struct { - _ struct{} `type:"structure"` - - // A complex type that contains the CNAME aliases, if any, that you want to - // associate with this distribution. - Items []*string `locationNameList:"CNAME" type:"list"` - - // The number of CNAME aliases, if any, that you want to associate with this - // distribution. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s Aliases) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Aliases) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Aliases) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Aliases"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *Aliases) SetItems(v []*string) *Aliases { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *Aliases) SetQuantity(v int64) *Aliases { - s.Quantity = &v - return s -} - -// A complex type that controls which HTTP methods CloudFront processes and -// forwards to your Amazon S3 bucket or your custom origin. There are three -// choices: -// -// * CloudFront forwards only GET and HEAD requests. -// -// * CloudFront forwards only GET, HEAD, and OPTIONS requests. -// -// * CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE -// requests. -// -// If you pick the third choice, you may need to restrict access to your Amazon -// S3 bucket or to your custom origin so users can't perform operations that -// you don't want them to. For example, you might not want users to have permissions -// to delete objects from your origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/AllowedMethods -type AllowedMethods struct { - _ struct{} `type:"structure"` - - // A complex type that controls whether CloudFront caches the response to requests - // using the specified HTTP methods. There are two choices: - // - // * CloudFront caches responses to GET and HEAD requests. - // - // * CloudFront caches responses to GET, HEAD, and OPTIONS requests. - // - // If you pick the second choice for your Amazon S3 Origin, you may need to - // forward Access-Control-Request-Method, Access-Control-Request-Headers, and - // Origin headers for the responses to be cached correctly. - CachedMethods *CachedMethods `type:"structure"` - - // A complex type that contains the HTTP methods that you want CloudFront to - // process and forward to your origin. - // - // Items is a required field - Items []*string `locationNameList:"Method" type:"list" required:"true"` - - // The number of HTTP methods that you want CloudFront to forward to your origin. - // Valid values are 2 (for GET and HEAD requests), 3 (for GET, HEAD, and OPTIONS - // requests) and 7 (for GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE requests). - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s AllowedMethods) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllowedMethods) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AllowedMethods) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AllowedMethods"} - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - if s.CachedMethods != nil { - if err := s.CachedMethods.Validate(); err != nil { - invalidParams.AddNested("CachedMethods", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCachedMethods sets the CachedMethods field's value. -func (s *AllowedMethods) SetCachedMethods(v *CachedMethods) *AllowedMethods { - s.CachedMethods = v - return s -} - -// SetItems sets the Items field's value. -func (s *AllowedMethods) SetItems(v []*string) *AllowedMethods { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *AllowedMethods) SetQuantity(v int64) *AllowedMethods { - s.Quantity = &v - return s -} - -// A complex type that describes how CloudFront processes requests. -// -// You must create at least as many cache behaviors (including the default cache -// behavior) as you have origins if you want CloudFront to distribute objects -// from all of the origins. Each cache behavior specifies the one origin from -// which you want CloudFront to get objects. If you have two origins and only -// the default cache behavior, the default cache behavior will cause CloudFront -// to get objects from one of the origins, but the other origin is never used. -// -// For the current limit on the number of cache behaviors that you can add to -// a distribution, see Amazon CloudFront Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_cloudfront) -// in the AWS General Reference. -// -// If you don't want to specify any cache behaviors, include only an empty CacheBehaviors -// element. Don't include an empty CacheBehavior element, or CloudFront returns -// a MalformedXML error. -// -// To delete all cache behaviors in an existing distribution, update the distribution -// configuration and include only an empty CacheBehaviors element. -// -// To add, change, or remove one or more cache behaviors, update the distribution -// configuration and specify all of the cache behaviors that you want to include -// in the updated distribution. -// -// For more information about cache behaviors, see Cache Behaviors (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesCacheBehavior) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CacheBehavior -type CacheBehavior struct { - _ struct{} `type:"structure"` - - // A complex type that controls which HTTP methods CloudFront processes and - // forwards to your Amazon S3 bucket or your custom origin. There are three - // choices: - // - // * CloudFront forwards only GET and HEAD requests. - // - // * CloudFront forwards only GET, HEAD, and OPTIONS requests. - // - // * CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE - // requests. - // - // If you pick the third choice, you may need to restrict access to your Amazon - // S3 bucket or to your custom origin so users can't perform operations that - // you don't want them to. For example, you might not want users to have permissions - // to delete objects from your origin. - AllowedMethods *AllowedMethods `type:"structure"` - - // Whether you want CloudFront to automatically compress certain files for this - // cache behavior. If so, specify true; if not, specify false. For more information, - // see Serving Compressed Files (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) - // in the Amazon CloudFront Developer Guide. - Compress *bool `type:"boolean"` - - // The default amount of time that you want objects to stay in CloudFront caches - // before CloudFront forwards another request to your origin to determine whether - // the object has been updated. The value that you specify applies only when - // your origin does not add HTTP headers such as Cache-Control max-age, Cache-Control - // s-maxage, and Expires to objects. For more information, see Specifying How - // Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) - // in the Amazon CloudFront Developer Guide. - DefaultTTL *int64 `type:"long"` - - // A complex type that specifies how CloudFront handles query strings and cookies. - // - // ForwardedValues is a required field - ForwardedValues *ForwardedValues `type:"structure" required:"true"` - - // A complex type that contains zero or more Lambda function associations for - // a cache behavior. - LambdaFunctionAssociations *LambdaFunctionAssociations `type:"structure"` - - // The maximum amount of time that you want objects to stay in CloudFront caches - // before CloudFront forwards another request to your origin to determine whether - // the object has been updated. The value that you specify applies only when - // your origin adds HTTP headers such as Cache-Control max-age, Cache-Control - // s-maxage, and Expires to objects. For more information, see Specifying How - // Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) - // in the Amazon CloudFront Developer Guide. - MaxTTL *int64 `type:"long"` - - // The minimum amount of time that you want objects to stay in CloudFront caches - // before CloudFront forwards another request to your origin to determine whether - // the object has been updated. For more information, see Specifying How Long - // Objects and Errors Stay in a CloudFront Edge Cache (Expiration) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) - // in the Amazon Amazon CloudFront Developer Guide. - // - // You must specify 0 for MinTTL if you configure CloudFront to forward all - // headers to your origin (under Headers, if you specify 1 for Quantity and - // * for Name). - // - // MinTTL is a required field - MinTTL *int64 `type:"long" required:"true"` - - // The pattern (for example, images/*.jpg) that specifies which requests to - // apply the behavior to. When CloudFront receives a viewer request, the requested - // path is compared with path patterns in the order in which cache behaviors - // are listed in the distribution. - // - // You can optionally include a slash (/) at the beginning of the path pattern. - // For example, /images/*.jpg. CloudFront behavior is the same with or without - // the leading /. - // - // The path pattern for the default cache behavior is * and cannot be changed. - // If the request for an object does not match the path pattern for any cache - // behaviors, CloudFront applies the behavior in the default cache behavior. - // - // For more information, see Path Pattern (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern) - // in the Amazon CloudFront Developer Guide. - // - // PathPattern is a required field - PathPattern *string `type:"string" required:"true"` - - // Indicates whether you want to distribute media files in the Microsoft Smooth - // Streaming format using the origin that is associated with this cache behavior. - // If so, specify true; if not, specify false. If you specify true for SmoothStreaming, - // you can still distribute other content using this cache behavior if the content - // matches the value of PathPattern. - SmoothStreaming *bool `type:"boolean"` - - // The value of ID for the origin that you want CloudFront to route requests - // to when a request matches the path pattern either for a cache behavior or - // for the default cache behavior. - // - // TargetOriginId is a required field - TargetOriginId *string `type:"string" required:"true"` - - // A complex type that specifies the AWS accounts, if any, that you want to - // allow to create signed URLs for private content. - // - // If you want to require signed URLs in requests for objects in the target - // origin that match the PathPattern for this cache behavior, specify true for - // Enabled, and specify the applicable values for Quantity and Items. For more - // information, see Serving Private Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) - // in the Amazon Amazon CloudFront Developer Guide. - // - // If you don't want to require signed URLs in requests for objects that match - // PathPattern, specify false for Enabled and 0 for Quantity. Omit Items. - // - // To add, change, or remove one or more trusted signers, change Enabled to - // true (if it's currently false), change Quantity as applicable, and specify - // all of the trusted signers that you want to include in the updated distribution. - // - // TrustedSigners is a required field - TrustedSigners *TrustedSigners `type:"structure" required:"true"` - - // The protocol that viewers can use to access the files in the origin specified - // by TargetOriginId when a request matches the path pattern in PathPattern. - // You can specify the following options: - // - // * allow-all: Viewers can use HTTP or HTTPS. - // - // * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns - // an HTTP status code of 301 (Moved Permanently) to the viewer along with - // the HTTPS URL. The viewer then resubmits the request using the new URL. - // - // - // * https-only: If a viewer sends an HTTP request, CloudFront returns an - // HTTP status code of 403 (Forbidden). - // - // For more information about requiring the HTTPS protocol, see Using an HTTPS - // Connection to Access Your Objects (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html) - // in the Amazon CloudFront Developer Guide. - // - // The only way to guarantee that viewers retrieve an object that was fetched - // from the origin using HTTPS is never to use any other protocol to fetch the - // object. If you have recently changed from HTTP to HTTPS, we recommend that - // you clear your objects' cache because cached objects are protocol agnostic. - // That means that an edge location will return an object from the cache regardless - // of whether the current request protocol matches the protocol used previously. - // For more information, see Specifying How Long Objects and Errors Stay in - // a CloudFront Edge Cache (Expiration) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) - // in the Amazon CloudFront Developer Guide. - // - // ViewerProtocolPolicy is a required field - ViewerProtocolPolicy *string `type:"string" required:"true" enum:"ViewerProtocolPolicy"` -} - -// String returns the string representation -func (s CacheBehavior) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheBehavior) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CacheBehavior) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CacheBehavior"} - if s.ForwardedValues == nil { - invalidParams.Add(request.NewErrParamRequired("ForwardedValues")) - } - if s.MinTTL == nil { - invalidParams.Add(request.NewErrParamRequired("MinTTL")) - } - if s.PathPattern == nil { - invalidParams.Add(request.NewErrParamRequired("PathPattern")) - } - if s.TargetOriginId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetOriginId")) - } - if s.TrustedSigners == nil { - invalidParams.Add(request.NewErrParamRequired("TrustedSigners")) - } - if s.ViewerProtocolPolicy == nil { - invalidParams.Add(request.NewErrParamRequired("ViewerProtocolPolicy")) - } - if s.AllowedMethods != nil { - if err := s.AllowedMethods.Validate(); err != nil { - invalidParams.AddNested("AllowedMethods", err.(request.ErrInvalidParams)) - } - } - if s.ForwardedValues != nil { - if err := s.ForwardedValues.Validate(); err != nil { - invalidParams.AddNested("ForwardedValues", err.(request.ErrInvalidParams)) - } - } - if s.LambdaFunctionAssociations != nil { - if err := s.LambdaFunctionAssociations.Validate(); err != nil { - invalidParams.AddNested("LambdaFunctionAssociations", err.(request.ErrInvalidParams)) - } - } - if s.TrustedSigners != nil { - if err := s.TrustedSigners.Validate(); err != nil { - invalidParams.AddNested("TrustedSigners", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedMethods sets the AllowedMethods field's value. -func (s *CacheBehavior) SetAllowedMethods(v *AllowedMethods) *CacheBehavior { - s.AllowedMethods = v - return s -} - -// SetCompress sets the Compress field's value. -func (s *CacheBehavior) SetCompress(v bool) *CacheBehavior { - s.Compress = &v - return s -} - -// SetDefaultTTL sets the DefaultTTL field's value. -func (s *CacheBehavior) SetDefaultTTL(v int64) *CacheBehavior { - s.DefaultTTL = &v - return s -} - -// SetForwardedValues sets the ForwardedValues field's value. -func (s *CacheBehavior) SetForwardedValues(v *ForwardedValues) *CacheBehavior { - s.ForwardedValues = v - return s -} - -// SetLambdaFunctionAssociations sets the LambdaFunctionAssociations field's value. -func (s *CacheBehavior) SetLambdaFunctionAssociations(v *LambdaFunctionAssociations) *CacheBehavior { - s.LambdaFunctionAssociations = v - return s -} - -// SetMaxTTL sets the MaxTTL field's value. -func (s *CacheBehavior) SetMaxTTL(v int64) *CacheBehavior { - s.MaxTTL = &v - return s -} - -// SetMinTTL sets the MinTTL field's value. -func (s *CacheBehavior) SetMinTTL(v int64) *CacheBehavior { - s.MinTTL = &v - return s -} - -// SetPathPattern sets the PathPattern field's value. -func (s *CacheBehavior) SetPathPattern(v string) *CacheBehavior { - s.PathPattern = &v - return s -} - -// SetSmoothStreaming sets the SmoothStreaming field's value. -func (s *CacheBehavior) SetSmoothStreaming(v bool) *CacheBehavior { - s.SmoothStreaming = &v - return s -} - -// SetTargetOriginId sets the TargetOriginId field's value. -func (s *CacheBehavior) SetTargetOriginId(v string) *CacheBehavior { - s.TargetOriginId = &v - return s -} - -// SetTrustedSigners sets the TrustedSigners field's value. -func (s *CacheBehavior) SetTrustedSigners(v *TrustedSigners) *CacheBehavior { - s.TrustedSigners = v - return s -} - -// SetViewerProtocolPolicy sets the ViewerProtocolPolicy field's value. -func (s *CacheBehavior) SetViewerProtocolPolicy(v string) *CacheBehavior { - s.ViewerProtocolPolicy = &v - return s -} - -// A complex type that contains zero or more CacheBehavior elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CacheBehaviors -type CacheBehaviors struct { - _ struct{} `type:"structure"` - - // Optional: A complex type that contains cache behaviors for this distribution. - // If Quantity is 0, you can omit Items. - Items []*CacheBehavior `locationNameList:"CacheBehavior" type:"list"` - - // The number of cache behaviors for this distribution. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s CacheBehaviors) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CacheBehaviors) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CacheBehaviors) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CacheBehaviors"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - if s.Items != nil { - for i, v := range s.Items { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *CacheBehaviors) SetItems(v []*CacheBehavior) *CacheBehaviors { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *CacheBehaviors) SetQuantity(v int64) *CacheBehaviors { - s.Quantity = &v - return s -} - -// A complex type that controls whether CloudFront caches the response to requests -// using the specified HTTP methods. There are two choices: -// -// * CloudFront caches responses to GET and HEAD requests. -// -// * CloudFront caches responses to GET, HEAD, and OPTIONS requests. -// -// If you pick the second choice for your Amazon S3 Origin, you may need to -// forward Access-Control-Request-Method, Access-Control-Request-Headers, and -// Origin headers for the responses to be cached correctly. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CachedMethods -type CachedMethods struct { - _ struct{} `type:"structure"` - - // A complex type that contains the HTTP methods that you want CloudFront to - // cache responses to. - // - // Items is a required field - Items []*string `locationNameList:"Method" type:"list" required:"true"` - - // The number of HTTP methods for which you want CloudFront to cache responses. - // Valid values are 2 (for caching responses to GET and HEAD requests) and 3 - // (for caching responses to GET, HEAD, and OPTIONS requests). - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s CachedMethods) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CachedMethods) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CachedMethods) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CachedMethods"} - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *CachedMethods) SetItems(v []*string) *CachedMethods { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *CachedMethods) SetQuantity(v int64) *CachedMethods { - s.Quantity = &v - return s -} - -// A complex type that specifies whether you want CloudFront to forward cookies -// to the origin and, if so, which ones. For more information about forwarding -// cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies -// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CookieNames -type CookieNames struct { - _ struct{} `type:"structure"` - - // A complex type that contains one Name element for each cookie that you want - // CloudFront to forward to the origin for this cache behavior. - Items []*string `locationNameList:"Name" type:"list"` - - // The number of different cookies that you want CloudFront to forward to the - // origin for this cache behavior. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s CookieNames) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CookieNames) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CookieNames) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CookieNames"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *CookieNames) SetItems(v []*string) *CookieNames { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *CookieNames) SetQuantity(v int64) *CookieNames { - s.Quantity = &v - return s -} - -// A complex type that specifies whether you want CloudFront to forward cookies -// to the origin and, if so, which ones. For more information about forwarding -// cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies -// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CookiePreference -type CookiePreference struct { - _ struct{} `type:"structure"` - - // Specifies which cookies to forward to the origin for this cache behavior: - // all, none, or the list of cookies specified in the WhitelistedNames complex - // type. - // - // Amazon S3 doesn't process cookies. When the cache behavior is forwarding - // requests to an Amazon S3 origin, specify none for the Forward element. - // - // Forward is a required field - Forward *string `type:"string" required:"true" enum:"ItemSelection"` - - // Required if you specify whitelist for the value of Forward:. A complex type - // that specifies how many different cookies you want CloudFront to forward - // to the origin for this cache behavior and, if you want to forward selected - // cookies, the names of those cookies. - // - // If you specify all or none for the value of Forward, omit WhitelistedNames. - // If you change the value of Forward from whitelist to all or none and you - // don't delete the WhitelistedNames element and its child elements, CloudFront - // deletes them automatically. - // - // For the current limit on the number of cookie names that you can whitelist - // for each cache behavior, see Amazon CloudFront Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_cloudfront) - // in the AWS General Reference. - WhitelistedNames *CookieNames `type:"structure"` -} - -// String returns the string representation -func (s CookiePreference) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CookiePreference) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CookiePreference) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CookiePreference"} - if s.Forward == nil { - invalidParams.Add(request.NewErrParamRequired("Forward")) - } - if s.WhitelistedNames != nil { - if err := s.WhitelistedNames.Validate(); err != nil { - invalidParams.AddNested("WhitelistedNames", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetForward sets the Forward field's value. -func (s *CookiePreference) SetForward(v string) *CookiePreference { - s.Forward = &v - return s -} - -// SetWhitelistedNames sets the WhitelistedNames field's value. -func (s *CookiePreference) SetWhitelistedNames(v *CookieNames) *CookiePreference { - s.WhitelistedNames = v - return s -} - -// The request to create a new origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentityRequest -type CreateCloudFrontOriginAccessIdentityInput struct { - _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityConfig"` - - // The current configuration information for the identity. - // - // CloudFrontOriginAccessIdentityConfig is a required field - CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `locationName:"CloudFrontOriginAccessIdentityConfig" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateCloudFrontOriginAccessIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCloudFrontOriginAccessIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCloudFrontOriginAccessIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCloudFrontOriginAccessIdentityInput"} - if s.CloudFrontOriginAccessIdentityConfig == nil { - invalidParams.Add(request.NewErrParamRequired("CloudFrontOriginAccessIdentityConfig")) - } - if s.CloudFrontOriginAccessIdentityConfig != nil { - if err := s.CloudFrontOriginAccessIdentityConfig.Validate(); err != nil { - invalidParams.AddNested("CloudFrontOriginAccessIdentityConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudFrontOriginAccessIdentityConfig sets the CloudFrontOriginAccessIdentityConfig field's value. -func (s *CreateCloudFrontOriginAccessIdentityInput) SetCloudFrontOriginAccessIdentityConfig(v *OriginAccessIdentityConfig) *CreateCloudFrontOriginAccessIdentityInput { - s.CloudFrontOriginAccessIdentityConfig = v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateCloudFrontOriginAccessIdentityResult -type CreateCloudFrontOriginAccessIdentityOutput struct { - _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentity"` - - // The origin access identity's information. - CloudFrontOriginAccessIdentity *OriginAccessIdentity `type:"structure"` - - // The current version of the origin access identity created. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The fully qualified URI of the new origin access identity just created. For - // example: https://cloudfront.amazonaws.com/2010-11-01/origin-access-identity/cloudfront/E74FTE3AJFJ256A. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s CreateCloudFrontOriginAccessIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCloudFrontOriginAccessIdentityOutput) GoString() string { - return s.String() -} - -// SetCloudFrontOriginAccessIdentity sets the CloudFrontOriginAccessIdentity field's value. -func (s *CreateCloudFrontOriginAccessIdentityOutput) SetCloudFrontOriginAccessIdentity(v *OriginAccessIdentity) *CreateCloudFrontOriginAccessIdentityOutput { - s.CloudFrontOriginAccessIdentity = v - return s -} - -// SetETag sets the ETag field's value. -func (s *CreateCloudFrontOriginAccessIdentityOutput) SetETag(v string) *CreateCloudFrontOriginAccessIdentityOutput { - s.ETag = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateCloudFrontOriginAccessIdentityOutput) SetLocation(v string) *CreateCloudFrontOriginAccessIdentityOutput { - s.Location = &v - return s -} - -// The request to create a new distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionRequest -type CreateDistributionInput struct { - _ struct{} `type:"structure" payload:"DistributionConfig"` - - // The distribution's configuration information. - // - // DistributionConfig is a required field - DistributionConfig *DistributionConfig `locationName:"DistributionConfig" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDistributionInput"} - if s.DistributionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("DistributionConfig")) - } - if s.DistributionConfig != nil { - if err := s.DistributionConfig.Validate(); err != nil { - invalidParams.AddNested("DistributionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDistributionConfig sets the DistributionConfig field's value. -func (s *CreateDistributionInput) SetDistributionConfig(v *DistributionConfig) *CreateDistributionInput { - s.DistributionConfig = v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionResult -type CreateDistributionOutput struct { - _ struct{} `type:"structure" payload:"Distribution"` - - // The distribution's information. - Distribution *Distribution `type:"structure"` - - // The current version of the distribution created. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The fully qualified URI of the new distribution resource just created. For - // example: https://cloudfront.amazonaws.com/2010-11-01/distribution/EDFDVBD632BHDS5. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s CreateDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDistributionOutput) GoString() string { - return s.String() -} - -// SetDistribution sets the Distribution field's value. -func (s *CreateDistributionOutput) SetDistribution(v *Distribution) *CreateDistributionOutput { - s.Distribution = v - return s -} - -// SetETag sets the ETag field's value. -func (s *CreateDistributionOutput) SetETag(v string) *CreateDistributionOutput { - s.ETag = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateDistributionOutput) SetLocation(v string) *CreateDistributionOutput { - s.Location = &v - return s -} - -// The request to create a new distribution with tags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTagsRequest -type CreateDistributionWithTagsInput struct { - _ struct{} `type:"structure" payload:"DistributionConfigWithTags"` - - // The distribution's configuration information. - // - // DistributionConfigWithTags is a required field - DistributionConfigWithTags *DistributionConfigWithTags `locationName:"DistributionConfigWithTags" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateDistributionWithTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDistributionWithTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDistributionWithTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDistributionWithTagsInput"} - if s.DistributionConfigWithTags == nil { - invalidParams.Add(request.NewErrParamRequired("DistributionConfigWithTags")) - } - if s.DistributionConfigWithTags != nil { - if err := s.DistributionConfigWithTags.Validate(); err != nil { - invalidParams.AddNested("DistributionConfigWithTags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDistributionConfigWithTags sets the DistributionConfigWithTags field's value. -func (s *CreateDistributionWithTagsInput) SetDistributionConfigWithTags(v *DistributionConfigWithTags) *CreateDistributionWithTagsInput { - s.DistributionConfigWithTags = v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateDistributionWithTagsResult -type CreateDistributionWithTagsOutput struct { - _ struct{} `type:"structure" payload:"Distribution"` - - // The distribution's information. - Distribution *Distribution `type:"structure"` - - // The current version of the distribution created. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The fully qualified URI of the new distribution resource just created. For - // example: https://cloudfront.amazonaws.com/2010-11-01/distribution/EDFDVBD632BHDS5. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s CreateDistributionWithTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDistributionWithTagsOutput) GoString() string { - return s.String() -} - -// SetDistribution sets the Distribution field's value. -func (s *CreateDistributionWithTagsOutput) SetDistribution(v *Distribution) *CreateDistributionWithTagsOutput { - s.Distribution = v - return s -} - -// SetETag sets the ETag field's value. -func (s *CreateDistributionWithTagsOutput) SetETag(v string) *CreateDistributionWithTagsOutput { - s.ETag = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateDistributionWithTagsOutput) SetLocation(v string) *CreateDistributionWithTagsOutput { - s.Location = &v - return s -} - -// The request to create an invalidation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidationRequest -type CreateInvalidationInput struct { - _ struct{} `type:"structure" payload:"InvalidationBatch"` - - // The distribution's id. - // - // DistributionId is a required field - DistributionId *string `location:"uri" locationName:"DistributionId" type:"string" required:"true"` - - // The batch information for the invalidation. - // - // InvalidationBatch is a required field - InvalidationBatch *InvalidationBatch `locationName:"InvalidationBatch" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateInvalidationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInvalidationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInvalidationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInvalidationInput"} - if s.DistributionId == nil { - invalidParams.Add(request.NewErrParamRequired("DistributionId")) - } - if s.InvalidationBatch == nil { - invalidParams.Add(request.NewErrParamRequired("InvalidationBatch")) - } - if s.InvalidationBatch != nil { - if err := s.InvalidationBatch.Validate(); err != nil { - invalidParams.AddNested("InvalidationBatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDistributionId sets the DistributionId field's value. -func (s *CreateInvalidationInput) SetDistributionId(v string) *CreateInvalidationInput { - s.DistributionId = &v - return s -} - -// SetInvalidationBatch sets the InvalidationBatch field's value. -func (s *CreateInvalidationInput) SetInvalidationBatch(v *InvalidationBatch) *CreateInvalidationInput { - s.InvalidationBatch = v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateInvalidationResult -type CreateInvalidationOutput struct { - _ struct{} `type:"structure" payload:"Invalidation"` - - // The invalidation's information. - Invalidation *Invalidation `type:"structure"` - - // The fully qualified URI of the distribution and invalidation batch request, - // including the Invalidation ID. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s CreateInvalidationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInvalidationOutput) GoString() string { - return s.String() -} - -// SetInvalidation sets the Invalidation field's value. -func (s *CreateInvalidationOutput) SetInvalidation(v *Invalidation) *CreateInvalidationOutput { - s.Invalidation = v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateInvalidationOutput) SetLocation(v string) *CreateInvalidationOutput { - s.Location = &v - return s -} - -// The request to create a new streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionRequest -type CreateStreamingDistributionInput struct { - _ struct{} `type:"structure" payload:"StreamingDistributionConfig"` - - // The streaming distribution's configuration information. - // - // StreamingDistributionConfig is a required field - StreamingDistributionConfig *StreamingDistributionConfig `locationName:"StreamingDistributionConfig" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateStreamingDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStreamingDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStreamingDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStreamingDistributionInput"} - if s.StreamingDistributionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("StreamingDistributionConfig")) - } - if s.StreamingDistributionConfig != nil { - if err := s.StreamingDistributionConfig.Validate(); err != nil { - invalidParams.AddNested("StreamingDistributionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamingDistributionConfig sets the StreamingDistributionConfig field's value. -func (s *CreateStreamingDistributionInput) SetStreamingDistributionConfig(v *StreamingDistributionConfig) *CreateStreamingDistributionInput { - s.StreamingDistributionConfig = v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionResult -type CreateStreamingDistributionOutput struct { - _ struct{} `type:"structure" payload:"StreamingDistribution"` - - // The current version of the streaming distribution created. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The fully qualified URI of the new streaming distribution resource just created. - // For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8. - Location *string `location:"header" locationName:"Location" type:"string"` - - // The streaming distribution's information. - StreamingDistribution *StreamingDistribution `type:"structure"` -} - -// String returns the string representation -func (s CreateStreamingDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStreamingDistributionOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *CreateStreamingDistributionOutput) SetETag(v string) *CreateStreamingDistributionOutput { - s.ETag = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateStreamingDistributionOutput) SetLocation(v string) *CreateStreamingDistributionOutput { - s.Location = &v - return s -} - -// SetStreamingDistribution sets the StreamingDistribution field's value. -func (s *CreateStreamingDistributionOutput) SetStreamingDistribution(v *StreamingDistribution) *CreateStreamingDistributionOutput { - s.StreamingDistribution = v - return s -} - -// The request to create a new streaming distribution with tags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTagsRequest -type CreateStreamingDistributionWithTagsInput struct { - _ struct{} `type:"structure" payload:"StreamingDistributionConfigWithTags"` - - // The streaming distribution's configuration information. - // - // StreamingDistributionConfigWithTags is a required field - StreamingDistributionConfigWithTags *StreamingDistributionConfigWithTags `locationName:"StreamingDistributionConfigWithTags" type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateStreamingDistributionWithTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStreamingDistributionWithTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStreamingDistributionWithTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStreamingDistributionWithTagsInput"} - if s.StreamingDistributionConfigWithTags == nil { - invalidParams.Add(request.NewErrParamRequired("StreamingDistributionConfigWithTags")) - } - if s.StreamingDistributionConfigWithTags != nil { - if err := s.StreamingDistributionConfigWithTags.Validate(); err != nil { - invalidParams.AddNested("StreamingDistributionConfigWithTags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamingDistributionConfigWithTags sets the StreamingDistributionConfigWithTags field's value. -func (s *CreateStreamingDistributionWithTagsInput) SetStreamingDistributionConfigWithTags(v *StreamingDistributionConfigWithTags) *CreateStreamingDistributionWithTagsInput { - s.StreamingDistributionConfigWithTags = v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CreateStreamingDistributionWithTagsResult -type CreateStreamingDistributionWithTagsOutput struct { - _ struct{} `type:"structure" payload:"StreamingDistribution"` - - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The fully qualified URI of the new streaming distribution resource just created. - // For example: https://cloudfront.amazonaws.com/2010-11-01/streaming-distribution/EGTXBD79H29TRA8. - Location *string `location:"header" locationName:"Location" type:"string"` - - // The streaming distribution's information. - StreamingDistribution *StreamingDistribution `type:"structure"` -} - -// String returns the string representation -func (s CreateStreamingDistributionWithTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStreamingDistributionWithTagsOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *CreateStreamingDistributionWithTagsOutput) SetETag(v string) *CreateStreamingDistributionWithTagsOutput { - s.ETag = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateStreamingDistributionWithTagsOutput) SetLocation(v string) *CreateStreamingDistributionWithTagsOutput { - s.Location = &v - return s -} - -// SetStreamingDistribution sets the StreamingDistribution field's value. -func (s *CreateStreamingDistributionWithTagsOutput) SetStreamingDistribution(v *StreamingDistribution) *CreateStreamingDistributionWithTagsOutput { - s.StreamingDistribution = v - return s -} - -// A complex type that controls: -// -// * Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range -// with custom error messages before returning the response to the viewer. -// -// -// * How long CloudFront caches HTTP status codes in the 4xx and 5xx range. -// -// For more information about custom error pages, see Customizing Error Responses -// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomErrorResponse -type CustomErrorResponse struct { - _ struct{} `type:"structure"` - - // The minimum amount of time, in seconds, that you want CloudFront to cache - // the HTTP status code specified in ErrorCode. When this time period has elapsed, - // CloudFront queries your origin to see whether the problem that caused the - // error has been resolved and the requested object is now available. - // - // If you don't want to specify a value, include an empty element, , - // in the XML document. - // - // For more information, see Customizing Error Responses (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) - // in the Amazon CloudFront Developer Guide. - ErrorCachingMinTTL *int64 `type:"long"` - - // The HTTP status code for which you want to specify a custom error page and/or - // a caching duration. - // - // ErrorCode is a required field - ErrorCode *int64 `type:"integer" required:"true"` - - // The HTTP status code that you want CloudFront to return to the viewer along - // with the custom error page. There are a variety of reasons that you might - // want CloudFront to return a status code different from the status code that - // your origin returned to CloudFront, for example: - // - // * Some Internet devices (some firewalls and corporate proxies, for example) - // intercept HTTP 4xx and 5xx and prevent the response from being returned - // to the viewer. If you substitute 200, the response typically won't be - // intercepted. - // - // * If you don't care about distinguishing among different client errors - // or server errors, you can specify 400 or 500 as the ResponseCode for all - // 4xx or 5xx errors. - // - // * You might want to return a 200 status code (OK) and static website so - // your customers don't know that your website is down. - // - // If you specify a value for ResponseCode, you must also specify a value for - // ResponsePagePath. If you don't want to specify a value, include an empty - // element, , in the XML document. - ResponseCode *string `type:"string"` - - // The path to the custom error page that you want CloudFront to return to a - // viewer when your origin returns the HTTP status code specified by ErrorCode, - // for example, /4xx-errors/403-forbidden.html. If you want to store your objects - // and your custom error pages in different locations, your distribution must - // include a cache behavior for which the following is true: - // - // * The value of PathPattern matches the path to your custom error messages. - // For example, suppose you saved custom error pages for 4xx errors in an - // Amazon S3 bucket in a directory named /4xx-errors. Your distribution must - // include a cache behavior for which the path pattern routes requests for - // your custom error pages to that location, for example, /4xx-errors/*. - // - // - // * The value of TargetOriginId specifies the value of the ID element for - // the origin that contains your custom error pages. - // - // If you specify a value for ResponsePagePath, you must also specify a value - // for ResponseCode. If you don't want to specify a value, include an empty - // element, , in the XML document. - // - // We recommend that you store custom error pages in an Amazon S3 bucket. If - // you store custom error pages on an HTTP server and the server starts to return - // 5xx errors, CloudFront can't get the files that you want to return to viewers - // because the origin server is unavailable. - ResponsePagePath *string `type:"string"` -} - -// String returns the string representation -func (s CustomErrorResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CustomErrorResponse) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomErrorResponse) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomErrorResponse"} - if s.ErrorCode == nil { - invalidParams.Add(request.NewErrParamRequired("ErrorCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetErrorCachingMinTTL sets the ErrorCachingMinTTL field's value. -func (s *CustomErrorResponse) SetErrorCachingMinTTL(v int64) *CustomErrorResponse { - s.ErrorCachingMinTTL = &v - return s -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *CustomErrorResponse) SetErrorCode(v int64) *CustomErrorResponse { - s.ErrorCode = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *CustomErrorResponse) SetResponseCode(v string) *CustomErrorResponse { - s.ResponseCode = &v - return s -} - -// SetResponsePagePath sets the ResponsePagePath field's value. -func (s *CustomErrorResponse) SetResponsePagePath(v string) *CustomErrorResponse { - s.ResponsePagePath = &v - return s -} - -// A complex type that controls: -// -// * Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range -// with custom error messages before returning the response to the viewer. -// -// * How long CloudFront caches HTTP status codes in the 4xx and 5xx range. -// -// For more information about custom error pages, see Customizing Error Responses -// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomErrorResponses -type CustomErrorResponses struct { - _ struct{} `type:"structure"` - - // A complex type that contains a CustomErrorResponse element for each HTTP - // status code for which you want to specify a custom error page and/or a caching - // duration. - Items []*CustomErrorResponse `locationNameList:"CustomErrorResponse" type:"list"` - - // The number of HTTP status codes for which you want to specify a custom error - // page and/or a caching duration. If Quantity is 0, you can omit Items. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s CustomErrorResponses) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CustomErrorResponses) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomErrorResponses) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomErrorResponses"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - if s.Items != nil { - for i, v := range s.Items { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *CustomErrorResponses) SetItems(v []*CustomErrorResponse) *CustomErrorResponses { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *CustomErrorResponses) SetQuantity(v int64) *CustomErrorResponses { - s.Quantity = &v - return s -} - -// A complex type that contains the list of Custom Headers for each origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomHeaders -type CustomHeaders struct { - _ struct{} `type:"structure"` - - // Optional: A list that contains one OriginCustomHeader element for each custom - // header that you want CloudFront to forward to the origin. If Quantity is - // 0, omit Items. - Items []*OriginCustomHeader `locationNameList:"OriginCustomHeader" type:"list"` - - // The number of custom headers, if any, for this distribution. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s CustomHeaders) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CustomHeaders) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomHeaders) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomHeaders"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - if s.Items != nil { - for i, v := range s.Items { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *CustomHeaders) SetItems(v []*OriginCustomHeader) *CustomHeaders { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *CustomHeaders) SetQuantity(v int64) *CustomHeaders { - s.Quantity = &v - return s -} - -// A customer origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CustomOriginConfig -type CustomOriginConfig struct { - _ struct{} `type:"structure"` - - // The HTTP port the custom origin listens on. - // - // HTTPPort is a required field - HTTPPort *int64 `type:"integer" required:"true"` - - // The HTTPS port the custom origin listens on. - // - // HTTPSPort is a required field - HTTPSPort *int64 `type:"integer" required:"true"` - - // You can create a custom keep-alive timeout. All timeout units are in seconds. - // The default keep-alive timeout is 5 seconds, but you can configure custom - // timeout lengths using the CloudFront API. The minimum timeout length is 1 - // second; the maximum is 60 seconds. - // - // If you need to increase the maximum time limit, contact the AWS Support Center - // (https://console.aws.amazon.com/support/home#/). - OriginKeepaliveTimeout *int64 `type:"integer"` - - // The origin protocol policy to apply to your origin. - // - // OriginProtocolPolicy is a required field - OriginProtocolPolicy *string `type:"string" required:"true" enum:"OriginProtocolPolicy"` - - // You can create a custom origin read timeout. All timeout units are in seconds. - // The default origin read timeout is 30 seconds, but you can configure custom - // timeout lengths using the CloudFront API. The minimum timeout length is 4 - // seconds; the maximum is 60 seconds. - // - // If you need to increase the maximum time limit, contact the AWS Support Center - // (https://console.aws.amazon.com/support/home#/). - OriginReadTimeout *int64 `type:"integer"` - - // The SSL/TLS protocols that you want CloudFront to use when communicating - // with your origin over HTTPS. - OriginSslProtocols *OriginSslProtocols `type:"structure"` -} - -// String returns the string representation -func (s CustomOriginConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CustomOriginConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomOriginConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomOriginConfig"} - if s.HTTPPort == nil { - invalidParams.Add(request.NewErrParamRequired("HTTPPort")) - } - if s.HTTPSPort == nil { - invalidParams.Add(request.NewErrParamRequired("HTTPSPort")) - } - if s.OriginProtocolPolicy == nil { - invalidParams.Add(request.NewErrParamRequired("OriginProtocolPolicy")) - } - if s.OriginSslProtocols != nil { - if err := s.OriginSslProtocols.Validate(); err != nil { - invalidParams.AddNested("OriginSslProtocols", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHTTPPort sets the HTTPPort field's value. -func (s *CustomOriginConfig) SetHTTPPort(v int64) *CustomOriginConfig { - s.HTTPPort = &v - return s -} - -// SetHTTPSPort sets the HTTPSPort field's value. -func (s *CustomOriginConfig) SetHTTPSPort(v int64) *CustomOriginConfig { - s.HTTPSPort = &v - return s -} - -// SetOriginKeepaliveTimeout sets the OriginKeepaliveTimeout field's value. -func (s *CustomOriginConfig) SetOriginKeepaliveTimeout(v int64) *CustomOriginConfig { - s.OriginKeepaliveTimeout = &v - return s -} - -// SetOriginProtocolPolicy sets the OriginProtocolPolicy field's value. -func (s *CustomOriginConfig) SetOriginProtocolPolicy(v string) *CustomOriginConfig { - s.OriginProtocolPolicy = &v - return s -} - -// SetOriginReadTimeout sets the OriginReadTimeout field's value. -func (s *CustomOriginConfig) SetOriginReadTimeout(v int64) *CustomOriginConfig { - s.OriginReadTimeout = &v - return s -} - -// SetOriginSslProtocols sets the OriginSslProtocols field's value. -func (s *CustomOriginConfig) SetOriginSslProtocols(v *OriginSslProtocols) *CustomOriginConfig { - s.OriginSslProtocols = v - return s -} - -// A complex type that describes the default cache behavior if you do not specify -// a CacheBehavior element or if files don't match any of the values of PathPattern -// in CacheBehavior elements. You must create exactly one default cache behavior. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DefaultCacheBehavior -type DefaultCacheBehavior struct { - _ struct{} `type:"structure"` - - // A complex type that controls which HTTP methods CloudFront processes and - // forwards to your Amazon S3 bucket or your custom origin. There are three - // choices: - // - // * CloudFront forwards only GET and HEAD requests. - // - // * CloudFront forwards only GET, HEAD, and OPTIONS requests. - // - // * CloudFront forwards GET, HEAD, OPTIONS, PUT, PATCH, POST, and DELETE - // requests. - // - // If you pick the third choice, you may need to restrict access to your Amazon - // S3 bucket or to your custom origin so users can't perform operations that - // you don't want them to. For example, you might not want users to have permissions - // to delete objects from your origin. - AllowedMethods *AllowedMethods `type:"structure"` - - // Whether you want CloudFront to automatically compress certain files for this - // cache behavior. If so, specify true; if not, specify false. For more information, - // see Serving Compressed Files (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) - // in the Amazon CloudFront Developer Guide. - Compress *bool `type:"boolean"` - - // The default amount of time that you want objects to stay in CloudFront caches - // before CloudFront forwards another request to your origin to determine whether - // the object has been updated. The value that you specify applies only when - // your origin does not add HTTP headers such as Cache-Control max-age, Cache-Control - // s-maxage, and Expires to objects. For more information, see Specifying How - // Long Objects and Errors Stay in a CloudFront Edge Cache (Expiration) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) - // in the Amazon CloudFront Developer Guide. - DefaultTTL *int64 `type:"long"` - - // A complex type that specifies how CloudFront handles query strings and cookies. - // - // ForwardedValues is a required field - ForwardedValues *ForwardedValues `type:"structure" required:"true"` - - // A complex type that contains zero or more Lambda function associations for - // a cache behavior. - LambdaFunctionAssociations *LambdaFunctionAssociations `type:"structure"` - - MaxTTL *int64 `type:"long"` - - // The minimum amount of time that you want objects to stay in CloudFront caches - // before CloudFront forwards another request to your origin to determine whether - // the object has been updated. For more information, see Specifying How Long - // Objects and Errors Stay in a CloudFront Edge Cache (Expiration) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) - // in the Amazon Amazon CloudFront Developer Guide. - // - // You must specify 0 for MinTTL if you configure CloudFront to forward all - // headers to your origin (under Headers, if you specify 1 for Quantity and - // * for Name). - // - // MinTTL is a required field - MinTTL *int64 `type:"long" required:"true"` - - // Indicates whether you want to distribute media files in the Microsoft Smooth - // Streaming format using the origin that is associated with this cache behavior. - // If so, specify true; if not, specify false. If you specify true for SmoothStreaming, - // you can still distribute other content using this cache behavior if the content - // matches the value of PathPattern. - SmoothStreaming *bool `type:"boolean"` - - // The value of ID for the origin that you want CloudFront to route requests - // to when a request matches the path pattern either for a cache behavior or - // for the default cache behavior. - // - // TargetOriginId is a required field - TargetOriginId *string `type:"string" required:"true"` - - // A complex type that specifies the AWS accounts, if any, that you want to - // allow to create signed URLs for private content. - // - // If you want to require signed URLs in requests for objects in the target - // origin that match the PathPattern for this cache behavior, specify true for - // Enabled, and specify the applicable values for Quantity and Items. For more - // information, see Serving Private Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) - // in the Amazon Amazon CloudFront Developer Guide. - // - // If you don't want to require signed URLs in requests for objects that match - // PathPattern, specify false for Enabled and 0 for Quantity. Omit Items. - // - // To add, change, or remove one or more trusted signers, change Enabled to - // true (if it's currently false), change Quantity as applicable, and specify - // all of the trusted signers that you want to include in the updated distribution. - // - // TrustedSigners is a required field - TrustedSigners *TrustedSigners `type:"structure" required:"true"` - - // The protocol that viewers can use to access the files in the origin specified - // by TargetOriginId when a request matches the path pattern in PathPattern. - // You can specify the following options: - // - // * allow-all: Viewers can use HTTP or HTTPS. - // - // * redirect-to-https: If a viewer submits an HTTP request, CloudFront returns - // an HTTP status code of 301 (Moved Permanently) to the viewer along with - // the HTTPS URL. The viewer then resubmits the request using the new URL. - // - // * https-only: If a viewer sends an HTTP request, CloudFront returns an - // HTTP status code of 403 (Forbidden). - // - // For more information about requiring the HTTPS protocol, see Using an HTTPS - // Connection to Access Your Objects (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html) - // in the Amazon CloudFront Developer Guide. - // - // The only way to guarantee that viewers retrieve an object that was fetched - // from the origin using HTTPS is never to use any other protocol to fetch the - // object. If you have recently changed from HTTP to HTTPS, we recommend that - // you clear your objects' cache because cached objects are protocol agnostic. - // That means that an edge location will return an object from the cache regardless - // of whether the current request protocol matches the protocol used previously. - // For more information, see Specifying How Long Objects and Errors Stay in - // a CloudFront Edge Cache (Expiration) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) - // in the Amazon CloudFront Developer Guide. - // - // ViewerProtocolPolicy is a required field - ViewerProtocolPolicy *string `type:"string" required:"true" enum:"ViewerProtocolPolicy"` -} - -// String returns the string representation -func (s DefaultCacheBehavior) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DefaultCacheBehavior) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DefaultCacheBehavior) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DefaultCacheBehavior"} - if s.ForwardedValues == nil { - invalidParams.Add(request.NewErrParamRequired("ForwardedValues")) - } - if s.MinTTL == nil { - invalidParams.Add(request.NewErrParamRequired("MinTTL")) - } - if s.TargetOriginId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetOriginId")) - } - if s.TrustedSigners == nil { - invalidParams.Add(request.NewErrParamRequired("TrustedSigners")) - } - if s.ViewerProtocolPolicy == nil { - invalidParams.Add(request.NewErrParamRequired("ViewerProtocolPolicy")) - } - if s.AllowedMethods != nil { - if err := s.AllowedMethods.Validate(); err != nil { - invalidParams.AddNested("AllowedMethods", err.(request.ErrInvalidParams)) - } - } - if s.ForwardedValues != nil { - if err := s.ForwardedValues.Validate(); err != nil { - invalidParams.AddNested("ForwardedValues", err.(request.ErrInvalidParams)) - } - } - if s.LambdaFunctionAssociations != nil { - if err := s.LambdaFunctionAssociations.Validate(); err != nil { - invalidParams.AddNested("LambdaFunctionAssociations", err.(request.ErrInvalidParams)) - } - } - if s.TrustedSigners != nil { - if err := s.TrustedSigners.Validate(); err != nil { - invalidParams.AddNested("TrustedSigners", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedMethods sets the AllowedMethods field's value. -func (s *DefaultCacheBehavior) SetAllowedMethods(v *AllowedMethods) *DefaultCacheBehavior { - s.AllowedMethods = v - return s -} - -// SetCompress sets the Compress field's value. -func (s *DefaultCacheBehavior) SetCompress(v bool) *DefaultCacheBehavior { - s.Compress = &v - return s -} - -// SetDefaultTTL sets the DefaultTTL field's value. -func (s *DefaultCacheBehavior) SetDefaultTTL(v int64) *DefaultCacheBehavior { - s.DefaultTTL = &v - return s -} - -// SetForwardedValues sets the ForwardedValues field's value. -func (s *DefaultCacheBehavior) SetForwardedValues(v *ForwardedValues) *DefaultCacheBehavior { - s.ForwardedValues = v - return s -} - -// SetLambdaFunctionAssociations sets the LambdaFunctionAssociations field's value. -func (s *DefaultCacheBehavior) SetLambdaFunctionAssociations(v *LambdaFunctionAssociations) *DefaultCacheBehavior { - s.LambdaFunctionAssociations = v - return s -} - -// SetMaxTTL sets the MaxTTL field's value. -func (s *DefaultCacheBehavior) SetMaxTTL(v int64) *DefaultCacheBehavior { - s.MaxTTL = &v - return s -} - -// SetMinTTL sets the MinTTL field's value. -func (s *DefaultCacheBehavior) SetMinTTL(v int64) *DefaultCacheBehavior { - s.MinTTL = &v - return s -} - -// SetSmoothStreaming sets the SmoothStreaming field's value. -func (s *DefaultCacheBehavior) SetSmoothStreaming(v bool) *DefaultCacheBehavior { - s.SmoothStreaming = &v - return s -} - -// SetTargetOriginId sets the TargetOriginId field's value. -func (s *DefaultCacheBehavior) SetTargetOriginId(v string) *DefaultCacheBehavior { - s.TargetOriginId = &v - return s -} - -// SetTrustedSigners sets the TrustedSigners field's value. -func (s *DefaultCacheBehavior) SetTrustedSigners(v *TrustedSigners) *DefaultCacheBehavior { - s.TrustedSigners = v - return s -} - -// SetViewerProtocolPolicy sets the ViewerProtocolPolicy field's value. -func (s *DefaultCacheBehavior) SetViewerProtocolPolicy(v string) *DefaultCacheBehavior { - s.ViewerProtocolPolicy = &v - return s -} - -// Deletes a origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentityRequest -type DeleteCloudFrontOriginAccessIdentityInput struct { - _ struct{} `type:"structure"` - - // The origin access identity's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The value of the ETag header you received from a previous GET or PUT request. - // For example: E2QWRUHAPOMQZL. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` -} - -// String returns the string representation -func (s DeleteCloudFrontOriginAccessIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCloudFrontOriginAccessIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCloudFrontOriginAccessIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCloudFrontOriginAccessIdentityInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteCloudFrontOriginAccessIdentityInput) SetId(v string) *DeleteCloudFrontOriginAccessIdentityInput { - s.Id = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *DeleteCloudFrontOriginAccessIdentityInput) SetIfMatch(v string) *DeleteCloudFrontOriginAccessIdentityInput { - s.IfMatch = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteCloudFrontOriginAccessIdentityOutput -type DeleteCloudFrontOriginAccessIdentityOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCloudFrontOriginAccessIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCloudFrontOriginAccessIdentityOutput) GoString() string { - return s.String() -} - -// This action deletes a web distribution. To delete a web distribution using -// the CloudFront API, perform the following steps. -// -// To delete a web distribution using the CloudFront API: -// -// Disable the web distribution -// -// Submit a GET Distribution Config request to get the current configuration -// and the Etag header for the distribution. -// -// Update the XML document that was returned in the response to your GET Distribution -// Config request to change the value of Enabled to false. -// -// Submit a PUT Distribution Config request to update the configuration for -// your distribution. In the request body, include the XML document that you -// updated in Step 3. Set the value of the HTTP If-Match header to the value -// of the ETag header that CloudFront returned when you submitted the GET Distribution -// Config request in Step 2. -// -// Review the response to the PUT Distribution Config request to confirm that -// the distribution was successfully disabled. -// -// Submit a GET Distribution request to confirm that your changes have propagated. -// When propagation is complete, the value of Status is Deployed. -// -// Submit a DELETE Distribution request. Set the value of the HTTP If-Match -// header to the value of the ETag header that CloudFront returned when you -// submitted the GET Distribution Config request in Step 6. -// -// Review the response to your DELETE Distribution request to confirm that the -// distribution was successfully deleted. -// -// For information about deleting a distribution using the CloudFront console, -// see Deleting a Distribution (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToDeleteDistribution.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistributionRequest -type DeleteDistributionInput struct { - _ struct{} `type:"structure"` - - // The distribution ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The value of the ETag header that you received when you disabled the distribution. - // For example: E2QWRUHAPOMQZL. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` -} - -// String returns the string representation -func (s DeleteDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDistributionInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteDistributionInput) SetId(v string) *DeleteDistributionInput { - s.Id = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *DeleteDistributionInput) SetIfMatch(v string) *DeleteDistributionInput { - s.IfMatch = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteDistributionOutput -type DeleteDistributionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDistributionOutput) GoString() string { - return s.String() -} - -// The request to delete a streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistributionRequest -type DeleteStreamingDistributionInput struct { - _ struct{} `type:"structure"` - - // The distribution ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The value of the ETag header that you received when you disabled the streaming - // distribution. For example: E2QWRUHAPOMQZL. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` -} - -// String returns the string representation -func (s DeleteStreamingDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStreamingDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStreamingDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStreamingDistributionInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteStreamingDistributionInput) SetId(v string) *DeleteStreamingDistributionInput { - s.Id = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *DeleteStreamingDistributionInput) SetIfMatch(v string) *DeleteStreamingDistributionInput { - s.IfMatch = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DeleteStreamingDistributionOutput -type DeleteStreamingDistributionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteStreamingDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStreamingDistributionOutput) GoString() string { - return s.String() -} - -// The distribution's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Distribution -type Distribution struct { - _ struct{} `type:"structure"` - - // The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, - // where 123456789012 is your AWS account ID. - // - // ARN is a required field - ARN *string `type:"string" required:"true"` - - // CloudFront automatically adds this element to the response only if you've - // set up the distribution to serve private content with signed URLs. The element - // lists the key pair IDs that CloudFront is aware of for each trusted signer. - // The Signer child element lists the AWS account number of the trusted signer - // (or an empty Self element if the signer is you). The Signer element also - // includes the IDs of any active key pairs associated with the trusted signer's - // AWS account. If no KeyPairId element appears for a Signer, that signer can't - // create working signed URLs. - // - // ActiveTrustedSigners is a required field - ActiveTrustedSigners *ActiveTrustedSigners `type:"structure" required:"true"` - - // The current configuration information for the distribution. Send a GET request - // to the /CloudFront API version/distribution ID/config resource. - // - // DistributionConfig is a required field - DistributionConfig *DistributionConfig `type:"structure" required:"true"` - - // The domain name corresponding to the distribution. For example: d604721fxaaqy9.cloudfront.net. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // The identifier for the distribution. For example: EDFDVBD632BHDS5. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The number of invalidation batches currently in progress. - // - // InProgressInvalidationBatches is a required field - InProgressInvalidationBatches *int64 `type:"integer" required:"true"` - - // The date and time the distribution was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // This response element indicates the current status of the distribution. When - // the status is Deployed, the distribution's information is fully propagated - // to all CloudFront edge locations. - // - // Status is a required field - Status *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Distribution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Distribution) GoString() string { - return s.String() -} - -// SetARN sets the ARN field's value. -func (s *Distribution) SetARN(v string) *Distribution { - s.ARN = &v - return s -} - -// SetActiveTrustedSigners sets the ActiveTrustedSigners field's value. -func (s *Distribution) SetActiveTrustedSigners(v *ActiveTrustedSigners) *Distribution { - s.ActiveTrustedSigners = v - return s -} - -// SetDistributionConfig sets the DistributionConfig field's value. -func (s *Distribution) SetDistributionConfig(v *DistributionConfig) *Distribution { - s.DistributionConfig = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *Distribution) SetDomainName(v string) *Distribution { - s.DomainName = &v - return s -} - -// SetId sets the Id field's value. -func (s *Distribution) SetId(v string) *Distribution { - s.Id = &v - return s -} - -// SetInProgressInvalidationBatches sets the InProgressInvalidationBatches field's value. -func (s *Distribution) SetInProgressInvalidationBatches(v int64) *Distribution { - s.InProgressInvalidationBatches = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *Distribution) SetLastModifiedTime(v time.Time) *Distribution { - s.LastModifiedTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Distribution) SetStatus(v string) *Distribution { - s.Status = &v - return s -} - -// A distribution configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionConfig -type DistributionConfig struct { - _ struct{} `type:"structure"` - - // A complex type that contains information about CNAMEs (alternate domain names), - // if any, for this distribution. - Aliases *Aliases `type:"structure"` - - // A complex type that contains zero or more CacheBehavior elements. - CacheBehaviors *CacheBehaviors `type:"structure"` - - // A unique value (for example, a date-time stamp) that ensures that the request - // can't be replayed. - // - // If the value of CallerReference is new (regardless of the content of the - // DistributionConfig object), CloudFront creates a new distribution. - // - // If CallerReference is a value you already sent in a previous request to create - // a distribution, and if the content of the DistributionConfig is identical - // to the original request (ignoring white space), CloudFront returns the same - // the response that it returned to the original request. - // - // If CallerReference is a value you already sent in a previous request to create - // a distribution but the content of the DistributionConfig is different from - // the original request, CloudFront returns a DistributionAlreadyExists error. - // - // CallerReference is a required field - CallerReference *string `type:"string" required:"true"` - - // Any comments you want to include about the distribution. - // - // If you don't want to specify a comment, include an empty Comment element. - // - // To delete an existing comment, update the distribution configuration and - // include an empty Comment element. - // - // To add or change a comment, update the distribution configuration and specify - // the new comment. - // - // Comment is a required field - Comment *string `type:"string" required:"true"` - - // A complex type that controls the following: - // - // * Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range - // with custom error messages before returning the response to the viewer. - // - // * How long CloudFront caches HTTP status codes in the 4xx and 5xx range. - // - // For more information about custom error pages, see Customizing Error Responses - // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) - // in the Amazon CloudFront Developer Guide. - CustomErrorResponses *CustomErrorResponses `type:"structure"` - - // A complex type that describes the default cache behavior if you do not specify - // a CacheBehavior element or if files don't match any of the values of PathPattern - // in CacheBehavior elements. You must create exactly one default cache behavior. - // - // DefaultCacheBehavior is a required field - DefaultCacheBehavior *DefaultCacheBehavior `type:"structure" required:"true"` - - // The object that you want CloudFront to request from your origin (for example, - // index.html) when a viewer requests the root URL for your distribution (http://www.example.com) - // instead of an object in your distribution (http://www.example.com/product-description.html). - // Specifying a default root object avoids exposing the contents of your distribution. - // - // Specify only the object name, for example, index.html. Do not add a / before - // the object name. - // - // If you don't want to specify a default root object when you create a distribution, - // include an empty DefaultRootObject element. - // - // To delete the default root object from an existing distribution, update the - // distribution configuration and include an empty DefaultRootObject element. - // - // To replace the default root object, update the distribution configuration - // and specify the new object. - // - // For more information about the default root object, see Creating a Default - // Root Object (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) - // in the Amazon CloudFront Developer Guide. - DefaultRootObject *string `type:"string"` - - // From this field, you can enable or disable the selected distribution. - // - // If you specify false for Enabled but you specify values for Bucket and Prefix, - // the values are automatically deleted. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // (Optional) Specify the maximum HTTP version that you want viewers to use - // to communicate with CloudFront. The default value for new web distributions - // is http2. Viewers that don't support HTTP/2 automatically use an earlier - // HTTP version. - // - // For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or - // later, and must support Server Name Identification (SNI). - // - // In general, configuring CloudFront to communicate with viewers using HTTP/2 - // reduces latency. You can improve performance by optimizing for HTTP/2. For - // more information, do an Internet search for "http/2 optimization." - HttpVersion *string `type:"string" enum:"HttpVersion"` - - // If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address - // for your distribution, specify true. If you specify false, CloudFront responds - // to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses. - // This allows viewers to submit a second request, for an IPv4 address for your - // distribution. - // - // In general, you should enable IPv6 if you have users on IPv6 networks who - // want to access your content. However, if you're using signed URLs or signed - // cookies to restrict access to your content, and if you're using a custom - // policy that includes the IpAddress parameter to restrict the IP addresses - // that can access your content, do not enable IPv6. If you want to restrict - // access to some content by IP address and not restrict access to other content - // (or restrict access but not by IP address), you can create two distributions. - // For more information, see Creating a Signed URL Using a Custom Policy (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html) - // in the Amazon CloudFront Developer Guide. - // - // If you're using an Amazon Route 53 alias resource record set to route traffic - // to your CloudFront distribution, you need to create a second alias resource - // record set when both of the following are true: - // - // * You enable IPv6 for the distribution - // - // * You're using alternate domain names in the URLs for your objects - // - // For more information, see Routing Traffic to an Amazon CloudFront Web Distribution - // by Using Your Domain Name (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html) - // in the Amazon Route 53 Developer Guide. - // - // If you created a CNAME resource record set, either with Amazon Route 53 or - // with another DNS service, you don't need to make any changes. A CNAME record - // will route traffic to your distribution regardless of the IP address format - // of the viewer request. - IsIPV6Enabled *bool `type:"boolean"` - - // A complex type that controls whether access logs are written for the distribution. - // - // For more information about logging, see Access Logs (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html) - // in the Amazon CloudFront Developer Guide. - Logging *LoggingConfig `type:"structure"` - - // A complex type that contains information about origins for this distribution. - // - // Origins is a required field - Origins *Origins `type:"structure" required:"true"` - - // The price class that corresponds with the maximum price that you want to - // pay for CloudFront service. If you specify PriceClass_All, CloudFront responds - // to requests for your objects from all CloudFront edge locations. - // - // If you specify a price class other than PriceClass_All, CloudFront serves - // your objects from the CloudFront edge location that has the lowest latency - // among the edge locations in your price class. Viewers who are in or near - // regions that are excluded from your specified price class may encounter slower - // performance. - // - // For more information about price classes, see Choosing the Price Class for - // a CloudFront Distribution (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html) - // in the Amazon CloudFront Developer Guide. For information about CloudFront - // pricing, including how price classes map to CloudFront regions, see Amazon - // CloudFront Pricing (https://aws.amazon.com/cloudfront/pricing/). - PriceClass *string `type:"string" enum:"PriceClass"` - - // A complex type that identifies ways in which you want to restrict distribution - // of your content. - Restrictions *Restrictions `type:"structure"` - - // A complex type that specifies the following: - // - // * Which SSL/TLS certificate to use when viewers request objects using - // HTTPS - // - // * Whether you want CloudFront to use dedicated IP addresses or SNI when - // you're using alternate domain names in your object names - // - // * The minimum protocol version that you want CloudFront to use when communicating - // with viewers - // - // For more information, see Using an HTTPS Connection to Access Your Objects - // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html) - // in the Amazon Amazon CloudFront Developer Guide. - ViewerCertificate *ViewerCertificate `type:"structure"` - - // A unique identifier that specifies the AWS WAF web ACL, if any, to associate - // with this distribution. - // - // AWS WAF is a web application firewall that lets you monitor the HTTP and - // HTTPS requests that are forwarded to CloudFront, and lets you control access - // to your content. Based on conditions that you specify, such as the IP addresses - // that requests originate from or the values of query strings, CloudFront responds - // to requests either with the requested content or with an HTTP 403 status - // code (Forbidden). You can also configure CloudFront to return a custom error - // page when a request is blocked. For more information about AWS WAF, see the - // AWS WAF Developer Guide (http://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html). - WebACLId *string `type:"string"` -} - -// String returns the string representation -func (s DistributionConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DistributionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DistributionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DistributionConfig"} - if s.CallerReference == nil { - invalidParams.Add(request.NewErrParamRequired("CallerReference")) - } - if s.Comment == nil { - invalidParams.Add(request.NewErrParamRequired("Comment")) - } - if s.DefaultCacheBehavior == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultCacheBehavior")) - } - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.Origins == nil { - invalidParams.Add(request.NewErrParamRequired("Origins")) - } - if s.Aliases != nil { - if err := s.Aliases.Validate(); err != nil { - invalidParams.AddNested("Aliases", err.(request.ErrInvalidParams)) - } - } - if s.CacheBehaviors != nil { - if err := s.CacheBehaviors.Validate(); err != nil { - invalidParams.AddNested("CacheBehaviors", err.(request.ErrInvalidParams)) - } - } - if s.CustomErrorResponses != nil { - if err := s.CustomErrorResponses.Validate(); err != nil { - invalidParams.AddNested("CustomErrorResponses", err.(request.ErrInvalidParams)) - } - } - if s.DefaultCacheBehavior != nil { - if err := s.DefaultCacheBehavior.Validate(); err != nil { - invalidParams.AddNested("DefaultCacheBehavior", err.(request.ErrInvalidParams)) - } - } - if s.Logging != nil { - if err := s.Logging.Validate(); err != nil { - invalidParams.AddNested("Logging", err.(request.ErrInvalidParams)) - } - } - if s.Origins != nil { - if err := s.Origins.Validate(); err != nil { - invalidParams.AddNested("Origins", err.(request.ErrInvalidParams)) - } - } - if s.Restrictions != nil { - if err := s.Restrictions.Validate(); err != nil { - invalidParams.AddNested("Restrictions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliases sets the Aliases field's value. -func (s *DistributionConfig) SetAliases(v *Aliases) *DistributionConfig { - s.Aliases = v - return s -} - -// SetCacheBehaviors sets the CacheBehaviors field's value. -func (s *DistributionConfig) SetCacheBehaviors(v *CacheBehaviors) *DistributionConfig { - s.CacheBehaviors = v - return s -} - -// SetCallerReference sets the CallerReference field's value. -func (s *DistributionConfig) SetCallerReference(v string) *DistributionConfig { - s.CallerReference = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *DistributionConfig) SetComment(v string) *DistributionConfig { - s.Comment = &v - return s -} - -// SetCustomErrorResponses sets the CustomErrorResponses field's value. -func (s *DistributionConfig) SetCustomErrorResponses(v *CustomErrorResponses) *DistributionConfig { - s.CustomErrorResponses = v - return s -} - -// SetDefaultCacheBehavior sets the DefaultCacheBehavior field's value. -func (s *DistributionConfig) SetDefaultCacheBehavior(v *DefaultCacheBehavior) *DistributionConfig { - s.DefaultCacheBehavior = v - return s -} - -// SetDefaultRootObject sets the DefaultRootObject field's value. -func (s *DistributionConfig) SetDefaultRootObject(v string) *DistributionConfig { - s.DefaultRootObject = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *DistributionConfig) SetEnabled(v bool) *DistributionConfig { - s.Enabled = &v - return s -} - -// SetHttpVersion sets the HttpVersion field's value. -func (s *DistributionConfig) SetHttpVersion(v string) *DistributionConfig { - s.HttpVersion = &v - return s -} - -// SetIsIPV6Enabled sets the IsIPV6Enabled field's value. -func (s *DistributionConfig) SetIsIPV6Enabled(v bool) *DistributionConfig { - s.IsIPV6Enabled = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *DistributionConfig) SetLogging(v *LoggingConfig) *DistributionConfig { - s.Logging = v - return s -} - -// SetOrigins sets the Origins field's value. -func (s *DistributionConfig) SetOrigins(v *Origins) *DistributionConfig { - s.Origins = v - return s -} - -// SetPriceClass sets the PriceClass field's value. -func (s *DistributionConfig) SetPriceClass(v string) *DistributionConfig { - s.PriceClass = &v - return s -} - -// SetRestrictions sets the Restrictions field's value. -func (s *DistributionConfig) SetRestrictions(v *Restrictions) *DistributionConfig { - s.Restrictions = v - return s -} - -// SetViewerCertificate sets the ViewerCertificate field's value. -func (s *DistributionConfig) SetViewerCertificate(v *ViewerCertificate) *DistributionConfig { - s.ViewerCertificate = v - return s -} - -// SetWebACLId sets the WebACLId field's value. -func (s *DistributionConfig) SetWebACLId(v string) *DistributionConfig { - s.WebACLId = &v - return s -} - -// A distribution Configuration and a list of tags to be associated with the -// distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionConfigWithTags -type DistributionConfigWithTags struct { - _ struct{} `type:"structure"` - - // A distribution configuration. - // - // DistributionConfig is a required field - DistributionConfig *DistributionConfig `type:"structure" required:"true"` - - // A complex type that contains zero or more Tag elements. - // - // Tags is a required field - Tags *Tags `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DistributionConfigWithTags) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DistributionConfigWithTags) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DistributionConfigWithTags) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DistributionConfigWithTags"} - if s.DistributionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("DistributionConfig")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.DistributionConfig != nil { - if err := s.DistributionConfig.Validate(); err != nil { - invalidParams.AddNested("DistributionConfig", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - if err := s.Tags.Validate(); err != nil { - invalidParams.AddNested("Tags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDistributionConfig sets the DistributionConfig field's value. -func (s *DistributionConfigWithTags) SetDistributionConfig(v *DistributionConfig) *DistributionConfigWithTags { - s.DistributionConfig = v - return s -} - -// SetTags sets the Tags field's value. -func (s *DistributionConfigWithTags) SetTags(v *Tags) *DistributionConfigWithTags { - s.Tags = v - return s -} - -// A distribution list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionList -type DistributionList struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether more distributions remain to be listed. If - // your results were truncated, you can make a follow-up pagination request - // using the Marker request parameter to retrieve more distributions in the - // list. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // A complex type that contains one DistributionSummary element for each distribution - // that was created by the current AWS account. - Items []*DistributionSummary `locationNameList:"DistributionSummary" type:"list"` - - // The value you provided for the Marker request parameter. - // - // Marker is a required field - Marker *string `type:"string" required:"true"` - - // The value you provided for the MaxItems request parameter. - // - // MaxItems is a required field - MaxItems *int64 `type:"integer" required:"true"` - - // If IsTruncated is true, this element is present and contains the value you - // can use for the Marker request parameter to continue listing your distributions - // where they left off. - NextMarker *string `type:"string"` - - // The number of distributions that were created by the current AWS account. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s DistributionList) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DistributionList) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *DistributionList) SetIsTruncated(v bool) *DistributionList { - s.IsTruncated = &v - return s -} - -// SetItems sets the Items field's value. -func (s *DistributionList) SetItems(v []*DistributionSummary) *DistributionList { - s.Items = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *DistributionList) SetMarker(v string) *DistributionList { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *DistributionList) SetMaxItems(v int64) *DistributionList { - s.MaxItems = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *DistributionList) SetNextMarker(v string) *DistributionList { - s.NextMarker = &v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *DistributionList) SetQuantity(v int64) *DistributionList { - s.Quantity = &v - return s -} - -// A summary of the information about a CloudFront distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/DistributionSummary -type DistributionSummary struct { - _ struct{} `type:"structure"` - - // The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, - // where 123456789012 is your AWS account ID. - // - // ARN is a required field - ARN *string `type:"string" required:"true"` - - // A complex type that contains information about CNAMEs (alternate domain names), - // if any, for this distribution. - // - // Aliases is a required field - Aliases *Aliases `type:"structure" required:"true"` - - // A complex type that contains zero or more CacheBehavior elements. - // - // CacheBehaviors is a required field - CacheBehaviors *CacheBehaviors `type:"structure" required:"true"` - - // The comment originally specified when this distribution was created. - // - // Comment is a required field - Comment *string `type:"string" required:"true"` - - // A complex type that contains zero or more CustomErrorResponses elements. - // - // CustomErrorResponses is a required field - CustomErrorResponses *CustomErrorResponses `type:"structure" required:"true"` - - // A complex type that describes the default cache behavior if you do not specify - // a CacheBehavior element or if files don't match any of the values of PathPattern - // in CacheBehavior elements. You must create exactly one default cache behavior. - // - // DefaultCacheBehavior is a required field - DefaultCacheBehavior *DefaultCacheBehavior `type:"structure" required:"true"` - - // The domain name that corresponds to the distribution. For example: d604721fxaaqy9.cloudfront.net. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // Whether the distribution is enabled to accept user requests for content. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // Specify the maximum HTTP version that you want viewers to use to communicate - // with CloudFront. The default value for new web distributions is http2. Viewers - // that don't support HTTP/2 will automatically use an earlier version. - // - // HttpVersion is a required field - HttpVersion *string `type:"string" required:"true" enum:"HttpVersion"` - - // The identifier for the distribution. For example: EDFDVBD632BHDS5. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // Whether CloudFront responds to IPv6 DNS requests with an IPv6 address for - // your distribution. - // - // IsIPV6Enabled is a required field - IsIPV6Enabled *bool `type:"boolean" required:"true"` - - // The date and time the distribution was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A complex type that contains information about origins for this distribution. - // - // Origins is a required field - Origins *Origins `type:"structure" required:"true"` - - // PriceClass is a required field - PriceClass *string `type:"string" required:"true" enum:"PriceClass"` - - // A complex type that identifies ways in which you want to restrict distribution - // of your content. - // - // Restrictions is a required field - Restrictions *Restrictions `type:"structure" required:"true"` - - // The current status of the distribution. When the status is Deployed, the - // distribution's information is propagated to all CloudFront edge locations. - // - // Status is a required field - Status *string `type:"string" required:"true"` - - // A complex type that specifies the following: - // - // * Which SSL/TLS certificate to use when viewers request objects using - // HTTPS - // - // * Whether you want CloudFront to use dedicated IP addresses or SNI when - // you're using alternate domain names in your object names - // - // * The minimum protocol version that you want CloudFront to use when communicating - // with viewers - // - // For more information, see Using an HTTPS Connection to Access Your Objects - // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html) - // in the Amazon Amazon CloudFront Developer Guide. - // - // ViewerCertificate is a required field - ViewerCertificate *ViewerCertificate `type:"structure" required:"true"` - - // The Web ACL Id (if any) associated with the distribution. - // - // WebACLId is a required field - WebACLId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DistributionSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DistributionSummary) GoString() string { - return s.String() -} - -// SetARN sets the ARN field's value. -func (s *DistributionSummary) SetARN(v string) *DistributionSummary { - s.ARN = &v - return s -} - -// SetAliases sets the Aliases field's value. -func (s *DistributionSummary) SetAliases(v *Aliases) *DistributionSummary { - s.Aliases = v - return s -} - -// SetCacheBehaviors sets the CacheBehaviors field's value. -func (s *DistributionSummary) SetCacheBehaviors(v *CacheBehaviors) *DistributionSummary { - s.CacheBehaviors = v - return s -} - -// SetComment sets the Comment field's value. -func (s *DistributionSummary) SetComment(v string) *DistributionSummary { - s.Comment = &v - return s -} - -// SetCustomErrorResponses sets the CustomErrorResponses field's value. -func (s *DistributionSummary) SetCustomErrorResponses(v *CustomErrorResponses) *DistributionSummary { - s.CustomErrorResponses = v - return s -} - -// SetDefaultCacheBehavior sets the DefaultCacheBehavior field's value. -func (s *DistributionSummary) SetDefaultCacheBehavior(v *DefaultCacheBehavior) *DistributionSummary { - s.DefaultCacheBehavior = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *DistributionSummary) SetDomainName(v string) *DistributionSummary { - s.DomainName = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *DistributionSummary) SetEnabled(v bool) *DistributionSummary { - s.Enabled = &v - return s -} - -// SetHttpVersion sets the HttpVersion field's value. -func (s *DistributionSummary) SetHttpVersion(v string) *DistributionSummary { - s.HttpVersion = &v - return s -} - -// SetId sets the Id field's value. -func (s *DistributionSummary) SetId(v string) *DistributionSummary { - s.Id = &v - return s -} - -// SetIsIPV6Enabled sets the IsIPV6Enabled field's value. -func (s *DistributionSummary) SetIsIPV6Enabled(v bool) *DistributionSummary { - s.IsIPV6Enabled = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DistributionSummary) SetLastModifiedTime(v time.Time) *DistributionSummary { - s.LastModifiedTime = &v - return s -} - -// SetOrigins sets the Origins field's value. -func (s *DistributionSummary) SetOrigins(v *Origins) *DistributionSummary { - s.Origins = v - return s -} - -// SetPriceClass sets the PriceClass field's value. -func (s *DistributionSummary) SetPriceClass(v string) *DistributionSummary { - s.PriceClass = &v - return s -} - -// SetRestrictions sets the Restrictions field's value. -func (s *DistributionSummary) SetRestrictions(v *Restrictions) *DistributionSummary { - s.Restrictions = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DistributionSummary) SetStatus(v string) *DistributionSummary { - s.Status = &v - return s -} - -// SetViewerCertificate sets the ViewerCertificate field's value. -func (s *DistributionSummary) SetViewerCertificate(v *ViewerCertificate) *DistributionSummary { - s.ViewerCertificate = v - return s -} - -// SetWebACLId sets the WebACLId field's value. -func (s *DistributionSummary) SetWebACLId(v string) *DistributionSummary { - s.WebACLId = &v - return s -} - -// A complex type that specifies how CloudFront handles query strings and cookies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ForwardedValues -type ForwardedValues struct { - _ struct{} `type:"structure"` - - // A complex type that specifies whether you want CloudFront to forward cookies - // to the origin and, if so, which ones. For more information about forwarding - // cookies to the origin, see How CloudFront Forwards, Caches, and Logs Cookies - // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) - // in the Amazon CloudFront Developer Guide. - // - // Cookies is a required field - Cookies *CookiePreference `type:"structure" required:"true"` - - // A complex type that specifies the Headers, if any, that you want CloudFront - // to vary upon for this cache behavior. - Headers *Headers `type:"structure"` - - // Indicates whether you want CloudFront to forward query strings to the origin - // that is associated with this cache behavior and cache based on the query - // string parameters. CloudFront behavior depends on the value of QueryString - // and on the values that you specify for QueryStringCacheKeys, if any: - // - // If you specify true for QueryString and you don't specify any values for - // QueryStringCacheKeys, CloudFront forwards all query string parameters to - // the origin and caches based on all query string parameters. Depending on - // how many query string parameters and values you have, this can adversely - // affect performance because CloudFront must forward more requests to the origin. - // - // If you specify true for QueryString and you specify one or more values for - // QueryStringCacheKeys, CloudFront forwards all query string parameters to - // the origin, but it only caches based on the query string parameters that - // you specify. - // - // If you specify false for QueryString, CloudFront doesn't forward any query - // string parameters to the origin, and doesn't cache based on query string - // parameters. - // - // For more information, see Configuring CloudFront to Cache Based on Query - // String Parameters (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html) - // in the Amazon CloudFront Developer Guide. - // - // QueryString is a required field - QueryString *bool `type:"boolean" required:"true"` - - // A complex type that contains information about the query string parameters - // that you want CloudFront to use for caching for this cache behavior. - QueryStringCacheKeys *QueryStringCacheKeys `type:"structure"` -} - -// String returns the string representation -func (s ForwardedValues) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ForwardedValues) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ForwardedValues) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ForwardedValues"} - if s.Cookies == nil { - invalidParams.Add(request.NewErrParamRequired("Cookies")) - } - if s.QueryString == nil { - invalidParams.Add(request.NewErrParamRequired("QueryString")) - } - if s.Cookies != nil { - if err := s.Cookies.Validate(); err != nil { - invalidParams.AddNested("Cookies", err.(request.ErrInvalidParams)) - } - } - if s.Headers != nil { - if err := s.Headers.Validate(); err != nil { - invalidParams.AddNested("Headers", err.(request.ErrInvalidParams)) - } - } - if s.QueryStringCacheKeys != nil { - if err := s.QueryStringCacheKeys.Validate(); err != nil { - invalidParams.AddNested("QueryStringCacheKeys", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCookies sets the Cookies field's value. -func (s *ForwardedValues) SetCookies(v *CookiePreference) *ForwardedValues { - s.Cookies = v - return s -} - -// SetHeaders sets the Headers field's value. -func (s *ForwardedValues) SetHeaders(v *Headers) *ForwardedValues { - s.Headers = v - return s -} - -// SetQueryString sets the QueryString field's value. -func (s *ForwardedValues) SetQueryString(v bool) *ForwardedValues { - s.QueryString = &v - return s -} - -// SetQueryStringCacheKeys sets the QueryStringCacheKeys field's value. -func (s *ForwardedValues) SetQueryStringCacheKeys(v *QueryStringCacheKeys) *ForwardedValues { - s.QueryStringCacheKeys = v - return s -} - -// A complex type that controls the countries in which your content is distributed. -// CloudFront determines the location of your users using MaxMind GeoIP databases. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GeoRestriction -type GeoRestriction struct { - _ struct{} `type:"structure"` - - // A complex type that contains a Location element for each country in which - // you want CloudFront either to distribute your content (whitelist) or not - // distribute your content (blacklist). - // - // The Location element is a two-letter, uppercase country code for a country - // that you want to include in your blacklist or whitelist. Include one Location - // element for each country. - // - // CloudFront and MaxMind both use ISO 3166 country codes. For the current list - // of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on - // the International Organization for Standardization website. You can also - // refer to the country list in the CloudFront console, which includes both - // country names and codes. - Items []*string `locationNameList:"Location" type:"list"` - - // When geo restriction is enabled, this is the number of countries in your - // whitelist or blacklist. Otherwise, when it is not enabled, Quantity is 0, - // and you can omit Items. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` - - // The method that you want to use to restrict distribution of your content - // by country: - // - // * none: No geo restriction is enabled, meaning access to content is not - // restricted by client geo location. - // - // * blacklist: The Location elements specify the countries in which you - // do not want CloudFront to distribute your content. - // - // * whitelist: The Location elements specify the countries in which you - // want CloudFront to distribute your content. - // - // RestrictionType is a required field - RestrictionType *string `type:"string" required:"true" enum:"GeoRestrictionType"` -} - -// String returns the string representation -func (s GeoRestriction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GeoRestriction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GeoRestriction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GeoRestriction"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - if s.RestrictionType == nil { - invalidParams.Add(request.NewErrParamRequired("RestrictionType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *GeoRestriction) SetItems(v []*string) *GeoRestriction { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *GeoRestriction) SetQuantity(v int64) *GeoRestriction { - s.Quantity = &v - return s -} - -// SetRestrictionType sets the RestrictionType field's value. -func (s *GeoRestriction) SetRestrictionType(v string) *GeoRestriction { - s.RestrictionType = &v - return s -} - -// The origin access identity's configuration information. For more information, -// see CloudFrontOriginAccessIdentityConfigComplexType. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfigRequest -type GetCloudFrontOriginAccessIdentityConfigInput struct { - _ struct{} `type:"structure"` - - // The identity's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetCloudFrontOriginAccessIdentityConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCloudFrontOriginAccessIdentityConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCloudFrontOriginAccessIdentityConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCloudFrontOriginAccessIdentityConfigInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetCloudFrontOriginAccessIdentityConfigInput) SetId(v string) *GetCloudFrontOriginAccessIdentityConfigInput { - s.Id = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityConfigResult -type GetCloudFrontOriginAccessIdentityConfigOutput struct { - _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityConfig"` - - // The origin access identity's configuration information. - CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `type:"structure"` - - // The current version of the configuration. For example: E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` -} - -// String returns the string representation -func (s GetCloudFrontOriginAccessIdentityConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCloudFrontOriginAccessIdentityConfigOutput) GoString() string { - return s.String() -} - -// SetCloudFrontOriginAccessIdentityConfig sets the CloudFrontOriginAccessIdentityConfig field's value. -func (s *GetCloudFrontOriginAccessIdentityConfigOutput) SetCloudFrontOriginAccessIdentityConfig(v *OriginAccessIdentityConfig) *GetCloudFrontOriginAccessIdentityConfigOutput { - s.CloudFrontOriginAccessIdentityConfig = v - return s -} - -// SetETag sets the ETag field's value. -func (s *GetCloudFrontOriginAccessIdentityConfigOutput) SetETag(v string) *GetCloudFrontOriginAccessIdentityConfigOutput { - s.ETag = &v - return s -} - -// The request to get an origin access identity's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityRequest -type GetCloudFrontOriginAccessIdentityInput struct { - _ struct{} `type:"structure"` - - // The identity's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetCloudFrontOriginAccessIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCloudFrontOriginAccessIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCloudFrontOriginAccessIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCloudFrontOriginAccessIdentityInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetCloudFrontOriginAccessIdentityInput) SetId(v string) *GetCloudFrontOriginAccessIdentityInput { - s.Id = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetCloudFrontOriginAccessIdentityResult -type GetCloudFrontOriginAccessIdentityOutput struct { - _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentity"` - - // The origin access identity's information. - CloudFrontOriginAccessIdentity *OriginAccessIdentity `type:"structure"` - - // The current version of the origin access identity's information. For example: - // E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` -} - -// String returns the string representation -func (s GetCloudFrontOriginAccessIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCloudFrontOriginAccessIdentityOutput) GoString() string { - return s.String() -} - -// SetCloudFrontOriginAccessIdentity sets the CloudFrontOriginAccessIdentity field's value. -func (s *GetCloudFrontOriginAccessIdentityOutput) SetCloudFrontOriginAccessIdentity(v *OriginAccessIdentity) *GetCloudFrontOriginAccessIdentityOutput { - s.CloudFrontOriginAccessIdentity = v - return s -} - -// SetETag sets the ETag field's value. -func (s *GetCloudFrontOriginAccessIdentityOutput) SetETag(v string) *GetCloudFrontOriginAccessIdentityOutput { - s.ETag = &v - return s -} - -// The request to get a distribution configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfigRequest -type GetDistributionConfigInput struct { - _ struct{} `type:"structure"` - - // The distribution's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDistributionConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDistributionConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDistributionConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDistributionConfigInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetDistributionConfigInput) SetId(v string) *GetDistributionConfigInput { - s.Id = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionConfigResult -type GetDistributionConfigOutput struct { - _ struct{} `type:"structure" payload:"DistributionConfig"` - - // The distribution's configuration information. - DistributionConfig *DistributionConfig `type:"structure"` - - // The current version of the configuration. For example: E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` -} - -// String returns the string representation -func (s GetDistributionConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDistributionConfigOutput) GoString() string { - return s.String() -} - -// SetDistributionConfig sets the DistributionConfig field's value. -func (s *GetDistributionConfigOutput) SetDistributionConfig(v *DistributionConfig) *GetDistributionConfigOutput { - s.DistributionConfig = v - return s -} - -// SetETag sets the ETag field's value. -func (s *GetDistributionConfigOutput) SetETag(v string) *GetDistributionConfigOutput { - s.ETag = &v - return s -} - -// The request to get a distribution's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionRequest -type GetDistributionInput struct { - _ struct{} `type:"structure"` - - // The distribution's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDistributionInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetDistributionInput) SetId(v string) *GetDistributionInput { - s.Id = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetDistributionResult -type GetDistributionOutput struct { - _ struct{} `type:"structure" payload:"Distribution"` - - // The distribution's information. - Distribution *Distribution `type:"structure"` - - // The current version of the distribution's information. For example: E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` -} - -// String returns the string representation -func (s GetDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDistributionOutput) GoString() string { - return s.String() -} - -// SetDistribution sets the Distribution field's value. -func (s *GetDistributionOutput) SetDistribution(v *Distribution) *GetDistributionOutput { - s.Distribution = v - return s -} - -// SetETag sets the ETag field's value. -func (s *GetDistributionOutput) SetETag(v string) *GetDistributionOutput { - s.ETag = &v - return s -} - -// The request to get an invalidation's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidationRequest -type GetInvalidationInput struct { - _ struct{} `type:"structure"` - - // The distribution's ID. - // - // DistributionId is a required field - DistributionId *string `location:"uri" locationName:"DistributionId" type:"string" required:"true"` - - // The identifier for the invalidation request, for example, IDFDVBD632BHDS5. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetInvalidationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInvalidationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInvalidationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInvalidationInput"} - if s.DistributionId == nil { - invalidParams.Add(request.NewErrParamRequired("DistributionId")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDistributionId sets the DistributionId field's value. -func (s *GetInvalidationInput) SetDistributionId(v string) *GetInvalidationInput { - s.DistributionId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetInvalidationInput) SetId(v string) *GetInvalidationInput { - s.Id = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetInvalidationResult -type GetInvalidationOutput struct { - _ struct{} `type:"structure" payload:"Invalidation"` - - // The invalidation's information. For more information, see Invalidation Complex - // Type (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/InvalidationDatatype.html). - Invalidation *Invalidation `type:"structure"` -} - -// String returns the string representation -func (s GetInvalidationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetInvalidationOutput) GoString() string { - return s.String() -} - -// SetInvalidation sets the Invalidation field's value. -func (s *GetInvalidationOutput) SetInvalidation(v *Invalidation) *GetInvalidationOutput { - s.Invalidation = v - return s -} - -// To request to get a streaming distribution configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfigRequest -type GetStreamingDistributionConfigInput struct { - _ struct{} `type:"structure"` - - // The streaming distribution's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetStreamingDistributionConfigInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStreamingDistributionConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStreamingDistributionConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStreamingDistributionConfigInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetStreamingDistributionConfigInput) SetId(v string) *GetStreamingDistributionConfigInput { - s.Id = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionConfigResult -type GetStreamingDistributionConfigOutput struct { - _ struct{} `type:"structure" payload:"StreamingDistributionConfig"` - - // The current version of the configuration. For example: E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The streaming distribution's configuration information. - StreamingDistributionConfig *StreamingDistributionConfig `type:"structure"` -} - -// String returns the string representation -func (s GetStreamingDistributionConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStreamingDistributionConfigOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *GetStreamingDistributionConfigOutput) SetETag(v string) *GetStreamingDistributionConfigOutput { - s.ETag = &v - return s -} - -// SetStreamingDistributionConfig sets the StreamingDistributionConfig field's value. -func (s *GetStreamingDistributionConfigOutput) SetStreamingDistributionConfig(v *StreamingDistributionConfig) *GetStreamingDistributionConfigOutput { - s.StreamingDistributionConfig = v - return s -} - -// The request to get a streaming distribution's information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionRequest -type GetStreamingDistributionInput struct { - _ struct{} `type:"structure"` - - // The streaming distribution's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetStreamingDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStreamingDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStreamingDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStreamingDistributionInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetStreamingDistributionInput) SetId(v string) *GetStreamingDistributionInput { - s.Id = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/GetStreamingDistributionResult -type GetStreamingDistributionOutput struct { - _ struct{} `type:"structure" payload:"StreamingDistribution"` - - // The current version of the streaming distribution's information. For example: - // E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The streaming distribution's information. - StreamingDistribution *StreamingDistribution `type:"structure"` -} - -// String returns the string representation -func (s GetStreamingDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetStreamingDistributionOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *GetStreamingDistributionOutput) SetETag(v string) *GetStreamingDistributionOutput { - s.ETag = &v - return s -} - -// SetStreamingDistribution sets the StreamingDistribution field's value. -func (s *GetStreamingDistributionOutput) SetStreamingDistribution(v *StreamingDistribution) *GetStreamingDistributionOutput { - s.StreamingDistribution = v - return s -} - -// A complex type that specifies the headers that you want CloudFront to forward -// to the origin for this cache behavior. -// -// For the headers that you specify, CloudFront also caches separate versions -// of a specified object based on the header values in viewer requests. For -// example, suppose viewer requests for logo.jpg contain a custom Product header -// that has a value of either Acme or Apex, and you configure CloudFront to -// cache your content based on values in the Product header. CloudFront forwards -// the Product header to the origin and caches the response from the origin -// once for each header value. For more information about caching based on header -// values, see How CloudFront Forwards and Caches Headers (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Headers -type Headers struct { - _ struct{} `type:"structure"` - - // A complex type that contains one Name element for each header that you want - // CloudFront to forward to the origin and to vary on for this cache behavior. - // If Quantity is 0, omit Items. - Items []*string `locationNameList:"Name" type:"list"` - - // The number of different headers that you want CloudFront to forward to the - // origin for this cache behavior. You can configure each cache behavior in - // a web distribution to do one of the following: - // - // * Forward all headers to your origin: Specify 1 for Quantity and * for - // Name. - // - // If you configure CloudFront to forward all headers to your origin, CloudFront - // doesn't cache the objects associated with this cache behavior. Instead, - // it sends every request to the origin. - // - // * Forward a whitelist of headers you specify: Specify the number of headers - // that you want to forward, and specify the header names in Name elements. - // CloudFront caches your objects based on the values in all of the specified - // headers. CloudFront also forwards the headers that it forwards by default, - // but it caches your objects based only on the headers that you specify. - // - // - // * Forward only the default headers: Specify 0 for Quantity and omit Items. - // In this configuration, CloudFront doesn't cache based on the values in - // the request headers. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s Headers) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Headers) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Headers) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Headers"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *Headers) SetItems(v []*string) *Headers { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *Headers) SetQuantity(v int64) *Headers { - s.Quantity = &v - return s -} - -// An invalidation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Invalidation -type Invalidation struct { - _ struct{} `type:"structure"` - - // The date and time the invalidation request was first made. - // - // CreateTime is a required field - CreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The identifier for the invalidation request. For example: IDFDVBD632BHDS5. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The current invalidation information for the batch request. - // - // InvalidationBatch is a required field - InvalidationBatch *InvalidationBatch `type:"structure" required:"true"` - - // The status of the invalidation request. When the invalidation batch is finished, - // the status is Completed. - // - // Status is a required field - Status *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Invalidation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Invalidation) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *Invalidation) SetCreateTime(v time.Time) *Invalidation { - s.CreateTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *Invalidation) SetId(v string) *Invalidation { - s.Id = &v - return s -} - -// SetInvalidationBatch sets the InvalidationBatch field's value. -func (s *Invalidation) SetInvalidationBatch(v *InvalidationBatch) *Invalidation { - s.InvalidationBatch = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Invalidation) SetStatus(v string) *Invalidation { - s.Status = &v - return s -} - -// An invalidation batch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/InvalidationBatch -type InvalidationBatch struct { - _ struct{} `type:"structure"` - - // A value that you specify to uniquely identify an invalidation request. CloudFront - // uses the value to prevent you from accidentally resubmitting an identical - // request. Whenever you create a new invalidation request, you must specify - // a new value for CallerReference and change other values in the request as - // applicable. One way to ensure that the value of CallerReference is unique - // is to use a timestamp, for example, 20120301090000. - // - // If you make a second invalidation request with the same value for CallerReference, - // and if the rest of the request is the same, CloudFront doesn't create a new - // invalidation request. Instead, CloudFront returns information about the invalidation - // request that you previously created with the same CallerReference. - // - // If CallerReference is a value you already sent in a previous invalidation - // batch request but the content of any Path is different from the original - // request, CloudFront returns an InvalidationBatchAlreadyExists error. - // - // CallerReference is a required field - CallerReference *string `type:"string" required:"true"` - - // A complex type that contains information about the objects that you want - // to invalidate. For more information, see Specifying the Objects to Invalidate - // (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidation-specifying-objects) - // in the Amazon CloudFront Developer Guide. - // - // Paths is a required field - Paths *Paths `type:"structure" required:"true"` -} - -// String returns the string representation -func (s InvalidationBatch) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvalidationBatch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvalidationBatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvalidationBatch"} - if s.CallerReference == nil { - invalidParams.Add(request.NewErrParamRequired("CallerReference")) - } - if s.Paths == nil { - invalidParams.Add(request.NewErrParamRequired("Paths")) - } - if s.Paths != nil { - if err := s.Paths.Validate(); err != nil { - invalidParams.AddNested("Paths", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallerReference sets the CallerReference field's value. -func (s *InvalidationBatch) SetCallerReference(v string) *InvalidationBatch { - s.CallerReference = &v - return s -} - -// SetPaths sets the Paths field's value. -func (s *InvalidationBatch) SetPaths(v *Paths) *InvalidationBatch { - s.Paths = v - return s -} - -// The InvalidationList complex type describes the list of invalidation objects. -// For more information about invalidation, see Invalidating Objects (Web Distributions -// Only) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/InvalidationList -type InvalidationList struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether more invalidation batch requests remain to - // be listed. If your results were truncated, you can make a follow-up pagination - // request using the Marker request parameter to retrieve more invalidation - // batches in the list. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // A complex type that contains one InvalidationSummary element for each invalidation - // batch created by the current AWS account. - Items []*InvalidationSummary `locationNameList:"InvalidationSummary" type:"list"` - - // The value that you provided for the Marker request parameter. - // - // Marker is a required field - Marker *string `type:"string" required:"true"` - - // The value that you provided for the MaxItems request parameter. - // - // MaxItems is a required field - MaxItems *int64 `type:"integer" required:"true"` - - // If IsTruncated is true, this element is present and contains the value that - // you can use for the Marker request parameter to continue listing your invalidation - // batches where they left off. - NextMarker *string `type:"string"` - - // The number of invalidation batches that were created by the current AWS account. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s InvalidationList) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvalidationList) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *InvalidationList) SetIsTruncated(v bool) *InvalidationList { - s.IsTruncated = &v - return s -} - -// SetItems sets the Items field's value. -func (s *InvalidationList) SetItems(v []*InvalidationSummary) *InvalidationList { - s.Items = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *InvalidationList) SetMarker(v string) *InvalidationList { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *InvalidationList) SetMaxItems(v int64) *InvalidationList { - s.MaxItems = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *InvalidationList) SetNextMarker(v string) *InvalidationList { - s.NextMarker = &v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *InvalidationList) SetQuantity(v int64) *InvalidationList { - s.Quantity = &v - return s -} - -// A summary of an invalidation request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/InvalidationSummary -type InvalidationSummary struct { - _ struct{} `type:"structure"` - - // CreateTime is a required field - CreateTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The unique ID for an invalidation request. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The status of an invalidation request. - // - // Status is a required field - Status *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s InvalidationSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InvalidationSummary) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *InvalidationSummary) SetCreateTime(v time.Time) *InvalidationSummary { - s.CreateTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *InvalidationSummary) SetId(v string) *InvalidationSummary { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InvalidationSummary) SetStatus(v string) *InvalidationSummary { - s.Status = &v - return s -} - -// A complex type that lists the active CloudFront key pairs, if any, that are -// associated with AwsAccountNumber. -// -// For more information, see ActiveTrustedSigners. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/KeyPairIds -type KeyPairIds struct { - _ struct{} `type:"structure"` - - // A complex type that lists the active CloudFront key pairs, if any, that are - // associated with AwsAccountNumber. - // - // For more information, see ActiveTrustedSigners. - Items []*string `locationNameList:"KeyPairId" type:"list"` - - // The number of active CloudFront key pairs for AwsAccountNumber. - // - // For more information, see ActiveTrustedSigners. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s KeyPairIds) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyPairIds) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *KeyPairIds) SetItems(v []*string) *KeyPairIds { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *KeyPairIds) SetQuantity(v int64) *KeyPairIds { - s.Quantity = &v - return s -} - -// A complex type that contains a Lambda function association. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/LambdaFunctionAssociation -type LambdaFunctionAssociation struct { - _ struct{} `type:"structure"` - - // Specifies the event type that triggers a Lambda function invocation. Valid - // values are: - // - // * viewer-request - // - // * origin-request - // - // * viewer-response - // - // * origin-response - EventType *string `type:"string" enum:"EventType"` - - // The ARN of the Lambda function. - LambdaFunctionARN *string `type:"string"` -} - -// String returns the string representation -func (s LambdaFunctionAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionAssociation) GoString() string { - return s.String() -} - -// SetEventType sets the EventType field's value. -func (s *LambdaFunctionAssociation) SetEventType(v string) *LambdaFunctionAssociation { - s.EventType = &v - return s -} - -// SetLambdaFunctionARN sets the LambdaFunctionARN field's value. -func (s *LambdaFunctionAssociation) SetLambdaFunctionARN(v string) *LambdaFunctionAssociation { - s.LambdaFunctionARN = &v - return s -} - -// A complex type that specifies a list of Lambda functions associations for -// a cache behavior. -// -// If you want to invoke one or more Lambda functions triggered by requests -// that match the PathPattern of the cache behavior, specify the applicable -// values for Quantity and Items. Note that there can be up to 4 LambdaFunctionAssociation -// items in this list (one for each possible value of EventType) and each EventType -// can be associated with the Lambda function only once. -// -// If you don't want to invoke any Lambda functions for the requests that match -// PathPattern, specify 0 for Quantity and omit Items. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/LambdaFunctionAssociations -type LambdaFunctionAssociations struct { - _ struct{} `type:"structure"` - - // Optional: A complex type that contains LambdaFunctionAssociation items for - // this cache behavior. If Quantity is 0, you can omit Items. - Items []*LambdaFunctionAssociation `locationNameList:"LambdaFunctionAssociation" type:"list"` - - // The number of Lambda function associations for this cache behavior. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s LambdaFunctionAssociations) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionAssociations) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LambdaFunctionAssociations) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LambdaFunctionAssociations"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *LambdaFunctionAssociations) SetItems(v []*LambdaFunctionAssociation) *LambdaFunctionAssociations { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *LambdaFunctionAssociations) SetQuantity(v int64) *LambdaFunctionAssociations { - s.Quantity = &v - return s -} - -// The request to list origin access identities. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentitiesRequest -type ListCloudFrontOriginAccessIdentitiesInput struct { - _ struct{} `type:"structure"` - - // Use this when paginating results to indicate where to begin in your list - // of origin access identities. The results include identities in the list that - // occur after the marker. To get the next page of results, set the Marker to - // the value of the NextMarker from the current page's response (which is also - // the ID of the last identity on that page). - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // The maximum number of origin access identities you want in the response body. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" type:"integer"` -} - -// String returns the string representation -func (s ListCloudFrontOriginAccessIdentitiesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCloudFrontOriginAccessIdentitiesInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListCloudFrontOriginAccessIdentitiesInput) SetMarker(v string) *ListCloudFrontOriginAccessIdentitiesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListCloudFrontOriginAccessIdentitiesInput) SetMaxItems(v int64) *ListCloudFrontOriginAccessIdentitiesInput { - s.MaxItems = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListCloudFrontOriginAccessIdentitiesResult -type ListCloudFrontOriginAccessIdentitiesOutput struct { - _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityList"` - - // The CloudFrontOriginAccessIdentityList type. - CloudFrontOriginAccessIdentityList *OriginAccessIdentityList `type:"structure"` -} - -// String returns the string representation -func (s ListCloudFrontOriginAccessIdentitiesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListCloudFrontOriginAccessIdentitiesOutput) GoString() string { - return s.String() -} - -// SetCloudFrontOriginAccessIdentityList sets the CloudFrontOriginAccessIdentityList field's value. -func (s *ListCloudFrontOriginAccessIdentitiesOutput) SetCloudFrontOriginAccessIdentityList(v *OriginAccessIdentityList) *ListCloudFrontOriginAccessIdentitiesOutput { - s.CloudFrontOriginAccessIdentityList = v - return s -} - -// The request to list distributions that are associated with a specified AWS -// WAF web ACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLIdRequest -type ListDistributionsByWebACLIdInput struct { - _ struct{} `type:"structure"` - - // Use Marker and MaxItems to control pagination of results. If you have more - // than MaxItems distributions that satisfy the request, the response includes - // a NextMarker element. To get the next page of results, submit another request. - // For the value of Marker, specify the value of NextMarker from the last response. - // (For the first request, omit Marker.) - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // The maximum number of distributions that you want CloudFront to return in - // the response body. The maximum and default values are both 100. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" type:"integer"` - - // The ID of the AWS WAF web ACL that you want to list the associated distributions. - // If you specify "null" for the ID, the request returns a list of the distributions - // that aren't associated with a web ACL. - // - // WebACLId is a required field - WebACLId *string `location:"uri" locationName:"WebACLId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListDistributionsByWebACLIdInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDistributionsByWebACLIdInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDistributionsByWebACLIdInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDistributionsByWebACLIdInput"} - if s.WebACLId == nil { - invalidParams.Add(request.NewErrParamRequired("WebACLId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMarker sets the Marker field's value. -func (s *ListDistributionsByWebACLIdInput) SetMarker(v string) *ListDistributionsByWebACLIdInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListDistributionsByWebACLIdInput) SetMaxItems(v int64) *ListDistributionsByWebACLIdInput { - s.MaxItems = &v - return s -} - -// SetWebACLId sets the WebACLId field's value. -func (s *ListDistributionsByWebACLIdInput) SetWebACLId(v string) *ListDistributionsByWebACLIdInput { - s.WebACLId = &v - return s -} - -// The response to a request to list the distributions that are associated with -// a specified AWS WAF web ACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsByWebACLIdResult -type ListDistributionsByWebACLIdOutput struct { - _ struct{} `type:"structure" payload:"DistributionList"` - - // The DistributionList type. - DistributionList *DistributionList `type:"structure"` -} - -// String returns the string representation -func (s ListDistributionsByWebACLIdOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDistributionsByWebACLIdOutput) GoString() string { - return s.String() -} - -// SetDistributionList sets the DistributionList field's value. -func (s *ListDistributionsByWebACLIdOutput) SetDistributionList(v *DistributionList) *ListDistributionsByWebACLIdOutput { - s.DistributionList = v - return s -} - -// The request to list your distributions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsRequest -type ListDistributionsInput struct { - _ struct{} `type:"structure"` - - // Use this when paginating results to indicate where to begin in your list - // of distributions. The results include distributions in the list that occur - // after the marker. To get the next page of results, set the Marker to the - // value of the NextMarker from the current page's response (which is also the - // ID of the last distribution on that page). - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // The maximum number of distributions you want in the response body. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" type:"integer"` -} - -// String returns the string representation -func (s ListDistributionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDistributionsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListDistributionsInput) SetMarker(v string) *ListDistributionsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListDistributionsInput) SetMaxItems(v int64) *ListDistributionsInput { - s.MaxItems = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListDistributionsResult -type ListDistributionsOutput struct { - _ struct{} `type:"structure" payload:"DistributionList"` - - // The DistributionList type. - DistributionList *DistributionList `type:"structure"` -} - -// String returns the string representation -func (s ListDistributionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDistributionsOutput) GoString() string { - return s.String() -} - -// SetDistributionList sets the DistributionList field's value. -func (s *ListDistributionsOutput) SetDistributionList(v *DistributionList) *ListDistributionsOutput { - s.DistributionList = v - return s -} - -// The request to list invalidations. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidationsRequest -type ListInvalidationsInput struct { - _ struct{} `type:"structure"` - - // The distribution's ID. - // - // DistributionId is a required field - DistributionId *string `location:"uri" locationName:"DistributionId" type:"string" required:"true"` - - // Use this parameter when paginating results to indicate where to begin in - // your list of invalidation batches. Because the results are returned in decreasing - // order from most recent to oldest, the most recent results are on the first - // page, the second page will contain earlier results, and so on. To get the - // next page of results, set Marker to the value of the NextMarker from the - // current page's response. This value is the same as the ID of the last invalidation - // batch on that page. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // The maximum number of invalidation batches that you want in the response - // body. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" type:"integer"` -} - -// String returns the string representation -func (s ListInvalidationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInvalidationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInvalidationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInvalidationsInput"} - if s.DistributionId == nil { - invalidParams.Add(request.NewErrParamRequired("DistributionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDistributionId sets the DistributionId field's value. -func (s *ListInvalidationsInput) SetDistributionId(v string) *ListInvalidationsInput { - s.DistributionId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListInvalidationsInput) SetMarker(v string) *ListInvalidationsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListInvalidationsInput) SetMaxItems(v int64) *ListInvalidationsInput { - s.MaxItems = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListInvalidationsResult -type ListInvalidationsOutput struct { - _ struct{} `type:"structure" payload:"InvalidationList"` - - // Information about invalidation batches. - InvalidationList *InvalidationList `type:"structure"` -} - -// String returns the string representation -func (s ListInvalidationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListInvalidationsOutput) GoString() string { - return s.String() -} - -// SetInvalidationList sets the InvalidationList field's value. -func (s *ListInvalidationsOutput) SetInvalidationList(v *InvalidationList) *ListInvalidationsOutput { - s.InvalidationList = v - return s -} - -// The request to list your streaming distributions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributionsRequest -type ListStreamingDistributionsInput struct { - _ struct{} `type:"structure"` - - // The value that you provided for the Marker request parameter. - Marker *string `location:"querystring" locationName:"Marker" type:"string"` - - // The value that you provided for the MaxItems request parameter. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" type:"integer"` -} - -// String returns the string representation -func (s ListStreamingDistributionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStreamingDistributionsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListStreamingDistributionsInput) SetMarker(v string) *ListStreamingDistributionsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListStreamingDistributionsInput) SetMaxItems(v int64) *ListStreamingDistributionsInput { - s.MaxItems = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListStreamingDistributionsResult -type ListStreamingDistributionsOutput struct { - _ struct{} `type:"structure" payload:"StreamingDistributionList"` - - // The StreamingDistributionList type. - StreamingDistributionList *StreamingDistributionList `type:"structure"` -} - -// String returns the string representation -func (s ListStreamingDistributionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStreamingDistributionsOutput) GoString() string { - return s.String() -} - -// SetStreamingDistributionList sets the StreamingDistributionList field's value. -func (s *ListStreamingDistributionsOutput) SetStreamingDistributionList(v *StreamingDistributionList) *ListStreamingDistributionsOutput { - s.StreamingDistributionList = v - return s -} - -// The request to list tags for a CloudFront resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResourceRequest -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // An ARN of a CloudFront resource. - // - // Resource is a required field - Resource *string `location:"querystring" locationName:"Resource" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsForResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResource sets the Resource field's value. -func (s *ListTagsForResourceInput) SetResource(v string) *ListTagsForResourceInput { - s.Resource = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ListTagsForResourceResult -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure" payload:"Tags"` - - // A complex type that contains zero or more Tag elements. - // - // Tags is a required field - Tags *Tags `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ListTagsForResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v *Tags) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// A complex type that controls whether access logs are written for the distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/LoggingConfig -type LoggingConfig struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // Specifies whether you want CloudFront to save access logs to an Amazon S3 - // bucket. If you do not want to enable logging when you create a distribution - // or if you want to disable logging for an existing distribution, specify false - // for Enabled, and specify empty Bucket and Prefix elements. If you specify - // false for Enabled but you specify values for Bucket, prefix, and IncludeCookies, - // the values are automatically deleted. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // Specifies whether you want CloudFront to include cookies in access logs, - // specify true for IncludeCookies. If you choose to include cookies in logs, - // CloudFront logs all cookies regardless of how you configure the cache behaviors - // for this distribution. If you do not want to include cookies when you create - // a distribution or if you want to disable include cookies for an existing - // distribution, specify false for IncludeCookies. - // - // IncludeCookies is a required field - IncludeCookies *bool `type:"boolean" required:"true"` - - // An optional string that you want CloudFront to prefix to the access log filenames - // for this distribution, for example, myprefix/. If you want to enable logging, - // but you do not want to specify a prefix, you still must include an empty - // Prefix element in the Logging element. - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s LoggingConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoggingConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoggingConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoggingConfig"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.IncludeCookies == nil { - invalidParams.Add(request.NewErrParamRequired("IncludeCookies")) - } - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *LoggingConfig) SetBucket(v string) *LoggingConfig { - s.Bucket = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *LoggingConfig) SetEnabled(v bool) *LoggingConfig { - s.Enabled = &v - return s -} - -// SetIncludeCookies sets the IncludeCookies field's value. -func (s *LoggingConfig) SetIncludeCookies(v bool) *LoggingConfig { - s.IncludeCookies = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *LoggingConfig) SetPrefix(v string) *LoggingConfig { - s.Prefix = &v - return s -} - -// A complex type that describes the Amazon S3 bucket or the HTTP server (for -// example, a web server) from which CloudFront gets your files. You must create -// at least one origin. -// -// For the current limit on the number of origins that you can create for a -// distribution, see Amazon CloudFront Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_cloudfront) -// in the AWS General Reference. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Origin -type Origin struct { - _ struct{} `type:"structure"` - - // A complex type that contains names and values for the custom headers that - // you want. - CustomHeaders *CustomHeaders `type:"structure"` - - // A complex type that contains information about a custom origin. If the origin - // is an Amazon S3 bucket, use the S3OriginConfig element instead. - CustomOriginConfig *CustomOriginConfig `type:"structure"` - - // Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want - // CloudFront to get objects for this origin, for example, myawsbucket.s3.amazonaws.com. - // - // Constraints for Amazon S3 origins: - // - // * If you configured Amazon S3 Transfer Acceleration for your bucket, do - // not specify the s3-accelerate endpoint for DomainName. - // - // * The bucket name must be between 3 and 63 characters long (inclusive). - // - // * The bucket name must contain only lowercase characters, numbers, periods, - // underscores, and dashes. - // - // * The bucket name must not contain adjacent periods. - // - // Custom Origins: The DNS domain name for the HTTP server from which you want - // CloudFront to get objects for this origin, for example, www.example.com. - // - // Constraints for custom origins: - // - // * DomainName must be a valid DNS name that contains only a-z, A-Z, 0-9, - // dot (.), hyphen (-), or underscore (_) characters. - // - // * The name cannot exceed 128 characters. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // A unique identifier for the origin. The value of Id must be unique within - // the distribution. - // - // When you specify the value of TargetOriginId for the default cache behavior - // or for another cache behavior, you indicate the origin to which you want - // the cache behavior to route requests by specifying the value of the Id element - // for that origin. When a request matches the path pattern for that cache behavior, - // CloudFront routes the request to the specified origin. For more information, - // see Cache Behavior Settings (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesCacheBehavior) - // in the Amazon CloudFront Developer Guide. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // An optional element that causes CloudFront to request your content from a - // directory in your Amazon S3 bucket or your custom origin. When you include - // the OriginPath element, specify the directory name, beginning with a /. CloudFront - // appends the directory name to the value of DomainName, for example, example.com/production. - // Do not include a / at the end of the directory name. - // - // For example, suppose you've specified the following values for your distribution: - // - // * DomainName: An Amazon S3 bucket named myawsbucket. - // - // * OriginPath: /production - // - // * CNAME: example.com - // - // When a user enters example.com/index.html in a browser, CloudFront sends - // a request to Amazon S3 for myawsbucket/production/index.html. - // - // When a user enters example.com/acme/index.html in a browser, CloudFront sends - // a request to Amazon S3 for myawsbucket/production/acme/index.html. - OriginPath *string `type:"string"` - - // A complex type that contains information about the Amazon S3 origin. If the - // origin is a custom origin, use the CustomOriginConfig element instead. - S3OriginConfig *S3OriginConfig `type:"structure"` -} - -// String returns the string representation -func (s Origin) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Origin) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Origin) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Origin"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.CustomHeaders != nil { - if err := s.CustomHeaders.Validate(); err != nil { - invalidParams.AddNested("CustomHeaders", err.(request.ErrInvalidParams)) - } - } - if s.CustomOriginConfig != nil { - if err := s.CustomOriginConfig.Validate(); err != nil { - invalidParams.AddNested("CustomOriginConfig", err.(request.ErrInvalidParams)) - } - } - if s.S3OriginConfig != nil { - if err := s.S3OriginConfig.Validate(); err != nil { - invalidParams.AddNested("S3OriginConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomHeaders sets the CustomHeaders field's value. -func (s *Origin) SetCustomHeaders(v *CustomHeaders) *Origin { - s.CustomHeaders = v - return s -} - -// SetCustomOriginConfig sets the CustomOriginConfig field's value. -func (s *Origin) SetCustomOriginConfig(v *CustomOriginConfig) *Origin { - s.CustomOriginConfig = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *Origin) SetDomainName(v string) *Origin { - s.DomainName = &v - return s -} - -// SetId sets the Id field's value. -func (s *Origin) SetId(v string) *Origin { - s.Id = &v - return s -} - -// SetOriginPath sets the OriginPath field's value. -func (s *Origin) SetOriginPath(v string) *Origin { - s.OriginPath = &v - return s -} - -// SetS3OriginConfig sets the S3OriginConfig field's value. -func (s *Origin) SetS3OriginConfig(v *S3OriginConfig) *Origin { - s.S3OriginConfig = v - return s -} - -// CloudFront origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentity -type OriginAccessIdentity struct { - _ struct{} `type:"structure"` - - // The current configuration information for the identity. - CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `type:"structure"` - - // The ID for the origin access identity. For example: E74FTE3AJFJ256A. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The Amazon S3 canonical user ID for the origin access identity, used when - // giving the origin access identity read permission to an object in Amazon - // S3. - // - // S3CanonicalUserId is a required field - S3CanonicalUserId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s OriginAccessIdentity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OriginAccessIdentity) GoString() string { - return s.String() -} - -// SetCloudFrontOriginAccessIdentityConfig sets the CloudFrontOriginAccessIdentityConfig field's value. -func (s *OriginAccessIdentity) SetCloudFrontOriginAccessIdentityConfig(v *OriginAccessIdentityConfig) *OriginAccessIdentity { - s.CloudFrontOriginAccessIdentityConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *OriginAccessIdentity) SetId(v string) *OriginAccessIdentity { - s.Id = &v - return s -} - -// SetS3CanonicalUserId sets the S3CanonicalUserId field's value. -func (s *OriginAccessIdentity) SetS3CanonicalUserId(v string) *OriginAccessIdentity { - s.S3CanonicalUserId = &v - return s -} - -// Origin access identity configuration. Send a GET request to the /CloudFront -// API version/CloudFront/identity ID/config resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentityConfig -type OriginAccessIdentityConfig struct { - _ struct{} `type:"structure"` - - // A unique number that ensures the request can't be replayed. - // - // If the CallerReference is new (no matter the content of the CloudFrontOriginAccessIdentityConfig - // object), a new origin access identity is created. - // - // If the CallerReference is a value already sent in a previous identity request, - // and the content of the CloudFrontOriginAccessIdentityConfig is identical - // to the original request (ignoring white space), the response includes the - // same information returned to the original request. - // - // If the CallerReference is a value you already sent in a previous request - // to create an identity, but the content of the CloudFrontOriginAccessIdentityConfig - // is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists - // error. - // - // CallerReference is a required field - CallerReference *string `type:"string" required:"true"` - - // Any comments you want to include about the origin access identity. - // - // Comment is a required field - Comment *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s OriginAccessIdentityConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OriginAccessIdentityConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OriginAccessIdentityConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OriginAccessIdentityConfig"} - if s.CallerReference == nil { - invalidParams.Add(request.NewErrParamRequired("CallerReference")) - } - if s.Comment == nil { - invalidParams.Add(request.NewErrParamRequired("Comment")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallerReference sets the CallerReference field's value. -func (s *OriginAccessIdentityConfig) SetCallerReference(v string) *OriginAccessIdentityConfig { - s.CallerReference = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *OriginAccessIdentityConfig) SetComment(v string) *OriginAccessIdentityConfig { - s.Comment = &v - return s -} - -// Lists the origin access identities for CloudFront.Send a GET request to the -// /CloudFront API version/origin-access-identity/cloudfront resource. The response -// includes a CloudFrontOriginAccessIdentityList element with zero or more CloudFrontOriginAccessIdentitySummary -// child elements. By default, your entire list of origin access identities -// is returned in one single page. If the list is long, you can paginate it -// using the MaxItems and Marker parameters. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentityList -type OriginAccessIdentityList struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether more origin access identities remain to be - // listed. If your results were truncated, you can make a follow-up pagination - // request using the Marker request parameter to retrieve more items in the - // list. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // A complex type that contains one CloudFrontOriginAccessIdentitySummary element - // for each origin access identity that was created by the current AWS account. - Items []*OriginAccessIdentitySummary `locationNameList:"CloudFrontOriginAccessIdentitySummary" type:"list"` - - // Use this when paginating results to indicate where to begin in your list - // of origin access identities. The results include identities in the list that - // occur after the marker. To get the next page of results, set the Marker to - // the value of the NextMarker from the current page's response (which is also - // the ID of the last identity on that page). - // - // Marker is a required field - Marker *string `type:"string" required:"true"` - - // The maximum number of origin access identities you want in the response body. - // - // MaxItems is a required field - MaxItems *int64 `type:"integer" required:"true"` - - // If IsTruncated is true, this element is present and contains the value you - // can use for the Marker request parameter to continue listing your origin - // access identities where they left off. - NextMarker *string `type:"string"` - - // The number of CloudFront origin access identities that were created by the - // current AWS account. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s OriginAccessIdentityList) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OriginAccessIdentityList) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *OriginAccessIdentityList) SetIsTruncated(v bool) *OriginAccessIdentityList { - s.IsTruncated = &v - return s -} - -// SetItems sets the Items field's value. -func (s *OriginAccessIdentityList) SetItems(v []*OriginAccessIdentitySummary) *OriginAccessIdentityList { - s.Items = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *OriginAccessIdentityList) SetMarker(v string) *OriginAccessIdentityList { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *OriginAccessIdentityList) SetMaxItems(v int64) *OriginAccessIdentityList { - s.MaxItems = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *OriginAccessIdentityList) SetNextMarker(v string) *OriginAccessIdentityList { - s.NextMarker = &v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *OriginAccessIdentityList) SetQuantity(v int64) *OriginAccessIdentityList { - s.Quantity = &v - return s -} - -// Summary of the information about a CloudFront origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/CloudFrontOriginAccessIdentitySummary -type OriginAccessIdentitySummary struct { - _ struct{} `type:"structure"` - - // The comment for this origin access identity, as originally specified when - // created. - // - // Comment is a required field - Comment *string `type:"string" required:"true"` - - // The ID for the origin access identity. For example: E74FTE3AJFJ256A. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The Amazon S3 canonical user ID for the origin access identity, which you - // use when giving the origin access identity read permission to an object in - // Amazon S3. - // - // S3CanonicalUserId is a required field - S3CanonicalUserId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s OriginAccessIdentitySummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OriginAccessIdentitySummary) GoString() string { - return s.String() -} - -// SetComment sets the Comment field's value. -func (s *OriginAccessIdentitySummary) SetComment(v string) *OriginAccessIdentitySummary { - s.Comment = &v - return s -} - -// SetId sets the Id field's value. -func (s *OriginAccessIdentitySummary) SetId(v string) *OriginAccessIdentitySummary { - s.Id = &v - return s -} - -// SetS3CanonicalUserId sets the S3CanonicalUserId field's value. -func (s *OriginAccessIdentitySummary) SetS3CanonicalUserId(v string) *OriginAccessIdentitySummary { - s.S3CanonicalUserId = &v - return s -} - -// A complex type that contains HeaderName and HeaderValue elements, if any, -// for this distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/OriginCustomHeader -type OriginCustomHeader struct { - _ struct{} `type:"structure"` - - // The name of a header that you want CloudFront to forward to your origin. - // For more information, see Forwarding Custom Headers to Your Origin (Web Distributions - // Only) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/forward-custom-headers.html) - // in the Amazon Amazon CloudFront Developer Guide. - // - // HeaderName is a required field - HeaderName *string `type:"string" required:"true"` - - // The value for the header that you specified in the HeaderName field. - // - // HeaderValue is a required field - HeaderValue *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s OriginCustomHeader) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OriginCustomHeader) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OriginCustomHeader) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OriginCustomHeader"} - if s.HeaderName == nil { - invalidParams.Add(request.NewErrParamRequired("HeaderName")) - } - if s.HeaderValue == nil { - invalidParams.Add(request.NewErrParamRequired("HeaderValue")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHeaderName sets the HeaderName field's value. -func (s *OriginCustomHeader) SetHeaderName(v string) *OriginCustomHeader { - s.HeaderName = &v - return s -} - -// SetHeaderValue sets the HeaderValue field's value. -func (s *OriginCustomHeader) SetHeaderValue(v string) *OriginCustomHeader { - s.HeaderValue = &v - return s -} - -// A complex type that contains information about the SSL/TLS protocols that -// CloudFront can use when establishing an HTTPS connection with your origin. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/OriginSslProtocols -type OriginSslProtocols struct { - _ struct{} `type:"structure"` - - // A list that contains allowed SSL/TLS protocols for this distribution. - // - // Items is a required field - Items []*string `locationNameList:"SslProtocol" type:"list" required:"true"` - - // The number of SSL/TLS protocols that you want to allow CloudFront to use - // when establishing an HTTPS connection with this origin. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s OriginSslProtocols) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s OriginSslProtocols) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OriginSslProtocols) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OriginSslProtocols"} - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *OriginSslProtocols) SetItems(v []*string) *OriginSslProtocols { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *OriginSslProtocols) SetQuantity(v int64) *OriginSslProtocols { - s.Quantity = &v - return s -} - -// A complex type that contains information about origins for this distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Origins -type Origins struct { - _ struct{} `type:"structure"` - - // A complex type that contains origins for this distribution. - Items []*Origin `locationNameList:"Origin" min:"1" type:"list"` - - // The number of origins for this distribution. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s Origins) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Origins) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Origins) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Origins"} - if s.Items != nil && len(s.Items) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Items", 1)) - } - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - if s.Items != nil { - for i, v := range s.Items { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *Origins) SetItems(v []*Origin) *Origins { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *Origins) SetQuantity(v int64) *Origins { - s.Quantity = &v - return s -} - -// A complex type that contains information about the objects that you want -// to invalidate. For more information, see Specifying the Objects to Invalidate -// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidation-specifying-objects) -// in the Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Paths -type Paths struct { - _ struct{} `type:"structure"` - - // A complex type that contains a list of the paths that you want to invalidate. - Items []*string `locationNameList:"Path" type:"list"` - - // The number of objects that you want to invalidate. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s Paths) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Paths) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Paths) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Paths"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *Paths) SetItems(v []*string) *Paths { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *Paths) SetQuantity(v int64) *Paths { - s.Quantity = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/QueryStringCacheKeys -type QueryStringCacheKeys struct { - _ struct{} `type:"structure"` - - // (Optional) A list that contains the query string parameters that you want - // CloudFront to use as a basis for caching for this cache behavior. If Quantity - // is 0, you can omit Items. - Items []*string `locationNameList:"Name" type:"list"` - - // The number of whitelisted query string parameters for this cache behavior. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s QueryStringCacheKeys) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QueryStringCacheKeys) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueryStringCacheKeys) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueryStringCacheKeys"} - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *QueryStringCacheKeys) SetItems(v []*string) *QueryStringCacheKeys { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *QueryStringCacheKeys) SetQuantity(v int64) *QueryStringCacheKeys { - s.Quantity = &v - return s -} - -// A complex type that identifies ways in which you want to restrict distribution -// of your content. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Restrictions -type Restrictions struct { - _ struct{} `type:"structure"` - - // A complex type that controls the countries in which your content is distributed. - // CloudFront determines the location of your users using MaxMind GeoIP databases. - // - // GeoRestriction is a required field - GeoRestriction *GeoRestriction `type:"structure" required:"true"` -} - -// String returns the string representation -func (s Restrictions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Restrictions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Restrictions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Restrictions"} - if s.GeoRestriction == nil { - invalidParams.Add(request.NewErrParamRequired("GeoRestriction")) - } - if s.GeoRestriction != nil { - if err := s.GeoRestriction.Validate(); err != nil { - invalidParams.AddNested("GeoRestriction", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGeoRestriction sets the GeoRestriction field's value. -func (s *Restrictions) SetGeoRestriction(v *GeoRestriction) *Restrictions { - s.GeoRestriction = v - return s -} - -// A complex type that contains information about the Amazon S3 bucket from -// which you want CloudFront to get your media files for distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/S3Origin -type S3Origin struct { - _ struct{} `type:"structure"` - - // The DNS name of the Amazon S3 origin. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // The CloudFront origin access identity to associate with the RTMP distribution. - // Use an origin access identity to configure the distribution so that end users - // can only access objects in an Amazon S3 bucket through CloudFront. - // - // If you want end users to be able to access objects using either the CloudFront - // URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. - // - // To delete the origin access identity from an existing distribution, update - // the distribution configuration and include an empty OriginAccessIdentity - // element. - // - // To replace the origin access identity, update the distribution configuration - // and specify the new origin access identity. - // - // For more information, see Using an Origin Access Identity to Restrict Access - // to Your Amazon S3 Content (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) - // in the Amazon Amazon CloudFront Developer Guide. - // - // OriginAccessIdentity is a required field - OriginAccessIdentity *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s S3Origin) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3Origin) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Origin) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Origin"} - if s.DomainName == nil { - invalidParams.Add(request.NewErrParamRequired("DomainName")) - } - if s.OriginAccessIdentity == nil { - invalidParams.Add(request.NewErrParamRequired("OriginAccessIdentity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainName sets the DomainName field's value. -func (s *S3Origin) SetDomainName(v string) *S3Origin { - s.DomainName = &v - return s -} - -// SetOriginAccessIdentity sets the OriginAccessIdentity field's value. -func (s *S3Origin) SetOriginAccessIdentity(v string) *S3Origin { - s.OriginAccessIdentity = &v - return s -} - -// A complex type that contains information about the Amazon S3 origin. If the -// origin is a custom origin, use the CustomOriginConfig element instead. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/S3OriginConfig -type S3OriginConfig struct { - _ struct{} `type:"structure"` - - // The CloudFront origin access identity to associate with the origin. Use an - // origin access identity to configure the origin so that viewers can only access - // objects in an Amazon S3 bucket through CloudFront. The format of the value - // is: - // - // origin-access-identity/CloudFront/ID-of-origin-access-identity - // - // where ID-of-origin-access-identity is the value that CloudFront returned - // in the ID element when you created the origin access identity. - // - // If you want viewers to be able to access objects using either the CloudFront - // URL or the Amazon S3 URL, specify an empty OriginAccessIdentity element. - // - // To delete the origin access identity from an existing distribution, update - // the distribution configuration and include an empty OriginAccessIdentity - // element. - // - // To replace the origin access identity, update the distribution configuration - // and specify the new origin access identity. - // - // For more information about the origin access identity, see Serving Private - // Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) - // in the Amazon CloudFront Developer Guide. - // - // OriginAccessIdentity is a required field - OriginAccessIdentity *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s S3OriginConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3OriginConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3OriginConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3OriginConfig"} - if s.OriginAccessIdentity == nil { - invalidParams.Add(request.NewErrParamRequired("OriginAccessIdentity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOriginAccessIdentity sets the OriginAccessIdentity field's value. -func (s *S3OriginConfig) SetOriginAccessIdentity(v string) *S3OriginConfig { - s.OriginAccessIdentity = &v - return s -} - -// A complex type that lists the AWS accounts that were included in the TrustedSigners -// complex type, as well as their active CloudFront key pair IDs, if any. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Signer -type Signer struct { - _ struct{} `type:"structure"` - - // An AWS account that is included in the TrustedSigners complex type for this - // RTMP distribution. Valid values include: - // - // * self, which is the AWS account used to create the distribution. - // - // * An AWS account number. - AwsAccountNumber *string `type:"string"` - - // A complex type that lists the active CloudFront key pairs, if any, that are - // associated with AwsAccountNumber. - KeyPairIds *KeyPairIds `type:"structure"` -} - -// String returns the string representation -func (s Signer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Signer) GoString() string { - return s.String() -} - -// SetAwsAccountNumber sets the AwsAccountNumber field's value. -func (s *Signer) SetAwsAccountNumber(v string) *Signer { - s.AwsAccountNumber = &v - return s -} - -// SetKeyPairIds sets the KeyPairIds field's value. -func (s *Signer) SetKeyPairIds(v *KeyPairIds) *Signer { - s.KeyPairIds = v - return s -} - -// A streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistribution -type StreamingDistribution struct { - _ struct{} `type:"structure"` - - // ARN is a required field - ARN *string `type:"string" required:"true"` - - // A complex type that lists the AWS accounts, if any, that you included in - // the TrustedSigners complex type for this distribution. These are the accounts - // that you want to allow to create signed URLs for private content. - // - // The Signer complex type lists the AWS account number of the trusted signer - // or self if the signer is the AWS account that created the distribution. The - // Signer element also includes the IDs of any active CloudFront key pairs that - // are associated with the trusted signer's AWS account. If no KeyPairId element - // appears for a Signer, that signer can't create signed URLs. - // - // For more information, see Serving Private Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) - // in the Amazon CloudFront Developer Guide. - // - // ActiveTrustedSigners is a required field - ActiveTrustedSigners *ActiveTrustedSigners `type:"structure" required:"true"` - - // The domain name that corresponds to the streaming distribution. For example: - // s5c39gqb8ow64r.cloudfront.net. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // The identifier for the RTMP distribution. For example: EGTXBD79EXAMPLE. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The date and time that the distribution was last modified. - LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The current status of the RTMP distribution. When the status is Deployed, - // the distribution's information is propagated to all CloudFront edge locations. - // - // Status is a required field - Status *string `type:"string" required:"true"` - - // The current configuration information for the RTMP distribution. - // - // StreamingDistributionConfig is a required field - StreamingDistributionConfig *StreamingDistributionConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s StreamingDistribution) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamingDistribution) GoString() string { - return s.String() -} - -// SetARN sets the ARN field's value. -func (s *StreamingDistribution) SetARN(v string) *StreamingDistribution { - s.ARN = &v - return s -} - -// SetActiveTrustedSigners sets the ActiveTrustedSigners field's value. -func (s *StreamingDistribution) SetActiveTrustedSigners(v *ActiveTrustedSigners) *StreamingDistribution { - s.ActiveTrustedSigners = v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *StreamingDistribution) SetDomainName(v string) *StreamingDistribution { - s.DomainName = &v - return s -} - -// SetId sets the Id field's value. -func (s *StreamingDistribution) SetId(v string) *StreamingDistribution { - s.Id = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *StreamingDistribution) SetLastModifiedTime(v time.Time) *StreamingDistribution { - s.LastModifiedTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StreamingDistribution) SetStatus(v string) *StreamingDistribution { - s.Status = &v - return s -} - -// SetStreamingDistributionConfig sets the StreamingDistributionConfig field's value. -func (s *StreamingDistribution) SetStreamingDistributionConfig(v *StreamingDistributionConfig) *StreamingDistribution { - s.StreamingDistributionConfig = v - return s -} - -// The RTMP distribution's configuration information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionConfig -type StreamingDistributionConfig struct { - _ struct{} `type:"structure"` - - // A complex type that contains information about CNAMEs (alternate domain names), - // if any, for this streaming distribution. - Aliases *Aliases `type:"structure"` - - // A unique number that ensures that the request can't be replayed. If the CallerReference - // is new (no matter the content of the StreamingDistributionConfig object), - // a new streaming distribution is created. If the CallerReference is a value - // that you already sent in a previous request to create a streaming distribution, - // and the content of the StreamingDistributionConfig is identical to the original - // request (ignoring white space), the response includes the same information - // returned to the original request. If the CallerReference is a value that - // you already sent in a previous request to create a streaming distribution - // but the content of the StreamingDistributionConfig is different from the - // original request, CloudFront returns a DistributionAlreadyExists error. - // - // CallerReference is a required field - CallerReference *string `type:"string" required:"true"` - - // Any comments you want to include about the streaming distribution. - // - // Comment is a required field - Comment *string `type:"string" required:"true"` - - // Whether the streaming distribution is enabled to accept user requests for - // content. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // A complex type that controls whether access logs are written for the streaming - // distribution. - Logging *StreamingLoggingConfig `type:"structure"` - - // A complex type that contains information about price class for this streaming - // distribution. - PriceClass *string `type:"string" enum:"PriceClass"` - - // A complex type that contains information about the Amazon S3 bucket from - // which you want CloudFront to get your media files for distribution. - // - // S3Origin is a required field - S3Origin *S3Origin `type:"structure" required:"true"` - - // A complex type that specifies any AWS accounts that you want to permit to - // create signed URLs for private content. If you want the distribution to use - // signed URLs, include this element; if you want the distribution to use public - // URLs, remove this element. For more information, see Serving Private Content - // through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) - // in the Amazon CloudFront Developer Guide. - // - // TrustedSigners is a required field - TrustedSigners *TrustedSigners `type:"structure" required:"true"` -} - -// String returns the string representation -func (s StreamingDistributionConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamingDistributionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StreamingDistributionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StreamingDistributionConfig"} - if s.CallerReference == nil { - invalidParams.Add(request.NewErrParamRequired("CallerReference")) - } - if s.Comment == nil { - invalidParams.Add(request.NewErrParamRequired("Comment")) - } - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.S3Origin == nil { - invalidParams.Add(request.NewErrParamRequired("S3Origin")) - } - if s.TrustedSigners == nil { - invalidParams.Add(request.NewErrParamRequired("TrustedSigners")) - } - if s.Aliases != nil { - if err := s.Aliases.Validate(); err != nil { - invalidParams.AddNested("Aliases", err.(request.ErrInvalidParams)) - } - } - if s.Logging != nil { - if err := s.Logging.Validate(); err != nil { - invalidParams.AddNested("Logging", err.(request.ErrInvalidParams)) - } - } - if s.S3Origin != nil { - if err := s.S3Origin.Validate(); err != nil { - invalidParams.AddNested("S3Origin", err.(request.ErrInvalidParams)) - } - } - if s.TrustedSigners != nil { - if err := s.TrustedSigners.Validate(); err != nil { - invalidParams.AddNested("TrustedSigners", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliases sets the Aliases field's value. -func (s *StreamingDistributionConfig) SetAliases(v *Aliases) *StreamingDistributionConfig { - s.Aliases = v - return s -} - -// SetCallerReference sets the CallerReference field's value. -func (s *StreamingDistributionConfig) SetCallerReference(v string) *StreamingDistributionConfig { - s.CallerReference = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *StreamingDistributionConfig) SetComment(v string) *StreamingDistributionConfig { - s.Comment = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *StreamingDistributionConfig) SetEnabled(v bool) *StreamingDistributionConfig { - s.Enabled = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *StreamingDistributionConfig) SetLogging(v *StreamingLoggingConfig) *StreamingDistributionConfig { - s.Logging = v - return s -} - -// SetPriceClass sets the PriceClass field's value. -func (s *StreamingDistributionConfig) SetPriceClass(v string) *StreamingDistributionConfig { - s.PriceClass = &v - return s -} - -// SetS3Origin sets the S3Origin field's value. -func (s *StreamingDistributionConfig) SetS3Origin(v *S3Origin) *StreamingDistributionConfig { - s.S3Origin = v - return s -} - -// SetTrustedSigners sets the TrustedSigners field's value. -func (s *StreamingDistributionConfig) SetTrustedSigners(v *TrustedSigners) *StreamingDistributionConfig { - s.TrustedSigners = v - return s -} - -// A streaming distribution Configuration and a list of tags to be associated -// with the streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionConfigWithTags -type StreamingDistributionConfigWithTags struct { - _ struct{} `type:"structure"` - - // A streaming distribution Configuration. - // - // StreamingDistributionConfig is a required field - StreamingDistributionConfig *StreamingDistributionConfig `type:"structure" required:"true"` - - // A complex type that contains zero or more Tag elements. - // - // Tags is a required field - Tags *Tags `type:"structure" required:"true"` -} - -// String returns the string representation -func (s StreamingDistributionConfigWithTags) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamingDistributionConfigWithTags) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StreamingDistributionConfigWithTags) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StreamingDistributionConfigWithTags"} - if s.StreamingDistributionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("StreamingDistributionConfig")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.StreamingDistributionConfig != nil { - if err := s.StreamingDistributionConfig.Validate(); err != nil { - invalidParams.AddNested("StreamingDistributionConfig", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - if err := s.Tags.Validate(); err != nil { - invalidParams.AddNested("Tags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamingDistributionConfig sets the StreamingDistributionConfig field's value. -func (s *StreamingDistributionConfigWithTags) SetStreamingDistributionConfig(v *StreamingDistributionConfig) *StreamingDistributionConfigWithTags { - s.StreamingDistributionConfig = v - return s -} - -// SetTags sets the Tags field's value. -func (s *StreamingDistributionConfigWithTags) SetTags(v *Tags) *StreamingDistributionConfigWithTags { - s.Tags = v - return s -} - -// A streaming distribution list. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionList -type StreamingDistributionList struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether more streaming distributions remain to be listed. - // If your results were truncated, you can make a follow-up pagination request - // using the Marker request parameter to retrieve more distributions in the - // list. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // A complex type that contains one StreamingDistributionSummary element for - // each distribution that was created by the current AWS account. - Items []*StreamingDistributionSummary `locationNameList:"StreamingDistributionSummary" type:"list"` - - // The value you provided for the Marker request parameter. - // - // Marker is a required field - Marker *string `type:"string" required:"true"` - - // The value you provided for the MaxItems request parameter. - // - // MaxItems is a required field - MaxItems *int64 `type:"integer" required:"true"` - - // If IsTruncated is true, this element is present and contains the value you - // can use for the Marker request parameter to continue listing your RTMP distributions - // where they left off. - NextMarker *string `type:"string"` - - // The number of streaming distributions that were created by the current AWS - // account. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s StreamingDistributionList) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamingDistributionList) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *StreamingDistributionList) SetIsTruncated(v bool) *StreamingDistributionList { - s.IsTruncated = &v - return s -} - -// SetItems sets the Items field's value. -func (s *StreamingDistributionList) SetItems(v []*StreamingDistributionSummary) *StreamingDistributionList { - s.Items = v - return s -} - -// SetMarker sets the Marker field's value. -func (s *StreamingDistributionList) SetMarker(v string) *StreamingDistributionList { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *StreamingDistributionList) SetMaxItems(v int64) *StreamingDistributionList { - s.MaxItems = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *StreamingDistributionList) SetNextMarker(v string) *StreamingDistributionList { - s.NextMarker = &v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *StreamingDistributionList) SetQuantity(v int64) *StreamingDistributionList { - s.Quantity = &v - return s -} - -// A summary of the information for an Amazon CloudFront streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingDistributionSummary -type StreamingDistributionSummary struct { - _ struct{} `type:"structure"` - - // The ARN (Amazon Resource Name) for the streaming distribution. For example: - // arn:aws:cloudfront::123456789012:streaming-distribution/EDFDVBD632BHDS5, - // where 123456789012 is your AWS account ID. - // - // ARN is a required field - ARN *string `type:"string" required:"true"` - - // A complex type that contains information about CNAMEs (alternate domain names), - // if any, for this streaming distribution. - // - // Aliases is a required field - Aliases *Aliases `type:"structure" required:"true"` - - // The comment originally specified when this distribution was created. - // - // Comment is a required field - Comment *string `type:"string" required:"true"` - - // The domain name corresponding to the distribution. For example: d604721fxaaqy9.cloudfront.net. - // - // DomainName is a required field - DomainName *string `type:"string" required:"true"` - - // Whether the distribution is enabled to accept end user requests for content. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // The identifier for the distribution. For example: EDFDVBD632BHDS5. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The date and time the distribution was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // PriceClass is a required field - PriceClass *string `type:"string" required:"true" enum:"PriceClass"` - - // A complex type that contains information about the Amazon S3 bucket from - // which you want CloudFront to get your media files for distribution. - // - // S3Origin is a required field - S3Origin *S3Origin `type:"structure" required:"true"` - - // Indicates the current status of the distribution. When the status is Deployed, - // the distribution's information is fully propagated throughout the Amazon - // CloudFront system. - // - // Status is a required field - Status *string `type:"string" required:"true"` - - // A complex type that specifies the AWS accounts, if any, that you want to - // allow to create signed URLs for private content. If you want to require signed - // URLs in requests for objects in the target origin that match the PathPattern - // for this cache behavior, specify true for Enabled, and specify the applicable - // values for Quantity and Items.If you don't want to require signed URLs in - // requests for objects that match PathPattern, specify false for Enabled and - // 0 for Quantity. Omit Items. To add, change, or remove one or more trusted - // signers, change Enabled to true (if it's currently false), change Quantity - // as applicable, and specify all of the trusted signers that you want to include - // in the updated distribution. - // - // TrustedSigners is a required field - TrustedSigners *TrustedSigners `type:"structure" required:"true"` -} - -// String returns the string representation -func (s StreamingDistributionSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamingDistributionSummary) GoString() string { - return s.String() -} - -// SetARN sets the ARN field's value. -func (s *StreamingDistributionSummary) SetARN(v string) *StreamingDistributionSummary { - s.ARN = &v - return s -} - -// SetAliases sets the Aliases field's value. -func (s *StreamingDistributionSummary) SetAliases(v *Aliases) *StreamingDistributionSummary { - s.Aliases = v - return s -} - -// SetComment sets the Comment field's value. -func (s *StreamingDistributionSummary) SetComment(v string) *StreamingDistributionSummary { - s.Comment = &v - return s -} - -// SetDomainName sets the DomainName field's value. -func (s *StreamingDistributionSummary) SetDomainName(v string) *StreamingDistributionSummary { - s.DomainName = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *StreamingDistributionSummary) SetEnabled(v bool) *StreamingDistributionSummary { - s.Enabled = &v - return s -} - -// SetId sets the Id field's value. -func (s *StreamingDistributionSummary) SetId(v string) *StreamingDistributionSummary { - s.Id = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *StreamingDistributionSummary) SetLastModifiedTime(v time.Time) *StreamingDistributionSummary { - s.LastModifiedTime = &v - return s -} - -// SetPriceClass sets the PriceClass field's value. -func (s *StreamingDistributionSummary) SetPriceClass(v string) *StreamingDistributionSummary { - s.PriceClass = &v - return s -} - -// SetS3Origin sets the S3Origin field's value. -func (s *StreamingDistributionSummary) SetS3Origin(v *S3Origin) *StreamingDistributionSummary { - s.S3Origin = v - return s -} - -// SetStatus sets the Status field's value. -func (s *StreamingDistributionSummary) SetStatus(v string) *StreamingDistributionSummary { - s.Status = &v - return s -} - -// SetTrustedSigners sets the TrustedSigners field's value. -func (s *StreamingDistributionSummary) SetTrustedSigners(v *TrustedSigners) *StreamingDistributionSummary { - s.TrustedSigners = v - return s -} - -// A complex type that controls whether access logs are written for this streaming -// distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/StreamingLoggingConfig -type StreamingLoggingConfig struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket to store the access logs in, for example, myawslogbucket.s3.amazonaws.com. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // Specifies whether you want CloudFront to save access logs to an Amazon S3 - // bucket. If you do not want to enable logging when you create a streaming - // distribution or if you want to disable logging for an existing streaming - // distribution, specify false for Enabled, and specify empty Bucket and Prefix - // elements. If you specify false for Enabled but you specify values for Bucket - // and Prefix, the values are automatically deleted. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // An optional string that you want CloudFront to prefix to the access log filenames - // for this streaming distribution, for example, myprefix/. If you want to enable - // logging, but you do not want to specify a prefix, you still must include - // an empty Prefix element in the Logging element. - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s StreamingLoggingConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamingLoggingConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StreamingLoggingConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StreamingLoggingConfig"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *StreamingLoggingConfig) SetBucket(v string) *StreamingLoggingConfig { - s.Bucket = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *StreamingLoggingConfig) SetEnabled(v bool) *StreamingLoggingConfig { - s.Enabled = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *StreamingLoggingConfig) SetPrefix(v string) *StreamingLoggingConfig { - s.Prefix = &v - return s -} - -// A complex type that contains Tag key and Tag value. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // A string that contains Tag key. - // - // The string length should be between 1 and 128 characters. Valid characters - // include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // A string that contains an optional Tag value. - // - // The string length should be between 0 and 256 characters. Valid characters - // include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @. - Value *string `type:"string"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - 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 -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// A complex type that contains zero or more Tag elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagKeys -type TagKeys struct { - _ struct{} `type:"structure"` - - // A complex type that contains Tag key elements. - Items []*string `locationNameList:"Key" type:"list"` -} - -// String returns the string representation -func (s TagKeys) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagKeys) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *TagKeys) SetItems(v []*string) *TagKeys { - s.Items = v - return s -} - -// The request to add tags to a CloudFront resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResourceRequest -type TagResourceInput struct { - _ struct{} `type:"structure" payload:"Tags"` - - // An ARN of a CloudFront resource. - // - // Resource is a required field - Resource *string `location:"querystring" locationName:"Resource" type:"string" required:"true"` - - // A complex type that contains zero or more Tag elements. - // - // Tags is a required field - Tags *Tags `locationName:"Tags" type:"structure" required:"true"` -} - -// String returns the string representation -func (s TagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - if err := s.Tags.Validate(); err != nil { - invalidParams.AddNested("Tags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResource sets the Resource field's value. -func (s *TagResourceInput) SetResource(v string) *TagResourceInput { - s.Resource = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v *Tags) *TagResourceInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TagResourceOutput -type TagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s TagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagResourceOutput) GoString() string { - return s.String() -} - -// A complex type that contains zero or more Tag elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/Tags -type Tags struct { - _ struct{} `type:"structure"` - - // A complex type that contains Tag elements. - Items []*Tag `locationNameList:"Tag" type:"list"` -} - -// String returns the string representation -func (s Tags) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tags) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tags) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tags"} - if s.Items != nil { - for i, v := range s.Items { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItems sets the Items field's value. -func (s *Tags) SetItems(v []*Tag) *Tags { - s.Items = v - return s -} - -// A complex type that specifies the AWS accounts, if any, that you want to -// allow to create signed URLs for private content. -// -// If you want to require signed URLs in requests for objects in the target -// origin that match the PathPattern for this cache behavior, specify true for -// Enabled, and specify the applicable values for Quantity and Items. For more -// information, see Serving Private Content through CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) -// in the Amazon Amazon CloudFront Developer Guide. -// -// If you don't want to require signed URLs in requests for objects that match -// PathPattern, specify false for Enabled and 0 for Quantity. Omit Items. -// -// To add, change, or remove one or more trusted signers, change Enabled to -// true (if it's currently false), change Quantity as applicable, and specify -// all of the trusted signers that you want to include in the updated distribution. -// -// For more information about updating the distribution configuration, see DistributionConfig -// . -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/TrustedSigners -type TrustedSigners struct { - _ struct{} `type:"structure"` - - // Specifies whether you want to require viewers to use signed URLs to access - // the files specified by PathPattern and TargetOriginId. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // Optional: A complex type that contains trusted signers for this cache behavior. - // If Quantity is 0, you can omit Items. - Items []*string `locationNameList:"AwsAccountNumber" type:"list"` - - // The number of trusted signers for this cache behavior. - // - // Quantity is a required field - Quantity *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s TrustedSigners) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TrustedSigners) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TrustedSigners) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TrustedSigners"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *TrustedSigners) SetEnabled(v bool) *TrustedSigners { - s.Enabled = &v - return s -} - -// SetItems sets the Items field's value. -func (s *TrustedSigners) SetItems(v []*string) *TrustedSigners { - s.Items = v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *TrustedSigners) SetQuantity(v int64) *TrustedSigners { - s.Quantity = &v - return s -} - -// The request to remove tags from a CloudFront resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResourceRequest -type UntagResourceInput struct { - _ struct{} `type:"structure" payload:"TagKeys"` - - // An ARN of a CloudFront resource. - // - // Resource is a required field - Resource *string `location:"querystring" locationName:"Resource" type:"string" required:"true"` - - // A complex type that contains zero or more Tag key elements. - // - // TagKeys is a required field - TagKeys *TagKeys `locationName:"TagKeys" type:"structure" required:"true"` -} - -// String returns the string representation -func (s UntagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResource sets the Resource field's value. -func (s *UntagResourceInput) SetResource(v string) *UntagResourceInput { - s.Resource = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v *TagKeys) *UntagResourceInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UntagResourceOutput -type UntagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UntagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagResourceOutput) GoString() string { - return s.String() -} - -// The request to update an origin access identity. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentityRequest -type UpdateCloudFrontOriginAccessIdentityInput struct { - _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentityConfig"` - - // The identity's configuration information. - // - // CloudFrontOriginAccessIdentityConfig is a required field - CloudFrontOriginAccessIdentityConfig *OriginAccessIdentityConfig `locationName:"CloudFrontOriginAccessIdentityConfig" type:"structure" required:"true"` - - // The identity's id. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The value of the ETag header that you received when retrieving the identity's - // configuration. For example: E2QWRUHAPOMQZL. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` -} - -// String returns the string representation -func (s UpdateCloudFrontOriginAccessIdentityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateCloudFrontOriginAccessIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCloudFrontOriginAccessIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCloudFrontOriginAccessIdentityInput"} - if s.CloudFrontOriginAccessIdentityConfig == nil { - invalidParams.Add(request.NewErrParamRequired("CloudFrontOriginAccessIdentityConfig")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.CloudFrontOriginAccessIdentityConfig != nil { - if err := s.CloudFrontOriginAccessIdentityConfig.Validate(); err != nil { - invalidParams.AddNested("CloudFrontOriginAccessIdentityConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudFrontOriginAccessIdentityConfig sets the CloudFrontOriginAccessIdentityConfig field's value. -func (s *UpdateCloudFrontOriginAccessIdentityInput) SetCloudFrontOriginAccessIdentityConfig(v *OriginAccessIdentityConfig) *UpdateCloudFrontOriginAccessIdentityInput { - s.CloudFrontOriginAccessIdentityConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateCloudFrontOriginAccessIdentityInput) SetId(v string) *UpdateCloudFrontOriginAccessIdentityInput { - s.Id = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *UpdateCloudFrontOriginAccessIdentityInput) SetIfMatch(v string) *UpdateCloudFrontOriginAccessIdentityInput { - s.IfMatch = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateCloudFrontOriginAccessIdentityResult -type UpdateCloudFrontOriginAccessIdentityOutput struct { - _ struct{} `type:"structure" payload:"CloudFrontOriginAccessIdentity"` - - // The origin access identity's information. - CloudFrontOriginAccessIdentity *OriginAccessIdentity `type:"structure"` - - // The current version of the configuration. For example: E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` -} - -// String returns the string representation -func (s UpdateCloudFrontOriginAccessIdentityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateCloudFrontOriginAccessIdentityOutput) GoString() string { - return s.String() -} - -// SetCloudFrontOriginAccessIdentity sets the CloudFrontOriginAccessIdentity field's value. -func (s *UpdateCloudFrontOriginAccessIdentityOutput) SetCloudFrontOriginAccessIdentity(v *OriginAccessIdentity) *UpdateCloudFrontOriginAccessIdentityOutput { - s.CloudFrontOriginAccessIdentity = v - return s -} - -// SetETag sets the ETag field's value. -func (s *UpdateCloudFrontOriginAccessIdentityOutput) SetETag(v string) *UpdateCloudFrontOriginAccessIdentityOutput { - s.ETag = &v - return s -} - -// The request to update a distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistributionRequest -type UpdateDistributionInput struct { - _ struct{} `type:"structure" payload:"DistributionConfig"` - - // The distribution's configuration information. - // - // DistributionConfig is a required field - DistributionConfig *DistributionConfig `locationName:"DistributionConfig" type:"structure" required:"true"` - - // The distribution's id. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The value of the ETag header that you received when retrieving the distribution's - // configuration. For example: E2QWRUHAPOMQZL. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` -} - -// String returns the string representation -func (s UpdateDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDistributionInput"} - if s.DistributionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("DistributionConfig")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.DistributionConfig != nil { - if err := s.DistributionConfig.Validate(); err != nil { - invalidParams.AddNested("DistributionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDistributionConfig sets the DistributionConfig field's value. -func (s *UpdateDistributionInput) SetDistributionConfig(v *DistributionConfig) *UpdateDistributionInput { - s.DistributionConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateDistributionInput) SetId(v string) *UpdateDistributionInput { - s.Id = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *UpdateDistributionInput) SetIfMatch(v string) *UpdateDistributionInput { - s.IfMatch = &v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateDistributionResult -type UpdateDistributionOutput struct { - _ struct{} `type:"structure" payload:"Distribution"` - - // The distribution's information. - Distribution *Distribution `type:"structure"` - - // The current version of the configuration. For example: E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` -} - -// String returns the string representation -func (s UpdateDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateDistributionOutput) GoString() string { - return s.String() -} - -// SetDistribution sets the Distribution field's value. -func (s *UpdateDistributionOutput) SetDistribution(v *Distribution) *UpdateDistributionOutput { - s.Distribution = v - return s -} - -// SetETag sets the ETag field's value. -func (s *UpdateDistributionOutput) SetETag(v string) *UpdateDistributionOutput { - s.ETag = &v - return s -} - -// The request to update a streaming distribution. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistributionRequest -type UpdateStreamingDistributionInput struct { - _ struct{} `type:"structure" payload:"StreamingDistributionConfig"` - - // The streaming distribution's id. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The value of the ETag header that you received when retrieving the streaming - // distribution's configuration. For example: E2QWRUHAPOMQZL. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` - - // The streaming distribution's configuration information. - // - // StreamingDistributionConfig is a required field - StreamingDistributionConfig *StreamingDistributionConfig `locationName:"StreamingDistributionConfig" type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateStreamingDistributionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateStreamingDistributionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateStreamingDistributionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateStreamingDistributionInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.StreamingDistributionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("StreamingDistributionConfig")) - } - if s.StreamingDistributionConfig != nil { - if err := s.StreamingDistributionConfig.Validate(); err != nil { - invalidParams.AddNested("StreamingDistributionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *UpdateStreamingDistributionInput) SetId(v string) *UpdateStreamingDistributionInput { - s.Id = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *UpdateStreamingDistributionInput) SetIfMatch(v string) *UpdateStreamingDistributionInput { - s.IfMatch = &v - return s -} - -// SetStreamingDistributionConfig sets the StreamingDistributionConfig field's value. -func (s *UpdateStreamingDistributionInput) SetStreamingDistributionConfig(v *StreamingDistributionConfig) *UpdateStreamingDistributionInput { - s.StreamingDistributionConfig = v - return s -} - -// The returned result of the corresponding request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/UpdateStreamingDistributionResult -type UpdateStreamingDistributionOutput struct { - _ struct{} `type:"structure" payload:"StreamingDistribution"` - - // The current version of the configuration. For example: E2QWRUHAPOMQZL. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // The streaming distribution's information. - StreamingDistribution *StreamingDistribution `type:"structure"` -} - -// String returns the string representation -func (s UpdateStreamingDistributionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateStreamingDistributionOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *UpdateStreamingDistributionOutput) SetETag(v string) *UpdateStreamingDistributionOutput { - s.ETag = &v - return s -} - -// SetStreamingDistribution sets the StreamingDistribution field's value. -func (s *UpdateStreamingDistributionOutput) SetStreamingDistribution(v *StreamingDistribution) *UpdateStreamingDistributionOutput { - s.StreamingDistribution = v - return s -} - -// A complex type that specifies the following: -// -// * Which SSL/TLS certificate to use when viewers request objects using -// HTTPS -// -// * Whether you want CloudFront to use dedicated IP addresses or SNI when -// you're using alternate domain names in your object names -// -// * The minimum protocol version that you want CloudFront to use when communicating -// with viewers -// -// For more information, see Using an HTTPS Connection to Access Your Objects -// (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html) -// in the Amazon Amazon CloudFront Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25/ViewerCertificate -type ViewerCertificate struct { - _ struct{} `type:"structure"` - - ACMCertificateArn *string `type:"string"` - - // Include one of these values to specify the following: - // - // * Whether you want viewers to use HTTP or HTTPS to request your objects. - // - // * If you want viewers to use HTTPS, whether you're using an alternate - // domain name such as example.com or the CloudFront domain name for your - // distribution, such as d111111abcdef8.cloudfront.net. - // - // * If you're using an alternate domain name, whether AWS Certificate Manager - // (ACM) provided the certificate, or you purchased a certificate from a - // third-party certificate authority and imported it into ACM or uploaded - // it to the IAM certificate store. - // - // You must specify one (and only one) of the three values. Do not specify false - // for CloudFrontDefaultCertificate. - // - // If you want viewers to use HTTP to request your objects: Specify the following - // value: - // - // true - // - // In addition, specify allow-all for ViewerProtocolPolicy for all of your cache - // behaviors. - // - // If you want viewers to use HTTPS to request your objects: Choose the type - // of certificate that you want to use based on whether you're using an alternate - // domain name for your objects or the CloudFront domain name: - // - // * If you're using an alternate domain name, such as example.com: Specify - // one of the following values, depending on whether ACM provided your certificate - // or you purchased your certificate from third-party certificate authority: - // - // ARN for ACM SSL/TLS certificate where - // ARN for ACM SSL/TLS certificate is the ARN for the ACM SSL/TLS certificate - // that you want to use for this distribution. - // - // IAM certificate ID where IAM certificate - // ID is the ID that IAM returned when you added the certificate to the IAM - // certificate store. - // - // If you specify ACMCertificateArn or IAMCertificateId, you must also specify - // a value for SSLSupportMethod. - // - // If you choose to use an ACM certificate or a certificate in the IAM certificate - // store, we recommend that you use only an alternate domain name in your - // object URLs (https://example.com/logo.jpg). If you use the domain name - // that is associated with your CloudFront distribution (https://d111111abcdef8.cloudfront.net/logo.jpg) - // and the viewer supports SNI, then CloudFront behaves normally. However, - // if the browser does not support SNI, the user's experience depends on - // the value that you choose for SSLSupportMethod: - // - // vip: The viewer displays a warning because there is a mismatch between the - // CloudFront domain name and the domain name in your SSL/TLS certificate. - // - // sni-only: CloudFront drops the connection with the browser without returning - // the object. - // - // * If you're using the CloudFront domain name for your distribution, such - // as d111111abcdef8.cloudfront.net: Specify the following value: - // - // true - // - // If you want viewers to use HTTPS, you must also specify one of the following - // values in your cache behaviors: - // - // https-only - // - // redirect-to-https - // - // You can also optionally require that CloudFront use HTTPS to communicate - // with your origin by specifying one of the following values for the applicable - // origins: - // - // https-only - // - // match-viewer - // - // For more information, see Using Alternate Domain Names and HTTPS (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html#CNAMEsAndHTTPS) - // in the Amazon CloudFront Developer Guide. - Certificate *string `deprecated:"true" type:"string"` - - // This field is deprecated. You can use one of the following: [ACMCertificateArn, - // IAMCertificateId, or CloudFrontDefaultCertificate]. - CertificateSource *string `deprecated:"true" type:"string" enum:"CertificateSource"` - - CloudFrontDefaultCertificate *bool `type:"boolean"` - - IAMCertificateId *string `type:"string"` - - // Specify the minimum version of the SSL/TLS protocol that you want CloudFront - // to use for HTTPS connections between viewers and CloudFront: SSLv3 or TLSv1. - // CloudFront serves your objects only to viewers that support SSL/TLS version - // that you specify and later versions. The TLSv1 protocol is more secure, so - // we recommend that you specify SSLv3 only if your users are using browsers - // or devices that don't support TLSv1. Note the following: - // - // * If you specify true, - // the minimum SSL protocol version is TLSv1 and can't be changed. - // - // * If you're using a custom certificate (if you specify a value for ACMCertificateArn - // or for IAMCertificateId) and if you're using SNI (if you specify sni-only - // for SSLSupportMethod), you must specify TLSv1 for MinimumProtocolVersion. - MinimumProtocolVersion *string `type:"string" enum:"MinimumProtocolVersion"` - - // If you specify a value for ACMCertificateArn or for IAMCertificateId, you - // must also specify how you want CloudFront to serve HTTPS requests: using - // a method that works for all clients or one that works for most clients: - // - // * vip: CloudFront uses dedicated IP addresses for your content and can - // respond to HTTPS requests from any viewer. However, you will incur additional - // monthly charges. - // - // * sni-only: CloudFront can respond to HTTPS requests from viewers that - // support Server Name Indication (SNI). All modern browsers support SNI, - // but some browsers still in use don't support SNI. If some of your users' - // browsers don't support SNI, we recommend that you do one of the following: - // - // Use the vip option (dedicated IP addresses) instead of sni-only. - // - // Use the CloudFront SSL/TLS certificate instead of a custom certificate. This - // requires that you use the CloudFront domain name of your distribution - // in the URLs for your objects, for example, https://d111111abcdef8.cloudfront.net/logo.png. - // - // If you can control which browser your users use, upgrade the browser to one - // that supports SNI. - // - // Use HTTP instead of HTTPS. - // - // Do not specify a value for SSLSupportMethod if you specified true. - // - // For more information, see Using Alternate Domain Names and HTTPS (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html#CNAMEsAndHTTPS.html) - // in the Amazon CloudFront Developer Guide. - SSLSupportMethod *string `type:"string" enum:"SSLSupportMethod"` -} - -// String returns the string representation -func (s ViewerCertificate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ViewerCertificate) GoString() string { - return s.String() -} - -// SetACMCertificateArn sets the ACMCertificateArn field's value. -func (s *ViewerCertificate) SetACMCertificateArn(v string) *ViewerCertificate { - s.ACMCertificateArn = &v - return s -} - -// SetCertificate sets the Certificate field's value. -func (s *ViewerCertificate) SetCertificate(v string) *ViewerCertificate { - s.Certificate = &v - return s -} - -// SetCertificateSource sets the CertificateSource field's value. -func (s *ViewerCertificate) SetCertificateSource(v string) *ViewerCertificate { - s.CertificateSource = &v - return s -} - -// SetCloudFrontDefaultCertificate sets the CloudFrontDefaultCertificate field's value. -func (s *ViewerCertificate) SetCloudFrontDefaultCertificate(v bool) *ViewerCertificate { - s.CloudFrontDefaultCertificate = &v - return s -} - -// SetIAMCertificateId sets the IAMCertificateId field's value. -func (s *ViewerCertificate) SetIAMCertificateId(v string) *ViewerCertificate { - s.IAMCertificateId = &v - return s -} - -// SetMinimumProtocolVersion sets the MinimumProtocolVersion field's value. -func (s *ViewerCertificate) SetMinimumProtocolVersion(v string) *ViewerCertificate { - s.MinimumProtocolVersion = &v - return s -} - -// SetSSLSupportMethod sets the SSLSupportMethod field's value. -func (s *ViewerCertificate) SetSSLSupportMethod(v string) *ViewerCertificate { - s.SSLSupportMethod = &v - return s -} - -const ( - // CertificateSourceCloudfront is a CertificateSource enum value - CertificateSourceCloudfront = "cloudfront" - - // CertificateSourceIam is a CertificateSource enum value - CertificateSourceIam = "iam" - - // CertificateSourceAcm is a CertificateSource enum value - CertificateSourceAcm = "acm" -) - -const ( - // EventTypeViewerRequest is a EventType enum value - EventTypeViewerRequest = "viewer-request" - - // EventTypeViewerResponse is a EventType enum value - EventTypeViewerResponse = "viewer-response" - - // EventTypeOriginRequest is a EventType enum value - EventTypeOriginRequest = "origin-request" - - // EventTypeOriginResponse is a EventType enum value - EventTypeOriginResponse = "origin-response" -) - -const ( - // GeoRestrictionTypeBlacklist is a GeoRestrictionType enum value - GeoRestrictionTypeBlacklist = "blacklist" - - // GeoRestrictionTypeWhitelist is a GeoRestrictionType enum value - GeoRestrictionTypeWhitelist = "whitelist" - - // GeoRestrictionTypeNone is a GeoRestrictionType enum value - GeoRestrictionTypeNone = "none" -) - -const ( - // HttpVersionHttp11 is a HttpVersion enum value - HttpVersionHttp11 = "http1.1" - - // HttpVersionHttp2 is a HttpVersion enum value - HttpVersionHttp2 = "http2" -) - -const ( - // ItemSelectionNone is a ItemSelection enum value - ItemSelectionNone = "none" - - // ItemSelectionWhitelist is a ItemSelection enum value - ItemSelectionWhitelist = "whitelist" - - // ItemSelectionAll is a ItemSelection enum value - ItemSelectionAll = "all" -) - -const ( - // MethodGet is a Method enum value - MethodGet = "GET" - - // MethodHead is a Method enum value - MethodHead = "HEAD" - - // MethodPost is a Method enum value - MethodPost = "POST" - - // MethodPut is a Method enum value - MethodPut = "PUT" - - // MethodPatch is a Method enum value - MethodPatch = "PATCH" - - // MethodOptions is a Method enum value - MethodOptions = "OPTIONS" - - // MethodDelete is a Method enum value - MethodDelete = "DELETE" -) - -const ( - // MinimumProtocolVersionSslv3 is a MinimumProtocolVersion enum value - MinimumProtocolVersionSslv3 = "SSLv3" - - // MinimumProtocolVersionTlsv1 is a MinimumProtocolVersion enum value - MinimumProtocolVersionTlsv1 = "TLSv1" -) - -const ( - // OriginProtocolPolicyHttpOnly is a OriginProtocolPolicy enum value - OriginProtocolPolicyHttpOnly = "http-only" - - // OriginProtocolPolicyMatchViewer is a OriginProtocolPolicy enum value - OriginProtocolPolicyMatchViewer = "match-viewer" - - // OriginProtocolPolicyHttpsOnly is a OriginProtocolPolicy enum value - OriginProtocolPolicyHttpsOnly = "https-only" -) - -const ( - // PriceClassPriceClass100 is a PriceClass enum value - PriceClassPriceClass100 = "PriceClass_100" - - // PriceClassPriceClass200 is a PriceClass enum value - PriceClassPriceClass200 = "PriceClass_200" - - // PriceClassPriceClassAll is a PriceClass enum value - PriceClassPriceClassAll = "PriceClass_All" -) - -const ( - // SSLSupportMethodSniOnly is a SSLSupportMethod enum value - SSLSupportMethodSniOnly = "sni-only" - - // SSLSupportMethodVip is a SSLSupportMethod enum value - SSLSupportMethodVip = "vip" -) - -const ( - // SslProtocolSslv3 is a SslProtocol enum value - SslProtocolSslv3 = "SSLv3" - - // SslProtocolTlsv1 is a SslProtocol enum value - SslProtocolTlsv1 = "TLSv1" - - // SslProtocolTlsv11 is a SslProtocol enum value - SslProtocolTlsv11 = "TLSv1.1" - - // SslProtocolTlsv12 is a SslProtocol enum value - SslProtocolTlsv12 = "TLSv1.2" -) - -const ( - // ViewerProtocolPolicyAllowAll is a ViewerProtocolPolicy enum value - ViewerProtocolPolicyAllowAll = "allow-all" - - // ViewerProtocolPolicyHttpsOnly is a ViewerProtocolPolicy enum value - ViewerProtocolPolicyHttpsOnly = "https-only" - - // ViewerProtocolPolicyRedirectToHttps is a ViewerProtocolPolicy enum value - ViewerProtocolPolicyRedirectToHttps = "redirect-to-https" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go deleted file mode 100644 index 2a38d54..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go +++ /dev/null @@ -1,333 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudfront - -const ( - - // ErrCodeAccessDenied for service response error code - // "AccessDenied". - // - // Access denied. - ErrCodeAccessDenied = "AccessDenied" - - // ErrCodeBatchTooLarge for service response error code - // "BatchTooLarge". - ErrCodeBatchTooLarge = "BatchTooLarge" - - // ErrCodeCNAMEAlreadyExists for service response error code - // "CNAMEAlreadyExists". - ErrCodeCNAMEAlreadyExists = "CNAMEAlreadyExists" - - // ErrCodeDistributionAlreadyExists for service response error code - // "DistributionAlreadyExists". - // - // The caller reference you attempted to create the distribution with is associated - // with another distribution. - ErrCodeDistributionAlreadyExists = "DistributionAlreadyExists" - - // ErrCodeDistributionNotDisabled for service response error code - // "DistributionNotDisabled". - ErrCodeDistributionNotDisabled = "DistributionNotDisabled" - - // ErrCodeIllegalUpdate for service response error code - // "IllegalUpdate". - // - // Origin and CallerReference cannot be updated. - ErrCodeIllegalUpdate = "IllegalUpdate" - - // ErrCodeInconsistentQuantities for service response error code - // "InconsistentQuantities". - // - // The value of Quantity and the size of Items do not match. - ErrCodeInconsistentQuantities = "InconsistentQuantities" - - // ErrCodeInvalidArgument for service response error code - // "InvalidArgument". - // - // The argument is invalid. - ErrCodeInvalidArgument = "InvalidArgument" - - // ErrCodeInvalidDefaultRootObject for service response error code - // "InvalidDefaultRootObject". - // - // The default root object file name is too big or contains an invalid character. - ErrCodeInvalidDefaultRootObject = "InvalidDefaultRootObject" - - // ErrCodeInvalidErrorCode for service response error code - // "InvalidErrorCode". - ErrCodeInvalidErrorCode = "InvalidErrorCode" - - // ErrCodeInvalidForwardCookies for service response error code - // "InvalidForwardCookies". - // - // Your request contains forward cookies option which doesn't match with the - // expectation for the whitelisted list of cookie names. Either list of cookie - // names has been specified when not allowed or list of cookie names is missing - // when expected. - ErrCodeInvalidForwardCookies = "InvalidForwardCookies" - - // ErrCodeInvalidGeoRestrictionParameter for service response error code - // "InvalidGeoRestrictionParameter". - ErrCodeInvalidGeoRestrictionParameter = "InvalidGeoRestrictionParameter" - - // ErrCodeInvalidHeadersForS3Origin for service response error code - // "InvalidHeadersForS3Origin". - ErrCodeInvalidHeadersForS3Origin = "InvalidHeadersForS3Origin" - - // ErrCodeInvalidIfMatchVersion for service response error code - // "InvalidIfMatchVersion". - // - // The If-Match version is missing or not valid for the distribution. - ErrCodeInvalidIfMatchVersion = "InvalidIfMatchVersion" - - // ErrCodeInvalidLambdaFunctionAssociation for service response error code - // "InvalidLambdaFunctionAssociation". - // - // The specified Lambda function association is invalid. - ErrCodeInvalidLambdaFunctionAssociation = "InvalidLambdaFunctionAssociation" - - // ErrCodeInvalidLocationCode for service response error code - // "InvalidLocationCode". - ErrCodeInvalidLocationCode = "InvalidLocationCode" - - // ErrCodeInvalidMinimumProtocolVersion for service response error code - // "InvalidMinimumProtocolVersion". - ErrCodeInvalidMinimumProtocolVersion = "InvalidMinimumProtocolVersion" - - // ErrCodeInvalidOrigin for service response error code - // "InvalidOrigin". - // - // The Amazon S3 origin server specified does not refer to a valid Amazon S3 - // bucket. - ErrCodeInvalidOrigin = "InvalidOrigin" - - // ErrCodeInvalidOriginAccessIdentity for service response error code - // "InvalidOriginAccessIdentity". - // - // The origin access identity is not valid or doesn't exist. - ErrCodeInvalidOriginAccessIdentity = "InvalidOriginAccessIdentity" - - // ErrCodeInvalidOriginKeepaliveTimeout for service response error code - // "InvalidOriginKeepaliveTimeout". - ErrCodeInvalidOriginKeepaliveTimeout = "InvalidOriginKeepaliveTimeout" - - // ErrCodeInvalidOriginReadTimeout for service response error code - // "InvalidOriginReadTimeout". - ErrCodeInvalidOriginReadTimeout = "InvalidOriginReadTimeout" - - // ErrCodeInvalidProtocolSettings for service response error code - // "InvalidProtocolSettings". - // - // You cannot specify SSLv3 as the minimum protocol version if you only want - // to support only clients that support Server Name Indication (SNI). - ErrCodeInvalidProtocolSettings = "InvalidProtocolSettings" - - // ErrCodeInvalidQueryStringParameters for service response error code - // "InvalidQueryStringParameters". - ErrCodeInvalidQueryStringParameters = "InvalidQueryStringParameters" - - // ErrCodeInvalidRelativePath for service response error code - // "InvalidRelativePath". - // - // The relative path is too big, is not URL-encoded, or does not begin with - // a slash (/). - ErrCodeInvalidRelativePath = "InvalidRelativePath" - - // ErrCodeInvalidRequiredProtocol for service response error code - // "InvalidRequiredProtocol". - // - // This operation requires the HTTPS protocol. Ensure that you specify the HTTPS - // protocol in your request, or omit the RequiredProtocols element from your - // distribution configuration. - ErrCodeInvalidRequiredProtocol = "InvalidRequiredProtocol" - - // ErrCodeInvalidResponseCode for service response error code - // "InvalidResponseCode". - ErrCodeInvalidResponseCode = "InvalidResponseCode" - - // ErrCodeInvalidTTLOrder for service response error code - // "InvalidTTLOrder". - ErrCodeInvalidTTLOrder = "InvalidTTLOrder" - - // ErrCodeInvalidTagging for service response error code - // "InvalidTagging". - ErrCodeInvalidTagging = "InvalidTagging" - - // ErrCodeInvalidViewerCertificate for service response error code - // "InvalidViewerCertificate". - ErrCodeInvalidViewerCertificate = "InvalidViewerCertificate" - - // ErrCodeInvalidWebACLId for service response error code - // "InvalidWebACLId". - ErrCodeInvalidWebACLId = "InvalidWebACLId" - - // ErrCodeMissingBody for service response error code - // "MissingBody". - // - // This operation requires a body. Ensure that the body is present and the Content-Type - // header is set. - ErrCodeMissingBody = "MissingBody" - - // ErrCodeNoSuchCloudFrontOriginAccessIdentity for service response error code - // "NoSuchCloudFrontOriginAccessIdentity". - // - // The specified origin access identity does not exist. - ErrCodeNoSuchCloudFrontOriginAccessIdentity = "NoSuchCloudFrontOriginAccessIdentity" - - // ErrCodeNoSuchDistribution for service response error code - // "NoSuchDistribution". - // - // The specified distribution does not exist. - ErrCodeNoSuchDistribution = "NoSuchDistribution" - - // ErrCodeNoSuchInvalidation for service response error code - // "NoSuchInvalidation". - // - // The specified invalidation does not exist. - ErrCodeNoSuchInvalidation = "NoSuchInvalidation" - - // ErrCodeNoSuchOrigin for service response error code - // "NoSuchOrigin". - // - // No origin exists with the specified Origin Id. - ErrCodeNoSuchOrigin = "NoSuchOrigin" - - // ErrCodeNoSuchResource for service response error code - // "NoSuchResource". - ErrCodeNoSuchResource = "NoSuchResource" - - // ErrCodeNoSuchStreamingDistribution for service response error code - // "NoSuchStreamingDistribution". - // - // The specified streaming distribution does not exist. - ErrCodeNoSuchStreamingDistribution = "NoSuchStreamingDistribution" - - // ErrCodeOriginAccessIdentityAlreadyExists for service response error code - // "OriginAccessIdentityAlreadyExists". - // - // If the CallerReference is a value you already sent in a previous request - // to create an identity but the content of the CloudFrontOriginAccessIdentityConfig - // is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists - // error. - ErrCodeOriginAccessIdentityAlreadyExists = "OriginAccessIdentityAlreadyExists" - - // ErrCodeOriginAccessIdentityInUse for service response error code - // "OriginAccessIdentityInUse". - ErrCodeOriginAccessIdentityInUse = "OriginAccessIdentityInUse" - - // ErrCodePreconditionFailed for service response error code - // "PreconditionFailed". - // - // The precondition given in one or more of the request-header fields evaluated - // to false. - ErrCodePreconditionFailed = "PreconditionFailed" - - // ErrCodeStreamingDistributionAlreadyExists for service response error code - // "StreamingDistributionAlreadyExists". - ErrCodeStreamingDistributionAlreadyExists = "StreamingDistributionAlreadyExists" - - // ErrCodeStreamingDistributionNotDisabled for service response error code - // "StreamingDistributionNotDisabled". - ErrCodeStreamingDistributionNotDisabled = "StreamingDistributionNotDisabled" - - // ErrCodeTooManyCacheBehaviors for service response error code - // "TooManyCacheBehaviors". - // - // You cannot create more cache behaviors for the distribution. - ErrCodeTooManyCacheBehaviors = "TooManyCacheBehaviors" - - // ErrCodeTooManyCertificates for service response error code - // "TooManyCertificates". - // - // You cannot create anymore custom SSL/TLS certificates. - ErrCodeTooManyCertificates = "TooManyCertificates" - - // ErrCodeTooManyCloudFrontOriginAccessIdentities for service response error code - // "TooManyCloudFrontOriginAccessIdentities". - // - // Processing your request would cause you to exceed the maximum number of origin - // access identities allowed. - ErrCodeTooManyCloudFrontOriginAccessIdentities = "TooManyCloudFrontOriginAccessIdentities" - - // ErrCodeTooManyCookieNamesInWhiteList for service response error code - // "TooManyCookieNamesInWhiteList". - // - // Your request contains more cookie names in the whitelist than are allowed - // per cache behavior. - ErrCodeTooManyCookieNamesInWhiteList = "TooManyCookieNamesInWhiteList" - - // ErrCodeTooManyDistributionCNAMEs for service response error code - // "TooManyDistributionCNAMEs". - // - // Your request contains more CNAMEs than are allowed per distribution. - ErrCodeTooManyDistributionCNAMEs = "TooManyDistributionCNAMEs" - - // ErrCodeTooManyDistributions for service response error code - // "TooManyDistributions". - // - // Processing your request would cause you to exceed the maximum number of distributions - // allowed. - ErrCodeTooManyDistributions = "TooManyDistributions" - - // ErrCodeTooManyDistributionsWithLambdaAssociations for service response error code - // "TooManyDistributionsWithLambdaAssociations". - // - // Processing your request would cause the maximum number of distributions with - // Lambda function associations per owner to be exceeded. - ErrCodeTooManyDistributionsWithLambdaAssociations = "TooManyDistributionsWithLambdaAssociations" - - // ErrCodeTooManyHeadersInForwardedValues for service response error code - // "TooManyHeadersInForwardedValues". - ErrCodeTooManyHeadersInForwardedValues = "TooManyHeadersInForwardedValues" - - // ErrCodeTooManyInvalidationsInProgress for service response error code - // "TooManyInvalidationsInProgress". - // - // You have exceeded the maximum number of allowable InProgress invalidation - // batch requests, or invalidation objects. - ErrCodeTooManyInvalidationsInProgress = "TooManyInvalidationsInProgress" - - // ErrCodeTooManyLambdaFunctionAssociations for service response error code - // "TooManyLambdaFunctionAssociations". - // - // Your request contains more Lambda function associations than are allowed - // per distribution. - ErrCodeTooManyLambdaFunctionAssociations = "TooManyLambdaFunctionAssociations" - - // ErrCodeTooManyOriginCustomHeaders for service response error code - // "TooManyOriginCustomHeaders". - ErrCodeTooManyOriginCustomHeaders = "TooManyOriginCustomHeaders" - - // ErrCodeTooManyOrigins for service response error code - // "TooManyOrigins". - // - // You cannot create more origins for the distribution. - ErrCodeTooManyOrigins = "TooManyOrigins" - - // ErrCodeTooManyQueryStringParameters for service response error code - // "TooManyQueryStringParameters". - ErrCodeTooManyQueryStringParameters = "TooManyQueryStringParameters" - - // ErrCodeTooManyStreamingDistributionCNAMEs for service response error code - // "TooManyStreamingDistributionCNAMEs". - ErrCodeTooManyStreamingDistributionCNAMEs = "TooManyStreamingDistributionCNAMEs" - - // ErrCodeTooManyStreamingDistributions for service response error code - // "TooManyStreamingDistributions". - // - // Processing your request would cause you to exceed the maximum number of streaming - // distributions allowed. - ErrCodeTooManyStreamingDistributions = "TooManyStreamingDistributions" - - // ErrCodeTooManyTrustedSigners for service response error code - // "TooManyTrustedSigners". - // - // Your request contains more trusted signers than are allowed per distribution. - ErrCodeTooManyTrustedSigners = "TooManyTrustedSigners" - - // ErrCodeTrustedSignerDoesNotExist for service response error code - // "TrustedSignerDoesNotExist". - // - // One or more of your trusted signers do not exist. - ErrCodeTrustedSignerDoesNotExist = "TrustedSignerDoesNotExist" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/examples_test.go deleted file mode 100644 index 4902d85..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/examples_test.go +++ /dev/null @@ -1,1442 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudfront_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/cloudfront" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleCloudFront_CreateCloudFrontOriginAccessIdentity() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.CreateCloudFrontOriginAccessIdentityInput{ - CloudFrontOriginAccessIdentityConfig: &cloudfront.OriginAccessIdentityConfig{ // Required - CallerReference: aws.String("string"), // Required - Comment: aws.String("string"), // Required - }, - } - resp, err := svc.CreateCloudFrontOriginAccessIdentity(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_CreateDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &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... - }, - }, - QueryStringCacheKeys: &cloudfront.QueryStringCacheKeys{ - 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 - }, - }, - Compress: aws.Bool(true), - DefaultTTL: aws.Int64(1), - LambdaFunctionAssociations: &cloudfront.LambdaFunctionAssociations{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.LambdaFunctionAssociation{ - { // Required - EventType: aws.String("EventType"), - LambdaFunctionARN: aws.String("string"), - }, - // More values... - }, - }, - 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 - CustomHeaders: &cloudfront.CustomHeaders{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.OriginCustomHeader{ - { // Required - HeaderName: aws.String("string"), // Required - HeaderValue: aws.String("string"), // Required - }, - // More values... - }, - }, - CustomOriginConfig: &cloudfront.CustomOriginConfig{ - HTTPPort: aws.Int64(1), // Required - HTTPSPort: aws.Int64(1), // Required - OriginProtocolPolicy: aws.String("OriginProtocolPolicy"), // Required - OriginKeepaliveTimeout: aws.Int64(1), - OriginReadTimeout: aws.Int64(1), - OriginSslProtocols: &cloudfront.OriginSslProtocols{ - Items: []*string{ // Required - aws.String("SslProtocol"), // Required - // More values... - }, - Quantity: aws.Int64(1), // 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... - }, - }, - QueryStringCacheKeys: &cloudfront.QueryStringCacheKeys{ - 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 - }, - }, - Compress: aws.Bool(true), - DefaultTTL: aws.Int64(1), - LambdaFunctionAssociations: &cloudfront.LambdaFunctionAssociations{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.LambdaFunctionAssociation{ - { // Required - EventType: aws.String("EventType"), - LambdaFunctionARN: aws.String("string"), - }, - // More values... - }, - }, - 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"), - HttpVersion: aws.String("HttpVersion"), - IsIPV6Enabled: aws.Bool(true), - 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{ - ACMCertificateArn: aws.String("string"), - Certificate: aws.String("string"), - CertificateSource: aws.String("CertificateSource"), - CloudFrontDefaultCertificate: aws.Bool(true), - IAMCertificateId: aws.String("string"), - MinimumProtocolVersion: aws.String("MinimumProtocolVersion"), - SSLSupportMethod: aws.String("SSLSupportMethod"), - }, - WebACLId: aws.String("string"), - }, - } - resp, err := svc.CreateDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_CreateDistributionWithTags() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.CreateDistributionWithTagsInput{ - DistributionConfigWithTags: &cloudfront.DistributionConfigWithTags{ // Required - 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... - }, - }, - QueryStringCacheKeys: &cloudfront.QueryStringCacheKeys{ - 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 - }, - }, - Compress: aws.Bool(true), - DefaultTTL: aws.Int64(1), - LambdaFunctionAssociations: &cloudfront.LambdaFunctionAssociations{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.LambdaFunctionAssociation{ - { // Required - EventType: aws.String("EventType"), - LambdaFunctionARN: aws.String("string"), - }, - // More values... - }, - }, - 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 - CustomHeaders: &cloudfront.CustomHeaders{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.OriginCustomHeader{ - { // Required - HeaderName: aws.String("string"), // Required - HeaderValue: aws.String("string"), // Required - }, - // More values... - }, - }, - CustomOriginConfig: &cloudfront.CustomOriginConfig{ - HTTPPort: aws.Int64(1), // Required - HTTPSPort: aws.Int64(1), // Required - OriginProtocolPolicy: aws.String("OriginProtocolPolicy"), // Required - OriginKeepaliveTimeout: aws.Int64(1), - OriginReadTimeout: aws.Int64(1), - OriginSslProtocols: &cloudfront.OriginSslProtocols{ - Items: []*string{ // Required - aws.String("SslProtocol"), // Required - // More values... - }, - Quantity: aws.Int64(1), // 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... - }, - }, - QueryStringCacheKeys: &cloudfront.QueryStringCacheKeys{ - 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 - }, - }, - Compress: aws.Bool(true), - DefaultTTL: aws.Int64(1), - LambdaFunctionAssociations: &cloudfront.LambdaFunctionAssociations{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.LambdaFunctionAssociation{ - { // Required - EventType: aws.String("EventType"), - LambdaFunctionARN: aws.String("string"), - }, - // More values... - }, - }, - 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"), - HttpVersion: aws.String("HttpVersion"), - IsIPV6Enabled: aws.Bool(true), - 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{ - ACMCertificateArn: aws.String("string"), - Certificate: aws.String("string"), - CertificateSource: aws.String("CertificateSource"), - CloudFrontDefaultCertificate: aws.Bool(true), - IAMCertificateId: aws.String("string"), - MinimumProtocolVersion: aws.String("MinimumProtocolVersion"), - SSLSupportMethod: aws.String("SSLSupportMethod"), - }, - WebACLId: aws.String("string"), - }, - Tags: &cloudfront.Tags{ // Required - Items: []*cloudfront.Tag{ - { // Required - Key: aws.String("TagKey"), // Required - Value: aws.String("TagValue"), - }, - // More values... - }, - }, - }, - } - resp, err := svc.CreateDistributionWithTags(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_CreateInvalidation() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.CreateInvalidationInput{ - DistributionId: aws.String("string"), // Required - InvalidationBatch: &cloudfront.InvalidationBatch{ // Required - CallerReference: aws.String("string"), // Required - Paths: &cloudfront.Paths{ // Required - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - }, - } - resp, err := svc.CreateInvalidation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_CreateStreamingDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.CreateStreamingDistributionInput{ - StreamingDistributionConfig: &cloudfront.StreamingDistributionConfig{ // Required - CallerReference: aws.String("string"), // Required - Comment: aws.String("string"), // Required - Enabled: aws.Bool(true), // Required - S3Origin: &cloudfront.S3Origin{ // Required - DomainName: aws.String("string"), // Required - OriginAccessIdentity: 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... - }, - }, - Aliases: &cloudfront.Aliases{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - Logging: &cloudfront.StreamingLoggingConfig{ - Bucket: aws.String("string"), // Required - Enabled: aws.Bool(true), // Required - Prefix: aws.String("string"), // Required - }, - PriceClass: aws.String("PriceClass"), - }, - } - resp, err := svc.CreateStreamingDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_CreateStreamingDistributionWithTags() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.CreateStreamingDistributionWithTagsInput{ - StreamingDistributionConfigWithTags: &cloudfront.StreamingDistributionConfigWithTags{ // Required - StreamingDistributionConfig: &cloudfront.StreamingDistributionConfig{ // Required - CallerReference: aws.String("string"), // Required - Comment: aws.String("string"), // Required - Enabled: aws.Bool(true), // Required - S3Origin: &cloudfront.S3Origin{ // Required - DomainName: aws.String("string"), // Required - OriginAccessIdentity: 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... - }, - }, - Aliases: &cloudfront.Aliases{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - Logging: &cloudfront.StreamingLoggingConfig{ - Bucket: aws.String("string"), // Required - Enabled: aws.Bool(true), // Required - Prefix: aws.String("string"), // Required - }, - PriceClass: aws.String("PriceClass"), - }, - Tags: &cloudfront.Tags{ // Required - Items: []*cloudfront.Tag{ - { // Required - Key: aws.String("TagKey"), // Required - Value: aws.String("TagValue"), - }, - // More values... - }, - }, - }, - } - resp, err := svc.CreateStreamingDistributionWithTags(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_DeleteCloudFrontOriginAccessIdentity() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.DeleteCloudFrontOriginAccessIdentityInput{ - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } - resp, err := svc.DeleteCloudFrontOriginAccessIdentity(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_DeleteDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.DeleteDistributionInput{ - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } - resp, err := svc.DeleteDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_DeleteStreamingDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.DeleteStreamingDistributionInput{ - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } - resp, err := svc.DeleteStreamingDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_GetCloudFrontOriginAccessIdentity() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.GetCloudFrontOriginAccessIdentityInput{ - Id: aws.String("string"), // Required - } - resp, err := svc.GetCloudFrontOriginAccessIdentity(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_GetCloudFrontOriginAccessIdentityConfig() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.GetCloudFrontOriginAccessIdentityConfigInput{ - Id: aws.String("string"), // Required - } - resp, err := svc.GetCloudFrontOriginAccessIdentityConfig(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_GetDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.GetDistributionInput{ - Id: aws.String("string"), // Required - } - resp, err := svc.GetDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_GetDistributionConfig() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.GetDistributionConfigInput{ - Id: aws.String("string"), // Required - } - resp, err := svc.GetDistributionConfig(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_GetInvalidation() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.GetInvalidationInput{ - DistributionId: aws.String("string"), // Required - Id: aws.String("string"), // Required - } - resp, err := svc.GetInvalidation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_GetStreamingDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.GetStreamingDistributionInput{ - Id: aws.String("string"), // Required - } - resp, err := svc.GetStreamingDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_GetStreamingDistributionConfig() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.GetStreamingDistributionConfigInput{ - Id: aws.String("string"), // Required - } - resp, err := svc.GetStreamingDistributionConfig(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_ListCloudFrontOriginAccessIdentities() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.ListCloudFrontOriginAccessIdentitiesInput{ - Marker: aws.String("string"), - MaxItems: aws.Int64(1), - } - resp, err := svc.ListCloudFrontOriginAccessIdentities(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_ListDistributions() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.ListDistributionsInput{ - Marker: aws.String("string"), - MaxItems: aws.Int64(1), - } - resp, err := svc.ListDistributions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_ListDistributionsByWebACLId() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.ListDistributionsByWebACLIdInput{ - WebACLId: aws.String("string"), // Required - Marker: aws.String("string"), - MaxItems: aws.Int64(1), - } - resp, err := svc.ListDistributionsByWebACLId(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_ListInvalidations() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.ListInvalidationsInput{ - DistributionId: aws.String("string"), // Required - Marker: aws.String("string"), - MaxItems: aws.Int64(1), - } - resp, err := svc.ListInvalidations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_ListStreamingDistributions() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.ListStreamingDistributionsInput{ - Marker: aws.String("string"), - MaxItems: aws.Int64(1), - } - resp, err := svc.ListStreamingDistributions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_ListTagsForResource() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.ListTagsForResourceInput{ - Resource: aws.String("ResourceARN"), // Required - } - resp, err := svc.ListTagsForResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_TagResource() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.TagResourceInput{ - Resource: aws.String("ResourceARN"), // Required - Tags: &cloudfront.Tags{ // Required - Items: []*cloudfront.Tag{ - { // Required - Key: aws.String("TagKey"), // Required - Value: aws.String("TagValue"), - }, - // More values... - }, - }, - } - resp, err := svc.TagResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_UntagResource() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.UntagResourceInput{ - Resource: aws.String("ResourceARN"), // Required - TagKeys: &cloudfront.TagKeys{ // Required - Items: []*string{ - aws.String("TagKey"), // Required - // More values... - }, - }, - } - resp, err := svc.UntagResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_UpdateCloudFrontOriginAccessIdentity() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.UpdateCloudFrontOriginAccessIdentityInput{ - CloudFrontOriginAccessIdentityConfig: &cloudfront.OriginAccessIdentityConfig{ // Required - CallerReference: aws.String("string"), // Required - Comment: aws.String("string"), // Required - }, - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } - resp, err := svc.UpdateCloudFrontOriginAccessIdentity(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_UpdateDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.UpdateDistributionInput{ - 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... - }, - }, - QueryStringCacheKeys: &cloudfront.QueryStringCacheKeys{ - 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 - }, - }, - Compress: aws.Bool(true), - DefaultTTL: aws.Int64(1), - LambdaFunctionAssociations: &cloudfront.LambdaFunctionAssociations{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.LambdaFunctionAssociation{ - { // Required - EventType: aws.String("EventType"), - LambdaFunctionARN: aws.String("string"), - }, - // More values... - }, - }, - 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 - CustomHeaders: &cloudfront.CustomHeaders{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.OriginCustomHeader{ - { // Required - HeaderName: aws.String("string"), // Required - HeaderValue: aws.String("string"), // Required - }, - // More values... - }, - }, - CustomOriginConfig: &cloudfront.CustomOriginConfig{ - HTTPPort: aws.Int64(1), // Required - HTTPSPort: aws.Int64(1), // Required - OriginProtocolPolicy: aws.String("OriginProtocolPolicy"), // Required - OriginKeepaliveTimeout: aws.Int64(1), - OriginReadTimeout: aws.Int64(1), - OriginSslProtocols: &cloudfront.OriginSslProtocols{ - Items: []*string{ // Required - aws.String("SslProtocol"), // Required - // More values... - }, - Quantity: aws.Int64(1), // 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... - }, - }, - QueryStringCacheKeys: &cloudfront.QueryStringCacheKeys{ - 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 - }, - }, - Compress: aws.Bool(true), - DefaultTTL: aws.Int64(1), - LambdaFunctionAssociations: &cloudfront.LambdaFunctionAssociations{ - Quantity: aws.Int64(1), // Required - Items: []*cloudfront.LambdaFunctionAssociation{ - { // Required - EventType: aws.String("EventType"), - LambdaFunctionARN: aws.String("string"), - }, - // More values... - }, - }, - 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"), - HttpVersion: aws.String("HttpVersion"), - IsIPV6Enabled: aws.Bool(true), - 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{ - ACMCertificateArn: aws.String("string"), - Certificate: aws.String("string"), - CertificateSource: aws.String("CertificateSource"), - CloudFrontDefaultCertificate: aws.Bool(true), - IAMCertificateId: aws.String("string"), - MinimumProtocolVersion: aws.String("MinimumProtocolVersion"), - SSLSupportMethod: aws.String("SSLSupportMethod"), - }, - WebACLId: aws.String("string"), - }, - Id: aws.String("string"), // Required - IfMatch: aws.String("string"), - } - resp, err := svc.UpdateDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleCloudFront_UpdateStreamingDistribution() { - sess := session.Must(session.NewSession()) - - svc := cloudfront.New(sess) - - params := &cloudfront.UpdateStreamingDistributionInput{ - Id: aws.String("string"), // Required - StreamingDistributionConfig: &cloudfront.StreamingDistributionConfig{ // Required - CallerReference: aws.String("string"), // Required - Comment: aws.String("string"), // Required - Enabled: aws.Bool(true), // Required - S3Origin: &cloudfront.S3Origin{ // Required - DomainName: aws.String("string"), // Required - OriginAccessIdentity: 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... - }, - }, - Aliases: &cloudfront.Aliases{ - Quantity: aws.Int64(1), // Required - Items: []*string{ - aws.String("string"), // Required - // More values... - }, - }, - Logging: &cloudfront.StreamingLoggingConfig{ - Bucket: aws.String("string"), // Required - Enabled: aws.Bool(true), // Required - Prefix: aws.String("string"), // Required - }, - PriceClass: aws.String("PriceClass"), - }, - IfMatch: aws.String("string"), - } - resp, err := svc.UpdateStreamingDistribution(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go deleted file mode 100644 index 35b82c4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudfront - -import ( - "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/private/protocol/restxml" -) - -// This is the Amazon CloudFront API Reference. This guide is for developers -// who need detailed information about the CloudFront API actions, data types, -// and errors. For detailed information about CloudFront features and their -// associated API calls, see the Amazon CloudFront Developer Guide. -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2017-03-25 -type CloudFront struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "cloudfront" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the CloudFront 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: -// // Create a CloudFront client from just a session. -// svc := cloudfront.New(mySession) -// -// // Create a CloudFront client with additional configuration -// svc := cloudfront.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudFront { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudFront { - svc := &CloudFront{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2017-03-25", - }, - 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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CloudFront operation and runs any -// custom request initialization. -func (c *CloudFront) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go deleted file mode 100644 index c8d4b14..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudfront - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilDistributionDeployed uses the CloudFront API operation -// GetDistribution to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *CloudFront) WaitUntilDistributionDeployed(input *GetDistributionInput) error { - return c.WaitUntilDistributionDeployedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilDistributionDeployedWithContext is an extended version of WaitUntilDistributionDeployed. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *CloudFront) WaitUntilDistributionDeployedWithContext(ctx aws.Context, input *GetDistributionInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilDistributionDeployed", - MaxAttempts: 25, - Delay: request.ConstantWaiterDelay(60 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "Distribution.Status", - Expected: "Deployed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetDistributionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetDistributionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInvalidationCompleted uses the CloudFront API operation -// GetInvalidation to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *CloudFront) WaitUntilInvalidationCompleted(input *GetInvalidationInput) error { - return c.WaitUntilInvalidationCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInvalidationCompletedWithContext is an extended version of WaitUntilInvalidationCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *CloudFront) WaitUntilInvalidationCompletedWithContext(ctx aws.Context, input *GetInvalidationInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInvalidationCompleted", - MaxAttempts: 30, - Delay: request.ConstantWaiterDelay(20 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "Invalidation.Status", - Expected: "Completed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetInvalidationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetInvalidationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilStreamingDistributionDeployed uses the CloudFront API operation -// GetStreamingDistribution to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *CloudFront) WaitUntilStreamingDistributionDeployed(input *GetStreamingDistributionInput) error { - return c.WaitUntilStreamingDistributionDeployedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilStreamingDistributionDeployedWithContext is an extended version of WaitUntilStreamingDistributionDeployed. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *CloudFront) WaitUntilStreamingDistributionDeployedWithContext(ctx aws.Context, input *GetStreamingDistributionInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilStreamingDistributionDeployed", - MaxAttempts: 25, - Delay: request.ConstantWaiterDelay(60 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "StreamingDistribution.Status", - Expected: "Deployed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetStreamingDistributionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetStreamingDistributionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go deleted file mode 100644 index 95b35ba..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go +++ /dev/null @@ -1,8906 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package dynamodb provides a client for Amazon DynamoDB. -package dynamodb - -import ( - "fmt" - "time" - - "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/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opBatchGetItem = "BatchGetItem" - -// BatchGetItemRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetItem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchGetItem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchGetItem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchGetItemRequest method. -// req, resp := client.BatchGetItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem -func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.Request, output *BatchGetItemOutput) { - op := &request.Operation{ - Name: opBatchGetItem, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"RequestItems"}, - OutputTokens: []string{"UnprocessedKeys"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &BatchGetItemInput{} - } - - output = &BatchGetItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetItem API operation for Amazon DynamoDB. -// -// The BatchGetItem operation returns the attributes of one or more items from -// one or more tables. You identify requested items by primary key. -// -// A single operation can retrieve up to 16 MB of data, which can contain as -// many as 100 items. BatchGetItem will return a partial result if the response -// size limit is exceeded, the table's provisioned throughput is exceeded, or -// an internal processing failure occurs. If a partial result is returned, the -// operation returns a value for UnprocessedKeys. You can use this value to -// retry the operation starting with the next item to get. -// -// If you request more than 100 items BatchGetItem will return a ValidationException -// with the message "Too many items requested for the BatchGetItem call". -// -// For example, if you ask to retrieve 100 items, but each individual item is -// 300 KB in size, the system returns 52 items (so as not to exceed the 16 MB -// limit). It also returns an appropriate UnprocessedKeys value so you can get -// the next page of results. If desired, your application can include its own -// logic to assemble the pages of results into one data set. -// -// If none of the items can be processed due to insufficient provisioned throughput -// on all of the tables in the request, then BatchGetItem will return a ProvisionedThroughputExceededException. -// If at least one of the items is successfully processed, then BatchGetItem -// completes successfully, while returning the keys of the unread items in UnprocessedKeys. -// -// If DynamoDB returns any unprocessed items, you should retry the batch operation -// on those items. However, we strongly recommend that you use an exponential -// backoff algorithm. If you retry the batch operation immediately, the underlying -// read or write requests can still fail due to throttling on the individual -// tables. If you delay the batch operation using exponential backoff, the individual -// requests in the batch are much more likely to succeed. -// -// For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations) -// in the Amazon DynamoDB Developer Guide. -// -// By default, BatchGetItem performs eventually consistent reads on every table -// in the request. If you want strongly consistent reads instead, you can set -// ConsistentRead to true for any or all tables. -// -// In order to minimize response latency, BatchGetItem retrieves items in parallel. -// -// When designing your application, keep in mind that DynamoDB does not return -// items in any particular order. To help parse the response by item, include -// the primary key values for the items in your request in the ProjectionExpression -// parameter. -// -// If a requested item does not exist, it is not returned in the result. Requests -// for nonexistent items consume the minimum read capacity units according to -// the type of read. For more information, see Capacity Units Calculations (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations) -// in the Amazon DynamoDB Developer Guide. -// -// 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 Amazon DynamoDB's -// API operation BatchGetItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem -func (c *DynamoDB) BatchGetItem(input *BatchGetItemInput) (*BatchGetItemOutput, error) { - req, out := c.BatchGetItemRequest(input) - return out, req.Send() -} - -// BatchGetItemWithContext is the same as BatchGetItem with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetItem 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 *DynamoDB) BatchGetItemWithContext(ctx aws.Context, input *BatchGetItemInput, opts ...request.Option) (*BatchGetItemOutput, error) { - req, out := c.BatchGetItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// BatchGetItemPages iterates over the pages of a BatchGetItem operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See BatchGetItem method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a BatchGetItem operation. -// pageNum := 0 -// err := client.BatchGetItemPages(params, -// func(page *BatchGetItemOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) BatchGetItemPages(input *BatchGetItemInput, fn func(*BatchGetItemOutput, bool) bool) error { - return c.BatchGetItemPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// BatchGetItemPagesWithContext same as BatchGetItemPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DynamoDB) BatchGetItemPagesWithContext(ctx aws.Context, input *BatchGetItemInput, fn func(*BatchGetItemOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *BatchGetItemInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.BatchGetItemRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*BatchGetItemOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opBatchWriteItem = "BatchWriteItem" - -// BatchWriteItemRequest generates a "aws/request.Request" representing the -// client's request for the BatchWriteItem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BatchWriteItem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BatchWriteItem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BatchWriteItemRequest method. -// req, resp := client.BatchWriteItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem -func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *request.Request, output *BatchWriteItemOutput) { - op := &request.Operation{ - Name: opBatchWriteItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchWriteItemInput{} - } - - output = &BatchWriteItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchWriteItem API operation for Amazon DynamoDB. -// -// The BatchWriteItem operation puts or deletes multiple items in one or more -// tables. A single call to BatchWriteItem can write up to 16 MB of data, which -// can comprise as many as 25 put or delete requests. Individual items to be -// written can be as large as 400 KB. -// -// BatchWriteItem cannot update items. To update items, use the UpdateItem action. -// -// The individual PutItem and DeleteItem operations specified in BatchWriteItem -// are atomic; however BatchWriteItem as a whole is not. If any requested operations -// fail because the table's provisioned throughput is exceeded or an internal -// processing failure occurs, the failed operations are returned in the UnprocessedItems -// response parameter. You can investigate and optionally resend the requests. -// Typically, you would call BatchWriteItem in a loop. Each iteration would -// check for unprocessed items and submit a new BatchWriteItem request with -// those unprocessed items until all items have been processed. -// -// Note that if none of the items can be processed due to insufficient provisioned -// throughput on all of the tables in the request, then BatchWriteItem will -// return a ProvisionedThroughputExceededException. -// -// If DynamoDB returns any unprocessed items, you should retry the batch operation -// on those items. However, we strongly recommend that you use an exponential -// backoff algorithm. If you retry the batch operation immediately, the underlying -// read or write requests can still fail due to throttling on the individual -// tables. If you delay the batch operation using exponential backoff, the individual -// requests in the batch are much more likely to succeed. -// -// For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations) -// in the Amazon DynamoDB Developer Guide. -// -// With BatchWriteItem, you can efficiently write or delete large amounts of -// data, such as from Amazon Elastic MapReduce (EMR), or copy data from another -// database into DynamoDB. In order to improve performance with these large-scale -// operations, BatchWriteItem does not behave in the same way as individual -// PutItem and DeleteItem calls would. For example, you cannot specify conditions -// on individual put and delete requests, and BatchWriteItem does not return -// deleted items in the response. -// -// If you use a programming language that supports concurrency, you can use -// threads to write items in parallel. Your application must include the necessary -// logic to manage the threads. With languages that don't support threading, -// you must update or delete the specified items one at a time. In both situations, -// BatchWriteItem performs the specified put and delete operations in parallel, -// giving you the power of the thread pool approach without having to introduce -// complexity into your application. -// -// Parallel processing reduces latency, but each specified put and delete request -// consumes the same number of write capacity units whether it is processed -// in parallel or not. Delete operations on nonexistent items consume one write -// capacity unit. -// -// If one or more of the following is true, DynamoDB rejects the entire batch -// write operation: -// -// * One or more tables specified in the BatchWriteItem request does not -// exist. -// -// * Primary key attributes specified on an item in the request do not match -// those in the corresponding table's primary key schema. -// -// * You try to perform multiple operations on the same item in the same -// BatchWriteItem request. For example, you cannot put and delete the same -// item in the same BatchWriteItem request. -// -// * There are more than 25 requests in the batch. -// -// * Any individual item in a batch exceeds 400 KB. -// -// * The total request size exceeds 16 MB. -// -// 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 Amazon DynamoDB's -// API operation BatchWriteItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem -func (c *DynamoDB) BatchWriteItem(input *BatchWriteItemInput) (*BatchWriteItemOutput, error) { - req, out := c.BatchWriteItemRequest(input) - return out, req.Send() -} - -// BatchWriteItemWithContext is the same as BatchWriteItem with the addition of -// the ability to pass a context and additional request options. -// -// See BatchWriteItem 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 *DynamoDB) BatchWriteItemWithContext(ctx aws.Context, input *BatchWriteItemInput, opts ...request.Option) (*BatchWriteItemOutput, error) { - req, out := c.BatchWriteItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTable = "CreateTable" - -// CreateTableRequest generates a "aws/request.Request" representing the -// client's request for the CreateTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTableRequest method. -// req, resp := client.CreateTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable -func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Request, output *CreateTableOutput) { - op := &request.Operation{ - Name: opCreateTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTableInput{} - } - - output = &CreateTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTable API operation for Amazon DynamoDB. -// -// The CreateTable operation adds a new table to your account. In an AWS account, -// table names must be unique within each region. That is, you can have two -// tables with same name if you create the tables in different regions. -// -// CreateTable is an asynchronous operation. Upon receiving a CreateTable request, -// DynamoDB immediately returns a response with a TableStatus of CREATING. After -// the table is created, DynamoDB sets the TableStatus to ACTIVE. You can perform -// read and write operations only on an ACTIVE table. -// -// You can optionally define secondary indexes on the new table, as part of -// the CreateTable operation. If you want to create multiple tables with secondary -// indexes on them, you must create the tables sequentially. Only one table -// with secondary indexes can be in the CREATING state at any given time. -// -// You can use the DescribeTable action to check the table status. -// -// 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 Amazon DynamoDB's -// API operation CreateTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of concurrent table requests (cumulative number of tables in the -// CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10. -// -// Also, for tables with secondary indexes, only one of those tables can be -// in the CREATING state at any point in time. Do not attempt to create more -// than one such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable -func (c *DynamoDB) CreateTable(input *CreateTableInput) (*CreateTableOutput, error) { - req, out := c.CreateTableRequest(input) - return out, req.Send() -} - -// CreateTableWithContext is the same as CreateTable with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTable 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 *DynamoDB) CreateTableWithContext(ctx aws.Context, input *CreateTableInput, opts ...request.Option) (*CreateTableOutput, error) { - req, out := c.CreateTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteItem = "DeleteItem" - -// DeleteItemRequest generates a "aws/request.Request" representing the -// client's request for the DeleteItem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteItem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteItem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteItemRequest method. -// req, resp := client.DeleteItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItem -func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Request, output *DeleteItemOutput) { - op := &request.Operation{ - Name: opDeleteItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteItemInput{} - } - - output = &DeleteItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteItem API operation for Amazon DynamoDB. -// -// Deletes a single item in a table by primary key. You can perform a conditional -// delete operation that deletes the item if it exists, or if it has an expected -// attribute value. -// -// In addition to deleting an item, you can also return the item's attribute -// values in the same operation, using the ReturnValues parameter. -// -// Unless you specify conditions, the DeleteItem is an idempotent operation; -// running it multiple times on the same item or attribute does not result in -// an error response. -// -// Conditional deletes are useful for deleting items only if specific conditions -// are met. If those conditions are met, DynamoDB performs the delete. Otherwise, -// the item is not deleted. -// -// 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 Amazon DynamoDB's -// API operation DeleteItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" -// A condition specified in the operation could not be evaluated. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItem -func (c *DynamoDB) DeleteItem(input *DeleteItemInput) (*DeleteItemOutput, error) { - req, out := c.DeleteItemRequest(input) - return out, req.Send() -} - -// DeleteItemWithContext is the same as DeleteItem with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteItem 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 *DynamoDB) DeleteItemWithContext(ctx aws.Context, input *DeleteItemInput, opts ...request.Option) (*DeleteItemOutput, error) { - req, out := c.DeleteItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTable = "DeleteTable" - -// DeleteTableRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTableRequest method. -// req, resp := client.DeleteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTable -func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Request, output *DeleteTableOutput) { - op := &request.Operation{ - Name: opDeleteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTableInput{} - } - - output = &DeleteTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTable API operation for Amazon DynamoDB. -// -// The DeleteTable operation deletes a table and all of its items. After a DeleteTable -// request, the specified table is in the DELETING state until DynamoDB completes -// the deletion. If the table is in the ACTIVE state, you can delete it. If -// a table is in CREATING or UPDATING states, then DynamoDB returns a ResourceInUseException. -// If the specified table does not exist, DynamoDB returns a ResourceNotFoundException. -// If table is already in the DELETING state, no error is returned. -// -// DynamoDB might continue to accept data read and write operations, such as -// GetItem and PutItem, on a table in the DELETING state until the table deletion -// is complete. -// -// When you delete a table, any indexes on that table are also deleted. -// -// If you have DynamoDB Streams enabled on the table, then the corresponding -// stream on that table goes into the DISABLED state, and the stream is automatically -// deleted after 24 hours. -// -// Use the DescribeTable action to check the status of the table. -// -// 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 Amazon DynamoDB's -// API operation DeleteTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of concurrent table requests (cumulative number of tables in the -// CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10. -// -// Also, for tables with secondary indexes, only one of those tables can be -// in the CREATING state at any point in time. Do not attempt to create more -// than one such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTable -func (c *DynamoDB) DeleteTable(input *DeleteTableInput) (*DeleteTableOutput, error) { - req, out := c.DeleteTableRequest(input) - return out, req.Send() -} - -// DeleteTableWithContext is the same as DeleteTable with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTable 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 *DynamoDB) DeleteTableWithContext(ctx aws.Context, input *DeleteTableInput, opts ...request.Option) (*DeleteTableOutput, error) { - req, out := c.DeleteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeLimits = "DescribeLimits" - -// DescribeLimitsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLimits operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLimits for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLimits method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLimitsRequest method. -// req, resp := client.DescribeLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimits -func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *request.Request, output *DescribeLimitsOutput) { - op := &request.Operation{ - Name: opDescribeLimits, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLimitsInput{} - } - - output = &DescribeLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLimits API operation for Amazon DynamoDB. -// -// Returns the current provisioned-capacity limits for your AWS account in a -// region, both for the region as a whole and for any one DynamoDB table that -// you create there. -// -// When you establish an AWS account, the account has initial limits on the -// maximum read capacity units and write capacity units that you can provision -// across all of your DynamoDB tables in a given region. Also, there are per-table -// limits that apply when you create a table there. For more information, see -// Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) -// page in the Amazon DynamoDB Developer Guide. -// -// Although you can increase these limits by filing a case at AWS Support Center -// (https://console.aws.amazon.com/support/home#/), obtaining the increase is -// not instantaneous. The DescribeLimits action lets you write code to compare -// the capacity you are currently using to those limits imposed by your account -// so that you have enough time to apply for an increase before you hit a limit. -// -// For example, you could use one of the AWS SDKs to do the following: -// -// Call DescribeLimits for a particular region to obtain your current account -// limits on provisioned capacity there. -// -// Create a variable to hold the aggregate read capacity units provisioned for -// all your tables in that region, and one to hold the aggregate write capacity -// units. Zero them both. -// -// Call ListTables to obtain a list of all your DynamoDB tables. -// -// For each table name listed by ListTables, do the following: -// -// Call DescribeTable with the table name. -// -// Use the data returned by DescribeTable to add the read capacity units and -// write capacity units provisioned for the table itself to your variables. -// -// If the table has one or more global secondary indexes (GSIs), loop over these -// GSIs and add their provisioned capacity values to your variables as well. -// -// Report the account limits for that region returned by DescribeLimits, along -// with the total current provisioned capacity levels you have calculated. -// -// This will let you see whether you are getting close to your account-level -// limits. -// -// The per-table limits apply only when you are creating a new table. They restrict -// the sum of the provisioned capacity of the new table itself and all its global -// secondary indexes. -// -// For existing tables and their GSIs, DynamoDB will not let you increase provisioned -// capacity extremely rapidly, but the only upper limit that applies is that -// the aggregate provisioned capacity over all your tables and GSIs cannot exceed -// either of the per-account limits. -// -// DescribeLimits should only be called periodically. You can expect throttling -// errors if you call it more than once in a minute. -// -// The DescribeLimits Request element has no content. -// -// 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 Amazon DynamoDB's -// API operation DescribeLimits for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimits -func (c *DynamoDB) DescribeLimits(input *DescribeLimitsInput) (*DescribeLimitsOutput, error) { - req, out := c.DescribeLimitsRequest(input) - return out, req.Send() -} - -// DescribeLimitsWithContext is the same as DescribeLimits with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLimits 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 *DynamoDB) DescribeLimitsWithContext(ctx aws.Context, input *DescribeLimitsInput, opts ...request.Option) (*DescribeLimitsOutput, error) { - req, out := c.DescribeLimitsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTable = "DescribeTable" - -// DescribeTableRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTableRequest method. -// req, resp := client.DescribeTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTable -func (c *DynamoDB) DescribeTableRequest(input *DescribeTableInput) (req *request.Request, output *DescribeTableOutput) { - op := &request.Operation{ - Name: opDescribeTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTableInput{} - } - - output = &DescribeTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTable API operation for Amazon DynamoDB. -// -// Returns information about the table, including the current status of the -// table, when it was created, the primary key schema, and any indexes on the -// table. -// -// If you issue a DescribeTable request immediately after a CreateTable request, -// DynamoDB might return a ResourceNotFoundException. This is because DescribeTable -// uses an eventually consistent query, and the metadata for your table might -// not be available at that moment. Wait for a few seconds, and then try the -// DescribeTable request again. -// -// 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 Amazon DynamoDB's -// API operation DescribeTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTable -func (c *DynamoDB) DescribeTable(input *DescribeTableInput) (*DescribeTableOutput, error) { - req, out := c.DescribeTableRequest(input) - return out, req.Send() -} - -// DescribeTableWithContext is the same as DescribeTable with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTable 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 *DynamoDB) DescribeTableWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.Option) (*DescribeTableOutput, error) { - req, out := c.DescribeTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTimeToLive = "DescribeTimeToLive" - -// DescribeTimeToLiveRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTimeToLive operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTimeToLive for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTimeToLive method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTimeToLiveRequest method. -// req, resp := client.DescribeTimeToLiveRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive -func (c *DynamoDB) DescribeTimeToLiveRequest(input *DescribeTimeToLiveInput) (req *request.Request, output *DescribeTimeToLiveOutput) { - op := &request.Operation{ - Name: opDescribeTimeToLive, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTimeToLiveInput{} - } - - output = &DescribeTimeToLiveOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTimeToLive API operation for Amazon DynamoDB. -// -// Gives a description of the Time to Live (TTL) status on the specified table. -// -// 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 Amazon DynamoDB's -// API operation DescribeTimeToLive for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive -func (c *DynamoDB) DescribeTimeToLive(input *DescribeTimeToLiveInput) (*DescribeTimeToLiveOutput, error) { - req, out := c.DescribeTimeToLiveRequest(input) - return out, req.Send() -} - -// DescribeTimeToLiveWithContext is the same as DescribeTimeToLive with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTimeToLive 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 *DynamoDB) DescribeTimeToLiveWithContext(ctx aws.Context, input *DescribeTimeToLiveInput, opts ...request.Option) (*DescribeTimeToLiveOutput, error) { - req, out := c.DescribeTimeToLiveRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetItem = "GetItem" - -// GetItemRequest generates a "aws/request.Request" representing the -// client's request for the GetItem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetItem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetItem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetItemRequest method. -// req, resp := client.GetItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItem -func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, output *GetItemOutput) { - op := &request.Operation{ - Name: opGetItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetItemInput{} - } - - output = &GetItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetItem API operation for Amazon DynamoDB. -// -// The GetItem operation returns a set of attributes for the item with the given -// primary key. If there is no matching item, GetItem does not return any data -// and there will be no Item element in the response. -// -// GetItem provides an eventually consistent read by default. If your application -// requires a strongly consistent read, set ConsistentRead to true. Although -// a strongly consistent read might take more time than an eventually consistent -// read, it always returns the last updated value. -// -// 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 Amazon DynamoDB's -// API operation GetItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItem -func (c *DynamoDB) GetItem(input *GetItemInput) (*GetItemOutput, error) { - req, out := c.GetItemRequest(input) - return out, req.Send() -} - -// GetItemWithContext is the same as GetItem with the addition of -// the ability to pass a context and additional request options. -// -// See GetItem 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 *DynamoDB) GetItemWithContext(ctx aws.Context, input *GetItemInput, opts ...request.Option) (*GetItemOutput, error) { - req, out := c.GetItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTables = "ListTables" - -// ListTablesRequest generates a "aws/request.Request" representing the -// client's request for the ListTables operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTables for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTables method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTablesRequest method. -// req, resp := client.ListTablesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTables -func (c *DynamoDB) ListTablesRequest(input *ListTablesInput) (req *request.Request, output *ListTablesOutput) { - op := &request.Operation{ - Name: opListTables, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartTableName"}, - OutputTokens: []string{"LastEvaluatedTableName"}, - LimitToken: "Limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTablesInput{} - } - - output = &ListTablesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTables API operation for Amazon DynamoDB. -// -// Returns an array of table names associated with the current account and endpoint. -// The output from ListTables is paginated, with each page returning a maximum -// of 100 table names. -// -// 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 Amazon DynamoDB's -// API operation ListTables for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTables -func (c *DynamoDB) ListTables(input *ListTablesInput) (*ListTablesOutput, error) { - req, out := c.ListTablesRequest(input) - return out, req.Send() -} - -// ListTablesWithContext is the same as ListTables with the addition of -// the ability to pass a context and additional request options. -// -// See ListTables 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 *DynamoDB) ListTablesWithContext(ctx aws.Context, input *ListTablesInput, opts ...request.Option) (*ListTablesOutput, error) { - req, out := c.ListTablesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTablesPages iterates over the pages of a ListTables operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTables method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTables operation. -// pageNum := 0 -// err := client.ListTablesPages(params, -// func(page *ListTablesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) ListTablesPages(input *ListTablesInput, fn func(*ListTablesOutput, bool) bool) error { - return c.ListTablesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTablesPagesWithContext same as ListTablesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DynamoDB) ListTablesPagesWithContext(ctx aws.Context, input *ListTablesInput, fn func(*ListTablesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTablesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTablesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTablesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTagsOfResource = "ListTagsOfResource" - -// ListTagsOfResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsOfResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsOfResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsOfResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsOfResourceRequest method. -// req, resp := client.ListTagsOfResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResource -func (c *DynamoDB) ListTagsOfResourceRequest(input *ListTagsOfResourceInput) (req *request.Request, output *ListTagsOfResourceOutput) { - op := &request.Operation{ - Name: opListTagsOfResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsOfResourceInput{} - } - - output = &ListTagsOfResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsOfResource API operation for Amazon DynamoDB. -// -// List all tags on an Amazon DynamoDB resource. You can call ListTagsOfResource -// up to 10 times per second, per account. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -// -// 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 Amazon DynamoDB's -// API operation ListTagsOfResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResource -func (c *DynamoDB) ListTagsOfResource(input *ListTagsOfResourceInput) (*ListTagsOfResourceOutput, error) { - req, out := c.ListTagsOfResourceRequest(input) - return out, req.Send() -} - -// ListTagsOfResourceWithContext is the same as ListTagsOfResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsOfResource 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 *DynamoDB) ListTagsOfResourceWithContext(ctx aws.Context, input *ListTagsOfResourceInput, opts ...request.Option) (*ListTagsOfResourceOutput, error) { - req, out := c.ListTagsOfResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutItem = "PutItem" - -// PutItemRequest generates a "aws/request.Request" representing the -// client's request for the PutItem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutItem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutItem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutItemRequest method. -// req, resp := client.PutItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItem -func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, output *PutItemOutput) { - op := &request.Operation{ - Name: opPutItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutItemInput{} - } - - output = &PutItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutItem API operation for Amazon DynamoDB. -// -// Creates a new item, or replaces an old item with a new item. If an item that -// has the same primary key as the new item already exists in the specified -// table, the new item completely replaces the existing item. You can perform -// a conditional put operation (add a new item if one with the specified primary -// key doesn't exist), or replace an existing item if it has certain attribute -// values. -// -// In addition to putting an item, you can also return the item's attribute -// values in the same operation, using the ReturnValues parameter. -// -// When you add an item, the primary key attribute(s) are the only required -// attributes. Attribute values cannot be null. String and Binary type attributes -// must have lengths greater than zero. Set type attributes cannot be empty. -// Requests with empty values will be rejected with a ValidationException exception. -// -// To prevent a new item from replacing an existing item, use a conditional -// expression that contains the attribute_not_exists function with the name -// of the attribute being used as the partition key for the table. Since every -// record must contain that attribute, the attribute_not_exists function will -// only succeed if no matching item exists. -// -// For more information about PutItem, see Working with Items (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html) -// in the Amazon DynamoDB Developer Guide. -// -// 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 Amazon DynamoDB's -// API operation PutItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" -// A condition specified in the operation could not be evaluated. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItem -func (c *DynamoDB) PutItem(input *PutItemInput) (*PutItemOutput, error) { - req, out := c.PutItemRequest(input) - return out, req.Send() -} - -// PutItemWithContext is the same as PutItem with the addition of -// the ability to pass a context and additional request options. -// -// See PutItem 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 *DynamoDB) PutItemWithContext(ctx aws.Context, input *PutItemInput, opts ...request.Option) (*PutItemOutput, error) { - req, out := c.PutItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opQuery = "Query" - -// QueryRequest generates a "aws/request.Request" representing the -// client's request for the Query operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Query for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Query method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the QueryRequest method. -// req, resp := client.QueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Query -func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output *QueryOutput) { - op := &request.Operation{ - Name: opQuery, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartKey"}, - OutputTokens: []string{"LastEvaluatedKey"}, - LimitToken: "Limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &QueryInput{} - } - - output = &QueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// Query API operation for Amazon DynamoDB. -// -// A Query operation uses the primary key of a table or a secondary index to -// directly access items from that table or index. -// -// Use the KeyConditionExpression parameter to provide a specific value for -// the partition key. The Query operation will return all of the items from -// the table or index with that partition key value. You can optionally narrow -// the scope of the Query operation by specifying a sort key value and a comparison -// operator in KeyConditionExpression. You can use the ScanIndexForward parameter -// to get results in forward or reverse order, by sort key. -// -// Queries that do not return results consume the minimum number of read capacity -// units for that type of read operation. -// -// If the total number of items meeting the query criteria exceeds the result -// set size limit of 1 MB, the query stops and results are returned to the user -// with the LastEvaluatedKey element to continue the query in a subsequent operation. -// Unlike a Scan operation, a Query operation never returns both an empty result -// set and a LastEvaluatedKey value. LastEvaluatedKey is only provided if you -// have used the Limit parameter, or if the result set exceeds 1 MB (prior to -// applying a filter). -// -// You can query a table, a local secondary index, or a global secondary index. -// For a query on a table or on a local secondary index, you can set the ConsistentRead -// parameter to true and obtain a strongly consistent result. Global secondary -// indexes support eventually consistent reads only, so do not specify ConsistentRead -// when querying a global secondary index. -// -// 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 Amazon DynamoDB's -// API operation Query for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Query -func (c *DynamoDB) Query(input *QueryInput) (*QueryOutput, error) { - req, out := c.QueryRequest(input) - return out, req.Send() -} - -// QueryWithContext is the same as Query with the addition of -// the ability to pass a context and additional request options. -// -// See Query 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 *DynamoDB) QueryWithContext(ctx aws.Context, input *QueryInput, opts ...request.Option) (*QueryOutput, error) { - req, out := c.QueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// QueryPages iterates over the pages of a Query operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Query method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a Query operation. -// pageNum := 0 -// err := client.QueryPages(params, -// func(page *QueryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) QueryPages(input *QueryInput, fn func(*QueryOutput, bool) bool) error { - return c.QueryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// QueryPagesWithContext same as QueryPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DynamoDB) QueryPagesWithContext(ctx aws.Context, input *QueryInput, fn func(*QueryOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *QueryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.QueryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*QueryOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opScan = "Scan" - -// ScanRequest generates a "aws/request.Request" representing the -// client's request for the Scan operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See Scan for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the Scan method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ScanRequest method. -// req, resp := client.ScanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Scan -func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output *ScanOutput) { - op := &request.Operation{ - Name: opScan, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartKey"}, - OutputTokens: []string{"LastEvaluatedKey"}, - LimitToken: "Limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ScanInput{} - } - - output = &ScanOutput{} - req = c.newRequest(op, input, output) - return -} - -// Scan API operation for Amazon DynamoDB. -// -// The Scan operation returns one or more items and item attributes by accessing -// every item in a table or a secondary index. To have DynamoDB return fewer -// items, you can provide a FilterExpression operation. -// -// If the total number of scanned items exceeds the maximum data set size limit -// of 1 MB, the scan stops and results are returned to the user as a LastEvaluatedKey -// value to continue the scan in a subsequent operation. The results also include -// the number of items exceeding the limit. A scan can result in no table data -// meeting the filter criteria. -// -// By default, Scan operations proceed sequentially; however, for faster performance -// on a large table or secondary index, applications can request a parallel -// Scan operation by providing the Segment and TotalSegments parameters. For -// more information, see Parallel Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#QueryAndScanParallelScan) -// in the Amazon DynamoDB Developer Guide. -// -// By default, Scan uses eventually consistent reads when accessing the data -// in a table; therefore, the result set might not include the changes to data -// in the table immediately before the operation began. If you need a consistent -// copy of the data, as of the time that the Scan begins, you can set the ConsistentRead -// parameter to true. -// -// 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 Amazon DynamoDB's -// API operation Scan for usage and error information. -// -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Scan -func (c *DynamoDB) Scan(input *ScanInput) (*ScanOutput, error) { - req, out := c.ScanRequest(input) - return out, req.Send() -} - -// ScanWithContext is the same as Scan with the addition of -// the ability to pass a context and additional request options. -// -// See Scan 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 *DynamoDB) ScanWithContext(ctx aws.Context, input *ScanInput, opts ...request.Option) (*ScanOutput, error) { - req, out := c.ScanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ScanPages iterates over the pages of a Scan operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Scan method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a Scan operation. -// pageNum := 0 -// err := client.ScanPages(params, -// func(page *ScanOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *DynamoDB) ScanPages(input *ScanInput, fn func(*ScanOutput, bool) bool) error { - return c.ScanPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ScanPagesWithContext same as ScanPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DynamoDB) ScanPagesWithContext(ctx aws.Context, input *ScanInput, fn func(*ScanOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ScanInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ScanRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ScanOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TagResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TagResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TagResource -func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon DynamoDB. -// -// Associate a set of tags with an Amazon DynamoDB resource. You can then activate -// these user-defined tags so that they appear on the Billing and Cost Management -// console for cost allocation tracking. You can call TagResource up to 5 times -// per second, per account. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -// -// 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 Amazon DynamoDB's -// API operation TagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of concurrent table requests (cumulative number of tables in the -// CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10. -// -// Also, for tables with secondary indexes, only one of those tables can be -// in the CREATING state at any point in time. Do not attempt to create more -// than one such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TagResource -func (c *DynamoDB) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *DynamoDB) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UntagResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UntagResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResource -func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon DynamoDB. -// -// Removes the association of tags from an Amazon DynamoDB resource. You can -// call UntagResource up to 5 times per second, per account. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -// -// 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 Amazon DynamoDB's -// API operation UntagResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of concurrent table requests (cumulative number of tables in the -// CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10. -// -// Also, for tables with secondary indexes, only one of those tables can be -// in the CREATING state at any point in time. Do not attempt to create more -// than one such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResource -func (c *DynamoDB) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *DynamoDB) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateItem = "UpdateItem" - -// UpdateItemRequest generates a "aws/request.Request" representing the -// client's request for the UpdateItem operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateItem for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateItem method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateItemRequest method. -// req, resp := client.UpdateItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItem -func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Request, output *UpdateItemOutput) { - op := &request.Operation{ - Name: opUpdateItem, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateItemInput{} - } - - output = &UpdateItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateItem API operation for Amazon DynamoDB. -// -// Edits an existing item's attributes, or adds a new item to the table if it -// does not already exist. You can put, delete, or add attribute values. You -// can also perform a conditional update on an existing item (insert a new attribute -// name-value pair if it doesn't exist, or replace an existing name-value pair -// if it has certain expected attribute values). -// -// You can also return the item's attribute values in the same UpdateItem operation -// using the ReturnValues parameter. -// -// 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 Amazon DynamoDB's -// API operation UpdateItem for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" -// A condition specified in the operation could not be evaluated. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry -// requests that receive this exception. Your request is eventually successful, -// unless your retry queue is too large to finish. Reduce the frequency of requests -// and use exponential backoff. For more information, go to Error Retries and -// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) -// in the Amazon DynamoDB Developer Guide. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeItemCollectionSizeLimitExceededException "ItemCollectionSizeLimitExceededException" -// An item collection is too large. This exception is only returned for tables -// that have one or more local secondary indexes. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItem -func (c *DynamoDB) UpdateItem(input *UpdateItemInput) (*UpdateItemOutput, error) { - req, out := c.UpdateItemRequest(input) - return out, req.Send() -} - -// UpdateItemWithContext is the same as UpdateItem with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateItem 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 *DynamoDB) UpdateItemWithContext(ctx aws.Context, input *UpdateItemInput, opts ...request.Option) (*UpdateItemOutput, error) { - req, out := c.UpdateItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTable = "UpdateTable" - -// UpdateTableRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateTableRequest method. -// req, resp := client.UpdateTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTable -func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Request, output *UpdateTableOutput) { - op := &request.Operation{ - Name: opUpdateTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateTableInput{} - } - - output = &UpdateTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTable API operation for Amazon DynamoDB. -// -// Modifies the provisioned throughput settings, global secondary indexes, or -// DynamoDB Streams settings for a given table. -// -// You can only perform one of the following operations at once: -// -// * Modify the provisioned throughput settings of the table. -// -// * Enable or disable Streams on the table. -// -// * Remove a global secondary index from the table. -// -// * Create a new global secondary index on the table. Once the index begins -// backfilling, you can use UpdateTable to perform other operations. -// -// UpdateTable is an asynchronous operation; while it is executing, the table -// status changes from ACTIVE to UPDATING. While it is UPDATING, you cannot -// issue another UpdateTable request. When the table returns to the ACTIVE state, -// the UpdateTable operation is complete. -// -// 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 Amazon DynamoDB's -// API operation UpdateTable for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of concurrent table requests (cumulative number of tables in the -// CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10. -// -// Also, for tables with secondary indexes, only one of those tables can be -// in the CREATING state at any point in time. Do not attempt to create more -// than one such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTable -func (c *DynamoDB) UpdateTable(input *UpdateTableInput) (*UpdateTableOutput, error) { - req, out := c.UpdateTableRequest(input) - return out, req.Send() -} - -// UpdateTableWithContext is the same as UpdateTable with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTable 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 *DynamoDB) UpdateTableWithContext(ctx aws.Context, input *UpdateTableInput, opts ...request.Option) (*UpdateTableOutput, error) { - req, out := c.UpdateTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTimeToLive = "UpdateTimeToLive" - -// UpdateTimeToLiveRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTimeToLive operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateTimeToLive for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateTimeToLive method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateTimeToLiveRequest method. -// req, resp := client.UpdateTimeToLiveRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive -func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *request.Request, output *UpdateTimeToLiveOutput) { - op := &request.Operation{ - Name: opUpdateTimeToLive, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateTimeToLiveInput{} - } - - output = &UpdateTimeToLiveOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTimeToLive API operation for Amazon DynamoDB. -// -// Specify the lifetime of individual table items. The database automatically -// removes the item at the expiration of the item. The UpdateTimeToLive method -// will enable or disable TTL for the specified table. A successful UpdateTimeToLive -// call returns the current TimeToLiveSpecification; it may take up to one hour -// for the change to fully process. -// -// TTL compares the current time in epoch time format to the time stored in -// the TTL attribute of an item. If the epoch time value stored in the attribute -// is less than the current time, the item is marked as expired and subsequently -// deleted. -// -// The epoch time format is the number of seconds elapsed since 12:00:00 AM -// January 1st, 1970 UTC. -// -// DynamoDB deletes expired items on a best-effort basis to ensure availability -// of throughput for other data operations. -// -// DynamoDB typically deletes expired items within two days of expiration. The -// exact duration within which an item gets deleted after expiration is specific -// to the nature of the workload. Items that have expired and not been deleted -// will still show up in reads, queries, and scans. -// -// As items are deleted, they are removed from any Local Secondary Index and -// Global Secondary Index immediately in the same eventually consistent way -// as a standard delete operation. -// -// For more information, see Time To Live (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html) -// in the Amazon DynamoDB Developer Guide. -// -// 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 Amazon DynamoDB's -// API operation UpdateTimeToLive for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The operation conflicts with the resource's availability. For example, you -// attempted to recreate an existing table, or tried to delete a table currently -// in the CREATING state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The operation tried to access a nonexistent table or index. The resource -// might not be specified correctly, or its status might not be ACTIVE. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The number of concurrent table requests (cumulative number of tables in the -// CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10. -// -// Also, for tables with secondary indexes, only one of those tables can be -// in the CREATING state at any point in time. Do not attempt to create more -// than one such table simultaneously. -// -// The total limit of tables in the ACTIVE state is 250. -// -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive -func (c *DynamoDB) UpdateTimeToLive(input *UpdateTimeToLiveInput) (*UpdateTimeToLiveOutput, error) { - req, out := c.UpdateTimeToLiveRequest(input) - return out, req.Send() -} - -// UpdateTimeToLiveWithContext is the same as UpdateTimeToLive with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTimeToLive 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 *DynamoDB) UpdateTimeToLiveWithContext(ctx aws.Context, input *UpdateTimeToLiveInput, opts ...request.Option) (*UpdateTimeToLiveOutput, error) { - req, out := c.UpdateTimeToLiveRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Represents an attribute for describing the key schema for the table and indexes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/AttributeDefinition -type AttributeDefinition struct { - _ struct{} `type:"structure"` - - // A name for the attribute. - // - // AttributeName is a required field - AttributeName *string `min:"1" type:"string" required:"true"` - - // The data type for the attribute, where: - // - // * S - the attribute is of type String - // - // * N - the attribute is of type Number - // - // * B - the attribute is of type Binary - // - // AttributeType is a required field - AttributeType *string `type:"string" required:"true" enum:"ScalarAttributeType"` -} - -// String returns the string representation -func (s AttributeDefinition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttributeDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttributeDefinition"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.AttributeName != nil && len(*s.AttributeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1)) - } - if s.AttributeType == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *AttributeDefinition) SetAttributeName(v string) *AttributeDefinition { - s.AttributeName = &v - return s -} - -// SetAttributeType sets the AttributeType field's value. -func (s *AttributeDefinition) SetAttributeType(v string) *AttributeDefinition { - s.AttributeType = &v - return s -} - -// Represents the data for an attribute. -// -// Each attribute value is described as a name-value pair. The name is the data -// type, and the value is the data itself. -// -// For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) -// in the Amazon DynamoDB Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/AttributeValue -type AttributeValue struct { - _ struct{} `type:"structure"` - - // An attribute of type Binary. For example: - // - // "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk" - // - // B is automatically base64 encoded/decoded by the SDK. - B []byte `type:"blob"` - - // An attribute of type Boolean. For example: - // - // "BOOL": true - BOOL *bool `type:"boolean"` - - // An attribute of type Binary Set. For example: - // - // "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="] - BS [][]byte `type:"list"` - - // An attribute of type List. For example: - // - // "L": ["Cookies", "Coffee", 3.14159] - L []*AttributeValue `type:"list"` - - // An attribute of type Map. For example: - // - // "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}} - M map[string]*AttributeValue `type:"map"` - - // An attribute of type Number. For example: - // - // "N": "123.45" - // - // Numbers are sent across the network to DynamoDB as strings, to maximize compatibility - // across languages and libraries. However, DynamoDB treats them as number type - // attributes for mathematical operations. - N *string `type:"string"` - - // An attribute of type Number Set. For example: - // - // "NS": ["42.2", "-19", "7.5", "3.14"] - // - // Numbers are sent across the network to DynamoDB as strings, to maximize compatibility - // across languages and libraries. However, DynamoDB treats them as number type - // attributes for mathematical operations. - NS []*string `type:"list"` - - // An attribute of type Null. For example: - // - // "NULL": true - NULL *bool `type:"boolean"` - - // An attribute of type String. For example: - // - // "S": "Hello" - S *string `type:"string"` - - // An attribute of type String Set. For example: - // - // "SS": ["Giraffe", "Hippo" ,"Zebra"] - SS []*string `type:"list"` -} - -// String returns the string representation -func (s AttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeValue) GoString() string { - return s.String() -} - -// SetB sets the B field's value. -func (s *AttributeValue) SetB(v []byte) *AttributeValue { - s.B = v - return s -} - -// SetBOOL sets the BOOL field's value. -func (s *AttributeValue) SetBOOL(v bool) *AttributeValue { - s.BOOL = &v - return s -} - -// SetBS sets the BS field's value. -func (s *AttributeValue) SetBS(v [][]byte) *AttributeValue { - s.BS = v - return s -} - -// SetL sets the L field's value. -func (s *AttributeValue) SetL(v []*AttributeValue) *AttributeValue { - s.L = v - return s -} - -// SetM sets the M field's value. -func (s *AttributeValue) SetM(v map[string]*AttributeValue) *AttributeValue { - s.M = v - return s -} - -// SetN sets the N field's value. -func (s *AttributeValue) SetN(v string) *AttributeValue { - s.N = &v - return s -} - -// SetNS sets the NS field's value. -func (s *AttributeValue) SetNS(v []*string) *AttributeValue { - s.NS = v - return s -} - -// SetNULL sets the NULL field's value. -func (s *AttributeValue) SetNULL(v bool) *AttributeValue { - s.NULL = &v - return s -} - -// SetS sets the S field's value. -func (s *AttributeValue) SetS(v string) *AttributeValue { - s.S = &v - return s -} - -// SetSS sets the SS field's value. -func (s *AttributeValue) SetSS(v []*string) *AttributeValue { - s.SS = v - return s -} - -// For the UpdateItem operation, represents the attributes to be modified, the -// action to perform on each, and the new value for each. -// -// You cannot use UpdateItem to update any primary key attributes. Instead, -// you will need to delete the item, and then use PutItem to create a new item -// with new attributes. -// -// Attribute values cannot be null; string and binary type attributes must have -// lengths greater than zero; and set type attributes must not be empty. Requests -// with empty values will be rejected with a ValidationException exception. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/AttributeValueUpdate -type AttributeValueUpdate struct { - _ struct{} `type:"structure"` - - // Specifies how to perform the update. Valid values are PUT (default), DELETE, - // and ADD. The behavior depends on whether the specified primary key already - // exists in the table. - // - // If an item with the specified Key is found in the table: - // - // * PUT - Adds the specified attribute to the item. If the attribute already - // exists, it is replaced by the new value. - // - // * DELETE - If no value is specified, the attribute and its value are removed - // from the item. The data type of the specified value must match the existing - // value's data type. - // - // If a set of values is specified, then those values are subtracted from the - // old set. For example, if the attribute value was the set [a,b,c] and the - // DELETE action specified [a,c], then the final attribute value would be - // [b]. Specifying an empty set is an error. - // - // * ADD - If the attribute does not already exist, then the attribute and - // its values are added to the item. If the attribute does exist, then the - // behavior of ADD depends on the data type of the attribute: - // - // If the existing attribute is a number, and if Value is also a number, then - // the Value is mathematically added to the existing attribute. If Value - // is a negative number, then it is subtracted from the existing attribute. - // - // If you use ADD to increment or decrement a number value for an item that - // doesn't exist before the update, DynamoDB uses 0 as the initial value. - // - // In addition, if you use ADD to update an existing item, and intend to increment - // or decrement an attribute value which does not yet exist, DynamoDB uses - // 0 as the initial value. For example, suppose that the item you want to - // update does not yet have an attribute named itemcount, but you decide - // to ADD the number 3 to this attribute anyway, even though it currently - // does not exist. DynamoDB will create the itemcount attribute, set its - // initial value to 0, and finally add 3 to it. The result will be a new - // itemcount attribute in the item, with a value of 3. - // - // If the existing data type is a set, and if the Value is also a set, then - // the Value is added to the existing set. (This is a set operation, not - // mathematical addition.) For example, if the attribute value was the set - // [1,2], and the ADD action specified [3], then the final attribute value - // would be [1,2,3]. An error occurs if an Add action is specified for a - // set attribute and the attribute type specified does not match the existing - // set type. - // - // Both sets must have the same primitive data type. For example, if the existing - // data type is a set of strings, the Value must also be a set of strings. - // The same holds true for number sets and binary sets. - // - // This action is only valid for an existing attribute whose data type is number - // or is a set. Do not use ADD for any other data types. - // - // If no item with the specified Key is found: - // - // * PUT - DynamoDB creates a new item with the specified primary key, and - // then adds the attribute. - // - // * DELETE - Nothing happens; there is no attribute to delete. - // - // * ADD - DynamoDB creates an item with the supplied primary key and number - // (or set of numbers) for the attribute value. The only data types allowed - // are number and number set; no other data types can be specified. - Action *string `type:"string" enum:"AttributeAction"` - - // Represents the data for an attribute. - // - // Each attribute value is described as a name-value pair. The name is the data - // type, and the value is the data itself. - // - // For more information, see Data TYpes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) - // in the Amazon DynamoDB Developer Guide. - Value *AttributeValue `type:"structure"` -} - -// String returns the string representation -func (s AttributeValueUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeValueUpdate) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *AttributeValueUpdate) SetAction(v string) *AttributeValueUpdate { - s.Action = &v - return s -} - -// SetValue sets the Value field's value. -func (s *AttributeValueUpdate) SetValue(v *AttributeValue) *AttributeValueUpdate { - s.Value = v - return s -} - -// Represents the input of a BatchGetItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItemInput -type BatchGetItemInput struct { - _ struct{} `type:"structure"` - - // A map of one or more table names and, for each table, a map that describes - // one or more items to retrieve from that table. Each table name can be used - // only once per BatchGetItem request. - // - // Each element in the map of items to retrieve consists of the following: - // - // * ConsistentRead - If true, a strongly consistent read is used; if false - // (the default), an eventually consistent read is used. - // - // * ExpressionAttributeNames - One or more substitution tokens for attribute - // names in the ProjectionExpression parameter. The following are some use - // cases for using ExpressionAttributeNames: - // - // To access an attribute whose name conflicts with a DynamoDB reserved word. - // - // To create a placeholder for repeating occurrences of an attribute name in - // an expression. - // - // To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could - // specify the following for ExpressionAttributeNames: - // - // {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - // - // * Keys - An array of primary key attribute values that define specific - // items in the table. For each primary key, you must provide all of the - // key attributes. For example, with a simple primary key, you only need - // to provide the partition key value. For a composite key, you must provide - // both the partition key value and the sort key value. - // - // * ProjectionExpression - A string that identifies one or more attributes - // to retrieve from the table. These attributes can include scalars, sets, - // or elements of a JSON document. The attributes in the expression must - // be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear - // in the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - // - // * AttributesToGet - This is a legacy parameter. Use ProjectionExpression - // instead. For more information, see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - // - // RequestItems is a required field - RequestItems map[string]*KeysAndAttributes `min:"1" type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` -} - -// String returns the string representation -func (s BatchGetItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetItemInput"} - if s.RequestItems == nil { - invalidParams.Add(request.NewErrParamRequired("RequestItems")) - } - if s.RequestItems != nil && len(s.RequestItems) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1)) - } - if s.RequestItems != nil { - for i, v := range s.RequestItems { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequestItems", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRequestItems sets the RequestItems field's value. -func (s *BatchGetItemInput) SetRequestItems(v map[string]*KeysAndAttributes) *BatchGetItemInput { - s.RequestItems = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *BatchGetItemInput) SetReturnConsumedCapacity(v string) *BatchGetItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// Represents the output of a BatchGetItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItemOutput -type BatchGetItemOutput struct { - _ struct{} `type:"structure"` - - // The read capacity units consumed by the entire BatchGetItem operation. - // - // Each element consists of: - // - // * TableName - The table that consumed the provisioned throughput. - // - // * CapacityUnits - The total number of capacity units consumed. - ConsumedCapacity []*ConsumedCapacity `type:"list"` - - // A map of table name to a list of items. Each object in Responses consists - // of a table name, along with a map of attribute data consisting of the data - // type and attribute value. - Responses map[string][]map[string]*AttributeValue `type:"map"` - - // A map of tables and their respective keys that were not processed with the - // current response. The UnprocessedKeys value is in the same form as RequestItems, - // so the value can be provided directly to a subsequent BatchGetItem operation. - // For more information, see RequestItems in the Request Parameters section. - // - // Each element consists of: - // - // * Keys - An array of primary key attribute values that define specific - // items in the table. - // - // * ProjectionExpression - One or more attributes to be retrieved from the - // table or index. By default, all attributes are returned. If a requested - // attribute is not found, it does not appear in the result. - // - // * ConsistentRead - The consistency of a read operation. If set to true, - // then a strongly consistent read is used; otherwise, an eventually consistent - // read is used. - // - // If there are no unprocessed keys remaining, the response contains an empty - // UnprocessedKeys map. - UnprocessedKeys map[string]*KeysAndAttributes `min:"1" type:"map"` -} - -// String returns the string representation -func (s BatchGetItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchGetItemOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *BatchGetItemOutput) SetConsumedCapacity(v []*ConsumedCapacity) *BatchGetItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetResponses sets the Responses field's value. -func (s *BatchGetItemOutput) SetResponses(v map[string][]map[string]*AttributeValue) *BatchGetItemOutput { - s.Responses = v - return s -} - -// SetUnprocessedKeys sets the UnprocessedKeys field's value. -func (s *BatchGetItemOutput) SetUnprocessedKeys(v map[string]*KeysAndAttributes) *BatchGetItemOutput { - s.UnprocessedKeys = v - return s -} - -// Represents the input of a BatchWriteItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItemInput -type BatchWriteItemInput struct { - _ struct{} `type:"structure"` - - // A map of one or more table names and, for each table, a list of operations - // to be performed (DeleteRequest or PutRequest). Each element in the map consists - // of the following: - // - // * DeleteRequest - Perform a DeleteItem operation on the specified item. - // The item to be deleted is identified by a Key subelement: - // - // Key - A map of primary key attribute values that uniquely identify the ! - // item. Each entry in this map consists of an attribute name and an attribute - // value. For each primary key, you must provide all of the key attributes. - // For example, with a simple primary key, you only need to provide a value - // for the partition key. For a composite primary key, you must provide values - // for both the partition key and the sort key. - // - // * PutRequest - Perform a PutItem operation on the specified item. The - // item to be put is identified by an Item subelement: - // - // Item - A map of attributes and their values. Each entry in this map consists - // of an attribute name and an attribute value. Attribute values must not - // be null; string and binary type attributes must have lengths greater than - // zero; and set type attributes must not be empty. Requests that contain - // empty values will be rejected with a ValidationException exception. - // - // If you specify any attributes that are part of an index key, then the data - // types for those attributes must match those of the schema in the table's - // attribute definition. - // - // RequestItems is a required field - RequestItems map[string][]*WriteRequest `min:"1" type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` -} - -// String returns the string representation -func (s BatchWriteItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchWriteItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchWriteItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchWriteItemInput"} - if s.RequestItems == nil { - invalidParams.Add(request.NewErrParamRequired("RequestItems")) - } - if s.RequestItems != nil && len(s.RequestItems) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRequestItems sets the RequestItems field's value. -func (s *BatchWriteItemInput) SetRequestItems(v map[string][]*WriteRequest) *BatchWriteItemInput { - s.RequestItems = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *BatchWriteItemInput) SetReturnConsumedCapacity(v string) *BatchWriteItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *BatchWriteItemInput) SetReturnItemCollectionMetrics(v string) *BatchWriteItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// Represents the output of a BatchWriteItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItemOutput -type BatchWriteItemOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the entire BatchWriteItem operation. - // - // Each element consists of: - // - // * TableName - The table that consumed the provisioned throughput. - // - // * CapacityUnits - The total number of capacity units consumed. - ConsumedCapacity []*ConsumedCapacity `type:"list"` - - // A list of tables that were processed by BatchWriteItem and, for each table, - // information about any item collections that were affected by individual DeleteItem - // or PutItem operations. - // - // Each entry consists of the following subelements: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item. - // - // * SizeEstimateRange - An estimate of item collection size, expressed in - // GB. This is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on the table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics map[string][]*ItemCollectionMetrics `type:"map"` - - // A map of tables and requests against those tables that were not processed. - // The UnprocessedItems value is in the same form as RequestItems, so you can - // provide this value directly to a subsequent BatchGetItem operation. For more - // information, see RequestItems in the Request Parameters section. - // - // Each UnprocessedItems entry consists of a table name and, for that table, - // a list of operations to perform (DeleteRequest or PutRequest). - // - // * DeleteRequest - Perform a DeleteItem operation on the specified item. - // The item to be deleted is identified by a Key subelement: - // - // Key - A map of primary key attribute values that uniquely identify the item. - // Each entry in this map consists of an attribute name and an attribute - // value. - // - // * PutRequest - Perform a PutItem operation on the specified item. The - // item to be put is identified by an Item subelement: - // - // Item - A map of attributes and their values. Each entry in this map consists - // of an attribute name and an attribute value. Attribute values must not - // be null; string and binary type attributes must have lengths greater than - // zero; and set type attributes must not be empty. Requests that contain - // empty values will be rejected with a ValidationException exception. - // - // If you specify any attributes that are part of an index key, then the data - // types for those attributes must match those of the schema in the table's - // attribute definition. - // - // If there are no unprocessed items remaining, the response contains an empty - // UnprocessedItems map. - UnprocessedItems map[string][]*WriteRequest `min:"1" type:"map"` -} - -// String returns the string representation -func (s BatchWriteItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchWriteItemOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *BatchWriteItemOutput) SetConsumedCapacity(v []*ConsumedCapacity) *BatchWriteItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *BatchWriteItemOutput) SetItemCollectionMetrics(v map[string][]*ItemCollectionMetrics) *BatchWriteItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// SetUnprocessedItems sets the UnprocessedItems field's value. -func (s *BatchWriteItemOutput) SetUnprocessedItems(v map[string][]*WriteRequest) *BatchWriteItemOutput { - s.UnprocessedItems = v - return s -} - -// Represents the amount of provisioned throughput capacity consumed on a table -// or an index. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Capacity -type Capacity struct { - _ struct{} `type:"structure"` - - // The total number of capacity units consumed on a table or an index. - CapacityUnits *float64 `type:"double"` -} - -// String returns the string representation -func (s Capacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Capacity) GoString() string { - return s.String() -} - -// SetCapacityUnits sets the CapacityUnits field's value. -func (s *Capacity) SetCapacityUnits(v float64) *Capacity { - s.CapacityUnits = &v - return s -} - -// Represents the selection criteria for a Query or Scan operation: -// -// * For a Query operation, Condition is used for specifying the KeyConditions -// to use when querying a table or an index. For KeyConditions, only the -// following comparison operators are supported: -// -// EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN -// -// Condition is also used in a QueryFilter, which evaluates the query results -// and returns only the desired values. -// -// * For a Scan operation, Condition is used in a ScanFilter, which evaluates -// the scan results and returns only the desired values. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Condition -type Condition struct { - _ struct{} `type:"structure"` - - // One or more values to evaluate against the supplied attribute. The number - // of values in the list depends on the ComparisonOperator being used. - // - // For type Number, value comparisons are numeric. - // - // String value comparisons for greater than, equals, or less than are based - // on ASCII character code values. For example, a is greater than A, and a is - // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters - // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - // - // For Binary, DynamoDB treats each byte of the binary data as unsigned when - // it compares binary values. - AttributeValueList []*AttributeValue `type:"list"` - - // A comparator for evaluating attributes. For example, equals, greater than, - // less than, etc. - // - // The following comparison operators are available: - // - // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | - // BEGINS_WITH | IN | BETWEEN - // - // The following are descriptions of each comparison operator. - // - // * EQ : Equal. EQ is supported for all data types, including lists and - // maps. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue element of a different type than the one provided in - // the request, the value does not match. For example, {"S":"6"} does not - // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * NE : Not equal. NE is supported for all data types, including lists - // and maps. - // - // * AttributeValueList can contain only one AttributeValue of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue of a different type than the one provided in the request, - // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. - // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * LE : Less than or equal. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, or Binary (not a set type). If an item contains an AttributeValue - // element of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} - // does not compare to {"NS":["6", "2", "1"]}. - // - // LT: Less than. - // - // AttributeValueListcan contain only one AttributeValueof type String, Number, or Binary (not a set type). If an item contains an - // AttributeValueelement of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"}does not equal {"N":"6"}. Also, {"N":"6"}does not compare to {"NS":["6", "2", "1"]} - // - // ComparisonOperator is a required field - ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` -} - -// String returns the string representation -func (s Condition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Condition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Condition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Condition"} - if s.ComparisonOperator == nil { - invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeValueList sets the AttributeValueList field's value. -func (s *Condition) SetAttributeValueList(v []*AttributeValue) *Condition { - s.AttributeValueList = v - return s -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *Condition) SetComparisonOperator(v string) *Condition { - s.ComparisonOperator = &v - return s -} - -// The capacity units consumed by an operation. The data returned includes the -// total provisioned throughput consumed, along with statistics for the table -// and any indexes involved in the operation. ConsumedCapacity is only returned -// if the request asked for it. For more information, see Provisioned Throughput -// (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) -// in the Amazon DynamoDB Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ConsumedCapacity -type ConsumedCapacity struct { - _ struct{} `type:"structure"` - - // The total number of capacity units consumed by the operation. - CapacityUnits *float64 `type:"double"` - - // The amount of throughput consumed on each global index affected by the operation. - GlobalSecondaryIndexes map[string]*Capacity `type:"map"` - - // The amount of throughput consumed on each local index affected by the operation. - LocalSecondaryIndexes map[string]*Capacity `type:"map"` - - // The amount of throughput consumed on the table affected by the operation. - Table *Capacity `type:"structure"` - - // The name of the table that was affected by the operation. - TableName *string `min:"3" type:"string"` -} - -// String returns the string representation -func (s ConsumedCapacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConsumedCapacity) GoString() string { - return s.String() -} - -// SetCapacityUnits sets the CapacityUnits field's value. -func (s *ConsumedCapacity) SetCapacityUnits(v float64) *ConsumedCapacity { - s.CapacityUnits = &v - return s -} - -// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. -func (s *ConsumedCapacity) SetGlobalSecondaryIndexes(v map[string]*Capacity) *ConsumedCapacity { - s.GlobalSecondaryIndexes = v - return s -} - -// SetLocalSecondaryIndexes sets the LocalSecondaryIndexes field's value. -func (s *ConsumedCapacity) SetLocalSecondaryIndexes(v map[string]*Capacity) *ConsumedCapacity { - s.LocalSecondaryIndexes = v - return s -} - -// SetTable sets the Table field's value. -func (s *ConsumedCapacity) SetTable(v *Capacity) *ConsumedCapacity { - s.Table = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *ConsumedCapacity) SetTableName(v string) *ConsumedCapacity { - s.TableName = &v - return s -} - -// Represents a new global secondary index to be added to an existing table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateGlobalSecondaryIndexAction -type CreateGlobalSecondaryIndexAction struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index to be created. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The key schema for the global secondary index. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // Represents attributes that are copied (projected) from the table into an - // index. These are in addition to the primary key attributes and index key - // attributes, which are automatically projected. - // - // Projection is a required field - Projection *Projection `type:"structure" required:"true"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateGlobalSecondaryIndexAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateGlobalSecondaryIndexAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGlobalSecondaryIndexAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGlobalSecondaryIndexAction"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.Projection == nil { - invalidParams.Add(request.NewErrParamRequired("Projection")) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Projection != nil { - if err := s.Projection.Validate(); err != nil { - invalidParams.AddNested("Projection", err.(request.ErrInvalidParams)) - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *CreateGlobalSecondaryIndexAction) SetIndexName(v string) *CreateGlobalSecondaryIndexAction { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *CreateGlobalSecondaryIndexAction) SetKeySchema(v []*KeySchemaElement) *CreateGlobalSecondaryIndexAction { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *CreateGlobalSecondaryIndexAction) SetProjection(v *Projection) *CreateGlobalSecondaryIndexAction { - s.Projection = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *CreateGlobalSecondaryIndexAction) SetProvisionedThroughput(v *ProvisionedThroughput) *CreateGlobalSecondaryIndexAction { - s.ProvisionedThroughput = v - return s -} - -// Represents the input of a CreateTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTableInput -type CreateTableInput struct { - _ struct{} `type:"structure"` - - // An array of attributes that describe the key schema for the table and indexes. - // - // AttributeDefinitions is a required field - AttributeDefinitions []*AttributeDefinition `type:"list" required:"true"` - - // One or more global secondary indexes (the maximum is five) to be created - // on the table. Each global secondary index in the array includes the following: - // - // * IndexName - The name of the global secondary index. Must be unique only - // for this table. - // - // * KeySchema - Specifies the key schema for the global secondary index. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // * ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - // - // * ProvisionedThroughput - The provisioned throughput settings for the - // global secondary index, consisting of read and write capacity units. - GlobalSecondaryIndexes []*GlobalSecondaryIndex `type:"list"` - - // Specifies the attributes that make up the primary key for a table or an index. - // The attributes in KeySchema must also be defined in the AttributeDefinitions - // array. For more information, see Data Model (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) - // in the Amazon DynamoDB Developer Guide. - // - // Each KeySchemaElement in the array is composed of: - // - // * AttributeName - The name of this key attribute. - // - // * KeyType - The role that the key attribute will assume: - // - // HASH - partition key - // - // RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // For a simple primary key (partition key), you must provide exactly one element - // with a KeyType of HASH. - // - // For a composite primary key (partition key and sort key), you must provide - // exactly two elements, in this order: The first element must have a KeyType - // of HASH, and the second element must have a KeyType of RANGE. - // - // For more information, see Specifying the Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key) - // in the Amazon DynamoDB Developer Guide. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // One or more local secondary indexes (the maximum is five) to be created on - // the table. Each index is scoped to a given partition key value. There is - // a 10 GB size limit per partition key value; otherwise, the size of a local - // secondary index is unconstrained. - // - // Each local secondary index in the array includes the following: - // - // * IndexName - The name of the local secondary index. Must be unique only - // for this table. - // - // * KeySchema - Specifies the key schema for the local secondary index. - // The key schema must begin with the same partition key as the table. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // * ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - LocalSecondaryIndexes []*LocalSecondaryIndex `type:"list"` - - // Represents the provisioned throughput settings for a specified table or index. - // The settings can be modified using the UpdateTable operation. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` - - // The settings for DynamoDB Streams on the table. These settings consist of: - // - // * StreamEnabled - Indicates whether Streams is to be enabled (true) or - // disabled (false). - // - // * StreamViewType - When an item in the table is modified, StreamViewType - // determines what information is written to the table's stream. Valid values - // for StreamViewType are: - // - // KEYS_ONLY - Only the key attributes of the modified item are written to the - // stream. - // - // NEW_IMAGE - The entire item, as it appears after it was modified, is written - // to the stream. - // - // OLD_IMAGE - The entire item, as it appeared before it was modified, is written - // to the stream. - // - // NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are - // written to the stream. - StreamSpecification *StreamSpecification `type:"structure"` - - // The name of the table to create. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTableInput"} - if s.AttributeDefinitions == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeDefinitions")) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.AttributeDefinitions != nil { - for i, v := range s.AttributeDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.GlobalSecondaryIndexes != nil { - for i, v := range s.GlobalSecondaryIndexes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LocalSecondaryIndexes != nil { - for i, v := range s.LocalSecondaryIndexes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LocalSecondaryIndexes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeDefinitions sets the AttributeDefinitions field's value. -func (s *CreateTableInput) SetAttributeDefinitions(v []*AttributeDefinition) *CreateTableInput { - s.AttributeDefinitions = v - return s -} - -// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. -func (s *CreateTableInput) SetGlobalSecondaryIndexes(v []*GlobalSecondaryIndex) *CreateTableInput { - s.GlobalSecondaryIndexes = v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *CreateTableInput) SetKeySchema(v []*KeySchemaElement) *CreateTableInput { - s.KeySchema = v - return s -} - -// SetLocalSecondaryIndexes sets the LocalSecondaryIndexes field's value. -func (s *CreateTableInput) SetLocalSecondaryIndexes(v []*LocalSecondaryIndex) *CreateTableInput { - s.LocalSecondaryIndexes = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *CreateTableInput) SetProvisionedThroughput(v *ProvisionedThroughput) *CreateTableInput { - s.ProvisionedThroughput = v - return s -} - -// SetStreamSpecification sets the StreamSpecification field's value. -func (s *CreateTableInput) SetStreamSpecification(v *StreamSpecification) *CreateTableInput { - s.StreamSpecification = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *CreateTableInput) SetTableName(v string) *CreateTableInput { - s.TableName = &v - return s -} - -// Represents the output of a CreateTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTableOutput -type CreateTableOutput struct { - _ struct{} `type:"structure"` - - // Represents the properties of the table. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s CreateTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTableOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *CreateTableOutput) SetTableDescription(v *TableDescription) *CreateTableOutput { - s.TableDescription = v - return s -} - -// Represents a global secondary index to be deleted from an existing table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteGlobalSecondaryIndexAction -type DeleteGlobalSecondaryIndexAction struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index to be deleted. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteGlobalSecondaryIndexAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGlobalSecondaryIndexAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGlobalSecondaryIndexAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGlobalSecondaryIndexAction"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *DeleteGlobalSecondaryIndexAction) SetIndexName(v string) *DeleteGlobalSecondaryIndexAction { - s.IndexName = &v - return s -} - -// Represents the input of a DeleteItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItemInput -type DeleteItemInput struct { - _ struct{} `type:"structure"` - - // A condition that must be satisfied in order for a conditional DeleteItem - // to succeed. - // - // An expression can contain any of the following: - // - // * Functions: attribute_exists | attribute_not_exists | attribute_type - // | contains | begins_with | size - // - // These function names are case-sensitive. - // - // * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN - // - // * Logical operators: AND | OR | NOT - // - // For more information on condition expressions, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // This is a legacy parameter. Use ConditionExpresssion instead. For more information, - // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - // in the Amazon DynamoDB Developer Guide. - Expected map[string]*ExpectedAttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A map of attribute names to AttributeValue objects, representing the primary - // key of the item to delete. - // - // For the primary key, you must provide all of the attributes. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide values for both the partition - // key and the sort key. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` - - // Use ReturnValues if you want to get the item attributes as they appeared - // before they were deleted. For DeleteItem, the valid values are: - // - // * NONE - If ReturnValues is not specified, or if its value is NONE, then - // nothing is returned. (This setting is the default for ReturnValues.) - // - // * ALL_OLD - The content of the old item is returned. - // - // The ReturnValues parameter is used by several DynamoDB operations; however, - // DeleteItem does not recognize any values other than NONE or ALL_OLD. - ReturnValues *string `type:"string" enum:"ReturnValue"` - - // The name of the table from which to delete the item. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteItemInput"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConditionExpression sets the ConditionExpression field's value. -func (s *DeleteItemInput) SetConditionExpression(v string) *DeleteItemInput { - s.ConditionExpression = &v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *DeleteItemInput) SetConditionalOperator(v string) *DeleteItemInput { - s.ConditionalOperator = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *DeleteItemInput) SetExpected(v map[string]*ExpectedAttributeValue) *DeleteItemInput { - s.Expected = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *DeleteItemInput) SetExpressionAttributeNames(v map[string]*string) *DeleteItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *DeleteItemInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *DeleteItemInput { - s.ExpressionAttributeValues = v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteItemInput) SetKey(v map[string]*AttributeValue) *DeleteItemInput { - s.Key = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *DeleteItemInput) SetReturnConsumedCapacity(v string) *DeleteItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *DeleteItemInput) SetReturnItemCollectionMetrics(v string) *DeleteItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// SetReturnValues sets the ReturnValues field's value. -func (s *DeleteItemInput) SetReturnValues(v string) *DeleteItemInput { - s.ReturnValues = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *DeleteItemInput) SetTableName(v string) *DeleteItemInput { - s.TableName = &v - return s -} - -// Represents the output of a DeleteItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItemOutput -type DeleteItemOutput struct { - _ struct{} `type:"structure"` - - // A map of attribute names to AttributeValue objects, representing the item - // as it appeared before the DeleteItem operation. This map appears in the response - // only if ReturnValues was specified as ALL_OLD in the request. - Attributes map[string]*AttributeValue `type:"map"` - - // The capacity units consumed by the DeleteItem operation. The data returned - // includes the total provisioned throughput consumed, along with statistics - // for the table and any indexes involved in the operation. ConsumedCapacity - // is only returned if the ReturnConsumedCapacity parameter was specified. For - // more information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // Information about item collections, if any, that were affected by the DeleteItem - // operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics - // parameter was specified. If the table does not have any local secondary indexes, - // this information is not returned in the response. - // - // Each ItemCollectionMetrics element consists of: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item itself. - // - // * SizeEstimateRange - An estimate of item collection size, in gigabytes. - // This value is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on that table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"` -} - -// String returns the string representation -func (s DeleteItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteItemOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *DeleteItemOutput) SetAttributes(v map[string]*AttributeValue) *DeleteItemOutput { - s.Attributes = v - return s -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *DeleteItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *DeleteItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *DeleteItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *DeleteItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// Represents a request to perform a DeleteItem operation on an item. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteRequest -type DeleteRequest struct { - _ struct{} `type:"structure"` - - // A map of attribute name to attribute values, representing the primary key - // of the item to delete. All of the table's primary key attributes must be - // specified, and their data types must match those of the table's key schema. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` -} - -// String returns the string representation -func (s DeleteRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRequest) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *DeleteRequest) SetKey(v map[string]*AttributeValue) *DeleteRequest { - s.Key = v - return s -} - -// Represents the input of a DeleteTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTableInput -type DeleteTableInput struct { - _ struct{} `type:"structure"` - - // The name of the table to delete. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTableInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *DeleteTableInput) SetTableName(v string) *DeleteTableInput { - s.TableName = &v - return s -} - -// Represents the output of a DeleteTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTableOutput -type DeleteTableOutput struct { - _ struct{} `type:"structure"` - - // Represents the properties of a table. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s DeleteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTableOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *DeleteTableOutput) SetTableDescription(v *TableDescription) *DeleteTableOutput { - s.TableDescription = v - return s -} - -// Represents the input of a DescribeLimits operation. Has no content. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimitsInput -type DescribeLimitsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLimitsInput) GoString() string { - return s.String() -} - -// Represents the output of a DescribeLimits operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimitsOutput -type DescribeLimitsOutput struct { - _ struct{} `type:"structure"` - - // The maximum total read capacity units that your account allows you to provision - // across all of your tables in this region. - AccountMaxReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum total write capacity units that your account allows you to provision - // across all of your tables in this region. - AccountMaxWriteCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum read capacity units that your account allows you to provision - // for a new table that you are creating in this region, including the read - // capacity units provisioned for its global secondary indexes (GSIs). - TableMaxReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum write capacity units that your account allows you to provision - // for a new table that you are creating in this region, including the write - // capacity units provisioned for its global secondary indexes (GSIs). - TableMaxWriteCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s DescribeLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLimitsOutput) GoString() string { - return s.String() -} - -// SetAccountMaxReadCapacityUnits sets the AccountMaxReadCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetAccountMaxReadCapacityUnits(v int64) *DescribeLimitsOutput { - s.AccountMaxReadCapacityUnits = &v - return s -} - -// SetAccountMaxWriteCapacityUnits sets the AccountMaxWriteCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetAccountMaxWriteCapacityUnits(v int64) *DescribeLimitsOutput { - s.AccountMaxWriteCapacityUnits = &v - return s -} - -// SetTableMaxReadCapacityUnits sets the TableMaxReadCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetTableMaxReadCapacityUnits(v int64) *DescribeLimitsOutput { - s.TableMaxReadCapacityUnits = &v - return s -} - -// SetTableMaxWriteCapacityUnits sets the TableMaxWriteCapacityUnits field's value. -func (s *DescribeLimitsOutput) SetTableMaxWriteCapacityUnits(v int64) *DescribeLimitsOutput { - s.TableMaxWriteCapacityUnits = &v - return s -} - -// Represents the input of a DescribeTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTableInput -type DescribeTableInput struct { - _ struct{} `type:"structure"` - - // The name of the table to describe. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTableInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *DescribeTableInput) SetTableName(v string) *DescribeTableInput { - s.TableName = &v - return s -} - -// Represents the output of a DescribeTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTableOutput -type DescribeTableOutput struct { - _ struct{} `type:"structure"` - - // The properties of the table. - Table *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTableOutput) GoString() string { - return s.String() -} - -// SetTable sets the Table field's value. -func (s *DescribeTableOutput) SetTable(v *TableDescription) *DescribeTableOutput { - s.Table = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLiveInput -type DescribeTimeToLiveInput struct { - _ struct{} `type:"structure"` - - // The name of the table to be described. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeTimeToLiveInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTimeToLiveInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTimeToLiveInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTimeToLiveInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *DescribeTimeToLiveInput) SetTableName(v string) *DescribeTimeToLiveInput { - s.TableName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLiveOutput -type DescribeTimeToLiveOutput struct { - _ struct{} `type:"structure"` - - TimeToLiveDescription *TimeToLiveDescription `type:"structure"` -} - -// String returns the string representation -func (s DescribeTimeToLiveOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTimeToLiveOutput) GoString() string { - return s.String() -} - -// SetTimeToLiveDescription sets the TimeToLiveDescription field's value. -func (s *DescribeTimeToLiveOutput) SetTimeToLiveDescription(v *TimeToLiveDescription) *DescribeTimeToLiveOutput { - s.TimeToLiveDescription = v - return s -} - -// Represents a condition to be compared with an attribute value. This condition -// can be used with DeleteItem, PutItem or UpdateItem operations; if the comparison -// evaluates to true, the operation succeeds; if not, the operation fails. You -// can use ExpectedAttributeValue in one of two different ways: -// -// * Use AttributeValueList to specify one or more values to compare against -// an attribute. Use ComparisonOperator to specify how you want to perform -// the comparison. If the comparison evaluates to true, then the conditional -// operation succeeds. -// -// * Use Value to specify a value that DynamoDB will compare against an attribute. -// If the values match, then ExpectedAttributeValue evaluates to true and -// the conditional operation succeeds. Optionally, you can also set Exists -// to false, indicating that you do not expect to find the attribute value -// in the table. In this case, the conditional operation succeeds only if -// the comparison evaluates to false. -// -// Value and Exists are incompatible with AttributeValueList and ComparisonOperator. -// Note that if you use both sets of parameters at once, DynamoDB will return -// a ValidationException exception. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ExpectedAttributeValue -type ExpectedAttributeValue struct { - _ struct{} `type:"structure"` - - // One or more values to evaluate against the supplied attribute. The number - // of values in the list depends on the ComparisonOperator being used. - // - // For type Number, value comparisons are numeric. - // - // String value comparisons for greater than, equals, or less than are based - // on ASCII character code values. For example, a is greater than A, and a is - // greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters - // (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - // - // For Binary, DynamoDB treats each byte of the binary data as unsigned when - // it compares binary values. - // - // For information on specifying data types in JSON, see JSON Data Format (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html) - // in the Amazon DynamoDB Developer Guide. - AttributeValueList []*AttributeValue `type:"list"` - - // A comparator for evaluating attributes in the AttributeValueList. For example, - // equals, greater than, less than, etc. - // - // The following comparison operators are available: - // - // EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | - // BEGINS_WITH | IN | BETWEEN - // - // The following are descriptions of each comparison operator. - // - // * EQ : Equal. EQ is supported for all data types, including lists and - // maps. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue element of a different type than the one provided in - // the request, the value does not match. For example, {"S":"6"} does not - // equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * NE : Not equal. NE is supported for all data types, including lists - // and maps. - // - // * AttributeValueList can contain only one AttributeValue of type String, - // Number, Binary, String Set, Number Set, or Binary Set. If an item contains - // an AttributeValue of a different type than the one provided in the request, - // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}. - // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}. - // - // * LE : Less than or equal. - // - // AttributeValueList can contain only one AttributeValue element of type String, - // Number, or Binary (not a set type). If an item contains an AttributeValue - // element of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} - // does not compare to {"NS":["6", "2", "1"]}. - // - // LT: Less than. - // - // AttributeValueListcan contain only one AttributeValueof type String, Number, or Binary (not a set type). If an item contains an - // AttributeValueelement of a different type than the one provided in the request, the value - // does not match. For example, {"S":"6"}does not equal {"N":"6"}. Also, {"N":"6"}does not compare to {"NS":["6", "2", "1"]} - ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` - - // Causes DynamoDB to evaluate the value before attempting a conditional operation: - // - // * If Exists is true, DynamoDB will check to see if that attribute value - // already exists in the table. If it is found, then the operation succeeds. - // If it is not found, the operation fails with a ConditionalCheckFailedException. - // - // * If Exists is false, DynamoDB assumes that the attribute value does not - // exist in the table. If in fact the value does not exist, then the assumption - // is valid and the operation succeeds. If the value is found, despite the - // assumption that it does not exist, the operation fails with a ConditionalCheckFailedException. - // - // The default setting for Exists is true. If you supply a Value all by itself, - // DynamoDB assumes the attribute exists: You don't have to set Exists to true, - // because it is implied. - // - // DynamoDB returns a ValidationException if: - // - // * Exists is true but there is no Value to check. (You expect a value to - // exist, but don't specify what that value is.) - // - // * Exists is false but you also provide a Value. (You cannot expect an - // attribute to have a value, while also expecting it not to exist.) - Exists *bool `type:"boolean"` - - // Represents the data for the expected attribute. - // - // Each attribute value is described as a name-value pair. The name is the data - // type, and the value is the data itself. - // - // For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) - // in the Amazon DynamoDB Developer Guide. - Value *AttributeValue `type:"structure"` -} - -// String returns the string representation -func (s ExpectedAttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExpectedAttributeValue) GoString() string { - return s.String() -} - -// SetAttributeValueList sets the AttributeValueList field's value. -func (s *ExpectedAttributeValue) SetAttributeValueList(v []*AttributeValue) *ExpectedAttributeValue { - s.AttributeValueList = v - return s -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *ExpectedAttributeValue) SetComparisonOperator(v string) *ExpectedAttributeValue { - s.ComparisonOperator = &v - return s -} - -// SetExists sets the Exists field's value. -func (s *ExpectedAttributeValue) SetExists(v bool) *ExpectedAttributeValue { - s.Exists = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ExpectedAttributeValue) SetValue(v *AttributeValue) *ExpectedAttributeValue { - s.Value = v - return s -} - -// Represents the input of a GetItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItemInput -type GetItemInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // Determines the read consistency model: If set to true, then the operation - // uses strongly consistent reads; otherwise, the operation uses eventually - // consistent reads. - ConsistentRead *bool `type:"boolean"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // A map of attribute names to AttributeValue objects, representing the primary - // key of the item to retrieve. - // - // For the primary key, you must provide all of the attributes. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide values for both the partition - // key and the sort key. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` - - // A string that identifies one or more attributes to retrieve from the table. - // These attributes can include scalars, sets, or elements of a JSON document. - // The attributes in the expression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // The name of the table containing the requested item. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetItemInput"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *GetItemInput) SetAttributesToGet(v []*string) *GetItemInput { - s.AttributesToGet = v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *GetItemInput) SetConsistentRead(v bool) *GetItemInput { - s.ConsistentRead = &v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *GetItemInput) SetExpressionAttributeNames(v map[string]*string) *GetItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetKey sets the Key field's value. -func (s *GetItemInput) SetKey(v map[string]*AttributeValue) *GetItemInput { - s.Key = v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *GetItemInput) SetProjectionExpression(v string) *GetItemInput { - s.ProjectionExpression = &v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *GetItemInput) SetReturnConsumedCapacity(v string) *GetItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *GetItemInput) SetTableName(v string) *GetItemInput { - s.TableName = &v - return s -} - -// Represents the output of a GetItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItemOutput -type GetItemOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the GetItem operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified. For more - // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // A map of attribute names to AttributeValue objects, as specified by ProjectionExpression. - Item map[string]*AttributeValue `type:"map"` -} - -// String returns the string representation -func (s GetItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetItemOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *GetItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *GetItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItem sets the Item field's value. -func (s *GetItemOutput) SetItem(v map[string]*AttributeValue) *GetItemOutput { - s.Item = v - return s -} - -// Represents the properties of a global secondary index. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GlobalSecondaryIndex -type GlobalSecondaryIndex struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index. The name must be unique among all - // other indexes on this table. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The complete key schema for a global secondary index, which consists of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - // - // Projection is a required field - Projection *Projection `type:"structure" required:"true"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GlobalSecondaryIndex) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalSecondaryIndex) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlobalSecondaryIndex) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndex"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.Projection == nil { - invalidParams.Add(request.NewErrParamRequired("Projection")) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Projection != nil { - if err := s.Projection.Validate(); err != nil { - invalidParams.AddNested("Projection", err.(request.ErrInvalidParams)) - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *GlobalSecondaryIndex) SetIndexName(v string) *GlobalSecondaryIndex { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *GlobalSecondaryIndex) SetKeySchema(v []*KeySchemaElement) *GlobalSecondaryIndex { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *GlobalSecondaryIndex) SetProjection(v *Projection) *GlobalSecondaryIndex { - s.Projection = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *GlobalSecondaryIndex) SetProvisionedThroughput(v *ProvisionedThroughput) *GlobalSecondaryIndex { - s.ProvisionedThroughput = v - return s -} - -// Represents the properties of a global secondary index. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GlobalSecondaryIndexDescription -type GlobalSecondaryIndexDescription struct { - _ struct{} `type:"structure"` - - // Indicates whether the index is currently backfilling. Backfilling is the - // process of reading items from the table and determining whether they can - // be added to the index. (Not all items will qualify: For example, a partition - // key cannot have any duplicate values.) If an item can be added to the index, - // DynamoDB will do so. After all items have been processed, the backfilling - // operation is complete and Backfilling is false. - // - // For indexes that were created during a CreateTable operation, the Backfilling - // attribute does not appear in the DescribeTable output. - Backfilling *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) that uniquely identifies the index. - IndexArn *string `type:"string"` - - // The name of the global secondary index. - IndexName *string `min:"3" type:"string"` - - // The total size of the specified index, in bytes. DynamoDB updates this value - // approximately every six hours. Recent changes might not be reflected in this - // value. - IndexSizeBytes *int64 `type:"long"` - - // The current state of the global secondary index: - // - // * CREATING - The index is being created. - // - // * UPDATING - The index is being updated. - // - // * DELETING - The index is being deleted. - // - // * ACTIVE - The index is ready for use. - IndexStatus *string `type:"string" enum:"IndexStatus"` - - // The number of items in the specified index. DynamoDB updates this value approximately - // every six hours. Recent changes might not be reflected in this value. - ItemCount *int64 `type:"long"` - - // The complete key schema for a global secondary index, which consists of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - Projection *Projection `type:"structure"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"` -} - -// String returns the string representation -func (s GlobalSecondaryIndexDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalSecondaryIndexDescription) GoString() string { - return s.String() -} - -// SetBackfilling sets the Backfilling field's value. -func (s *GlobalSecondaryIndexDescription) SetBackfilling(v bool) *GlobalSecondaryIndexDescription { - s.Backfilling = &v - return s -} - -// SetIndexArn sets the IndexArn field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexArn(v string) *GlobalSecondaryIndexDescription { - s.IndexArn = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexName(v string) *GlobalSecondaryIndexDescription { - s.IndexName = &v - return s -} - -// SetIndexSizeBytes sets the IndexSizeBytes field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexSizeBytes(v int64) *GlobalSecondaryIndexDescription { - s.IndexSizeBytes = &v - return s -} - -// SetIndexStatus sets the IndexStatus field's value. -func (s *GlobalSecondaryIndexDescription) SetIndexStatus(v string) *GlobalSecondaryIndexDescription { - s.IndexStatus = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *GlobalSecondaryIndexDescription) SetItemCount(v int64) *GlobalSecondaryIndexDescription { - s.ItemCount = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *GlobalSecondaryIndexDescription) SetKeySchema(v []*KeySchemaElement) *GlobalSecondaryIndexDescription { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *GlobalSecondaryIndexDescription) SetProjection(v *Projection) *GlobalSecondaryIndexDescription { - s.Projection = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *GlobalSecondaryIndexDescription) SetProvisionedThroughput(v *ProvisionedThroughputDescription) *GlobalSecondaryIndexDescription { - s.ProvisionedThroughput = v - return s -} - -// Represents one of the following: -// -// * A new global secondary index to be added to an existing table. -// -// * New provisioned throughput parameters for an existing global secondary -// index. -// -// * An existing global secondary index to be removed from an existing table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GlobalSecondaryIndexUpdate -type GlobalSecondaryIndexUpdate struct { - _ struct{} `type:"structure"` - - // The parameters required for creating a global secondary index on an existing - // table: - // - // * IndexName - // - // * KeySchema - // - // * AttributeDefinitions - // - // * Projection - // - // * ProvisionedThroughput - Create *CreateGlobalSecondaryIndexAction `type:"structure"` - - // The name of an existing global secondary index to be removed. - Delete *DeleteGlobalSecondaryIndexAction `type:"structure"` - - // The name of an existing global secondary index, along with new provisioned - // throughput settings to be applied to that index. - Update *UpdateGlobalSecondaryIndexAction `type:"structure"` -} - -// String returns the string representation -func (s GlobalSecondaryIndexUpdate) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlobalSecondaryIndexUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlobalSecondaryIndexUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndexUpdate"} - if s.Create != nil { - if err := s.Create.Validate(); err != nil { - invalidParams.AddNested("Create", err.(request.ErrInvalidParams)) - } - } - if s.Delete != nil { - if err := s.Delete.Validate(); err != nil { - invalidParams.AddNested("Delete", err.(request.ErrInvalidParams)) - } - } - if s.Update != nil { - if err := s.Update.Validate(); err != nil { - invalidParams.AddNested("Update", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreate sets the Create field's value. -func (s *GlobalSecondaryIndexUpdate) SetCreate(v *CreateGlobalSecondaryIndexAction) *GlobalSecondaryIndexUpdate { - s.Create = v - return s -} - -// SetDelete sets the Delete field's value. -func (s *GlobalSecondaryIndexUpdate) SetDelete(v *DeleteGlobalSecondaryIndexAction) *GlobalSecondaryIndexUpdate { - s.Delete = v - return s -} - -// SetUpdate sets the Update field's value. -func (s *GlobalSecondaryIndexUpdate) SetUpdate(v *UpdateGlobalSecondaryIndexAction) *GlobalSecondaryIndexUpdate { - s.Update = v - return s -} - -// Information about item collections, if any, that were affected by the operation. -// ItemCollectionMetrics is only returned if the request asked for it. If the -// table does not have any local secondary indexes, this information is not -// returned in the response. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ItemCollectionMetrics -type ItemCollectionMetrics struct { - _ struct{} `type:"structure"` - - // The partition key value of the item collection. This value is the same as - // the partition key value of the item. - ItemCollectionKey map[string]*AttributeValue `type:"map"` - - // An estimate of item collection size, in gigabytes. This value is a two-element - // array containing a lower bound and an upper bound for the estimate. The estimate - // includes the size of all the items in the table, plus the size of all attributes - // projected into all of the local secondary indexes on that table. Use this - // estimate to measure whether a local secondary index is approaching its size - // limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - SizeEstimateRangeGB []*float64 `type:"list"` -} - -// String returns the string representation -func (s ItemCollectionMetrics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ItemCollectionMetrics) GoString() string { - return s.String() -} - -// SetItemCollectionKey sets the ItemCollectionKey field's value. -func (s *ItemCollectionMetrics) SetItemCollectionKey(v map[string]*AttributeValue) *ItemCollectionMetrics { - s.ItemCollectionKey = v - return s -} - -// SetSizeEstimateRangeGB sets the SizeEstimateRangeGB field's value. -func (s *ItemCollectionMetrics) SetSizeEstimateRangeGB(v []*float64) *ItemCollectionMetrics { - s.SizeEstimateRangeGB = v - return s -} - -// Represents a single element of a key schema. A key schema specifies the attributes -// that make up the primary key of a table, or the key attributes of an index. -// -// A KeySchemaElement represents exactly one attribute of the primary key. For -// example, a simple primary key would be represented by one KeySchemaElement -// (for the partition key). A composite primary key would require one KeySchemaElement -// for the partition key, and another KeySchemaElement for the sort key. -// -// A KeySchemaElement must be a scalar, top-level attribute (not a nested attribute). -// The data type must be one of String, Number, or Binary. The attribute cannot -// be nested within a List or a Map. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/KeySchemaElement -type KeySchemaElement struct { - _ struct{} `type:"structure"` - - // The name of a key attribute. - // - // AttributeName is a required field - AttributeName *string `min:"1" type:"string" required:"true"` - - // The role that this key attribute will assume: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // KeyType is a required field - KeyType *string `type:"string" required:"true" enum:"KeyType"` -} - -// String returns the string representation -func (s KeySchemaElement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeySchemaElement) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KeySchemaElement) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KeySchemaElement"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.AttributeName != nil && len(*s.AttributeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1)) - } - if s.KeyType == nil { - invalidParams.Add(request.NewErrParamRequired("KeyType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *KeySchemaElement) SetAttributeName(v string) *KeySchemaElement { - s.AttributeName = &v - return s -} - -// SetKeyType sets the KeyType field's value. -func (s *KeySchemaElement) SetKeyType(v string) *KeySchemaElement { - s.KeyType = &v - return s -} - -// Represents a set of primary keys and, for each key, the attributes to retrieve -// from the table. -// -// For each primary key, you must provide all of the key attributes. For example, -// with a simple primary key, you only need to provide the partition key. For -// a composite primary key, you must provide both the partition key and the -// sort key. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/KeysAndAttributes -type KeysAndAttributes struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see Legacy Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // The consistency of a read operation. If set to true, then a strongly consistent - // read is used; otherwise, an eventually consistent read is used. - ConsistentRead *bool `type:"boolean"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // The primary key attribute values that define the items and the attributes - // associated with the items. - // - // Keys is a required field - Keys []map[string]*AttributeValue `min:"1" type:"list" required:"true"` - - // A string that identifies one or more attributes to retrieve from the table. - // These attributes can include scalars, sets, or elements of a JSON document. - // The attributes in the ProjectionExpression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` -} - -// String returns the string representation -func (s KeysAndAttributes) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeysAndAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KeysAndAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KeysAndAttributes"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.Keys == nil { - invalidParams.Add(request.NewErrParamRequired("Keys")) - } - if s.Keys != nil && len(s.Keys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Keys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *KeysAndAttributes) SetAttributesToGet(v []*string) *KeysAndAttributes { - s.AttributesToGet = v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *KeysAndAttributes) SetConsistentRead(v bool) *KeysAndAttributes { - s.ConsistentRead = &v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *KeysAndAttributes) SetExpressionAttributeNames(v map[string]*string) *KeysAndAttributes { - s.ExpressionAttributeNames = v - return s -} - -// SetKeys sets the Keys field's value. -func (s *KeysAndAttributes) SetKeys(v []map[string]*AttributeValue) *KeysAndAttributes { - s.Keys = v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *KeysAndAttributes) SetProjectionExpression(v string) *KeysAndAttributes { - s.ProjectionExpression = &v - return s -} - -// Represents the input of a ListTables operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTablesInput -type ListTablesInput struct { - _ struct{} `type:"structure"` - - // The first table name that this operation will evaluate. Use the value that - // was returned for LastEvaluatedTableName in a previous operation, so that - // you can obtain the next page of results. - ExclusiveStartTableName *string `min:"3" type:"string"` - - // A maximum number of table names to return. If this parameter is not specified, - // the limit is 100. - Limit *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListTablesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTablesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTablesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTablesInput"} - if s.ExclusiveStartTableName != nil && len(*s.ExclusiveStartTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartTableName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartTableName sets the ExclusiveStartTableName field's value. -func (s *ListTablesInput) SetExclusiveStartTableName(v string) *ListTablesInput { - s.ExclusiveStartTableName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListTablesInput) SetLimit(v int64) *ListTablesInput { - s.Limit = &v - return s -} - -// Represents the output of a ListTables operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTablesOutput -type ListTablesOutput struct { - _ struct{} `type:"structure"` - - // The name of the last table in the current page of results. Use this value - // as the ExclusiveStartTableName in a new request to obtain the next page of - // results, until all the table names are returned. - // - // If you do not receive a LastEvaluatedTableName value in the response, this - // means that there are no more table names to be retrieved. - LastEvaluatedTableName *string `min:"3" type:"string"` - - // The names of the tables associated with the current account at the current - // endpoint. The maximum size of this array is 100. - // - // If LastEvaluatedTableName also appears in the output, you can use this value - // as the ExclusiveStartTableName parameter in a subsequent ListTables request - // and obtain the next page of results. - TableNames []*string `type:"list"` -} - -// String returns the string representation -func (s ListTablesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTablesOutput) GoString() string { - return s.String() -} - -// SetLastEvaluatedTableName sets the LastEvaluatedTableName field's value. -func (s *ListTablesOutput) SetLastEvaluatedTableName(v string) *ListTablesOutput { - s.LastEvaluatedTableName = &v - return s -} - -// SetTableNames sets the TableNames field's value. -func (s *ListTablesOutput) SetTableNames(v []*string) *ListTablesOutput { - s.TableNames = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResourceInput -type ListTagsOfResourceInput struct { - _ struct{} `type:"structure"` - - // An optional string that, if supplied, must be copied from the output of a - // previous call to ListTagOfResource. When provided in this manner, this API - // fetches the next page of results. - NextToken *string `type:"string"` - - // The Amazon DynamoDB resource with tags to be listed. This value is an Amazon - // Resource Name (ARN). - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsOfResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsOfResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsOfResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsOfResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOfResourceInput) SetNextToken(v string) *ListTagsOfResourceInput { - s.NextToken = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsOfResourceInput) SetResourceArn(v string) *ListTagsOfResourceInput { - s.ResourceArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResourceOutput -type ListTagsOfResourceOutput struct { - _ struct{} `type:"structure"` - - // If this value is returned, there are additional results to be displayed. - // To retrieve them, call ListTagsOfResource again, with NextToken set to this - // value. - NextToken *string `type:"string"` - - // The tags currently associated with the Amazon DynamoDB resource. - Tags []*Tag `type:"list"` -} - -// String returns the string representation -func (s ListTagsOfResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsOfResourceOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOfResourceOutput) SetNextToken(v string) *ListTagsOfResourceOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListTagsOfResourceOutput) SetTags(v []*Tag) *ListTagsOfResourceOutput { - s.Tags = v - return s -} - -// Represents the properties of a local secondary index. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/LocalSecondaryIndex -type LocalSecondaryIndex struct { - _ struct{} `type:"structure"` - - // The name of the local secondary index. The name must be unique among all - // other indexes on this table. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // The complete key schema for the local secondary index, consisting of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` - - // Represents attributes that are copied (projected) from the table into the - // local secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - // - // Projection is a required field - Projection *Projection `type:"structure" required:"true"` -} - -// String returns the string representation -func (s LocalSecondaryIndex) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LocalSecondaryIndex) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LocalSecondaryIndex) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LocalSecondaryIndex"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.KeySchema == nil { - invalidParams.Add(request.NewErrParamRequired("KeySchema")) - } - if s.KeySchema != nil && len(s.KeySchema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1)) - } - if s.Projection == nil { - invalidParams.Add(request.NewErrParamRequired("Projection")) - } - if s.KeySchema != nil { - for i, v := range s.KeySchema { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeySchema", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Projection != nil { - if err := s.Projection.Validate(); err != nil { - invalidParams.AddNested("Projection", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndex) SetIndexName(v string) *LocalSecondaryIndex { - s.IndexName = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *LocalSecondaryIndex) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndex { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *LocalSecondaryIndex) SetProjection(v *Projection) *LocalSecondaryIndex { - s.Projection = v - return s -} - -// Represents the properties of a local secondary index. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/LocalSecondaryIndexDescription -type LocalSecondaryIndexDescription struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that uniquely identifies the index. - IndexArn *string `type:"string"` - - // Represents the name of the local secondary index. - IndexName *string `min:"3" type:"string"` - - // The total size of the specified index, in bytes. DynamoDB updates this value - // approximately every six hours. Recent changes might not be reflected in this - // value. - IndexSizeBytes *int64 `type:"long"` - - // The number of items in the specified index. DynamoDB updates this value approximately - // every six hours. Recent changes might not be reflected in this value. - ItemCount *int64 `type:"long"` - - // The complete key schema for the local secondary index, consisting of one - // or more pairs of attribute names and key types: - // - // * HASH - partition key - // - // * RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // Represents attributes that are copied (projected) from the table into the - // global secondary index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. - Projection *Projection `type:"structure"` -} - -// String returns the string representation -func (s LocalSecondaryIndexDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LocalSecondaryIndexDescription) GoString() string { - return s.String() -} - -// SetIndexArn sets the IndexArn field's value. -func (s *LocalSecondaryIndexDescription) SetIndexArn(v string) *LocalSecondaryIndexDescription { - s.IndexArn = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndexDescription) SetIndexName(v string) *LocalSecondaryIndexDescription { - s.IndexName = &v - return s -} - -// SetIndexSizeBytes sets the IndexSizeBytes field's value. -func (s *LocalSecondaryIndexDescription) SetIndexSizeBytes(v int64) *LocalSecondaryIndexDescription { - s.IndexSizeBytes = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *LocalSecondaryIndexDescription) SetItemCount(v int64) *LocalSecondaryIndexDescription { - s.ItemCount = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *LocalSecondaryIndexDescription) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndexDescription { - s.KeySchema = v - return s -} - -// SetProjection sets the Projection field's value. -func (s *LocalSecondaryIndexDescription) SetProjection(v *Projection) *LocalSecondaryIndexDescription { - s.Projection = v - return s -} - -// Represents attributes that are copied (projected) from the table into an -// index. These are in addition to the primary key attributes and index key -// attributes, which are automatically projected. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Projection -type Projection struct { - _ struct{} `type:"structure"` - - // Represents the non-key attribute names which will be projected into the index. - // - // For local secondary indexes, the total count of NonKeyAttributes summed across - // all of the local secondary indexes, must not exceed 20. If you project the - // same attribute into two different indexes, this counts as two distinct attributes - // when determining the total. - NonKeyAttributes []*string `min:"1" type:"list"` - - // The set of attributes that are projected into the index: - // - // * KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // * INCLUDE - Only the specified table attributes are projected into the - // index. The list of projected attributes are in NonKeyAttributes. - // - // * ALL - All of the table attributes are projected into the index. - ProjectionType *string `type:"string" enum:"ProjectionType"` -} - -// String returns the string representation -func (s Projection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Projection) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Projection) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Projection"} - if s.NonKeyAttributes != nil && len(s.NonKeyAttributes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NonKeyAttributes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNonKeyAttributes sets the NonKeyAttributes field's value. -func (s *Projection) SetNonKeyAttributes(v []*string) *Projection { - s.NonKeyAttributes = v - return s -} - -// SetProjectionType sets the ProjectionType field's value. -func (s *Projection) SetProjectionType(v string) *Projection { - s.ProjectionType = &v - return s -} - -// Represents the provisioned throughput settings for a specified table or index. -// The settings can be modified using the UpdateTable operation. -// -// For current minimum and maximum provisioned throughput values, see Limits -// (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) -// in the Amazon DynamoDB Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ProvisionedThroughput -type ProvisionedThroughput struct { - _ struct{} `type:"structure"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. For more information, see Specifying - // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - // - // ReadCapacityUnits is a required field - ReadCapacityUnits *int64 `min:"1" type:"long" required:"true"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. For more information, see Specifying Read and Write - // Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - // - // WriteCapacityUnits is a required field - WriteCapacityUnits *int64 `min:"1" type:"long" required:"true"` -} - -// String returns the string representation -func (s ProvisionedThroughput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProvisionedThroughput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProvisionedThroughput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProvisionedThroughput"} - if s.ReadCapacityUnits == nil { - invalidParams.Add(request.NewErrParamRequired("ReadCapacityUnits")) - } - if s.ReadCapacityUnits != nil && *s.ReadCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("ReadCapacityUnits", 1)) - } - if s.WriteCapacityUnits == nil { - invalidParams.Add(request.NewErrParamRequired("WriteCapacityUnits")) - } - if s.WriteCapacityUnits != nil && *s.WriteCapacityUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("WriteCapacityUnits", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReadCapacityUnits sets the ReadCapacityUnits field's value. -func (s *ProvisionedThroughput) SetReadCapacityUnits(v int64) *ProvisionedThroughput { - s.ReadCapacityUnits = &v - return s -} - -// SetWriteCapacityUnits sets the WriteCapacityUnits field's value. -func (s *ProvisionedThroughput) SetWriteCapacityUnits(v int64) *ProvisionedThroughput { - s.WriteCapacityUnits = &v - return s -} - -// Represents the provisioned throughput settings for the table, consisting -// of read and write capacity units, along with data about increases and decreases. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ProvisionedThroughputDescription -type ProvisionedThroughputDescription struct { - _ struct{} `type:"structure"` - - // The date and time of the last provisioned throughput decrease for this table. - LastDecreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The date and time of the last provisioned throughput increase for this table. - LastIncreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The number of provisioned throughput decreases for this table during this - // UTC calendar day. For current maximums on provisioned throughput decreases, - // see Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - NumberOfDecreasesToday *int64 `min:"1" type:"long"` - - // The maximum number of strongly consistent reads consumed per second before - // DynamoDB returns a ThrottlingException. Eventually consistent reads require - // less effort than strongly consistent reads, so a setting of 50 ReadCapacityUnits - // per second provides 100 eventually consistent ReadCapacityUnits per second. - ReadCapacityUnits *int64 `min:"1" type:"long"` - - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. - WriteCapacityUnits *int64 `min:"1" type:"long"` -} - -// String returns the string representation -func (s ProvisionedThroughputDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProvisionedThroughputDescription) GoString() string { - return s.String() -} - -// SetLastDecreaseDateTime sets the LastDecreaseDateTime field's value. -func (s *ProvisionedThroughputDescription) SetLastDecreaseDateTime(v time.Time) *ProvisionedThroughputDescription { - s.LastDecreaseDateTime = &v - return s -} - -// SetLastIncreaseDateTime sets the LastIncreaseDateTime field's value. -func (s *ProvisionedThroughputDescription) SetLastIncreaseDateTime(v time.Time) *ProvisionedThroughputDescription { - s.LastIncreaseDateTime = &v - return s -} - -// SetNumberOfDecreasesToday sets the NumberOfDecreasesToday field's value. -func (s *ProvisionedThroughputDescription) SetNumberOfDecreasesToday(v int64) *ProvisionedThroughputDescription { - s.NumberOfDecreasesToday = &v - return s -} - -// SetReadCapacityUnits sets the ReadCapacityUnits field's value. -func (s *ProvisionedThroughputDescription) SetReadCapacityUnits(v int64) *ProvisionedThroughputDescription { - s.ReadCapacityUnits = &v - return s -} - -// SetWriteCapacityUnits sets the WriteCapacityUnits field's value. -func (s *ProvisionedThroughputDescription) SetWriteCapacityUnits(v int64) *ProvisionedThroughputDescription { - s.WriteCapacityUnits = &v - return s -} - -// Represents the input of a PutItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItemInput -type PutItemInput struct { - _ struct{} `type:"structure"` - - // A condition that must be satisfied in order for a conditional PutItem operation - // to succeed. - // - // An expression can contain any of the following: - // - // * Functions: attribute_exists | attribute_not_exists | attribute_type - // | contains | begins_with | size - // - // These function names are case-sensitive. - // - // * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN - // - // * Logical operators: AND | OR | NOT - // - // For more information on condition expressions, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // This is a legacy parameter. Use ConditionExpresssion instead. For more information, - // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - // in the Amazon DynamoDB Developer Guide. - Expected map[string]*ExpectedAttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A map of attribute name/value pairs, one for each attribute. Only the primary - // key attributes are required; you can optionally provide other attribute name-value - // pairs for the item. - // - // You must provide all of the attributes for the primary key. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide both values for both the - // partition key and the sort key. - // - // If you specify any attributes that are part of an index key, then the data - // types for those attributes must match those of the schema in the table's - // attribute definition. - // - // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey) - // in the Amazon DynamoDB Developer Guide. - // - // Each element in the Item map is an AttributeValue object. - // - // Item is a required field - Item map[string]*AttributeValue `type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` - - // Use ReturnValues if you want to get the item attributes as they appeared - // before they were updated with the PutItem request. For PutItem, the valid - // values are: - // - // * NONE - If ReturnValues is not specified, or if its value is NONE, then - // nothing is returned. (This setting is the default for ReturnValues.) - // - // * ALL_OLD - If PutItem overwrote an attribute name-value pair, then the - // content of the old item is returned. - // - // The ReturnValues parameter is used by several DynamoDB operations; however, - // PutItem does not recognize any values other than NONE or ALL_OLD. - ReturnValues *string `type:"string" enum:"ReturnValue"` - - // The name of the table to contain the item. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutItemInput"} - if s.Item == nil { - invalidParams.Add(request.NewErrParamRequired("Item")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConditionExpression sets the ConditionExpression field's value. -func (s *PutItemInput) SetConditionExpression(v string) *PutItemInput { - s.ConditionExpression = &v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *PutItemInput) SetConditionalOperator(v string) *PutItemInput { - s.ConditionalOperator = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *PutItemInput) SetExpected(v map[string]*ExpectedAttributeValue) *PutItemInput { - s.Expected = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *PutItemInput) SetExpressionAttributeNames(v map[string]*string) *PutItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *PutItemInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *PutItemInput { - s.ExpressionAttributeValues = v - return s -} - -// SetItem sets the Item field's value. -func (s *PutItemInput) SetItem(v map[string]*AttributeValue) *PutItemInput { - s.Item = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *PutItemInput) SetReturnConsumedCapacity(v string) *PutItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *PutItemInput) SetReturnItemCollectionMetrics(v string) *PutItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// SetReturnValues sets the ReturnValues field's value. -func (s *PutItemInput) SetReturnValues(v string) *PutItemInput { - s.ReturnValues = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *PutItemInput) SetTableName(v string) *PutItemInput { - s.TableName = &v - return s -} - -// Represents the output of a PutItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItemOutput -type PutItemOutput struct { - _ struct{} `type:"structure"` - - // The attribute values as they appeared before the PutItem operation, but only - // if ReturnValues is specified as ALL_OLD in the request. Each element consists - // of an attribute name and an attribute value. - Attributes map[string]*AttributeValue `type:"map"` - - // The capacity units consumed by the PutItem operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified. For more - // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // Information about item collections, if any, that were affected by the PutItem - // operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics - // parameter was specified. If the table does not have any local secondary indexes, - // this information is not returned in the response. - // - // Each ItemCollectionMetrics element consists of: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item itself. - // - // * SizeEstimateRange - An estimate of item collection size, in gigabytes. - // This value is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on that table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"` -} - -// String returns the string representation -func (s PutItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutItemOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *PutItemOutput) SetAttributes(v map[string]*AttributeValue) *PutItemOutput { - s.Attributes = v - return s -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *PutItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *PutItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *PutItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *PutItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// Represents a request to perform a PutItem operation on an item. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutRequest -type PutRequest struct { - _ struct{} `type:"structure"` - - // A map of attribute name to attribute values, representing the primary key - // of an item to be processed by PutItem. All of the table's primary key attributes - // must be specified, and their data types must match those of the table's key - // schema. If any attributes are present in the item which are part of an index - // key schema for the table, their types must match the index key schema. - // - // Item is a required field - Item map[string]*AttributeValue `type:"map" required:"true"` -} - -// String returns the string representation -func (s PutRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRequest) GoString() string { - return s.String() -} - -// SetItem sets the Item field's value. -func (s *PutRequest) SetItem(v map[string]*AttributeValue) *PutRequest { - s.Item = v - return s -} - -// Represents the input of a Query operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/QueryInput -type QueryInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // Determines the read consistency model: If set to true, then the operation - // uses strongly consistent reads; otherwise, the operation uses eventually - // consistent reads. - // - // Strongly consistent reads are not supported on global secondary indexes. - // If you query a global secondary index with ConsistentRead set to true, you - // will receive a ValidationException. - ConsistentRead *bool `type:"boolean"` - - // The primary key of the first item that this operation will evaluate. Use - // the value that was returned for LastEvaluatedKey in the previous operation. - // - // The data type for ExclusiveStartKey must be String, Number or Binary. No - // set data types are allowed. - ExclusiveStartKey map[string]*AttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A string that contains conditions that DynamoDB applies after the Query operation, - // but before the data is returned to you. Items that do not satisfy the FilterExpression - // criteria are not returned. - // - // A FilterExpression does not allow key attributes. You cannot define a filter - // expression based on a partition key or a sort key. - // - // A FilterExpression is applied after the items have already been read; the - // process of filtering does not consume any additional read capacity units. - // - // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults) - // in the Amazon DynamoDB Developer Guide. - FilterExpression *string `type:"string"` - - // The name of an index to query. This index can be any local secondary index - // or global secondary index on the table. Note that if you use the IndexName - // parameter, you must also provide TableName. - IndexName *string `min:"3" type:"string"` - - // The condition that specifies the key value(s) for items to be retrieved by - // the Query action. - // - // The condition must perform an equality test on a single partition key value. - // The condition can also perform one of several comparison tests on a single - // sort key value. Query can use KeyConditionExpression to retrieve one item - // with a given partition key value and sort key value, or several items that - // have the same partition key value but different sort key values. - // - // The partition key equality test is required, and must be specified in the - // following format: - // - // partitionKeyName=:partitionkeyval - // - // If you also want to provide a condition for the sort key, it must be combined - // using AND with the condition for the sort key. Following is an example, using - // the = comparison operator for the sort key: - // - // partitionKeyName=:partitionkeyvalANDsortKeyName=:sortkeyval - // - // Valid comparisons for the sort key condition are as follows: - // - // * sortKeyName=:sortkeyval - true if the sort key value is equal to :sortkeyval. - // - // * sortKeyName<:sortkeyval - true if the sort key value is less than :sortkeyval. - // - // * sortKeyName<=:sortkeyval - true if the sort key value is less than or - // equal to :sortkeyval. - // - // * sortKeyName>:sortkeyval - true if the sort key value is greater than - // :sortkeyval. - // - // * sortKeyName>= :sortkeyval - true if the sort key value is greater than - // or equal to :sortkeyval. - // - // * sortKeyNameBETWEEN:sortkeyval1AND:sortkeyval2 - true if the sort key - // value is greater than or equal to :sortkeyval1, and less than or equal - // to :sortkeyval2. - // - // * begins_with (sortKeyName, :sortkeyval) - true if the sort key value - // begins with a particular operand. (You cannot use this function with a - // sort key that is of type Number.) Note that the function name begins_with - // is case-sensitive. - // - // Use the ExpressionAttributeValues parameter to replace tokens such as :partitionval - // and :sortval with actual values at runtime. - // - // You can optionally use the ExpressionAttributeNames parameter to replace - // the names of the partition key and sort key with placeholder tokens. This - // option might be necessary if an attribute name conflicts with a DynamoDB - // reserved word. For example, the following KeyConditionExpression parameter - // causes an error because Size is a reserved word: - // - // * Size = :myval - // - // To work around this, define a placeholder (such a #S) to represent the attribute - // name Size. KeyConditionExpression then is as follows: - // - // * #S = :myval - // - // For a list of reserved words, see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide. - // - // For more information on ExpressionAttributeNames and ExpressionAttributeValues, - // see Using Placeholders for Attribute Names and Values (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html) - // in the Amazon DynamoDB Developer Guide. - KeyConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use KeyConditionExpression instead. For more - // information, see KeyConditions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html) - // in the Amazon DynamoDB Developer Guide. - KeyConditions map[string]*Condition `type:"map"` - - // The maximum number of items to evaluate (not necessarily the number of matching - // items). If DynamoDB processes the number of items up to the limit while processing - // the results, it stops the operation and returns the matching values up to - // that point, and a key in LastEvaluatedKey to apply in a subsequent operation, - // so that you can pick up where you left off. Also, if the processed data set - // size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation - // and returns the matching values up to the limit, and a key in LastEvaluatedKey - // to apply in a subsequent operation to continue the operation. For more information, - // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) - // in the Amazon DynamoDB Developer Guide. - Limit *int64 `min:"1" type:"integer"` - - // A string that identifies one or more attributes to retrieve from the table. - // These attributes can include scalars, sets, or elements of a JSON document. - // The attributes in the expression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see QueryFilter (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html) - // in the Amazon DynamoDB Developer Guide. - QueryFilter map[string]*Condition `type:"map"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Specifies the order for index traversal: If true (default), the traversal - // is performed in ascending order; if false, the traversal is performed in - // descending order. - // - // Items with the same partition key value are stored in sorted order by sort - // key. If the sort key data type is Number, the results are stored in numeric - // order. For type String, the results are stored in order of ASCII character - // code values. For type Binary, DynamoDB treats each byte of the binary data - // as unsigned. - // - // If ScanIndexForward is true, DynamoDB returns the results in the order in - // which they are stored (by sort key value). This is the default behavior. - // If ScanIndexForward is false, DynamoDB reads the results in reverse order - // by sort key value, and then returns the results to the client. - ScanIndexForward *bool `type:"boolean"` - - // The attributes to be returned in the result. You can retrieve all item attributes, - // specific item attributes, the count of matching items, or in the case of - // an index, some or all of the attributes projected into the index. - // - // * ALL_ATTRIBUTES - Returns all of the item attributes from the specified - // table or index. If you query a local secondary index, then for each matching - // item in the index DynamoDB will fetch the entire item from the parent - // table. If the index is configured to project all item attributes, then - // all of the data can be obtained from the local secondary index, and no - // fetching is required. - // - // * ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves - // all attributes that have been projected into the index. If the index is - // configured to project all attributes, this return value is equivalent - // to specifying ALL_ATTRIBUTES. - // - // * COUNT - Returns the number of matching items, rather than the matching - // items themselves. - // - // * SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet. - // This return value is equivalent to specifying AttributesToGet without - // specifying any value for Select. - // - // If you query or scan a local secondary index and request only attributes - // that are projected into that index, the operation will read only the index - // and not the table. If any of the requested attributes are not projected - // into the local secondary index, DynamoDB will fetch each of these attributes - // from the parent table. This extra fetching incurs additional throughput - // cost and latency. - // - // If you query or scan a global secondary index, you can only request attributes - // that are projected into the index. Global secondary index queries cannot - // fetch attributes from the parent table. - // - // If neither Select nor AttributesToGet are specified, DynamoDB defaults to - // ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when - // accessing an index. You cannot use both Select and AttributesToGet together - // in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES. - // (This usage is equivalent to specifying AttributesToGet without any value - // for Select.) - // - // If you use the ProjectionExpression parameter, then the value for Select - // can only be SPECIFIC_ATTRIBUTES. Any other value for Select will return an - // error. - Select *string `type:"string" enum:"Select"` - - // The name of the table containing the requested items. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s QueryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueryInput"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.KeyConditions != nil { - for i, v := range s.KeyConditions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeyConditions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.QueryFilter != nil { - for i, v := range s.QueryFilter { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueryFilter", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *QueryInput) SetAttributesToGet(v []*string) *QueryInput { - s.AttributesToGet = v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *QueryInput) SetConditionalOperator(v string) *QueryInput { - s.ConditionalOperator = &v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *QueryInput) SetConsistentRead(v bool) *QueryInput { - s.ConsistentRead = &v - return s -} - -// SetExclusiveStartKey sets the ExclusiveStartKey field's value. -func (s *QueryInput) SetExclusiveStartKey(v map[string]*AttributeValue) *QueryInput { - s.ExclusiveStartKey = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *QueryInput) SetExpressionAttributeNames(v map[string]*string) *QueryInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *QueryInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *QueryInput { - s.ExpressionAttributeValues = v - return s -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *QueryInput) SetFilterExpression(v string) *QueryInput { - s.FilterExpression = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *QueryInput) SetIndexName(v string) *QueryInput { - s.IndexName = &v - return s -} - -// SetKeyConditionExpression sets the KeyConditionExpression field's value. -func (s *QueryInput) SetKeyConditionExpression(v string) *QueryInput { - s.KeyConditionExpression = &v - return s -} - -// SetKeyConditions sets the KeyConditions field's value. -func (s *QueryInput) SetKeyConditions(v map[string]*Condition) *QueryInput { - s.KeyConditions = v - return s -} - -// SetLimit sets the Limit field's value. -func (s *QueryInput) SetLimit(v int64) *QueryInput { - s.Limit = &v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *QueryInput) SetProjectionExpression(v string) *QueryInput { - s.ProjectionExpression = &v - return s -} - -// SetQueryFilter sets the QueryFilter field's value. -func (s *QueryInput) SetQueryFilter(v map[string]*Condition) *QueryInput { - s.QueryFilter = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *QueryInput) SetReturnConsumedCapacity(v string) *QueryInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetScanIndexForward sets the ScanIndexForward field's value. -func (s *QueryInput) SetScanIndexForward(v bool) *QueryInput { - s.ScanIndexForward = &v - return s -} - -// SetSelect sets the Select field's value. -func (s *QueryInput) SetSelect(v string) *QueryInput { - s.Select = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *QueryInput) SetTableName(v string) *QueryInput { - s.TableName = &v - return s -} - -// Represents the output of a Query operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/QueryOutput -type QueryOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the Query operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified For more information, - // see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // The number of items in the response. - // - // If you used a QueryFilter in the request, then Count is the number of items - // returned after the filter was applied, and ScannedCount is the number of - // matching items before the filter was applied. - // - // If you did not use a filter in the request, then Count and ScannedCount are - // the same. - Count *int64 `type:"integer"` - - // An array of item attributes that match the query criteria. Each element in - // this array consists of an attribute name and the value for that attribute. - Items []map[string]*AttributeValue `type:"list"` - - // The primary key of the item where the operation stopped, inclusive of the - // previous result set. Use this value to start a new operation, excluding this - // value in the new request. - // - // If LastEvaluatedKey is empty, then the "last page" of results has been processed - // and there is no more data to be retrieved. - // - // If LastEvaluatedKey is not empty, it does not necessarily mean that there - // is more data in the result set. The only way to know when you have reached - // the end of the result set is when LastEvaluatedKey is empty. - LastEvaluatedKey map[string]*AttributeValue `type:"map"` - - // The number of items evaluated, before any QueryFilter is applied. A high - // ScannedCount value with few, or no, Count results indicates an inefficient - // Query operation. For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count) - // in the Amazon DynamoDB Developer Guide. - // - // If you did not use a filter in the request, then ScannedCount is the same - // as Count. - ScannedCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s QueryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QueryOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *QueryOutput) SetConsumedCapacity(v *ConsumedCapacity) *QueryOutput { - s.ConsumedCapacity = v - return s -} - -// SetCount sets the Count field's value. -func (s *QueryOutput) SetCount(v int64) *QueryOutput { - s.Count = &v - return s -} - -// SetItems sets the Items field's value. -func (s *QueryOutput) SetItems(v []map[string]*AttributeValue) *QueryOutput { - s.Items = v - return s -} - -// SetLastEvaluatedKey sets the LastEvaluatedKey field's value. -func (s *QueryOutput) SetLastEvaluatedKey(v map[string]*AttributeValue) *QueryOutput { - s.LastEvaluatedKey = v - return s -} - -// SetScannedCount sets the ScannedCount field's value. -func (s *QueryOutput) SetScannedCount(v int64) *QueryOutput { - s.ScannedCount = &v - return s -} - -// Represents the input of a Scan operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ScanInput -type ScanInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // A Boolean value that determines the read consistency model during the scan: - // - // * If ConsistentRead is false, then the data returned from Scan might not - // contain the results from other recently completed write operations (PutItem, - // UpdateItem or DeleteItem). - // - // * If ConsistentRead is true, then all of the write operations that completed - // before the Scan began are guaranteed to be contained in the Scan response. - // - // The default setting for ConsistentRead is false. - // - // The ConsistentRead parameter is not supported on global secondary indexes. - // If you scan a global secondary index with ConsistentRead set to true, you - // will receive a ValidationException. - ConsistentRead *bool `type:"boolean"` - - // The primary key of the first item that this operation will evaluate. Use - // the value that was returned for LastEvaluatedKey in the previous operation. - // - // The data type for ExclusiveStartKey must be String, Number or Binary. No - // set data types are allowed. - // - // In a parallel scan, a Scan request that includes ExclusiveStartKey must specify - // the same segment whose previous Scan returned the corresponding value of - // LastEvaluatedKey. - ExclusiveStartKey map[string]*AttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A string that contains conditions that DynamoDB applies after the Scan operation, - // but before the data is returned to you. Items that do not satisfy the FilterExpression - // criteria are not returned. - // - // A FilterExpression is applied after the items have already been read; the - // process of filtering does not consume any additional read capacity units. - // - // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults) - // in the Amazon DynamoDB Developer Guide. - FilterExpression *string `type:"string"` - - // The name of a secondary index to scan. This index can be any local secondary - // index or global secondary index. Note that if you use the IndexName parameter, - // you must also provide TableName. - IndexName *string `min:"3" type:"string"` - - // The maximum number of items to evaluate (not necessarily the number of matching - // items). If DynamoDB processes the number of items up to the limit while processing - // the results, it stops the operation and returns the matching values up to - // that point, and a key in LastEvaluatedKey to apply in a subsequent operation, - // so that you can pick up where you left off. Also, if the processed data set - // size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation - // and returns the matching values up to the limit, and a key in LastEvaluatedKey - // to apply in a subsequent operation to continue the operation. For more information, - // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) - // in the Amazon DynamoDB Developer Guide. - Limit *int64 `min:"1" type:"integer"` - - // A string that identifies one or more attributes to retrieve from the specified - // table or index. These attributes can include scalars, sets, or elements of - // a JSON document. The attributes in the expression must be separated by commas. - // - // If no attribute names are specified, then all attributes will be returned. - // If any of the requested attributes are not found, they will not appear in - // the result. - // - // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see ScanFilter (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html) - // in the Amazon DynamoDB Developer Guide. - ScanFilter map[string]*Condition `type:"map"` - - // For a parallel Scan request, Segment identifies an individual segment to - // be scanned by an application worker. - // - // Segment IDs are zero-based, so the first segment is always 0. For example, - // if you want to use four application threads to scan a table or an index, - // then the first thread specifies a Segment value of 0, the second thread specifies - // 1, and so on. - // - // The value of LastEvaluatedKey returned from a parallel Scan request must - // be used as ExclusiveStartKey with the same segment ID in a subsequent Scan - // operation. - // - // The value for Segment must be greater than or equal to 0, and less than the - // value provided for TotalSegments. - // - // If you provide Segment, you must also provide TotalSegments. - Segment *int64 `type:"integer"` - - // The attributes to be returned in the result. You can retrieve all item attributes, - // specific item attributes, the count of matching items, or in the case of - // an index, some or all of the attributes projected into the index. - // - // * ALL_ATTRIBUTES - Returns all of the item attributes from the specified - // table or index. If you query a local secondary index, then for each matching - // item in the index DynamoDB will fetch the entire item from the parent - // table. If the index is configured to project all item attributes, then - // all of the data can be obtained from the local secondary index, and no - // fetching is required. - // - // * ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves - // all attributes that have been projected into the index. If the index is - // configured to project all attributes, this return value is equivalent - // to specifying ALL_ATTRIBUTES. - // - // * COUNT - Returns the number of matching items, rather than the matching - // items themselves. - // - // * SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet. - // This return value is equivalent to specifying AttributesToGet without - // specifying any value for Select. - // - // If you query or scan a local secondary index and request only attributes - // that are projected into that index, the operation will read only the index - // and not the table. If any of the requested attributes are not projected - // into the local secondary index, DynamoDB will fetch each of these attributes - // from the parent table. This extra fetching incurs additional throughput - // cost and latency. - // - // If you query or scan a global secondary index, you can only request attributes - // that are projected into the index. Global secondary index queries cannot - // fetch attributes from the parent table. - // - // If neither Select nor AttributesToGet are specified, DynamoDB defaults to - // ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when - // accessing an index. You cannot use both Select and AttributesToGet together - // in a single request, unless the value for Select is SPECIFIC_ATTRIBUTES. - // (This usage is equivalent to specifying AttributesToGet without any value - // for Select.) - // - // If you use the ProjectionExpression parameter, then the value for Select - // can only be SPECIFIC_ATTRIBUTES. Any other value for Select will return an - // error. - Select *string `type:"string" enum:"Select"` - - // The name of the table containing the requested items; or, if you provide - // IndexName, the name of the table to which that index belongs. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` - - // For a parallel Scan request, TotalSegments represents the total number of - // segments into which the Scan operation will be divided. The value of TotalSegments - // corresponds to the number of application workers that will perform the parallel - // scan. For example, if you want to use four application threads to scan a - // table or an index, specify a TotalSegments value of 4. - // - // The value for TotalSegments must be greater than or equal to 1, and less - // than or equal to 1000000. If you specify a TotalSegments value of 1, the - // Scan operation will be sequential rather than parallel. - // - // If you specify TotalSegments, you must also specify Segment. - TotalSegments *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ScanInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScanInput"} - if s.AttributesToGet != nil && len(s.AttributesToGet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributesToGet", 1)) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.TotalSegments != nil && *s.TotalSegments < 1 { - invalidParams.Add(request.NewErrParamMinValue("TotalSegments", 1)) - } - if s.ScanFilter != nil { - for i, v := range s.ScanFilter { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScanFilter", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *ScanInput) SetAttributesToGet(v []*string) *ScanInput { - s.AttributesToGet = v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *ScanInput) SetConditionalOperator(v string) *ScanInput { - s.ConditionalOperator = &v - return s -} - -// SetConsistentRead sets the ConsistentRead field's value. -func (s *ScanInput) SetConsistentRead(v bool) *ScanInput { - s.ConsistentRead = &v - return s -} - -// SetExclusiveStartKey sets the ExclusiveStartKey field's value. -func (s *ScanInput) SetExclusiveStartKey(v map[string]*AttributeValue) *ScanInput { - s.ExclusiveStartKey = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *ScanInput) SetExpressionAttributeNames(v map[string]*string) *ScanInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *ScanInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *ScanInput { - s.ExpressionAttributeValues = v - return s -} - -// SetFilterExpression sets the FilterExpression field's value. -func (s *ScanInput) SetFilterExpression(v string) *ScanInput { - s.FilterExpression = &v - return s -} - -// SetIndexName sets the IndexName field's value. -func (s *ScanInput) SetIndexName(v string) *ScanInput { - s.IndexName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ScanInput) SetLimit(v int64) *ScanInput { - s.Limit = &v - return s -} - -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *ScanInput) SetProjectionExpression(v string) *ScanInput { - s.ProjectionExpression = &v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *ScanInput) SetReturnConsumedCapacity(v string) *ScanInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetScanFilter sets the ScanFilter field's value. -func (s *ScanInput) SetScanFilter(v map[string]*Condition) *ScanInput { - s.ScanFilter = v - return s -} - -// SetSegment sets the Segment field's value. -func (s *ScanInput) SetSegment(v int64) *ScanInput { - s.Segment = &v - return s -} - -// SetSelect sets the Select field's value. -func (s *ScanInput) SetSelect(v string) *ScanInput { - s.Select = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *ScanInput) SetTableName(v string) *ScanInput { - s.TableName = &v - return s -} - -// SetTotalSegments sets the TotalSegments field's value. -func (s *ScanInput) SetTotalSegments(v int64) *ScanInput { - s.TotalSegments = &v - return s -} - -// Represents the output of a Scan operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ScanOutput -type ScanOutput struct { - _ struct{} `type:"structure"` - - // The capacity units consumed by the Scan operation. The data returned includes - // the total provisioned throughput consumed, along with statistics for the - // table and any indexes involved in the operation. ConsumedCapacity is only - // returned if the ReturnConsumedCapacity parameter was specified. For more - // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // The number of items in the response. - // - // If you set ScanFilter in the request, then Count is the number of items returned - // after the filter was applied, and ScannedCount is the number of matching - // items before the filter was applied. - // - // If you did not use a filter in the request, then Count is the same as ScannedCount. - Count *int64 `type:"integer"` - - // An array of item attributes that match the scan criteria. Each element in - // this array consists of an attribute name and the value for that attribute. - Items []map[string]*AttributeValue `type:"list"` - - // The primary key of the item where the operation stopped, inclusive of the - // previous result set. Use this value to start a new operation, excluding this - // value in the new request. - // - // If LastEvaluatedKey is empty, then the "last page" of results has been processed - // and there is no more data to be retrieved. - // - // If LastEvaluatedKey is not empty, it does not necessarily mean that there - // is more data in the result set. The only way to know when you have reached - // the end of the result set is when LastEvaluatedKey is empty. - LastEvaluatedKey map[string]*AttributeValue `type:"map"` - - // The number of items evaluated, before any ScanFilter is applied. A high ScannedCount - // value with few, or no, Count results indicates an inefficient Scan operation. - // For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count) - // in the Amazon DynamoDB Developer Guide. - // - // If you did not use a filter in the request, then ScannedCount is the same - // as Count. - ScannedCount *int64 `type:"integer"` -} - -// String returns the string representation -func (s ScanOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScanOutput) GoString() string { - return s.String() -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *ScanOutput) SetConsumedCapacity(v *ConsumedCapacity) *ScanOutput { - s.ConsumedCapacity = v - return s -} - -// SetCount sets the Count field's value. -func (s *ScanOutput) SetCount(v int64) *ScanOutput { - s.Count = &v - return s -} - -// SetItems sets the Items field's value. -func (s *ScanOutput) SetItems(v []map[string]*AttributeValue) *ScanOutput { - s.Items = v - return s -} - -// SetLastEvaluatedKey sets the LastEvaluatedKey field's value. -func (s *ScanOutput) SetLastEvaluatedKey(v map[string]*AttributeValue) *ScanOutput { - s.LastEvaluatedKey = v - return s -} - -// SetScannedCount sets the ScannedCount field's value. -func (s *ScanOutput) SetScannedCount(v int64) *ScanOutput { - s.ScannedCount = &v - return s -} - -// Represents the DynamoDB Streams configuration for a table in DynamoDB. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/StreamSpecification -type StreamSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether DynamoDB Streams is enabled (true) or disabled (false) - // on the table. - StreamEnabled *bool `type:"boolean"` - - // When an item in the table is modified, StreamViewType determines what information - // is written to the stream for this table. Valid values for StreamViewType - // are: - // - // * KEYS_ONLY - Only the key attributes of the modified item are written - // to the stream. - // - // * NEW_IMAGE - The entire item, as it appears after it was modified, is - // written to the stream. - // - // * OLD_IMAGE - The entire item, as it appeared before it was modified, - // is written to the stream. - // - // * NEW_AND_OLD_IMAGES - Both the new and the old item images of the item - // are written to the stream. - StreamViewType *string `type:"string" enum:"StreamViewType"` -} - -// String returns the string representation -func (s StreamSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamSpecification) GoString() string { - return s.String() -} - -// SetStreamEnabled sets the StreamEnabled field's value. -func (s *StreamSpecification) SetStreamEnabled(v bool) *StreamSpecification { - s.StreamEnabled = &v - return s -} - -// SetStreamViewType sets the StreamViewType field's value. -func (s *StreamSpecification) SetStreamViewType(v string) *StreamSpecification { - s.StreamViewType = &v - return s -} - -// Represents the properties of a table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TableDescription -type TableDescription struct { - _ struct{} `type:"structure"` - - // An array of AttributeDefinition objects. Each of these objects describes - // one attribute in the table and index key schema. - // - // Each AttributeDefinition object in this array is composed of: - // - // * AttributeName - The name of the attribute. - // - // * AttributeType - The data type for the attribute. - AttributeDefinitions []*AttributeDefinition `type:"list"` - - // The date and time when the table was created, in UNIX epoch time (http://www.epochconverter.com/) - // format. - CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The global secondary indexes, if any, on the table. Each index is scoped - // to a given partition key value. Each element is composed of: - // - // * Backfilling - If true, then the index is currently in the backfilling - // phase. Backfilling occurs only when a new global secondary index is added - // to the table; it is the process by which DynamoDB populates the new index - // with data from the table. (This attribute does not appear for indexes - // that were created during a CreateTable operation.) - // - // * IndexName - The name of the global secondary index. - // - // * IndexSizeBytes - The total size of the global secondary index, in bytes. - // DynamoDB updates this value approximately every six hours. Recent changes - // might not be reflected in this value. - // - // * IndexStatus - The current status of the global secondary index: - // - // CREATING - The index is being created. - // - // UPDATING - The index is being updated. - // - // DELETING - The index is being deleted. - // - // ACTIVE - The index is ready for use. - // - // * ItemCount - The number of items in the global secondary index. DynamoDB - // updates this value approximately every six hours. Recent changes might - // not be reflected in this value. - // - // * KeySchema - Specifies the complete index key schema. The attribute names - // in the key schema must be between 1 and 255 characters (inclusive). The - // key schema must begin with the same partition key as the table. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - // - // * ProvisionedThroughput - The provisioned throughput settings for the - // global secondary index, consisting of read and write capacity units, along - // with data about increases and decreases. - // - // If the table is in the DELETING state, no information about indexes will - // be returned. - GlobalSecondaryIndexes []*GlobalSecondaryIndexDescription `type:"list"` - - // The number of items in the specified table. DynamoDB updates this value approximately - // every six hours. Recent changes might not be reflected in this value. - ItemCount *int64 `type:"long"` - - // The primary key structure for the table. Each KeySchemaElement consists of: - // - // * AttributeName - The name of the attribute. - // - // * KeyType - The role of the attribute: - // - // HASH - partition key - // - // RANGE - sort key - // - // The partition key of an item is also known as its hash attribute. The term - // "hash attribute" derives from DynamoDB' usage of an internal hash function - // to evenly distribute data items across partitions, based on their partition - // key values. - // - // The sort key of an item is also known as its range attribute. The term "range - // attribute" derives from the way DynamoDB stores items with the same partition - // key physically close together, in sorted order by the sort key value. - // - // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey) - // in the Amazon DynamoDB Developer Guide. - KeySchema []*KeySchemaElement `min:"1" type:"list"` - - // The Amazon Resource Name (ARN) that uniquely identifies the latest stream - // for this table. - LatestStreamArn *string `min:"37" type:"string"` - - // A timestamp, in ISO 8601 format, for this stream. - // - // Note that LatestStreamLabel is not a unique identifier for the stream, because - // it is possible that a stream from another table might have the same timestamp. - // However, the combination of the following three elements is guaranteed to - // be unique: - // - // * the AWS customer ID. - // - // * the table name. - // - // * the StreamLabel. - LatestStreamLabel *string `type:"string"` - - // Represents one or more local secondary indexes on the table. Each index is - // scoped to a given partition key value. Tables with one or more local secondary - // indexes are subject to an item collection size limit, where the amount of - // data within a given item collection cannot exceed 10 GB. Each element is - // composed of: - // - // * IndexName - The name of the local secondary index. - // - // * KeySchema - Specifies the complete index key schema. The attribute names - // in the key schema must be between 1 and 255 characters (inclusive). The - // key schema must begin with the same partition key as the table. - // - // * Projection - Specifies attributes that are copied (projected) from the - // table into the index. These are in addition to the primary key attributes - // and index key attributes, which are automatically projected. Each attribute - // specification is composed of: - // - // ProjectionType - One of the following: - // - // KEYS_ONLY - Only the index and primary keys are projected into the index. - // - // INCLUDE - Only the specified table attributes are projected into the index. - // The list of projected attributes are in NonKeyAttributes. - // - // ALL - All of the table attributes are projected into the index. - // - // NonKeyAttributes - A list of one or more non-key attribute names that are - // projected into the secondary index. The total count of attributes provided - // in NonKeyAttributes, summed across all of the secondary indexes, must - // not exceed 20. If you project the same attribute into two different indexes, - // this counts as two distinct attributes when determining the total. - // - // * IndexSizeBytes - Represents the total size of the index, in bytes. DynamoDB - // updates this value approximately every six hours. Recent changes might - // not be reflected in this value. - // - // * ItemCount - Represents the number of items in the index. DynamoDB updates - // this value approximately every six hours. Recent changes might not be - // reflected in this value. - // - // If the table is in the DELETING state, no information about indexes will - // be returned. - LocalSecondaryIndexes []*LocalSecondaryIndexDescription `type:"list"` - - // The provisioned throughput settings for the table, consisting of read and - // write capacity units, along with data about increases and decreases. - ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"` - - // The current DynamoDB Streams configuration for the table. - StreamSpecification *StreamSpecification `type:"structure"` - - // The Amazon Resource Name (ARN) that uniquely identifies the table. - TableArn *string `type:"string"` - - // The name of the table. - TableName *string `min:"3" type:"string"` - - // The total size of the specified table, in bytes. DynamoDB updates this value - // approximately every six hours. Recent changes might not be reflected in this - // value. - TableSizeBytes *int64 `type:"long"` - - // The current state of the table: - // - // * CREATING - The table is being created. - // - // * UPDATING - The table is being updated. - // - // * DELETING - The table is being deleted. - // - // * ACTIVE - The table is ready for use. - TableStatus *string `type:"string" enum:"TableStatus"` -} - -// String returns the string representation -func (s TableDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TableDescription) GoString() string { - return s.String() -} - -// SetAttributeDefinitions sets the AttributeDefinitions field's value. -func (s *TableDescription) SetAttributeDefinitions(v []*AttributeDefinition) *TableDescription { - s.AttributeDefinitions = v - return s -} - -// SetCreationDateTime sets the CreationDateTime field's value. -func (s *TableDescription) SetCreationDateTime(v time.Time) *TableDescription { - s.CreationDateTime = &v - return s -} - -// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. -func (s *TableDescription) SetGlobalSecondaryIndexes(v []*GlobalSecondaryIndexDescription) *TableDescription { - s.GlobalSecondaryIndexes = v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *TableDescription) SetItemCount(v int64) *TableDescription { - s.ItemCount = &v - return s -} - -// SetKeySchema sets the KeySchema field's value. -func (s *TableDescription) SetKeySchema(v []*KeySchemaElement) *TableDescription { - s.KeySchema = v - return s -} - -// SetLatestStreamArn sets the LatestStreamArn field's value. -func (s *TableDescription) SetLatestStreamArn(v string) *TableDescription { - s.LatestStreamArn = &v - return s -} - -// SetLatestStreamLabel sets the LatestStreamLabel field's value. -func (s *TableDescription) SetLatestStreamLabel(v string) *TableDescription { - s.LatestStreamLabel = &v - return s -} - -// SetLocalSecondaryIndexes sets the LocalSecondaryIndexes field's value. -func (s *TableDescription) SetLocalSecondaryIndexes(v []*LocalSecondaryIndexDescription) *TableDescription { - s.LocalSecondaryIndexes = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *TableDescription) SetProvisionedThroughput(v *ProvisionedThroughputDescription) *TableDescription { - s.ProvisionedThroughput = v - return s -} - -// SetStreamSpecification sets the StreamSpecification field's value. -func (s *TableDescription) SetStreamSpecification(v *StreamSpecification) *TableDescription { - s.StreamSpecification = v - return s -} - -// SetTableArn sets the TableArn field's value. -func (s *TableDescription) SetTableArn(v string) *TableDescription { - s.TableArn = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *TableDescription) SetTableName(v string) *TableDescription { - s.TableName = &v - return s -} - -// SetTableSizeBytes sets the TableSizeBytes field's value. -func (s *TableDescription) SetTableSizeBytes(v int64) *TableDescription { - s.TableSizeBytes = &v - return s -} - -// SetTableStatus sets the TableStatus field's value. -func (s *TableDescription) SetTableStatus(v string) *TableDescription { - s.TableStatus = &v - return s -} - -// Describes a tag. A tag is a key-value pair. You can add up to 50 tags to -// a single DynamoDB table. -// -// AWS-assigned tag names and values are automatically assigned the aws: prefix, -// which the user cannot assign. AWS-assigned tag names do not count towards -// the tag limit of 50. User-assigned tag names have the prefix user: in the -// Cost Allocation Report. You cannot backdate the application of a tag. -// -// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) -// in the Amazon DynamoDB Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag.Tag keys are case sensitive. Each DynamoDB table can only - // have up to one tag with the same key. If you try to add an existing tag (same - // key), the existing tag value will be updated to the new value. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of the tag. Tag values are case-sensitive and can be null. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TagResourceInput -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // Identifies the Amazon DynamoDB resource to which tags should be added. This - // value is an Amazon Resource Name (ARN). - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` - - // The tags to be assigned to the Amazon DynamoDB resource. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// String returns the string representation -func (s TagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TagResourceOutput -type TagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s TagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagResourceOutput) GoString() string { - return s.String() -} - -// The description of the Time to Live (TTL) status on the specified table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TimeToLiveDescription -type TimeToLiveDescription struct { - _ struct{} `type:"structure"` - - // The name of the Time to Live attribute for items in the table. - AttributeName *string `min:"1" type:"string"` - - // The Time to Live status for the table. - TimeToLiveStatus *string `type:"string" enum:"TimeToLiveStatus"` -} - -// String returns the string representation -func (s TimeToLiveDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeToLiveDescription) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *TimeToLiveDescription) SetAttributeName(v string) *TimeToLiveDescription { - s.AttributeName = &v - return s -} - -// SetTimeToLiveStatus sets the TimeToLiveStatus field's value. -func (s *TimeToLiveDescription) SetTimeToLiveStatus(v string) *TimeToLiveDescription { - s.TimeToLiveStatus = &v - return s -} - -// Represents the settings used to enable or disable Time to Live for the specified -// table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TimeToLiveSpecification -type TimeToLiveSpecification struct { - _ struct{} `type:"structure"` - - // The name of the Time to Live attribute used to store the expiration time - // for items in the table. - // - // AttributeName is a required field - AttributeName *string `min:"1" type:"string" required:"true"` - - // Indicates whether Time To Live is to be enabled (true) or disabled (false) - // on the table. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s TimeToLiveSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeToLiveSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TimeToLiveSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TimeToLiveSpecification"} - if s.AttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeName")) - } - if s.AttributeName != nil && len(*s.AttributeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeName", 1)) - } - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeName sets the AttributeName field's value. -func (s *TimeToLiveSpecification) SetAttributeName(v string) *TimeToLiveSpecification { - s.AttributeName = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *TimeToLiveSpecification) SetEnabled(v bool) *TimeToLiveSpecification { - s.Enabled = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResourceInput -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon DyanamoDB resource the tags will be removed from. This value is - // an Amazon Resource Name (ARN). - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` - - // A list of tag keys. Existing tags of the resource whose keys are members - // of this list will be removed from the Amazon DynamoDB resource. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s UntagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UntagResourceOutput -type UntagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UntagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UntagResourceOutput) GoString() string { - return s.String() -} - -// Represents the new provisioned throughput settings to be applied to a global -// secondary index. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateGlobalSecondaryIndexAction -type UpdateGlobalSecondaryIndexAction struct { - _ struct{} `type:"structure"` - - // The name of the global secondary index to be updated. - // - // IndexName is a required field - IndexName *string `min:"3" type:"string" required:"true"` - - // Represents the provisioned throughput settings for the specified global secondary - // index. - // - // For current minimum and maximum provisioned throughput values, see Limits - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - // in the Amazon DynamoDB Developer Guide. - // - // ProvisionedThroughput is a required field - ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateGlobalSecondaryIndexAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateGlobalSecondaryIndexAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGlobalSecondaryIndexAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGlobalSecondaryIndexAction"} - if s.IndexName == nil { - invalidParams.Add(request.NewErrParamRequired("IndexName")) - } - if s.IndexName != nil && len(*s.IndexName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) - } - if s.ProvisionedThroughput == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput")) - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexName sets the IndexName field's value. -func (s *UpdateGlobalSecondaryIndexAction) SetIndexName(v string) *UpdateGlobalSecondaryIndexAction { - s.IndexName = &v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *UpdateGlobalSecondaryIndexAction) SetProvisionedThroughput(v *ProvisionedThroughput) *UpdateGlobalSecondaryIndexAction { - s.ProvisionedThroughput = v - return s -} - -// Represents the input of an UpdateItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItemInput -type UpdateItemInput struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use UpdateExpression instead. For more information, - // see AttributeUpdates (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html) - // in the Amazon DynamoDB Developer Guide. - AttributeUpdates map[string]*AttributeValueUpdate `type:"map"` - - // A condition that must be satisfied in order for a conditional update to succeed. - // - // An expression can contain any of the following: - // - // * Functions: attribute_exists | attribute_not_exists | attribute_type - // | contains | begins_with | size - // - // These function names are case-sensitive. - // - // * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN - // - // * Logical operators: AND | OR | NOT - // - // For more information on condition expressions, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ConditionExpression *string `type:"string"` - - // This is a legacy parameter. Use ConditionExpression instead. For more information, - // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` - - // This is a legacy parameter. Use ConditionExpresssion instead. For more information, - // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - // in the Amazon DynamoDB Developer Guide. - Expected map[string]*ExpectedAttributeValue `type:"map"` - - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: - // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. - // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. - // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. - // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: - // - // * Percentile - // - // The name of this attribute conflicts with a reserved word, so it cannot be - // used directly in an expression. (For the complete list of reserved words, - // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - // in the Amazon DynamoDB Developer Guide). To work around this, you could specify - // the following for ExpressionAttributeNames: - // - // * {"#P":"Percentile"} - // - // You could then use this substitution in an expression, as in this example: - // - // * #P = :val - // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. - // - // For more information on expression attribute names, see Accessing Item Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute - // value. For example, suppose that you wanted to check whether the value of - // the ProductStatus attribute was one of the following: - // - // Available | Backordered | Discontinued - // - // You would first need to specify ExpressionAttributeValues as follows: - // - // { ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} - // } - // - // You could then use these values in an expression, such as this: - // - // ProductStatus IN (:avail, :back, :disc) - // - // For more information on expression attribute values, see Specifying Conditions - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // The primary key of the item to be updated. Each element consists of an attribute - // name and a value for that attribute. - // - // For the primary key, you must provide all of the attributes. For example, - // with a simple primary key, you only need to provide a value for the partition - // key. For a composite primary key, you must provide values for both the partition - // key and the sort key. - // - // Key is a required field - Key map[string]*AttributeValue `type:"map" required:"true"` - - // Determines the level of detail about provisioned throughput consumption that - // is returned in the response: - // - // * INDEXES - The response includes the aggregate ConsumedCapacity for the - // operation, together with ConsumedCapacity for each table and secondary - // index that was accessed. - // - // Note that some operations, such as GetItem and BatchGetItem, do not access - // any indexes at all. In these cases, specifying INDEXES will only return - // ConsumedCapacity information for table(s). - // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. - // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` - - // Determines whether item collection metrics are returned. If set to SIZE, - // the response includes statistics about item collections, if any, that were - // modified during the operation are returned in the response. If set to NONE - // (the default), no statistics are returned. - ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"` - - // Use ReturnValues if you want to get the item attributes as they appeared - // either before or after they were updated. For UpdateItem, the valid values - // are: - // - // * NONE - If ReturnValues is not specified, or if its value is NONE, then - // nothing is returned. (This setting is the default for ReturnValues.) - // - // * ALL_OLD - Returns all of the attributes of the item, as they appeared - // before the UpdateItem operation. - // - // * UPDATED_OLD - Returns only the updated attributes, as they appeared - // before the UpdateItem operation. - // - // * ALL_NEW - Returns all of the attributes of the item, as they appear - // after the UpdateItem operation. - // - // * UPDATED_NEW - Returns only the updated attributes, as they appear after - // the UpdateItem operation. - // - // There is no additional cost associated with requesting a return value aside - // from the small network and processing overhead of receiving a larger response. - // No Read Capacity Units are consumed. - // - // Values returned are strongly consistent - ReturnValues *string `type:"string" enum:"ReturnValue"` - - // The name of the table containing the item to update. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` - - // An expression that defines one or more attributes to be updated, the action - // to be performed on them, and new value(s) for them. - // - // The following action values are available for UpdateExpression. - // - // * SET - Adds one or more attributes and values to an item. If any of these - // attribute already exist, they are replaced by the new values. You can - // also use SET to add or subtract from an attribute that is of type Number. - // For example: SET myNum = myNum + :val - // - // SET supports the following functions: - // - // if_not_exists (path, operand) - if the item does not contain an attribute - // at the specified path, then if_not_exists evaluates to operand; otherwise, - // it evaluates to path. You can use this function to avoid overwriting an - // attribute that may already be present in the item. - // - // list_append (operand, operand) - evaluates to a list with a new element added - // to it. You can append the new element to the start or the end of the list - // by reversing the order of the operands. - // - // These function names are case-sensitive. - // - // * REMOVE - Removes one or more attributes from an item. - // - // * ADD - Adds the specified value to the item, if the attribute does not - // already exist. If the attribute does exist, then the behavior of ADD depends - // on the data type of the attribute: - // - // If the existing attribute is a number, and if Value is also a number, then - // Value is mathematically added to the existing attribute. If Value is a - // negative number, then it is subtracted from the existing attribute. - // - // If you use ADD to increment or decrement a number value for an item that - // doesn't exist before the update, DynamoDB uses 0 as the initial value. - // - // Similarly, if you use ADD for an existing item to increment or decrement - // an attribute value that doesn't exist before the update, DynamoDB uses - // 0 as the initial value. For example, suppose that the item you want to - // update doesn't have an attribute named itemcount, but you decide to ADD - // the number 3 to this attribute anyway. DynamoDB will create the itemcount - // attribute, set its initial value to 0, and finally add 3 to it. The result - // will be a new itemcount attribute in the item, with a value of 3. - // - // If the existing data type is a set and if Value is also a set, then Value - // is added to the existing set. For example, if the attribute value is the - // set [1,2], and the ADD action specified [3], then the final attribute - // value is [1,2,3]. An error occurs if an ADD action is specified for a - // set attribute and the attribute type specified does not match the existing - // set type. - // - // Both sets must have the same primitive data type. For example, if the existing - // data type is a set of strings, the Value must also be a set of strings. - // - // The ADD action only supports Number and set data types. In addition, ADD - // can only be used on top-level attributes, not nested attributes. - // - // * DELETE - Deletes an element from a set. - // - // If a set of values is specified, then those values are subtracted from the - // old set. For example, if the attribute value was the set [a,b,c] and the - // DELETE action specifies [a,c], then the final attribute value is [b]. - // Specifying an empty set is an error. - // - // The DELETE action only supports set data types. In addition, DELETE can only - // be used on top-level attributes, not nested attributes. - // - // You can have many actions in a single expression, such as the following: - // SET a=:value1, b=:value2 DELETE :value3, :value4, :value5 - // - // For more information on update expressions, see Modifying Items and Attributes - // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html) - // in the Amazon DynamoDB Developer Guide. - UpdateExpression *string `type:"string"` -} - -// String returns the string representation -func (s UpdateItemInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateItemInput"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeUpdates sets the AttributeUpdates field's value. -func (s *UpdateItemInput) SetAttributeUpdates(v map[string]*AttributeValueUpdate) *UpdateItemInput { - s.AttributeUpdates = v - return s -} - -// SetConditionExpression sets the ConditionExpression field's value. -func (s *UpdateItemInput) SetConditionExpression(v string) *UpdateItemInput { - s.ConditionExpression = &v - return s -} - -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *UpdateItemInput) SetConditionalOperator(v string) *UpdateItemInput { - s.ConditionalOperator = &v - return s -} - -// SetExpected sets the Expected field's value. -func (s *UpdateItemInput) SetExpected(v map[string]*ExpectedAttributeValue) *UpdateItemInput { - s.Expected = v - return s -} - -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *UpdateItemInput) SetExpressionAttributeNames(v map[string]*string) *UpdateItemInput { - s.ExpressionAttributeNames = v - return s -} - -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *UpdateItemInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *UpdateItemInput { - s.ExpressionAttributeValues = v - return s -} - -// SetKey sets the Key field's value. -func (s *UpdateItemInput) SetKey(v map[string]*AttributeValue) *UpdateItemInput { - s.Key = v - return s -} - -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *UpdateItemInput) SetReturnConsumedCapacity(v string) *UpdateItemInput { - s.ReturnConsumedCapacity = &v - return s -} - -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *UpdateItemInput) SetReturnItemCollectionMetrics(v string) *UpdateItemInput { - s.ReturnItemCollectionMetrics = &v - return s -} - -// SetReturnValues sets the ReturnValues field's value. -func (s *UpdateItemInput) SetReturnValues(v string) *UpdateItemInput { - s.ReturnValues = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *UpdateItemInput) SetTableName(v string) *UpdateItemInput { - s.TableName = &v - return s -} - -// SetUpdateExpression sets the UpdateExpression field's value. -func (s *UpdateItemInput) SetUpdateExpression(v string) *UpdateItemInput { - s.UpdateExpression = &v - return s -} - -// Represents the output of an UpdateItem operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItemOutput -type UpdateItemOutput struct { - _ struct{} `type:"structure"` - - // A map of attribute values as they appeared before the UpdateItem operation. - // This map only appears if ReturnValues was specified as something other than - // NONE in the request. Each element represents one attribute. - Attributes map[string]*AttributeValue `type:"map"` - - // The capacity units consumed by the UpdateItem operation. The data returned - // includes the total provisioned throughput consumed, along with statistics - // for the table and any indexes involved in the operation. ConsumedCapacity - // is only returned if the ReturnConsumedCapacity parameter was specified. For - // more information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` - - // Information about item collections, if any, that were affected by the UpdateItem - // operation. ItemCollectionMetrics is only returned if the ReturnItemCollectionMetrics - // parameter was specified. If the table does not have any local secondary indexes, - // this information is not returned in the response. - // - // Each ItemCollectionMetrics element consists of: - // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item itself. - // - // * SizeEstimateRange - An estimate of item collection size, in gigabytes. - // This value is a two-element array containing a lower bound and an upper - // bound for the estimate. The estimate includes the size of all the items - // in the table, plus the size of all attributes projected into all of the - // local secondary indexes on that table. Use this estimate to measure whether - // a local secondary index is approaching its size limit. - // - // The estimate is subject to change over time; therefore, do not rely on the - // precision or accuracy of the estimate. - ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"` -} - -// String returns the string representation -func (s UpdateItemOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateItemOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *UpdateItemOutput) SetAttributes(v map[string]*AttributeValue) *UpdateItemOutput { - s.Attributes = v - return s -} - -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *UpdateItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *UpdateItemOutput { - s.ConsumedCapacity = v - return s -} - -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *UpdateItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *UpdateItemOutput { - s.ItemCollectionMetrics = v - return s -} - -// Represents the input of an UpdateTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTableInput -type UpdateTableInput struct { - _ struct{} `type:"structure"` - - // An array of attributes that describe the key schema for the table and indexes. - // If you are adding a new global secondary index to the table, AttributeDefinitions - // must include the key element(s) of the new index. - AttributeDefinitions []*AttributeDefinition `type:"list"` - - // An array of one or more global secondary indexes for the table. For each - // index in the array, you can request one action: - // - // * Create - add a new global secondary index to the table. - // - // * Update - modify the provisioned throughput settings of an existing global - // secondary index. - // - // * Delete - remove a global secondary index from the table. - // - // For more information, see Managing Global Secondary Indexes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html) - // in the Amazon DynamoDB Developer Guide. - GlobalSecondaryIndexUpdates []*GlobalSecondaryIndexUpdate `type:"list"` - - // The new provisioned throughput settings for the specified table or index. - ProvisionedThroughput *ProvisionedThroughput `type:"structure"` - - // Represents the DynamoDB Streams configuration for the table. - // - // You will receive a ResourceInUseException if you attempt to enable a stream - // on a table that already has a stream, or if you attempt to disable a stream - // on a table which does not have a stream. - StreamSpecification *StreamSpecification `type:"structure"` - - // The name of the table to be updated. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTableInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.AttributeDefinitions != nil { - for i, v := range s.AttributeDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AttributeDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.GlobalSecondaryIndexUpdates != nil { - for i, v := range s.GlobalSecondaryIndexUpdates { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexUpdates", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ProvisionedThroughput != nil { - if err := s.ProvisionedThroughput.Validate(); err != nil { - invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeDefinitions sets the AttributeDefinitions field's value. -func (s *UpdateTableInput) SetAttributeDefinitions(v []*AttributeDefinition) *UpdateTableInput { - s.AttributeDefinitions = v - return s -} - -// SetGlobalSecondaryIndexUpdates sets the GlobalSecondaryIndexUpdates field's value. -func (s *UpdateTableInput) SetGlobalSecondaryIndexUpdates(v []*GlobalSecondaryIndexUpdate) *UpdateTableInput { - s.GlobalSecondaryIndexUpdates = v - return s -} - -// SetProvisionedThroughput sets the ProvisionedThroughput field's value. -func (s *UpdateTableInput) SetProvisionedThroughput(v *ProvisionedThroughput) *UpdateTableInput { - s.ProvisionedThroughput = v - return s -} - -// SetStreamSpecification sets the StreamSpecification field's value. -func (s *UpdateTableInput) SetStreamSpecification(v *StreamSpecification) *UpdateTableInput { - s.StreamSpecification = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *UpdateTableInput) SetTableName(v string) *UpdateTableInput { - s.TableName = &v - return s -} - -// Represents the output of an UpdateTable operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTableOutput -type UpdateTableOutput struct { - _ struct{} `type:"structure"` - - // Represents the properties of the table. - TableDescription *TableDescription `type:"structure"` -} - -// String returns the string representation -func (s UpdateTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTableOutput) GoString() string { - return s.String() -} - -// SetTableDescription sets the TableDescription field's value. -func (s *UpdateTableOutput) SetTableDescription(v *TableDescription) *UpdateTableOutput { - s.TableDescription = v - return s -} - -// Represents the input of an UpdateTimeToLive operation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLiveInput -type UpdateTimeToLiveInput struct { - _ struct{} `type:"structure"` - - // The name of the table to be configured. - // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` - - // Represents the settings used to enable or disable Time to Live for the specified - // table. - // - // TimeToLiveSpecification is a required field - TimeToLiveSpecification *TimeToLiveSpecification `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateTimeToLiveInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTimeToLiveInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTimeToLiveInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTimeToLiveInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - if s.TimeToLiveSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("TimeToLiveSpecification")) - } - if s.TimeToLiveSpecification != nil { - if err := s.TimeToLiveSpecification.Validate(); err != nil { - invalidParams.AddNested("TimeToLiveSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *UpdateTimeToLiveInput) SetTableName(v string) *UpdateTimeToLiveInput { - s.TableName = &v - return s -} - -// SetTimeToLiveSpecification sets the TimeToLiveSpecification field's value. -func (s *UpdateTimeToLiveInput) SetTimeToLiveSpecification(v *TimeToLiveSpecification) *UpdateTimeToLiveInput { - s.TimeToLiveSpecification = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLiveOutput -type UpdateTimeToLiveOutput struct { - _ struct{} `type:"structure"` - - // Represents the output of an UpdateTimeToLive operation. - TimeToLiveSpecification *TimeToLiveSpecification `type:"structure"` -} - -// String returns the string representation -func (s UpdateTimeToLiveOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTimeToLiveOutput) GoString() string { - return s.String() -} - -// SetTimeToLiveSpecification sets the TimeToLiveSpecification field's value. -func (s *UpdateTimeToLiveOutput) SetTimeToLiveSpecification(v *TimeToLiveSpecification) *UpdateTimeToLiveOutput { - s.TimeToLiveSpecification = v - return s -} - -// Represents an operation to perform - either DeleteItem or PutItem. You can -// only request one of these operations, not both, in a single WriteRequest. -// If you do need to perform both of these operations, you will need to provide -// two separate WriteRequest objects. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/WriteRequest -type WriteRequest struct { - _ struct{} `type:"structure"` - - // A request to perform a DeleteItem operation. - DeleteRequest *DeleteRequest `type:"structure"` - - // A request to perform a PutItem operation. - PutRequest *PutRequest `type:"structure"` -} - -// String returns the string representation -func (s WriteRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WriteRequest) GoString() string { - return s.String() -} - -// SetDeleteRequest sets the DeleteRequest field's value. -func (s *WriteRequest) SetDeleteRequest(v *DeleteRequest) *WriteRequest { - s.DeleteRequest = v - return s -} - -// SetPutRequest sets the PutRequest field's value. -func (s *WriteRequest) SetPutRequest(v *PutRequest) *WriteRequest { - s.PutRequest = v - return s -} - -const ( - // AttributeActionAdd is a AttributeAction enum value - AttributeActionAdd = "ADD" - - // AttributeActionPut is a AttributeAction enum value - AttributeActionPut = "PUT" - - // AttributeActionDelete is a AttributeAction enum value - AttributeActionDelete = "DELETE" -) - -const ( - // ComparisonOperatorEq is a ComparisonOperator enum value - ComparisonOperatorEq = "EQ" - - // ComparisonOperatorNe is a ComparisonOperator enum value - ComparisonOperatorNe = "NE" - - // ComparisonOperatorIn is a ComparisonOperator enum value - ComparisonOperatorIn = "IN" - - // ComparisonOperatorLe is a ComparisonOperator enum value - ComparisonOperatorLe = "LE" - - // ComparisonOperatorLt is a ComparisonOperator enum value - ComparisonOperatorLt = "LT" - - // ComparisonOperatorGe is a ComparisonOperator enum value - ComparisonOperatorGe = "GE" - - // ComparisonOperatorGt is a ComparisonOperator enum value - ComparisonOperatorGt = "GT" - - // ComparisonOperatorBetween is a ComparisonOperator enum value - ComparisonOperatorBetween = "BETWEEN" - - // ComparisonOperatorNotNull is a ComparisonOperator enum value - ComparisonOperatorNotNull = "NOT_NULL" - - // ComparisonOperatorNull is a ComparisonOperator enum value - ComparisonOperatorNull = "NULL" - - // ComparisonOperatorContains is a ComparisonOperator enum value - ComparisonOperatorContains = "CONTAINS" - - // ComparisonOperatorNotContains is a ComparisonOperator enum value - ComparisonOperatorNotContains = "NOT_CONTAINS" - - // ComparisonOperatorBeginsWith is a ComparisonOperator enum value - ComparisonOperatorBeginsWith = "BEGINS_WITH" -) - -const ( - // ConditionalOperatorAnd is a ConditionalOperator enum value - ConditionalOperatorAnd = "AND" - - // ConditionalOperatorOr is a ConditionalOperator enum value - ConditionalOperatorOr = "OR" -) - -const ( - // IndexStatusCreating is a IndexStatus enum value - IndexStatusCreating = "CREATING" - - // IndexStatusUpdating is a IndexStatus enum value - IndexStatusUpdating = "UPDATING" - - // IndexStatusDeleting is a IndexStatus enum value - IndexStatusDeleting = "DELETING" - - // IndexStatusActive is a IndexStatus enum value - IndexStatusActive = "ACTIVE" -) - -const ( - // KeyTypeHash is a KeyType enum value - KeyTypeHash = "HASH" - - // KeyTypeRange is a KeyType enum value - KeyTypeRange = "RANGE" -) - -const ( - // ProjectionTypeAll is a ProjectionType enum value - ProjectionTypeAll = "ALL" - - // ProjectionTypeKeysOnly is a ProjectionType enum value - ProjectionTypeKeysOnly = "KEYS_ONLY" - - // ProjectionTypeInclude is a ProjectionType enum value - ProjectionTypeInclude = "INCLUDE" -) - -// Determines the level of detail about provisioned throughput consumption that -// is returned in the response: -// -// * INDEXES - The response includes the aggregate ConsumedCapacity for the -// operation, together with ConsumedCapacity for each table and secondary -// index that was accessed. -// -// Note that some operations, such as GetItem and BatchGetItem, do not access -// any indexes at all. In these cases, specifying INDEXES will only return -// ConsumedCapacity information for table(s). -// -// * TOTAL - The response includes only the aggregate ConsumedCapacity for -// the operation. -// -// * NONE - No ConsumedCapacity details are included in the response. -const ( - // ReturnConsumedCapacityIndexes is a ReturnConsumedCapacity enum value - ReturnConsumedCapacityIndexes = "INDEXES" - - // ReturnConsumedCapacityTotal is a ReturnConsumedCapacity enum value - ReturnConsumedCapacityTotal = "TOTAL" - - // ReturnConsumedCapacityNone is a ReturnConsumedCapacity enum value - ReturnConsumedCapacityNone = "NONE" -) - -const ( - // ReturnItemCollectionMetricsSize is a ReturnItemCollectionMetrics enum value - ReturnItemCollectionMetricsSize = "SIZE" - - // ReturnItemCollectionMetricsNone is a ReturnItemCollectionMetrics enum value - ReturnItemCollectionMetricsNone = "NONE" -) - -const ( - // ReturnValueNone is a ReturnValue enum value - ReturnValueNone = "NONE" - - // ReturnValueAllOld is a ReturnValue enum value - ReturnValueAllOld = "ALL_OLD" - - // ReturnValueUpdatedOld is a ReturnValue enum value - ReturnValueUpdatedOld = "UPDATED_OLD" - - // ReturnValueAllNew is a ReturnValue enum value - ReturnValueAllNew = "ALL_NEW" - - // ReturnValueUpdatedNew is a ReturnValue enum value - ReturnValueUpdatedNew = "UPDATED_NEW" -) - -const ( - // ScalarAttributeTypeS is a ScalarAttributeType enum value - ScalarAttributeTypeS = "S" - - // ScalarAttributeTypeN is a ScalarAttributeType enum value - ScalarAttributeTypeN = "N" - - // ScalarAttributeTypeB is a ScalarAttributeType enum value - ScalarAttributeTypeB = "B" -) - -const ( - // SelectAllAttributes is a Select enum value - SelectAllAttributes = "ALL_ATTRIBUTES" - - // SelectAllProjectedAttributes is a Select enum value - SelectAllProjectedAttributes = "ALL_PROJECTED_ATTRIBUTES" - - // SelectSpecificAttributes is a Select enum value - SelectSpecificAttributes = "SPECIFIC_ATTRIBUTES" - - // SelectCount is a Select enum value - SelectCount = "COUNT" -) - -const ( - // StreamViewTypeNewImage is a StreamViewType enum value - StreamViewTypeNewImage = "NEW_IMAGE" - - // StreamViewTypeOldImage is a StreamViewType enum value - StreamViewTypeOldImage = "OLD_IMAGE" - - // StreamViewTypeNewAndOldImages is a StreamViewType enum value - StreamViewTypeNewAndOldImages = "NEW_AND_OLD_IMAGES" - - // StreamViewTypeKeysOnly is a StreamViewType enum value - StreamViewTypeKeysOnly = "KEYS_ONLY" -) - -const ( - // TableStatusCreating is a TableStatus enum value - TableStatusCreating = "CREATING" - - // TableStatusUpdating is a TableStatus enum value - TableStatusUpdating = "UPDATING" - - // TableStatusDeleting is a TableStatus enum value - TableStatusDeleting = "DELETING" - - // TableStatusActive is a TableStatus enum value - TableStatusActive = "ACTIVE" -) - -const ( - // TimeToLiveStatusEnabling is a TimeToLiveStatus enum value - TimeToLiveStatusEnabling = "ENABLING" - - // TimeToLiveStatusDisabling is a TimeToLiveStatus enum value - TimeToLiveStatusDisabling = "DISABLING" - - // TimeToLiveStatusEnabled is a TimeToLiveStatus enum value - TimeToLiveStatusEnabled = "ENABLED" - - // TimeToLiveStatusDisabled is a TimeToLiveStatus enum value - TimeToLiveStatusDisabled = "DISABLED" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go deleted file mode 100644 index 333e61b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations.go +++ /dev/null @@ -1,109 +0,0 @@ -package dynamodb - -import ( - "bytes" - "hash/crc32" - "io" - "io/ioutil" - "math" - "strconv" - "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" -) - -type retryer struct { - client.DefaultRetryer -} - -func (d retryer) RetryRules(r *request.Request) time.Duration { - delay := time.Duration(math.Pow(2, float64(r.RetryCount))) * 50 - return delay * time.Millisecond -} - -func init() { - initClient = func(c *client.Client) { - if c.Config.Retryer == nil { - // Only override the retryer with a custom one if the config - // does not already contain a retryer - setCustomRetryer(c) - } - - c.Handlers.Build.PushBack(disableCompression) - c.Handlers.Unmarshal.PushFront(validateCRC32) - } -} - -func setCustomRetryer(c *client.Client) { - maxRetries := aws.IntValue(c.Config.MaxRetries) - if c.Config.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries { - maxRetries = 10 - } - - c.Retryer = retryer{ - DefaultRetryer: client.DefaultRetryer{ - NumMaxRetries: maxRetries, - }, - } -} - -func drainBody(b io.ReadCloser, length int64) (out *bytes.Buffer, err error) { - if length < 0 { - length = 0 - } - buf := bytes.NewBuffer(make([]byte, 0, length)) - - if _, err = buf.ReadFrom(b); err != nil { - return nil, err - } - if err = b.Close(); err != nil { - return nil, err - } - return buf, nil -} - -func disableCompression(r *request.Request) { - r.HTTPRequest.Header.Set("Accept-Encoding", "identity") -} - -func validateCRC32(r *request.Request) { - if r.Error != nil { - return // already have an error, no need to verify CRC - } - - // Checksum validation is off, skip - if aws.BoolValue(r.Config.DisableComputeChecksums) { - return - } - - // Try to get CRC from response - header := r.HTTPResponse.Header.Get("X-Amz-Crc32") - if header == "" { - return // No header, skip - } - - expected, err := strconv.ParseUint(header, 10, 32) - if err != nil { - return // Could not determine CRC value, skip - } - - buf, err := drainBody(r.HTTPResponse.Body, r.HTTPResponse.ContentLength) - if err != nil { // failed to read the response body, skip - return - } - - // Reset body for subsequent reads - r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewReader(buf.Bytes())) - - // Compute the CRC checksum - crc := crc32.ChecksumIEEE(buf.Bytes()) - - if crc != uint32(expected) { - // CRC does not match, set a retryable error - r.Retryable = aws.Bool(true) - r.Error = awserr.New("CRC32CheckFailed", "CRC32 integrity check failed", nil) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations_test.go deleted file mode 100644 index 0247d56..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/customizations_test.go +++ /dev/null @@ -1,153 +0,0 @@ -package dynamodb_test - -import ( - "bytes" - "io/ioutil" - "net/http" - "os" - "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/request" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -var db *dynamodb.DynamoDB - -func TestMain(m *testing.M) { - db = dynamodb.New(unit.Session, &aws.Config{ - MaxRetries: aws.Int(2), - }) - db.Handlers.Send.Clear() // mock sending - - os.Exit(m.Run()) -} - -func mockCRCResponse(svc *dynamodb.DynamoDB, status int, body, crc string) (req *request.Request) { - header := http.Header{} - header.Set("x-amz-crc32", crc) - - req, _ = svc.ListTablesRequest(nil) - req.Handlers.Send.PushBack(func(*request.Request) { - req.HTTPResponse = &http.Response{ - ContentLength: int64(len(body)), - StatusCode: status, - Body: ioutil.NopCloser(bytes.NewReader([]byte(body))), - Header: header, - } - }) - req.Send() - return -} - -func TestDefaultRetryRules(t *testing.T) { - d := dynamodb.New(unit.Session, &aws.Config{MaxRetries: aws.Int(-1)}) - if e, a := 10, d.MaxRetries(); e != a { - t.Errorf("expect %d max retries, got %d", e, a) - } -} - -func TestCustomRetryRules(t *testing.T) { - d := dynamodb.New(unit.Session, &aws.Config{MaxRetries: aws.Int(2)}) - if e, a := 2, d.MaxRetries(); e != a { - t.Errorf("expect %d max retries, got %d", e, a) - } -} - -type testCustomRetryer struct { - client.DefaultRetryer -} - -func TestCustomRetry_FromConfig(t *testing.T) { - d := dynamodb.New(unit.Session, &aws.Config{ - Retryer: testCustomRetryer{client.DefaultRetryer{NumMaxRetries: 9}}, - }) - - if _, ok := d.Retryer.(testCustomRetryer); !ok { - t.Errorf("expect retryer to be testCustomRetryer, but got %T", d.Retryer) - } - - if e, a := 9, d.MaxRetries(); e != a { - t.Errorf("expect %d max retries from custom retryer, got %d", e, a) - } -} - -func TestValidateCRC32NoHeaderSkip(t *testing.T) { - req := mockCRCResponse(db, 200, "{}", "") - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } -} - -func TestValidateCRC32InvalidHeaderSkip(t *testing.T) { - req := mockCRCResponse(db, 200, "{}", "ABC") - if req.Error != nil { - t.Errorf("expect no error, got %v", req.Error) - } -} - -func TestValidateCRC32AlreadyErrorSkip(t *testing.T) { - req := mockCRCResponse(db, 400, "{}", "1234") - if req.Error == nil { - t.Fatalf("expect error, but got none") - } - - aerr := req.Error.(awserr.Error) - if aerr.Code() == "CRC32CheckFailed" { - t.Errorf("expect error code not to be CRC32CheckFailed") - } -} - -func TestValidateCRC32IsValid(t *testing.T) { - req := mockCRCResponse(db, 200, `{"TableNames":["A"]}`, "3090163698") - if req.Error != nil { - t.Fatalf("expect no error, got %v", req.Error) - } - - // CRC check does not affect output parsing - out := req.Data.(*dynamodb.ListTablesOutput) - if e, a := "A", *out.TableNames[0]; e != a { - t.Errorf("expect %q table name, got %q", e, a) - } -} - -func TestValidateCRC32DoesNotMatch(t *testing.T) { - req := mockCRCResponse(db, 200, "{}", "1234") - if req.Error == nil { - t.Fatalf("expect error, but got none") - } - - aerr := req.Error.(awserr.Error) - if e, a := "CRC32CheckFailed", aerr.Code(); e != a { - t.Errorf("expect %s error code, got %s", e, a) - } - if e, a := 2, req.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } -} - -func TestValidateCRC32DoesNotMatchNoComputeChecksum(t *testing.T) { - svc := dynamodb.New(unit.Session, &aws.Config{ - MaxRetries: aws.Int(2), - DisableComputeChecksums: aws.Bool(true), - }) - svc.Handlers.Send.Clear() // mock sending - - req := mockCRCResponse(svc, 200, `{"TableNames":["A"]}`, "1234") - if req.Error != nil { - t.Fatalf("expect no error, got %v", req.Error) - } - - if e, a := 0, req.RetryCount; e != a { - t.Errorf("expect %d retry count, got %d", e, a) - } - - // CRC check disabled. Does not affect output parsing - out := req.Data.(*dynamodb.ListTablesOutput) - if e, a := "A", *out.TableNames[0]; e != a { - t.Errorf("expect %q table name, got %q", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go deleted file mode 100644 index e38e41d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter.go +++ /dev/null @@ -1,443 +0,0 @@ -package dynamodbattribute - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "runtime" - "strconv" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// ConvertToMap accepts a map[string]interface{} or struct and converts it to a -// map[string]*dynamodb.AttributeValue. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a map[string]interface{}, so `json` struct tags are respected. -// -// Deprecated: Use MarshalMap instead -func ConvertToMap(in interface{}) (item map[string]*dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in == nil { - return nil, awserr.New("SerializationError", - "in must be a map[string]interface{} or struct, got ", nil) - } - - v := reflect.ValueOf(in) - if v.Kind() != reflect.Struct && !(v.Kind() == reflect.Map && v.Type().Key().Kind() == reflect.String) { - return nil, awserr.New("SerializationError", - fmt.Sprintf("in must be a map[string]interface{} or struct, got %s", - v.Type().String()), - nil) - } - - if isTyped(reflect.TypeOf(in)) { - var out map[string]interface{} - in = convertToUntyped(in, out) - } - - item = make(map[string]*dynamodb.AttributeValue) - for k, v := range in.(map[string]interface{}) { - item[k] = convertTo(v) - } - - return item, nil -} - -// ConvertFromMap accepts a map[string]*dynamodb.AttributeValue and converts it to a -// map[string]interface{} or struct. -// -// If v points to a struct, the result is first converted it to a -// map[string]interface{}, then JSON encoded/decoded it to convert to a struct, -// so `json` struct tags are respected. -// -// Deprecated: Use UnmarshalMap instead -func ConvertFromMap(item map[string]*dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to a map[string]interface{} or struct, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Struct && !(rv.Elem().Kind() == reflect.Map && rv.Elem().Type().Key().Kind() == reflect.String) { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to a map[string]interface{} or struct, got %s", - rv.Type()), - nil) - } - - m := make(map[string]interface{}) - for k, v := range item { - m[k] = convertFrom(v) - } - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(m, v) - } else { - rv.Elem().Set(reflect.ValueOf(m)) - } - - return err -} - -// ConvertToList accepts an array or slice and converts it to a -// []*dynamodb.AttributeValue. -// -// Converting []byte fields to dynamodb.AttributeValue are only currently supported -// if the input is a map[string]interface{} type. []byte within typed structs are not -// converted correctly and are converted into base64 strings. This is a known bug, -// and will be fixed in a later release. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a []interface{}, so `json` struct tags are respected. -// -// Deprecated: Use MarshalList instead -func ConvertToList(in interface{}) (item []*dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in == nil { - return nil, awserr.New("SerializationError", - "in must be an array or slice, got ", - nil) - } - - v := reflect.ValueOf(in) - if v.Kind() != reflect.Array && v.Kind() != reflect.Slice { - return nil, awserr.New("SerializationError", - fmt.Sprintf("in must be an array or slice, got %s", - v.Type().String()), - nil) - } - - if isTyped(reflect.TypeOf(in)) { - var out []interface{} - in = convertToUntyped(in, out) - } - - item = make([]*dynamodb.AttributeValue, 0, len(in.([]interface{}))) - for _, v := range in.([]interface{}) { - item = append(item, convertTo(v)) - } - - return item, nil -} - -// ConvertFromList accepts a []*dynamodb.AttributeValue and converts it to an array or -// slice. -// -// If v contains any structs, the result is first converted it to a -// []interface{}, then JSON encoded/decoded it to convert to a typed array or -// slice, so `json` struct tags are respected. -// -// Deprecated: Use UnmarshalList instead -func ConvertFromList(item []*dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an array or slice, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Array && rv.Elem().Kind() != reflect.Slice { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an array or slice, got %s", - rv.Type()), - nil) - } - - l := make([]interface{}, 0, len(item)) - for _, v := range item { - l = append(l, convertFrom(v)) - } - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(l, v) - } else { - rv.Elem().Set(reflect.ValueOf(l)) - } - - return err -} - -// ConvertTo accepts any interface{} and converts it to a *dynamodb.AttributeValue. -// -// If in contains any structs, it is first JSON encoded/decoded it to convert it -// to a interface{}, so `json` struct tags are respected. -// -// Deprecated: Use Marshal instead -func ConvertTo(in interface{}) (item *dynamodb.AttributeValue, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - if in != nil && isTyped(reflect.TypeOf(in)) { - var out interface{} - in = convertToUntyped(in, out) - } - - item = convertTo(in) - return item, nil -} - -// ConvertFrom accepts a *dynamodb.AttributeValue and converts it to any interface{}. -// -// If v contains any structs, the result is first converted it to a interface{}, -// then JSON encoded/decoded it to convert to a struct, so `json` struct tags -// are respected. -// -// Deprecated: Use Unmarshal instead -func ConvertFrom(item *dynamodb.AttributeValue, v interface{}) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(runtime.Error); ok { - err = e - } else if s, ok := r.(string); ok { - err = fmt.Errorf(s) - } else { - err = r.(error) - } - item = nil - } - }() - - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr || rv.IsNil() { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an interface{} or struct, got %s", - rv.Type()), - nil) - } - if rv.Elem().Kind() != reflect.Interface && rv.Elem().Kind() != reflect.Struct { - return awserr.New("SerializationError", - fmt.Sprintf("v must be a non-nil pointer to an interface{} or struct, got %s", - rv.Type()), - nil) - } - - res := convertFrom(item) - - if isTyped(reflect.TypeOf(v)) { - err = convertToTyped(res, v) - } else if res != nil { - rv.Elem().Set(reflect.ValueOf(res)) - } - - return err -} - -func isTyped(v reflect.Type) bool { - switch v.Kind() { - case reflect.Struct: - return true - case reflect.Array, reflect.Slice: - if isTyped(v.Elem()) { - return true - } - case reflect.Map: - if isTyped(v.Key()) { - return true - } - if isTyped(v.Elem()) { - return true - } - case reflect.Ptr: - return isTyped(v.Elem()) - } - return false -} - -func convertToUntyped(in, out interface{}) interface{} { - b, err := json.Marshal(in) - if err != nil { - panic(err) - } - - decoder := json.NewDecoder(bytes.NewReader(b)) - decoder.UseNumber() - err = decoder.Decode(&out) - if err != nil { - panic(err) - } - - return out -} - -func convertToTyped(in, out interface{}) error { - b, err := json.Marshal(in) - if err != nil { - return err - } - - decoder := json.NewDecoder(bytes.NewReader(b)) - return decoder.Decode(&out) -} - -func convertTo(in interface{}) *dynamodb.AttributeValue { - a := &dynamodb.AttributeValue{} - - if in == nil { - a.NULL = new(bool) - *a.NULL = true - return a - } - - if m, ok := in.(map[string]interface{}); ok { - a.M = make(map[string]*dynamodb.AttributeValue) - for k, v := range m { - a.M[k] = convertTo(v) - } - return a - } - - v := reflect.ValueOf(in) - switch v.Kind() { - case reflect.Bool: - a.BOOL = new(bool) - *a.BOOL = v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - a.N = new(string) - *a.N = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - a.N = new(string) - *a.N = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - a.N = new(string) - *a.N = strconv.FormatFloat(v.Float(), 'f', -1, 64) - case reflect.String: - if n, ok := in.(json.Number); ok { - a.N = new(string) - *a.N = n.String() - } else { - a.S = new(string) - *a.S = v.String() - } - case reflect.Slice: - switch v.Type() { - case reflect.TypeOf(([]byte)(nil)): - a.B = v.Bytes() - default: - a.L = make([]*dynamodb.AttributeValue, v.Len()) - for i := 0; i < v.Len(); i++ { - a.L[i] = convertTo(v.Index(i).Interface()) - } - } - default: - panic(fmt.Sprintf("the type %s is not supported", v.Type().String())) - } - - return a -} - -func convertFrom(a *dynamodb.AttributeValue) interface{} { - if a.S != nil { - return *a.S - } - - if a.N != nil { - // Number is tricky b/c we don't know which numeric type to use. Here we - // simply try the different types from most to least restrictive. - if n, err := strconv.ParseInt(*a.N, 10, 64); err == nil { - return int(n) - } - if n, err := strconv.ParseUint(*a.N, 10, 64); err == nil { - return uint(n) - } - n, err := strconv.ParseFloat(*a.N, 64) - if err != nil { - panic(err) - } - return n - } - - if a.BOOL != nil { - return *a.BOOL - } - - if a.NULL != nil { - return nil - } - - if a.M != nil { - m := make(map[string]interface{}) - for k, v := range a.M { - m[k] = convertFrom(v) - } - return m - } - - if a.L != nil { - l := make([]interface{}, len(a.L)) - for index, v := range a.L { - l[index] = convertFrom(v) - } - return l - } - - if a.B != nil { - return a.B - } - - panic(fmt.Sprintf("%#v is not a supported dynamodb.AttributeValue", a)) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter_examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter_examples_test.go deleted file mode 100644 index 67b65fa..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter_examples_test.go +++ /dev/null @@ -1,80 +0,0 @@ -package dynamodbattribute_test - -import ( - "fmt" - "reflect" - - "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" -) - -func ExampleConvertTo() { - type Record struct { - MyField string - Letters []string - Numbers []int - } - - r := Record{ - MyField: "MyFieldValue", - Letters: []string{"a", "b", "c", "d"}, - Numbers: []int{1, 2, 3}, - } - av, err := dynamodbattribute.ConvertTo(r) - fmt.Println("err", err) - fmt.Println("MyField", av.M["MyField"]) - fmt.Println("Letters", av.M["Letters"]) - fmt.Println("Numbers", av.M["Numbers"]) - - // Output: - // err - // MyField { - // S: "MyFieldValue" - // } - // Letters { - // L: [ - // { - // S: "a" - // }, - // { - // S: "b" - // }, - // { - // S: "c" - // }, - // { - // S: "d" - // } - // ] - // } - // Numbers { - // L: [{ - // N: "1" - // },{ - // N: "2" - // },{ - // N: "3" - // }] - // } -} - -func ExampleConvertFrom() { - type Record struct { - MyField string - Letters []string - A2Num map[string]int - } - - r := Record{ - MyField: "MyFieldValue", - Letters: []string{"a", "b", "c", "d"}, - A2Num: map[string]int{"a": 1, "b": 2, "c": 3}, - } - av, err := dynamodbattribute.ConvertTo(r) - - r2 := Record{} - err = dynamodbattribute.ConvertFrom(av, &r2) - fmt.Println(err, reflect.DeepEqual(r, r2)) - - // Output: - // true -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter_test.go deleted file mode 100644 index a73cd22..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/converter_test.go +++ /dev/null @@ -1,498 +0,0 @@ -package dynamodbattribute - -import ( - "math" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -type mySimpleStruct struct { - String string - Int int - Uint uint - Float32 float32 - Float64 float64 - Bool bool - Null *interface{} -} - -type myComplexStruct struct { - Simple []mySimpleStruct -} - -type converterTestInput struct { - input interface{} - expected interface{} - err awserr.Error - inputType string // "enum" of types -} - -var trueValue = true -var falseValue = false - -var converterScalarInputs = []converterTestInput{ - { - input: nil, - expected: &dynamodb.AttributeValue{NULL: &trueValue}, - }, - { - input: "some string", - expected: &dynamodb.AttributeValue{S: aws.String("some string")}, - }, - { - input: true, - expected: &dynamodb.AttributeValue{BOOL: &trueValue}, - }, - { - input: false, - expected: &dynamodb.AttributeValue{BOOL: &falseValue}, - }, - { - input: 3.14, - expected: &dynamodb.AttributeValue{N: aws.String("3.14")}, - }, - { - input: math.MaxFloat32, - expected: &dynamodb.AttributeValue{N: aws.String("340282346638528860000000000000000000000")}, - }, - { - input: math.MaxFloat64, - expected: &dynamodb.AttributeValue{N: aws.String("179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")}, - }, - { - input: 12, - expected: &dynamodb.AttributeValue{N: aws.String("12")}, - }, - { - input: mySimpleStruct{}, - expected: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {S: aws.String("")}, - "Uint": {N: aws.String("0")}, - }, - }, - inputType: "mySimpleStruct", - }, -} - -var converterMapTestInputs = []converterTestInput{ - // Scalar tests - { - input: nil, - err: awserr.New("SerializationError", "in must be a map[string]interface{} or struct, got ", nil), - }, - { - input: map[string]interface{}{"string": "some string"}, - expected: map[string]*dynamodb.AttributeValue{"string": {S: aws.String("some string")}}, - }, - { - input: map[string]interface{}{"bool": true}, - expected: map[string]*dynamodb.AttributeValue{"bool": {BOOL: &trueValue}}, - }, - { - input: map[string]interface{}{"bool": false}, - expected: map[string]*dynamodb.AttributeValue{"bool": {BOOL: &falseValue}}, - }, - { - input: map[string]interface{}{"null": nil}, - expected: map[string]*dynamodb.AttributeValue{"null": {NULL: &trueValue}}, - }, - { - input: map[string]interface{}{"float": 3.14}, - expected: map[string]*dynamodb.AttributeValue{"float": {N: aws.String("3.14")}}, - }, - { - input: map[string]interface{}{"float": math.MaxFloat32}, - expected: map[string]*dynamodb.AttributeValue{"float": {N: aws.String("340282346638528860000000000000000000000")}}, - }, - { - input: map[string]interface{}{"float": math.MaxFloat64}, - expected: map[string]*dynamodb.AttributeValue{"float": {N: aws.String("179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")}}, - }, - { - input: map[string]interface{}{"int": int(12)}, - expected: map[string]*dynamodb.AttributeValue{"int": {N: aws.String("12")}}, - }, - { - input: map[string]interface{}{"byte": []byte{48, 49}}, - expected: map[string]*dynamodb.AttributeValue{"byte": {B: []byte{48, 49}}}, - }, - // List - { - input: map[string]interface{}{"list": []interface{}{"a string", 12, 3.14, true, nil, false}}, - expected: map[string]*dynamodb.AttributeValue{ - "list": { - L: []*dynamodb.AttributeValue{ - {S: aws.String("a string")}, - {N: aws.String("12")}, - {N: aws.String("3.14")}, - {BOOL: &trueValue}, - {NULL: &trueValue}, - {BOOL: &falseValue}, - }, - }, - }, - }, - // Map - { - input: map[string]interface{}{"map": map[string]interface{}{"nestedint": 12}}, - expected: map[string]*dynamodb.AttributeValue{ - "map": { - M: map[string]*dynamodb.AttributeValue{ - "nestedint": { - N: aws.String("12"), - }, - }, - }, - }, - }, - // Structs - { - input: mySimpleStruct{}, - expected: map[string]*dynamodb.AttributeValue{ - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {S: aws.String("")}, - "Uint": {N: aws.String("0")}, - }, - inputType: "mySimpleStruct", - }, - { - input: myComplexStruct{}, - expected: map[string]*dynamodb.AttributeValue{ - "Simple": {NULL: &trueValue}, - }, - inputType: "myComplexStruct", - }, - { - input: myComplexStruct{Simple: []mySimpleStruct{{Int: -2}, {Uint: 5}}}, - expected: map[string]*dynamodb.AttributeValue{ - "Simple": { - L: []*dynamodb.AttributeValue{ - { - M: map[string]*dynamodb.AttributeValue{ - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("-2")}, - "Null": {NULL: &trueValue}, - "String": {S: aws.String("")}, - "Uint": {N: aws.String("0")}, - }, - }, - { - M: map[string]*dynamodb.AttributeValue{ - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {S: aws.String("")}, - "Uint": {N: aws.String("5")}, - }, - }, - }, - }, - }, - inputType: "myComplexStruct", - }, -} - -var converterListTestInputs = []converterTestInput{ - { - input: nil, - err: awserr.New("SerializationError", "in must be an array or slice, got ", nil), - }, - { - input: []interface{}{}, - expected: []*dynamodb.AttributeValue{}, - }, - { - input: []interface{}{"a string", 12, 3.14, true, nil, false}, - expected: []*dynamodb.AttributeValue{ - {S: aws.String("a string")}, - {N: aws.String("12")}, - {N: aws.String("3.14")}, - {BOOL: &trueValue}, - {NULL: &trueValue}, - {BOOL: &falseValue}, - }, - }, - { - input: []mySimpleStruct{{}}, - expected: []*dynamodb.AttributeValue{ - { - M: map[string]*dynamodb.AttributeValue{ - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {S: aws.String("")}, - "Uint": {N: aws.String("0")}, - }, - }, - }, - inputType: "mySimpleStruct", - }, -} - -func TestConvertTo(t *testing.T) { - for _, test := range converterScalarInputs { - testConvertTo(t, test) - } -} - -func testConvertTo(t *testing.T, test converterTestInput) { - actual, err := ConvertTo(test.input) - if test.err != nil { - if err == nil { - t.Errorf("ConvertTo with input %#v retured %#v, expected error `%s`", test.input, actual, test.err) - } else if err.Error() != test.err.Error() { - t.Errorf("ConvertTo with input %#v retured error `%s`, expected error `%s`", test.input, err, test.err) - } - } else { - if err != nil { - t.Errorf("ConvertTo with input %#v retured error `%s`", test.input, err) - } - compareObjects(t, test.expected, actual) - } -} - -func TestConvertFrom(t *testing.T) { - // Using the same inputs from TestConvertTo, test the reverse mapping. - for _, test := range converterScalarInputs { - if test.expected != nil { - testConvertFrom(t, test) - } - } -} - -func testConvertFrom(t *testing.T, test converterTestInput) { - switch test.inputType { - case "mySimpleStruct": - var actual mySimpleStruct - if err := ConvertFrom(test.expected.(*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFrom with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - case "myComplexStruct": - var actual myComplexStruct - if err := ConvertFrom(test.expected.(*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFrom with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - default: - var actual interface{} - if err := ConvertFrom(test.expected.(*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFrom with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - } -} - -func TestConvertFromError(t *testing.T) { - // Test that we get an error using ConvertFrom to convert to a map. - var actual map[string]interface{} - expected := awserr.New("SerializationError", `v must be a non-nil pointer to an interface{} or struct, got *map[string]interface {}`, nil).Error() - if err := ConvertFrom(nil, &actual); err == nil { - t.Errorf("ConvertFrom with input %#v returned no error, expected error `%s`", nil, expected) - } else if err.Error() != expected { - t.Errorf("ConvertFrom with input %#v returned error `%s`, expected error `%s`", nil, err, expected) - } - - // Test that we get an error using ConvertFrom to convert to a list. - var actual2 []interface{} - expected = awserr.New("SerializationError", `v must be a non-nil pointer to an interface{} or struct, got *[]interface {}`, nil).Error() - if err := ConvertFrom(nil, &actual2); err == nil { - t.Errorf("ConvertFrom with input %#v returned no error, expected error `%s`", nil, expected) - } else if err.Error() != expected { - t.Errorf("ConvertFrom with input %#v returned error `%s`, expected error `%s`", nil, err, expected) - } -} - -func TestConvertToMap(t *testing.T) { - for _, test := range converterMapTestInputs { - testConvertToMap(t, test) - } -} - -func testConvertToMap(t *testing.T, test converterTestInput) { - actual, err := ConvertToMap(test.input) - if test.err != nil { - if err == nil { - t.Errorf("ConvertToMap with input %#v retured %#v, expected error `%s`", test.input, actual, test.err) - } else if err.Error() != test.err.Error() { - t.Errorf("ConvertToMap with input %#v retured error `%s`, expected error `%s`", test.input, err, test.err) - } - } else { - if err != nil { - t.Errorf("ConvertToMap with input %#v retured error `%s`", test.input, err) - } - compareObjects(t, test.expected, actual) - } -} - -func TestConvertFromMap(t *testing.T) { - // Using the same inputs from TestConvertToMap, test the reverse mapping. - for _, test := range converterMapTestInputs { - if test.expected != nil { - testConvertFromMap(t, test) - } - } -} - -func testConvertFromMap(t *testing.T, test converterTestInput) { - switch test.inputType { - case "mySimpleStruct": - var actual mySimpleStruct - if err := ConvertFromMap(test.expected.(map[string]*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFromMap with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - case "myComplexStruct": - var actual myComplexStruct - if err := ConvertFromMap(test.expected.(map[string]*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFromMap with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - default: - var actual map[string]interface{} - if err := ConvertFromMap(test.expected.(map[string]*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFromMap with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - } -} - -func TestConvertFromMapError(t *testing.T) { - // Test that we get an error using ConvertFromMap to convert to an interface{}. - var actual interface{} - expected := awserr.New("SerializationError", `v must be a non-nil pointer to a map[string]interface{} or struct, got *interface {}`, nil).Error() - if err := ConvertFromMap(nil, &actual); err == nil { - t.Errorf("ConvertFromMap with input %#v returned no error, expected error `%s`", nil, expected) - } else if err.Error() != expected { - t.Errorf("ConvertFromMap with input %#v returned error `%s`, expected error `%s`", nil, err, expected) - } - - // Test that we get an error using ConvertFromMap to convert to a slice. - var actual2 []interface{} - expected = awserr.New("SerializationError", `v must be a non-nil pointer to a map[string]interface{} or struct, got *[]interface {}`, nil).Error() - if err := ConvertFromMap(nil, &actual2); err == nil { - t.Errorf("ConvertFromMap with input %#v returned no error, expected error `%s`", nil, expected) - } else if err.Error() != expected { - t.Errorf("ConvertFromMap with input %#v returned error `%s`, expected error `%s`", nil, err, expected) - } -} - -func TestConvertToList(t *testing.T) { - for _, test := range converterListTestInputs { - testConvertToList(t, test) - } -} - -func testConvertToList(t *testing.T, test converterTestInput) { - actual, err := ConvertToList(test.input) - if test.err != nil { - if err == nil { - t.Errorf("ConvertToList with input %#v retured %#v, expected error `%s`", test.input, actual, test.err) - } else if err.Error() != test.err.Error() { - t.Errorf("ConvertToList with input %#v retured error `%s`, expected error `%s`", test.input, err, test.err) - } - } else { - if err != nil { - t.Errorf("ConvertToList with input %#v retured error `%s`", test.input, err) - } - compareObjects(t, test.expected, actual) - } -} - -func TestConvertFromList(t *testing.T) { - // Using the same inputs from TestConvertToList, test the reverse mapping. - for _, test := range converterListTestInputs { - if test.expected != nil { - testConvertFromList(t, test) - } - } -} - -func testConvertFromList(t *testing.T, test converterTestInput) { - switch test.inputType { - case "mySimpleStruct": - var actual []mySimpleStruct - if err := ConvertFromList(test.expected.([]*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFromList with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - case "myComplexStruct": - var actual []myComplexStruct - if err := ConvertFromList(test.expected.([]*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFromList with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - default: - var actual []interface{} - if err := ConvertFromList(test.expected.([]*dynamodb.AttributeValue), &actual); err != nil { - t.Errorf("ConvertFromList with input %#v retured error `%s`", test.expected, err) - } - compareObjects(t, test.input, actual) - } -} - -func TestConvertFromListError(t *testing.T) { - // Test that we get an error using ConvertFromList to convert to a map. - var actual map[string]interface{} - expected := awserr.New("SerializationError", `v must be a non-nil pointer to an array or slice, got *map[string]interface {}`, nil).Error() - if err := ConvertFromList(nil, &actual); err == nil { - t.Errorf("ConvertFromList with input %#v returned no error, expected error `%s`", nil, expected) - } else if err.Error() != expected { - t.Errorf("ConvertFromList with input %#v returned error `%s`, expected error `%s`", nil, err, expected) - } - - // Test that we get an error using ConvertFromList to convert to a struct. - var actual2 myComplexStruct - expected = awserr.New("SerializationError", `v must be a non-nil pointer to an array or slice, got *dynamodbattribute.myComplexStruct`, nil).Error() - if err := ConvertFromList(nil, &actual2); err == nil { - t.Errorf("ConvertFromList with input %#v returned no error, expected error `%s`", nil, expected) - } else if err.Error() != expected { - t.Errorf("ConvertFromList with input %#v returned error `%s`, expected error `%s`", nil, err, expected) - } - - // Test that we get an error using ConvertFromList to convert to an interface{}. - var actual3 interface{} - expected = awserr.New("SerializationError", `v must be a non-nil pointer to an array or slice, got *interface {}`, nil).Error() - if err := ConvertFromList(nil, &actual3); err == nil { - t.Errorf("ConvertFromList with input %#v returned no error, expected error `%s`", nil, expected) - } else if err.Error() != expected { - t.Errorf("ConvertFromList with input %#v returned error `%s`, expected error `%s`", nil, err, expected) - } -} - -func BenchmarkConvertTo(b *testing.B) { - d := mySimpleStruct{ - String: "abc", - Int: 123, - Uint: 123, - Float32: 123.321, - Float64: 123.321, - Bool: true, - Null: nil, - } - for i := 0; i < b.N; i++ { - _, err := ConvertTo(d) - if err != nil { - b.Fatal("unexpected error", err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go deleted file mode 100644 index 4459585..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go +++ /dev/null @@ -1,732 +0,0 @@ -package dynamodbattribute - -import ( - "fmt" - "reflect" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// An Unmarshaler is an interface to provide custom unmarshaling of -// AttributeValues. Use this to provide custom logic determining -// how AttributeValues should be unmarshaled. -// type ExampleUnmarshaler struct { -// Value int -// } -// -// type (u *exampleUnmarshaler) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { -// if av.N == nil { -// return nil -// } -// -// n, err := strconv.ParseInt(*av.N, 10, 0) -// if err != nil { -// return err -// } -// -// u.Value = n -// return nil -// } -type Unmarshaler interface { - UnmarshalDynamoDBAttributeValue(*dynamodb.AttributeValue) error -} - -// Unmarshal will unmarshal DynamoDB AttributeValues to Go value types. -// Both generic interface{} and concrete types are valid unmarshal -// destination types. -// -// Unmarshal will allocate maps, slices, and pointers as needed to -// unmarshal the AttributeValue into the provided type value. -// -// When unmarshaling AttributeValues into structs Unmarshal matches -// the field names of the struct to the AttributeValue Map keys. -// Initially it will look for exact field name matching, but will -// fall back to case insensitive if not exact match is found. -// -// With the exception of omitempty, omitemptyelem, binaryset, numberset -// and stringset all struct tags used by Marshal are also used by -// Unmarshal. -// -// When decoding AttributeValues to interfaces Unmarshal will use the -// following types. -// -// []byte, AV Binary (B) -// [][]byte, AV Binary Set (BS) -// bool, AV Boolean (BOOL) -// []interface{}, AV List (L) -// map[string]interface{}, AV Map (M) -// float64, AV Number (N) -// Number, AV Number (N) with UseNumber set -// []float64, AV Number Set (NS) -// []Number, AV Number Set (NS) with UseNumber set -// string, AV String (S) -// []string, AV String Set (SS) -// -// If the Decoder option, UseNumber is set numbers will be unmarshaled -// as Number values instead of float64. Use this to maintain the original -// string formating of the number as it was represented in the AttributeValue. -// In addition provides additional opportunities to parse the number -// string based on individual use cases. -// -// When unmarshaling any error that occurs will halt the unmarshal -// and return the error. -// -// The output value provided must be a non-nil pointer -func Unmarshal(av *dynamodb.AttributeValue, out interface{}) error { - return NewDecoder().Decode(av, out) -} - -// UnmarshalMap is an alias for Unmarshal which unmarshals from -// a map of AttributeValues. -// -// The output value provided must be a non-nil pointer -func UnmarshalMap(m map[string]*dynamodb.AttributeValue, out interface{}) error { - return NewDecoder().Decode(&dynamodb.AttributeValue{M: m}, out) -} - -// UnmarshalList is an alias for Unmarshal func which unmarshals -// a slice of AttributeValues. -// -// The output value provided must be a non-nil pointer -func UnmarshalList(l []*dynamodb.AttributeValue, out interface{}) error { - return NewDecoder().Decode(&dynamodb.AttributeValue{L: l}, out) -} - -// UnmarshalListOfMaps is an alias for Unmarshal func which unmarshals a -// slice of maps of attribute values. -// -// This is useful for when you need to unmarshal the Items from a DynamoDB -// Query API call. -// -// The output value provided must be a non-nil pointer -func UnmarshalListOfMaps(l []map[string]*dynamodb.AttributeValue, out interface{}) error { - items := make([]*dynamodb.AttributeValue, len(l)) - for i, m := range l { - items[i] = &dynamodb.AttributeValue{M: m} - } - - return UnmarshalList(items, out) -} - -// A Decoder provides unmarshaling AttributeValues to Go value types. -type Decoder struct { - MarshalOptions - - // Instructs the decoder to decode AttributeValue Numbers as - // Number type instead of float64 when the destination type - // is interface{}. Similar to encoding/json.Number - UseNumber bool -} - -// NewDecoder creates a new Decoder with default configuration. Use -// the `opts` functional options to override the default configuration. -func NewDecoder(opts ...func(*Decoder)) *Decoder { - d := &Decoder{ - MarshalOptions: MarshalOptions{ - SupportJSONTags: true, - }, - } - for _, o := range opts { - o(d) - } - - return d -} - -// Decode will unmarshal an AttributeValue into a Go value type. An error -// will be return if the decoder is unable to unmarshal the AttributeValue -// to the provide Go value type. -// -// The output value provided must be a non-nil pointer -func (d *Decoder) Decode(av *dynamodb.AttributeValue, out interface{}, opts ...func(*Decoder)) error { - v := reflect.ValueOf(out) - if v.Kind() != reflect.Ptr || v.IsNil() || !v.IsValid() { - return &InvalidUnmarshalError{Type: reflect.TypeOf(out)} - } - - return d.decode(av, v, tag{}) -} - -var stringInterfaceMapType = reflect.TypeOf(map[string]interface{}(nil)) -var byteSliceType = reflect.TypeOf([]byte(nil)) -var byteSliceSlicetype = reflect.TypeOf([][]byte(nil)) -var numberType = reflect.TypeOf(Number("")) - -func (d *Decoder) decode(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - var u Unmarshaler - if av == nil || av.NULL != nil { - u, v = indirect(v, true) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(av) - } - return d.decodeNull(v) - } - - u, v = indirect(v, false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(av) - } - - switch { - case len(av.B) != 0: - return d.decodeBinary(av.B, v) - case av.BOOL != nil: - return d.decodeBool(av.BOOL, v) - case len(av.BS) != 0: - return d.decodeBinarySet(av.BS, v) - case len(av.L) != 0: - return d.decodeList(av.L, v) - case len(av.M) != 0: - return d.decodeMap(av.M, v) - case av.N != nil: - return d.decodeNumber(av.N, v, fieldTag) - case len(av.NS) != 0: - return d.decodeNumberSet(av.NS, v) - case av.S != nil: - return d.decodeString(av.S, v, fieldTag) - case len(av.SS) != 0: - return d.decodeStringSet(av.SS, v) - } - - return nil -} - -func (d *Decoder) decodeBinary(b []byte, v reflect.Value) error { - if v.Kind() == reflect.Interface { - buf := make([]byte, len(b)) - copy(buf, b) - v.Set(reflect.ValueOf(buf)) - return nil - } - - if v.Kind() != reflect.Slice { - return &UnmarshalTypeError{Value: "binary", Type: v.Type()} - } - - if v.Type() == byteSliceType { - // Optimization for []byte types - if v.IsNil() || v.Cap() < len(b) { - v.Set(reflect.MakeSlice(byteSliceType, len(b), len(b))) - } else if v.Len() != len(b) { - v.SetLen(len(b)) - } - copy(v.Interface().([]byte), b) - return nil - } - - switch v.Type().Elem().Kind() { - case reflect.Uint8: - // Fallback to reflection copy for type aliased of []byte type - if v.IsNil() || v.Cap() < len(b) { - v.Set(reflect.MakeSlice(v.Type(), len(b), len(b))) - } else if v.Len() != len(b) { - v.SetLen(len(b)) - } - for i := 0; i < len(b); i++ { - v.Index(i).SetUint(uint64(b[i])) - } - default: - if v.Kind() == reflect.Array && v.Type().Elem().Kind() == reflect.Uint8 { - reflect.Copy(v, reflect.ValueOf(b)) - break - } - return &UnmarshalTypeError{Value: "binary", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeBool(b *bool, v reflect.Value) error { - switch v.Kind() { - case reflect.Bool, reflect.Interface: - v.Set(reflect.ValueOf(*b).Convert(v.Type())) - default: - return &UnmarshalTypeError{Value: "bool", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeBinarySet(bs [][]byte, v reflect.Value) error { - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(bs) { - // What about if ignoring nil/empty values? - v.Set(reflect.MakeSlice(v.Type(), 0, len(bs))) - } - case reflect.Array: - // Limited to capacity of existing array. - case reflect.Interface: - set := make([][]byte, len(bs)) - for i, b := range bs { - if err := d.decodeBinary(b, reflect.ValueOf(&set[i]).Elem()); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - return nil - default: - return &UnmarshalTypeError{Value: "binary set", Type: v.Type()} - } - - for i := 0; i < v.Cap() && i < len(bs); i++ { - v.SetLen(i + 1) - u, elem := indirect(v.Index(i), false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(&dynamodb.AttributeValue{BS: bs}) - } - if err := d.decodeBinary(bs[i], elem); err != nil { - return err - } - } - - return nil -} - -func (d *Decoder) decodeNumber(n *string, v reflect.Value, fieldTag tag) error { - switch v.Kind() { - case reflect.Interface: - i, err := d.decodeNumberToInterface(n) - if err != nil { - return err - } - v.Set(reflect.ValueOf(i)) - return nil - case reflect.String: - if v.Type() == numberType { // Support Number value type - v.Set(reflect.ValueOf(Number(*n))) - return nil - } - v.Set(reflect.ValueOf(*n)) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - i, err := strconv.ParseInt(*n, 10, 64) - if err != nil { - return err - } - if v.OverflowInt(i) { - return &UnmarshalTypeError{ - Value: fmt.Sprintf("number overflow, %s", *n), - Type: v.Type(), - } - } - v.SetInt(i) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - i, err := strconv.ParseUint(*n, 10, 64) - if err != nil { - return err - } - if v.OverflowUint(i) { - return &UnmarshalTypeError{ - Value: fmt.Sprintf("number overflow, %s", *n), - Type: v.Type(), - } - } - v.SetUint(i) - case reflect.Float32, reflect.Float64: - i, err := strconv.ParseFloat(*n, 64) - if err != nil { - return err - } - if v.OverflowFloat(i) { - return &UnmarshalTypeError{ - Value: fmt.Sprintf("number overflow, %s", *n), - Type: v.Type(), - } - } - v.SetFloat(i) - default: - if _, ok := v.Interface().(time.Time); ok && fieldTag.AsUnixTime { - t, err := decodeUnixTime(*n) - if err != nil { - return err - } - v.Set(reflect.ValueOf(t)) - return nil - } - return &UnmarshalTypeError{Value: "number", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeNumberToInterface(n *string) (interface{}, error) { - if d.UseNumber { - return Number(*n), nil - } - - // Default to float64 for all numbers - return strconv.ParseFloat(*n, 64) -} - -func (d *Decoder) decodeNumberSet(ns []*string, v reflect.Value) error { - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(ns) { - // What about if ignoring nil/empty values? - v.Set(reflect.MakeSlice(v.Type(), 0, len(ns))) - } - case reflect.Array: - // Limited to capacity of existing array. - case reflect.Interface: - if d.UseNumber { - set := make([]Number, len(ns)) - for i, n := range ns { - if err := d.decodeNumber(n, reflect.ValueOf(&set[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - } else { - set := make([]float64, len(ns)) - for i, n := range ns { - if err := d.decodeNumber(n, reflect.ValueOf(&set[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - } - return nil - default: - return &UnmarshalTypeError{Value: "number set", Type: v.Type()} - } - - for i := 0; i < v.Cap() && i < len(ns); i++ { - v.SetLen(i + 1) - u, elem := indirect(v.Index(i), false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(&dynamodb.AttributeValue{NS: ns}) - } - if err := d.decodeNumber(ns[i], elem, tag{}); err != nil { - return err - } - } - - return nil -} - -func (d *Decoder) decodeList(avList []*dynamodb.AttributeValue, v reflect.Value) error { - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(avList) { - // What about if ignoring nil/empty values? - v.Set(reflect.MakeSlice(v.Type(), 0, len(avList))) - } - case reflect.Array: - // Limited to capacity of existing array. - case reflect.Interface: - s := make([]interface{}, len(avList)) - for i, av := range avList { - if err := d.decode(av, reflect.ValueOf(&s[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(s)) - return nil - default: - return &UnmarshalTypeError{Value: "list", Type: v.Type()} - } - - // If v is not a slice, array - for i := 0; i < v.Cap() && i < len(avList); i++ { - v.SetLen(i + 1) - if err := d.decode(avList[i], v.Index(i), tag{}); err != nil { - return err - } - } - - return nil -} - -func (d *Decoder) decodeMap(avMap map[string]*dynamodb.AttributeValue, v reflect.Value) error { - switch v.Kind() { - case reflect.Map: - t := v.Type() - if t.Key().Kind() != reflect.String { - return &UnmarshalTypeError{Value: "map string key", Type: t.Key()} - } - if v.IsNil() { - v.Set(reflect.MakeMap(t)) - } - case reflect.Struct: - case reflect.Interface: - v.Set(reflect.MakeMap(stringInterfaceMapType)) - v = v.Elem() - default: - return &UnmarshalTypeError{Value: "map", Type: v.Type()} - } - - if v.Kind() == reflect.Map { - for k, av := range avMap { - key := reflect.ValueOf(k) - elem := reflect.New(v.Type().Elem()).Elem() - if err := d.decode(av, elem, tag{}); err != nil { - return err - } - v.SetMapIndex(key, elem) - } - } else if v.Kind() == reflect.Struct { - fields := unionStructFields(v.Type(), d.MarshalOptions) - for k, av := range avMap { - if f, ok := fieldByName(fields, k); ok { - fv := fieldByIndex(v, f.Index, func(v *reflect.Value) bool { - v.Set(reflect.New(v.Type().Elem())) - return true // to continue the loop. - }) - if err := d.decode(av, fv, f.tag); err != nil { - return err - } - } - } - } - - return nil -} - -func (d *Decoder) decodeNull(v reflect.Value) error { - if v.IsValid() && v.CanSet() { - v.Set(reflect.Zero(v.Type())) - } - - return nil -} - -func (d *Decoder) decodeString(s *string, v reflect.Value, fieldTag tag) error { - if fieldTag.AsString { - return d.decodeNumber(s, v, fieldTag) - } - - // To maintain backwards compatibility with ConvertFrom family of methods which - // converted strings to time.Time structs - if _, ok := v.Interface().(time.Time); ok { - t, err := time.Parse(time.RFC3339, *s) - if err != nil { - return err - } - v.Set(reflect.ValueOf(t)) - return nil - } - - switch v.Kind() { - case reflect.String: - v.SetString(*s) - case reflect.Interface: - // Ensure type aliasing is handled properly - v.Set(reflect.ValueOf(*s).Convert(v.Type())) - default: - return &UnmarshalTypeError{Value: "string", Type: v.Type()} - } - - return nil -} - -func (d *Decoder) decodeStringSet(ss []*string, v reflect.Value) error { - switch v.Kind() { - case reflect.Slice: - // Make room for the slice elements if needed - if v.IsNil() || v.Cap() < len(ss) { - v.Set(reflect.MakeSlice(v.Type(), 0, len(ss))) - } - case reflect.Array: - // Limited to capacity of existing array. - case reflect.Interface: - set := make([]string, len(ss)) - for i, s := range ss { - if err := d.decodeString(s, reflect.ValueOf(&set[i]).Elem(), tag{}); err != nil { - return err - } - } - v.Set(reflect.ValueOf(set)) - return nil - default: - return &UnmarshalTypeError{Value: "string set", Type: v.Type()} - } - - for i := 0; i < v.Cap() && i < len(ss); i++ { - v.SetLen(i + 1) - u, elem := indirect(v.Index(i), false) - if u != nil { - return u.UnmarshalDynamoDBAttributeValue(&dynamodb.AttributeValue{SS: ss}) - } - if err := d.decodeString(ss[i], elem, tag{}); err != nil { - return err - } - } - - return nil -} - -func decodeUnixTime(n string) (time.Time, error) { - v, err := strconv.ParseInt(n, 10, 64) - if err != nil { - return time.Time{}, &UnmarshalError{ - Err: err, Value: n, Type: reflect.TypeOf(time.Time{}), - } - } - - return time.Unix(v, 0), nil -} - -// indirect will walk a value's interface or pointer value types. Returning -// the final value or the value a unmarshaler is defined on. -// -// Based on the enoding/json type reflect value type indirection in Go Stdlib -// https://golang.org/src/encoding/json/decode.go indirect func. -func indirect(v reflect.Value, decodingNull bool) (Unmarshaler, reflect.Value) { - if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { - v = v.Addr() - } - for { - if v.Kind() == reflect.Interface && !v.IsNil() { - e := v.Elem() - if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { - v = e - continue - } - } - if v.Kind() != reflect.Ptr { - break - } - if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { - break - } - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - if v.Type().NumMethod() > 0 { - if u, ok := v.Interface().(Unmarshaler); ok { - return u, reflect.Value{} - } - } - v = v.Elem() - } - - return nil, v -} - -// A Number represents a Attributevalue number literal. -type Number string - -// Float64 attempts to cast the number ot a float64, returning -// the result of the case or error if the case failed. -func (n Number) Float64() (float64, error) { - return strconv.ParseFloat(string(n), 64) -} - -// Int64 attempts to cast the number ot a int64, returning -// the result of the case or error if the case failed. -func (n Number) Int64() (int64, error) { - return strconv.ParseInt(string(n), 10, 64) -} - -// Uint64 attempts to cast the number ot a uint64, returning -// the result of the case or error if the case failed. -func (n Number) Uint64() (uint64, error) { - return strconv.ParseUint(string(n), 10, 64) -} - -// String returns the raw number represented as a string -func (n Number) String() string { - return string(n) -} - -type emptyOrigError struct{} - -func (e emptyOrigError) OrigErr() error { - return nil -} - -// An UnmarshalTypeError is an error type representing a error -// unmarshaling the AttributeValue's element to a Go value type. -// Includes details about the AttributeValue type and Go value type. -type UnmarshalTypeError struct { - emptyOrigError - Value string - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *UnmarshalTypeError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *UnmarshalTypeError) Code() string { - return "UnmarshalTypeError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *UnmarshalTypeError) Message() string { - return "cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String() -} - -// An InvalidUnmarshalError is an error type representing an invalid type -// encountered while unmarshaling a AttributeValue to a Go value type. -type InvalidUnmarshalError struct { - emptyOrigError - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *InvalidUnmarshalError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *InvalidUnmarshalError) Code() string { - return "InvalidUnmarshalError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *InvalidUnmarshalError) Message() string { - if e.Type == nil { - return "cannot unmarshal to nil value" - } - if e.Type.Kind() != reflect.Ptr { - return "cannot unmarshal to non-pointer value, got " + e.Type.String() - } - return "cannot unmarshal to nil value, " + e.Type.String() -} - -// An UnmarshalError wraps an error that occured while unmarshaling a DynamoDB -// AttributeValue element into a Go type. This is different from UnmarshalTypeError -// in that it wraps the underlying error that occured. -type UnmarshalError struct { - Err error - Value string - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface. -func (e *UnmarshalError) Error() string { - return fmt.Sprintf("%s: %s\ncaused by: %v", e.Code(), e.Message(), e.Err) -} - -// OrigErr returns the original error that caused this issue. -func (e UnmarshalError) OrigErr() error { - return e.Err -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *UnmarshalError) Code() string { - return "UnmarshalError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *UnmarshalError) Message() string { - return fmt.Sprintf("cannot unmarshal %q into %s.", - e.Value, e.Type.String()) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode_test.go deleted file mode 100644 index a4b84d8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode_test.go +++ /dev/null @@ -1,529 +0,0 @@ -package dynamodbattribute - -import ( - "fmt" - "reflect" - "strconv" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/stretchr/testify/assert" -) - -func TestUnmarshalErrorTypes(t *testing.T) { - var _ awserr.Error = (*UnmarshalTypeError)(nil) - var _ awserr.Error = (*InvalidUnmarshalError)(nil) -} - -func TestUnmarshalShared(t *testing.T) { - for i, c := range sharedTestCases { - err := Unmarshal(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -func TestUnmarshal(t *testing.T) { - cases := []struct { - in *dynamodb.AttributeValue - actual, expected interface{} - err error - }{ - //------------ - // Sets - //------------ - { - in: &dynamodb.AttributeValue{BS: [][]byte{ - {48, 49}, {50, 51}, - }}, - actual: &[][]byte{}, - expected: [][]byte{{48, 49}, {50, 51}}, - }, - { - in: &dynamodb.AttributeValue{NS: []*string{ - aws.String("123"), aws.String("321"), - }}, - actual: &[]int{}, - expected: []int{123, 321}, - }, - { - in: &dynamodb.AttributeValue{NS: []*string{ - aws.String("123"), aws.String("321"), - }}, - actual: &[]interface{}{}, - expected: []interface{}{123., 321.}, - }, - { - in: &dynamodb.AttributeValue{SS: []*string{ - aws.String("abc"), aws.String("123"), - }}, - actual: &[]string{}, - expected: &[]string{"abc", "123"}, - }, - { - in: &dynamodb.AttributeValue{SS: []*string{ - aws.String("abc"), aws.String("123"), - }}, - actual: &[]*string{}, - expected: &[]*string{aws.String("abc"), aws.String("123")}, - }, - //------------ - // Interfaces - //------------ - { - in: &dynamodb.AttributeValue{B: []byte{48, 49}}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: []byte{48, 49}, - }, - { - in: &dynamodb.AttributeValue{BS: [][]byte{ - {48, 49}, {50, 51}, - }}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: [][]byte{{48, 49}, {50, 51}}, - }, - { - in: &dynamodb.AttributeValue{BOOL: aws.Bool(true)}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: bool(true), - }, - { - in: &dynamodb.AttributeValue{L: []*dynamodb.AttributeValue{ - {S: aws.String("abc")}, {S: aws.String("123")}, - }}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: []interface{}{"abc", "123"}, - }, - { - in: &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - "123": {S: aws.String("abc")}, - "abc": {S: aws.String("123")}, - }}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: map[string]interface{}{"123": "abc", "abc": "123"}, - }, - { - in: &dynamodb.AttributeValue{N: aws.String("123")}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: float64(123), - }, - { - in: &dynamodb.AttributeValue{NS: []*string{ - aws.String("123"), aws.String("321"), - }}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: []float64{123., 321.}, - }, - { - in: &dynamodb.AttributeValue{S: aws.String("123")}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: "123", - }, - { - in: &dynamodb.AttributeValue{SS: []*string{ - aws.String("123"), aws.String("321"), - }}, - actual: func() interface{} { - var v interface{} - return &v - }(), - expected: []string{"123", "321"}, - }, - { - in: &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - "abc": {S: aws.String("123")}, - "Cba": {S: aws.String("321")}, - }}, - actual: &struct{ Abc, Cba string }{}, - expected: struct{ Abc, Cba string }{Abc: "123", Cba: "321"}, - }, - { - in: &dynamodb.AttributeValue{N: aws.String("512")}, - actual: new(uint8), - err: &UnmarshalTypeError{ - Value: fmt.Sprintf("number overflow, 512"), - Type: reflect.TypeOf(uint8(0)), - }, - }, - } - - for i, c := range cases { - err := Unmarshal(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -func TestInterfaceInput(t *testing.T) { - var v interface{} - expected := []interface{}{"abc", "123"} - err := Unmarshal(&dynamodb.AttributeValue{L: []*dynamodb.AttributeValue{ - {S: aws.String("abc")}, {S: aws.String("123")}, - }}, &v) - assertConvertTest(t, 0, v, expected, err, nil) -} - -func TestUnmarshalError(t *testing.T) { - cases := []struct { - in *dynamodb.AttributeValue - actual, expected interface{} - err error - }{ - { - in: &dynamodb.AttributeValue{}, - actual: int(0), - expected: nil, - err: &InvalidUnmarshalError{Type: reflect.TypeOf(int(0))}, - }, - } - - for i, c := range cases { - err := Unmarshal(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -func TestUnmarshalListShared(t *testing.T) { - for i, c := range sharedListTestCases { - err := UnmarshalList(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -func TestUnmarshalListError(t *testing.T) { - cases := []struct { - in []*dynamodb.AttributeValue - actual, expected interface{} - err error - }{ - { - in: []*dynamodb.AttributeValue{}, - actual: []interface{}{}, - expected: nil, - err: &InvalidUnmarshalError{Type: reflect.TypeOf([]interface{}{})}, - }, - } - - for i, c := range cases { - err := UnmarshalList(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -func TestUnmarshalMapShared(t *testing.T) { - for i, c := range sharedMapTestCases { - err := UnmarshalMap(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -func TestUnmarshalMapError(t *testing.T) { - cases := []struct { - in map[string]*dynamodb.AttributeValue - actual, expected interface{} - err error - }{ - { - in: map[string]*dynamodb.AttributeValue{}, - actual: map[string]interface{}{}, - expected: nil, - err: &InvalidUnmarshalError{Type: reflect.TypeOf(map[string]interface{}{})}, - }, - { - in: map[string]*dynamodb.AttributeValue{ - "BOOL": {BOOL: aws.Bool(true)}, - }, - actual: &map[int]interface{}{}, - expected: nil, - err: &UnmarshalTypeError{Value: "map string key", Type: reflect.TypeOf(int(0))}, - }, - } - - for i, c := range cases { - err := UnmarshalMap(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -func TestUnmarshalListOfMaps(t *testing.T) { - type testItem struct { - Value string - Value2 int - } - - cases := []struct { - in []map[string]*dynamodb.AttributeValue - actual, expected interface{} - err error - }{ - { // Simple map conversion. - in: []map[string]*dynamodb.AttributeValue{ - { - "Value": &dynamodb.AttributeValue{ - BOOL: aws.Bool(true), - }, - }, - }, - actual: &[]map[string]interface{}{}, - expected: []map[string]interface{}{ - { - "Value": true, - }, - }, - }, - { // attribute to struct. - in: []map[string]*dynamodb.AttributeValue{ - { - "Value": &dynamodb.AttributeValue{ - S: aws.String("abc"), - }, - "Value2": &dynamodb.AttributeValue{ - N: aws.String("123"), - }, - }, - }, - actual: &[]testItem{}, - expected: []testItem{ - { - Value: "abc", - Value2: 123, - }, - }, - }, - } - - for i, c := range cases { - err := UnmarshalListOfMaps(c.in, c.actual) - assertConvertTest(t, i, c.actual, c.expected, err, c.err) - } -} - -type unmarshalUnmarshaler struct { - Value string - Value2 int - Value3 bool - Value4 time.Time -} - -func (u *unmarshalUnmarshaler) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { - if av.M == nil { - return fmt.Errorf("expected AttributeValue to be map") - } - - if v, ok := av.M["abc"]; !ok { - return fmt.Errorf("expected `abc` map key") - } else if v.S == nil { - return fmt.Errorf("expected `abc` map value string") - } else { - u.Value = *v.S - } - - if v, ok := av.M["def"]; !ok { - return fmt.Errorf("expected `def` map key") - } else if v.N == nil { - return fmt.Errorf("expected `def` map value number") - } else { - n, err := strconv.ParseInt(*v.N, 10, 64) - if err != nil { - return err - } - u.Value2 = int(n) - } - - if v, ok := av.M["ghi"]; !ok { - return fmt.Errorf("expected `ghi` map key") - } else if v.BOOL == nil { - return fmt.Errorf("expected `ghi` map value number") - } else { - u.Value3 = *v.BOOL - } - - if v, ok := av.M["jkl"]; !ok { - return fmt.Errorf("expected `jkl` map key") - } else if v.S == nil { - return fmt.Errorf("expected `jkl` map value string") - } else { - t, err := time.Parse(time.RFC3339, *v.S) - if err != nil { - return err - } - u.Value4 = t - } - - return nil -} - -func TestUnmarshalUnmashaler(t *testing.T) { - u := &unmarshalUnmarshaler{} - av := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "abc": {S: aws.String("value")}, - "def": {N: aws.String("123")}, - "ghi": {BOOL: aws.Bool(true)}, - "jkl": {S: aws.String("2016-05-03T17:06:26.209072Z")}, - }, - } - - err := Unmarshal(av, u) - assert.NoError(t, err) - - assert.Equal(t, "value", u.Value) - assert.Equal(t, 123, u.Value2) - assert.Equal(t, true, u.Value3) - assert.Equal(t, testDate, u.Value4) -} - -func TestDecodeUseNumber(t *testing.T) { - u := map[string]interface{}{} - av := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "abc": {S: aws.String("value")}, - "def": {N: aws.String("123")}, - "ghi": {BOOL: aws.Bool(true)}, - }, - } - - decoder := NewDecoder(func(d *Decoder) { - d.UseNumber = true - }) - err := decoder.Decode(av, &u) - assert.NoError(t, err) - - assert.Equal(t, "value", u["abc"]) - n, ok := u["def"].(Number) - assert.True(t, ok) - assert.Equal(t, "123", n.String()) - assert.Equal(t, true, u["ghi"]) -} - -func TestDecodeUseNumberNumberSet(t *testing.T) { - u := map[string]interface{}{} - av := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "ns": { - NS: []*string{ - aws.String("123"), aws.String("321"), - }, - }, - }, - } - - decoder := NewDecoder(func(d *Decoder) { - d.UseNumber = true - }) - err := decoder.Decode(av, &u) - assert.NoError(t, err) - - ns, ok := u["ns"].([]Number) - assert.True(t, ok) - - assert.Equal(t, "123", ns[0].String()) - assert.Equal(t, "321", ns[1].String()) -} - -func TestDecodeEmbeddedPointerStruct(t *testing.T) { - type B struct { - Bint int - } - type C struct { - Cint int - } - type A struct { - Aint int - *B - *C - } - av := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Aint": { - N: aws.String("321"), - }, - "Bint": { - N: aws.String("123"), - }, - }, - } - decoder := NewDecoder() - a := A{} - err := decoder.Decode(av, &a) - assert.NoError(t, err) - assert.Equal(t, 321, a.Aint) - // Embedded pointer struct can be created automatically. - assert.Equal(t, 123, a.Bint) - // But not for absent fields. - assert.Nil(t, a.C) -} - -func TestDecodeBooleanOverlay(t *testing.T) { - type BooleanOverlay bool - - av := &dynamodb.AttributeValue{ - BOOL: aws.Bool(true), - } - - decoder := NewDecoder() - - var v BooleanOverlay - - err := decoder.Decode(av, &v) - assert.NoError(t, err) - assert.Equal(t, BooleanOverlay(true), v) -} - -func TestDecodeUnixTime(t *testing.T) { - type A struct { - Normal time.Time - Tagged time.Time `dynamodbav:",unixtime"` - Typed UnixTime - } - - expect := A{ - Normal: time.Unix(123, 0).UTC(), - Tagged: time.Unix(456, 0), - Typed: UnixTime(time.Unix(789, 0)), - } - - input := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Normal": { - S: aws.String("1970-01-01T00:02:03Z"), - }, - "Tagged": { - N: aws.String("456"), - }, - "Typed": { - N: aws.String("789"), - }, - }, - } - actual := A{} - - err := Unmarshal(input, &actual) - assert.NoError(t, err) - assert.Equal(t, expect, actual) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go deleted file mode 100644 index 03fd912..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go +++ /dev/null @@ -1,63 +0,0 @@ -// Package dynamodbattribute provides marshaling utilities for marshaling to -// dynamodb.AttributeValue types and unmarshaling to Go value types. These -// utilities allow you to marshal slices, maps, structs, and scalar values -// to and from dynamodb.AttributeValue. These are useful when marshaling -// Go value tyes to dynamodb.AttributeValue for DynamoDB requests, or -// unmarshaling the dynamodb.AttributeValue back into a Go value type. -// -// Marshal Go value types to dynamodb.AttributeValue: See (ExampleMarshal) -// -// type Record struct { -// MyField string -// Letters []string -// A2Num map[string]int -// } -// -// ... -// -// r := Record{ -// MyField: "dynamodbattribute.Marshal example", -// Letters: []string{"a", "b", "c", "d"}, -// A2Num: map[string]int{"a": 1, "b": 2, "c": 3}, -// } -// av, err := dynamodbattribute.Marshal(r) -// fmt.Println(av, err) -// -// Unmarshal dynamodb.AttributeValue to Go value type: See (ExampleUnmarshal) -// -// r2 := Record{} -// err = dynamodbattribute.Unmarshal(av, &r2) -// fmt.Println(err, reflect.DeepEqual(r, r2)) -// -// Marshal Go value type for DynamoDB.PutItem: -// -// sess := session.Must(session.NewSession()) -// -// svc := dynamodb.New(sess) -// item, err := dynamodbattribute.MarshalMap(r) -// if err != nil { -// fmt.Println("Failed to convert", err) -// return -// } -// result, err := svc.PutItem(&dynamodb.PutItemInput{ -// Item: item, -// TableName: aws.String("exampleTable"), -// }) -// -// -// -// The ConvertTo, ConvertToList, ConvertToMap, ConvertFrom, ConvertFromMap -// and ConvertFromList methods have been deprecated. The Marshal and Unmarshal -// functions should be used instead. The ConvertTo|From marshallers do not -// support BinarySet, NumberSet, nor StringSets, and will incorrect marshal -// binary data fields in structs as base64 strings. -// -// The Marshal and Unmarshal functions correct this behavior, and removes -// the reliance on encoding.json. `json` struct tags are still supported. In -// addition support for a new struct tag `dynamodbav` was added. Support for -// the json.Marshaler and json.Unmarshaler interfaces have been removed and -// replaced with have been replaced with dynamodbattribute.Marshaler and -// dynamodbattribute.Unmarshaler interfaces. -// -// `time.Time` is marshaled as RFC3339 format. -package dynamodbattribute diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go deleted file mode 100644 index 51adf2f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go +++ /dev/null @@ -1,635 +0,0 @@ -package dynamodbattribute - -import ( - "fmt" - "reflect" - "strconv" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -// An UnixTime provides aliasing of time.Time into a type that when marshaled -// and unmarshaled with DynamoDB AttributeValues it will be done so as number -// instead of string in seconds since January 1, 1970 UTC. -// -// This type is useful as an alterntitive to the struct tag `unixtime` when you -// want to have your time value marshaled as Unix time in seconds intead of -// the default time.RFC3339. -// -// Important to note that zero value time as unixtime is not 0 seconds -// from January 1, 1970 UTC, but -62135596800. Which is seconds between -// January 1, 0001 UTC, and January 1, 0001 UTC. -type UnixTime time.Time - -// MarshalDynamoDBAttributeValue implements the Marshaler interface so that -// the UnixTime can be marshaled from to a DynamoDB AttributeValue number -// value encoded in the number of seconds since January 1, 1970 UTC. -func (e UnixTime) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { - t := time.Time(e) - s := strconv.FormatInt(t.Unix(), 10) - av.N = &s - - return nil -} - -// UnmarshalDynamoDBAttributeValue implements the Unmarshaler interface so that -// the UnixTime can be unmarshaled from a DynamoDB AttributeValue number representing -// the number of seconds since January 1, 1970 UTC. -// -// If an error parsing the AttributeValue number occurs UnmarshalError will be -// returned. -func (e *UnixTime) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { - t, err := decodeUnixTime(aws.StringValue(av.N)) - if err != nil { - return err - } - - *e = UnixTime(t) - return nil -} - -// A Marshaler is an interface to provide custom marshaling of Go value types -// to AttributeValues. Use this to provide custom logic determining how a -// Go Value type should be marshaled. -// -// type ExampleMarshaler struct { -// Value int -// } -// type (m *ExampleMarshaler) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { -// n := fmt.Sprintf("%v", m.Value) -// av.N = &n -// -// return nil -// } -// -type Marshaler interface { - MarshalDynamoDBAttributeValue(*dynamodb.AttributeValue) error -} - -// Marshal will serialize the passed in Go value type into a DynamoDB AttributeValue -// type. This value can be used in DynamoDB API operations to simplify marshaling -// your Go value types into AttributeValues. -// -// Marshal will recursively transverse the passed in value marshaling its -// contents into a AttributeValue. Marshal supports basic scalars -// (int,uint,float,bool,string), maps, slices, and structs. Anonymous -// nested types are flattened based on Go anonymous type visibility. -// -// Marshaling slices to AttributeValue will default to a List for all -// types except for []byte and [][]byte. []byte will be marshaled as -// Binary data (B), and [][]byte will be marshaled as binary data set -// (BS). -// -// `dynamodbav` struct tag can be used to control how the value will be -// marshaled into a AttributeValue. -// -// // Field is ignored -// Field int `dynamodbav:"-"` -// -// // Field AttributeValue map key "myName" -// Field int `dynamodbav:"myName"` -// -// // Field AttributeValue map key "myName", and -// // Field is omitted if it is empty -// Field int `dynamodbav:"myName,omitempty"` -// -// // Field AttributeValue map key "Field", and -// // Field is omitted if it is empty -// Field int `dynamodbav:",omitempty"` -// -// // Field's elems will be omitted if empty -// // only valid for slices, and maps. -// Field []string `dynamodbav:",omitemptyelem"` -// -// // Field will be marshaled as a AttributeValue string -// // only value for number types, (int,uint,float) -// Field int `dynamodbav:",string"` -// -// // Field will be marshaled as a binary set -// Field [][]byte `dynamodbav:",binaryset"` -// -// // Field will be marshaled as a number set -// Field []int `dynamodbav:",numberset"` -// -// // Field will be marshaled as a string set -// Field []string `dynamodbav:",stringset"` -// -// // Field will be marshaled as Unix time number in seconds. -// // This tag is only valid with time.Time typed struct fields. -// // Important to note that zero value time as unixtime is not 0 seconds -// // from January 1, 1970 UTC, but -62135596800. Which is seconds between -// // January 1, 0001 UTC, and January 1, 0001 UTC. -// Field time.Time `dynamodbav:",unixtime"` -// -// The omitempty tag is only used during Marshaling and is ignored for -// Unmarshal. Any zero value or a value when marshaled results in a -// AttributeValue NULL will be added to AttributeValue Maps during struct -// marshal. The omitemptyelem tag works the same as omitempty except it -// applies to maps and slices instead of struct fields, and will not be -// included in the marshaled AttributeValue Map, List, or Set. -// -// For convenience and backwards compatibility with ConvertTo functions -// json struct tags are supported by the Marshal and Unmarshal. If -// both json and dynamodbav struct tags are provided the json tag will -// be ignored in favor of dynamodbav. -// -// All struct fields and with anonymous fields, are marshaled unless the -// any of the following conditions are meet. -// -// - the field is not exported -// - json or dynamodbav field tag is "-" -// - json or dynamodbav field tag specifies "omitempty", and is empty. -// -// Pointer and interfaces values encode as the value pointed to or contained -// in the interface. A nil value encodes as the AttributeValue NULL value. -// -// Channel, complex, and function values are not encoded and will be skipped -// when walking the value to be marshaled. -// -// When marshaling any error that occurs will halt the marshal and return -// the error. -// -// Marshal cannot represent cyclic data structures and will not handle them. -// Passing cyclic structures to Marshal will result in an infinite recursion. -func Marshal(in interface{}) (*dynamodb.AttributeValue, error) { - return NewEncoder().Encode(in) -} - -// MarshalMap is an alias for Marshal func which marshals Go value -// type to a map of AttributeValues. -func MarshalMap(in interface{}) (map[string]*dynamodb.AttributeValue, error) { - av, err := NewEncoder().Encode(in) - if err != nil || av == nil || av.M == nil { - return map[string]*dynamodb.AttributeValue{}, err - } - - return av.M, nil -} - -// MarshalList is an alias for Marshal func which marshals Go value -// type to a slice of AttributeValues. -func MarshalList(in interface{}) ([]*dynamodb.AttributeValue, error) { - av, err := NewEncoder().Encode(in) - if err != nil || av == nil || av.L == nil { - return []*dynamodb.AttributeValue{}, err - } - - return av.L, nil -} - -// A MarshalOptions is a collection of options shared between marshaling -// and unmarshaling -type MarshalOptions struct { - // States that the encoding/json struct tags should be supported. - // if a `dynamodbav` struct tag is also provided the encoding/json - // tag will be ignored. - // - // Enabled by default. - SupportJSONTags bool -} - -// An Encoder provides marshaling Go value types to AttributeValues. -type Encoder struct { - MarshalOptions - - // Empty strings, "", will be marked as NULL AttributeValue types. - // Empty strings are not valid values for DynamoDB. Will not apply - // to lists, sets, or maps. Use the struct tag `omitemptyelem` - // to skip empty (zero) values in lists, sets and maps. - // - // Enabled by default. - NullEmptyString bool -} - -// NewEncoder creates a new Encoder with default configuration. Use -// the `opts` functional options to override the default configuration. -func NewEncoder(opts ...func(*Encoder)) *Encoder { - e := &Encoder{ - MarshalOptions: MarshalOptions{ - SupportJSONTags: true, - }, - NullEmptyString: true, - } - for _, o := range opts { - o(e) - } - - return e -} - -// Encode will marshal a Go value type to an AttributeValue. Returning -// the AttributeValue constructed or error. -func (e *Encoder) Encode(in interface{}) (*dynamodb.AttributeValue, error) { - av := &dynamodb.AttributeValue{} - if err := e.encode(av, reflect.ValueOf(in), tag{}); err != nil { - return nil, err - } - - return av, nil -} - -func fieldByIndex(v reflect.Value, index []int, - OnEmbeddedNilStruct func(*reflect.Value) bool) reflect.Value { - fv := v - for i, x := range index { - if i > 0 { - if fv.Kind() == reflect.Ptr && fv.Type().Elem().Kind() == reflect.Struct { - if fv.IsNil() && !OnEmbeddedNilStruct(&fv) { - break - } - fv = fv.Elem() - } - } - fv = fv.Field(x) - } - return fv -} - -func (e *Encoder) encode(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - // We should check for omitted values first before dereferencing. - if fieldTag.OmitEmpty && emptyValue(v) { - encodeNull(av) - return nil - } - - // Handle both pointers and interface conversion into types - v = valueElem(v) - - if v.Kind() != reflect.Invalid { - if used, err := tryMarshaler(av, v); used { - return err - } - } - - switch v.Kind() { - case reflect.Invalid: - encodeNull(av) - case reflect.Struct: - return e.encodeStruct(av, v, fieldTag) - case reflect.Map: - return e.encodeMap(av, v, fieldTag) - case reflect.Slice, reflect.Array: - return e.encodeSlice(av, v, fieldTag) - case reflect.Chan, reflect.Func, reflect.UnsafePointer: - // do nothing for unsupported types - default: - return e.encodeScalar(av, v, fieldTag) - } - - return nil -} - -func (e *Encoder) encodeStruct(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - // To maintain backwards compatibility with ConvertTo family of methods which - // converted time.Time structs to strings - if t, ok := v.Interface().(time.Time); ok { - if fieldTag.AsUnixTime { - return UnixTime(t).MarshalDynamoDBAttributeValue(av) - } - s := t.Format(time.RFC3339Nano) - av.S = &s - return nil - } - - av.M = map[string]*dynamodb.AttributeValue{} - fields := unionStructFields(v.Type(), e.MarshalOptions) - for _, f := range fields { - if f.Name == "" { - return &InvalidMarshalError{msg: "map key cannot be empty"} - } - - found := true - fv := fieldByIndex(v, f.Index, func(v *reflect.Value) bool { - found = false - return false // to break the loop. - }) - if !found { - continue - } - elem := &dynamodb.AttributeValue{} - err := e.encode(elem, fv, f.tag) - if err != nil { - return err - } - skip, err := keepOrOmitEmpty(f.OmitEmpty, elem, err) - if err != nil { - return err - } else if skip { - continue - } - - av.M[f.Name] = elem - } - if len(av.M) == 0 { - encodeNull(av) - } - - return nil -} - -func (e *Encoder) encodeMap(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - av.M = map[string]*dynamodb.AttributeValue{} - for _, key := range v.MapKeys() { - keyName := fmt.Sprint(key.Interface()) - if keyName == "" { - return &InvalidMarshalError{msg: "map key cannot be empty"} - } - - elemVal := v.MapIndex(key) - elem := &dynamodb.AttributeValue{} - err := e.encode(elem, elemVal, tag{}) - skip, err := keepOrOmitEmpty(fieldTag.OmitEmptyElem, elem, err) - if err != nil { - return err - } else if skip { - continue - } - - av.M[keyName] = elem - } - if len(av.M) == 0 { - encodeNull(av) - } - - return nil -} - -func (e *Encoder) encodeSlice(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - switch v.Type().Elem().Kind() { - case reflect.Uint8: - b := v.Bytes() - if len(b) == 0 { - encodeNull(av) - return nil - } - av.B = append([]byte{}, b...) - default: - var elemFn func(dynamodb.AttributeValue) error - - if fieldTag.AsBinSet || v.Type() == byteSliceSlicetype { // Binary Set - av.BS = make([][]byte, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - if elem.B == nil { - return &InvalidMarshalError{msg: "binary set must only contain non-nil byte slices"} - } - av.BS = append(av.BS, elem.B) - return nil - } - } else if fieldTag.AsNumSet { // Number Set - av.NS = make([]*string, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - if elem.N == nil { - return &InvalidMarshalError{msg: "number set must only contain non-nil string numbers"} - } - av.NS = append(av.NS, elem.N) - return nil - } - } else if fieldTag.AsStrSet { // String Set - av.SS = make([]*string, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - if elem.S == nil { - return &InvalidMarshalError{msg: "string set must only contain non-nil strings"} - } - av.SS = append(av.SS, elem.S) - return nil - } - } else { // List - av.L = make([]*dynamodb.AttributeValue, 0, v.Len()) - elemFn = func(elem dynamodb.AttributeValue) error { - av.L = append(av.L, &elem) - return nil - } - } - - if n, err := e.encodeList(v, fieldTag, elemFn); err != nil { - return err - } else if n == 0 { - encodeNull(av) - } - } - - return nil -} - -func (e *Encoder) encodeList(v reflect.Value, fieldTag tag, elemFn func(dynamodb.AttributeValue) error) (int, error) { - count := 0 - for i := 0; i < v.Len(); i++ { - elem := dynamodb.AttributeValue{} - err := e.encode(&elem, v.Index(i), tag{OmitEmpty: fieldTag.OmitEmptyElem}) - skip, err := keepOrOmitEmpty(fieldTag.OmitEmptyElem, &elem, err) - if err != nil { - return 0, err - } else if skip { - continue - } - - if err := elemFn(elem); err != nil { - return 0, err - } - count++ - } - - return count, nil -} - -func (e *Encoder) encodeScalar(av *dynamodb.AttributeValue, v reflect.Value, fieldTag tag) error { - if v.Type() == numberType { - s := v.String() - if fieldTag.AsString { - av.S = &s - } else { - av.N = &s - } - return nil - } - - switch v.Kind() { - case reflect.Bool: - av.BOOL = new(bool) - *av.BOOL = v.Bool() - case reflect.String: - if err := e.encodeString(av, v); err != nil { - return err - } - default: - // Fallback to encoding numbers, will return invalid type if not supported - if err := e.encodeNumber(av, v); err != nil { - return err - } - if fieldTag.AsString && av.NULL == nil && av.N != nil { - av.S = av.N - av.N = nil - } - } - - return nil -} - -func (e *Encoder) encodeNumber(av *dynamodb.AttributeValue, v reflect.Value) error { - if used, err := tryMarshaler(av, v); used { - return err - } - - var out string - switch v.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - out = encodeInt(v.Int()) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - out = encodeUint(v.Uint()) - case reflect.Float32, reflect.Float64: - out = encodeFloat(v.Float()) - default: - return &unsupportedMarshalTypeError{Type: v.Type()} - } - - av.N = &out - - return nil -} - -func (e *Encoder) encodeString(av *dynamodb.AttributeValue, v reflect.Value) error { - if used, err := tryMarshaler(av, v); used { - return err - } - - switch v.Kind() { - case reflect.String: - s := v.String() - if len(s) == 0 && e.NullEmptyString { - encodeNull(av) - } else { - av.S = &s - } - default: - return &unsupportedMarshalTypeError{Type: v.Type()} - } - - return nil -} - -func encodeInt(i int64) string { - return strconv.FormatInt(i, 10) -} -func encodeUint(u uint64) string { - return strconv.FormatUint(u, 10) -} -func encodeFloat(f float64) string { - return strconv.FormatFloat(f, 'f', -1, 64) -} -func encodeNull(av *dynamodb.AttributeValue) { - t := true - *av = dynamodb.AttributeValue{NULL: &t} -} - -func valueElem(v reflect.Value) reflect.Value { - switch v.Kind() { - case reflect.Interface, reflect.Ptr: - for v.Kind() == reflect.Interface || v.Kind() == reflect.Ptr { - v = v.Elem() - } - } - - return v -} - -func emptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} - -func tryMarshaler(av *dynamodb.AttributeValue, v reflect.Value) (bool, error) { - if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { - v = v.Addr() - } - - if v.Type().NumMethod() == 0 { - return false, nil - } - - if m, ok := v.Interface().(Marshaler); ok { - return true, m.MarshalDynamoDBAttributeValue(av) - } - - return false, nil -} - -func keepOrOmitEmpty(omitEmpty bool, av *dynamodb.AttributeValue, err error) (bool, error) { - if err != nil { - if _, ok := err.(*unsupportedMarshalTypeError); ok { - return true, nil - } - return false, err - } - - if av.NULL != nil && omitEmpty { - return true, nil - } - - return false, nil -} - -// An InvalidMarshalError is an error type representing an error -// occurring when marshaling a Go value type to an AttributeValue. -type InvalidMarshalError struct { - emptyOrigError - msg string -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *InvalidMarshalError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *InvalidMarshalError) Code() string { - return "InvalidMarshalError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *InvalidMarshalError) Message() string { - return e.msg -} - -// An unsupportedMarshalTypeError represents a Go value type -// which cannot be marshaled into an AttributeValue and should -// be skipped by the marshaler. -type unsupportedMarshalTypeError struct { - emptyOrigError - Type reflect.Type -} - -// Error returns the string representation of the error. -// satisfying the error interface -func (e *unsupportedMarshalTypeError) Error() string { - return fmt.Sprintf("%s: %s", e.Code(), e.Message()) -} - -// Code returns the code of the error, satisfying the awserr.Error -// interface. -func (e *unsupportedMarshalTypeError) Code() string { - return "unsupportedMarshalTypeError" -} - -// Message returns the detailed message of the error, satisfying -// the awserr.Error interface. -func (e *unsupportedMarshalTypeError) Message() string { - return "Go value type " + e.Type.String() + " is not supported" -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode_test.go deleted file mode 100644 index a78f0ca..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode_test.go +++ /dev/null @@ -1,209 +0,0 @@ -package dynamodbattribute - -import ( - "fmt" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/stretchr/testify/assert" -) - -func TestMarshalErrorTypes(t *testing.T) { - var _ awserr.Error = (*InvalidMarshalError)(nil) - var _ awserr.Error = (*unsupportedMarshalTypeError)(nil) -} - -func TestMarshalShared(t *testing.T) { - for i, c := range sharedTestCases { - av, err := Marshal(c.expected) - assertConvertTest(t, i, av, c.in, err, c.err) - } -} - -func TestMarshalListShared(t *testing.T) { - for i, c := range sharedListTestCases { - av, err := MarshalList(c.expected) - assertConvertTest(t, i, av, c.in, err, c.err) - } -} - -func TestMarshalMapShared(t *testing.T) { - for i, c := range sharedMapTestCases { - av, err := MarshalMap(c.expected) - assertConvertTest(t, i, av, c.in, err, c.err) - } -} - -type marshalMarshaler struct { - Value string - Value2 int - Value3 bool - Value4 time.Time -} - -func (m *marshalMarshaler) MarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error { - av.M = map[string]*dynamodb.AttributeValue{ - "abc": {S: &m.Value}, - "def": {N: aws.String(fmt.Sprintf("%d", m.Value2))}, - "ghi": {BOOL: &m.Value3}, - "jkl": {S: aws.String(m.Value4.Format(time.RFC3339Nano))}, - } - - return nil -} - -func TestMarshalMashaler(t *testing.T) { - m := &marshalMarshaler{ - Value: "value", - Value2: 123, - Value3: true, - Value4: testDate, - } - - expect := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "abc": {S: aws.String("value")}, - "def": {N: aws.String("123")}, - "ghi": {BOOL: aws.Bool(true)}, - "jkl": {S: aws.String("2016-05-03T17:06:26.209072Z")}, - }, - } - - actual, err := Marshal(m) - assert.NoError(t, err) - - assert.Equal(t, expect, actual) -} - -type testOmitEmptyElemListStruct struct { - Values []string `dynamodbav:",omitemptyelem"` -} - -type testOmitEmptyElemMapStruct struct { - Values map[string]interface{} `dynamodbav:",omitemptyelem"` -} - -func TestMarshalListOmitEmptyElem(t *testing.T) { - expect := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Values": {L: []*dynamodb.AttributeValue{ - {S: aws.String("abc")}, - {S: aws.String("123")}, - }}, - }, - } - - m := testOmitEmptyElemListStruct{Values: []string{"abc", "", "123"}} - - actual, err := Marshal(m) - assert.NoError(t, err) - assert.Equal(t, expect, actual) -} - -func TestMarshalMapOmitEmptyElem(t *testing.T) { - expect := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Values": {M: map[string]*dynamodb.AttributeValue{ - "abc": {N: aws.String("123")}, - "klm": {S: aws.String("abc")}, - }}, - }, - } - - m := testOmitEmptyElemMapStruct{Values: map[string]interface{}{ - "abc": 123., - "efg": nil, - "hij": "", - "klm": "abc", - }} - - actual, err := Marshal(m) - assert.NoError(t, err) - assert.Equal(t, expect, actual) -} - -type testOmitEmptyScalar struct { - IntZero int `dynamodbav:",omitempty"` - IntPtrNil *int `dynamodbav:",omitempty"` - IntPtrSetZero *int `dynamodbav:",omitempty"` -} - -func TestMarshalOmitEmpty(t *testing.T) { - expect := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "IntPtrSetZero": {N: aws.String("0")}, - }, - } - - m := testOmitEmptyScalar{IntPtrSetZero: aws.Int(0)} - - actual, err := Marshal(m) - assert.NoError(t, err) - assert.Equal(t, expect, actual) -} - -func TestEncodeEmbeddedPointerStruct(t *testing.T) { - type B struct { - Bint int - } - type C struct { - Cint int - } - type A struct { - Aint int - *B - *C - } - a := A{Aint: 321, B: &B{123}} - assert.Equal(t, 321, a.Aint) - assert.Equal(t, 123, a.Bint) - assert.Nil(t, a.C) - - actual, err := Marshal(a) - assert.NoError(t, err) - expect := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Aint": { - N: aws.String("321"), - }, - "Bint": { - N: aws.String("123"), - }, - }, - } - assert.Equal(t, expect, actual) -} - -func TestEncodeUnixTime(t *testing.T) { - type A struct { - Normal time.Time - Tagged time.Time `dynamodbav:",unixtime"` - Typed UnixTime - } - - a := A{ - Normal: time.Unix(123, 0).UTC(), - Tagged: time.Unix(456, 0), - Typed: UnixTime(time.Unix(789, 0)), - } - - actual, err := Marshal(a) - assert.NoError(t, err) - expect := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Normal": { - S: aws.String("1970-01-01T00:02:03Z"), - }, - "Tagged": { - N: aws.String("456"), - }, - "Typed": { - N: aws.String("789"), - }, - }, - } - assert.Equal(t, expect, actual) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go deleted file mode 100644 index 1fe0d35..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go +++ /dev/null @@ -1,269 +0,0 @@ -package dynamodbattribute - -import ( - "reflect" - "sort" - "strings" -) - -type field struct { - tag - - Name string - NameFromTag bool - - Index []int - Type reflect.Type -} - -func fieldByName(fields []field, name string) (field, bool) { - foldExists := false - foldField := field{} - - for _, f := range fields { - if f.Name == name { - return f, true - } - if !foldExists && strings.EqualFold(f.Name, name) { - foldField = f - foldExists = true - } - } - - return foldField, foldExists -} - -func buildField(pIdx []int, i int, sf reflect.StructField, fieldTag tag) field { - f := field{ - Name: sf.Name, - Type: sf.Type, - tag: fieldTag, - } - if len(fieldTag.Name) != 0 { - f.NameFromTag = true - f.Name = fieldTag.Name - } - - f.Index = make([]int, len(pIdx)+1) - copy(f.Index, pIdx) - f.Index[len(pIdx)] = i - - return f -} - -func unionStructFields(t reflect.Type, opts MarshalOptions) []field { - fields := enumFields(t, opts) - - sort.Sort(fieldsByName(fields)) - - fields = visibleFields(fields) - - return fields -} - -// enumFields will recursively iterate through a structure and its nested -// anonymous fields. -// -// Based on the enoding/json struct field enumeration of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go typeField func. -func enumFields(t reflect.Type, opts MarshalOptions) []field { - // Fields to explore - current := []field{} - next := []field{{Type: t}} - - // count of queued names - count := map[reflect.Type]int{} - nextCount := map[reflect.Type]int{} - - visited := map[reflect.Type]struct{}{} - fields := []field{} - - for len(next) > 0 { - current, next = next, current[:0] - count, nextCount = nextCount, map[reflect.Type]int{} - - for _, f := range current { - if _, ok := visited[f.Type]; ok { - continue - } - visited[f.Type] = struct{}{} - - for i := 0; i < f.Type.NumField(); i++ { - sf := f.Type.Field(i) - if sf.PkgPath != "" && !sf.Anonymous { - // Ignore unexported and non-anonymous fields - // unexported but anonymous field may still be used if - // the type has exported nested fields - continue - } - - fieldTag := tag{} - fieldTag.parseAVTag(sf.Tag) - if opts.SupportJSONTags && fieldTag == (tag{}) { - fieldTag.parseJSONTag(sf.Tag) - } - - if fieldTag.Ignore { - continue - } - - ft := sf.Type - if ft.Name() == "" && ft.Kind() == reflect.Ptr { - ft = ft.Elem() - } - - structField := buildField(f.Index, i, sf, fieldTag) - structField.Type = ft - - if !sf.Anonymous || ft.Kind() != reflect.Struct { - fields = append(fields, structField) - if count[f.Type] > 1 { - // If there were multiple instances, add a second, - // so that the annihilation code will see a duplicate. - // It only cares about the distinction between 1 or 2, - // so don't bother generating any more copies. - fields = append(fields, structField) - } - continue - } - - // Record new anon struct to explore next round - nextCount[ft]++ - if nextCount[ft] == 1 { - next = append(next, structField) - } - } - } - } - - return fields -} - -// visibleFields will return a slice of fields which are visible based on -// Go's standard visiblity rules with the exception of ties being broken -// by depth and struct tag naming. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go typeField func. -func visibleFields(fields []field) []field { - // Delete all fields that are hidden by the Go rules for embedded fields, - // except that fields with JSON tags are promoted. - - // The fields are sorted in primary order of name, secondary order - // of field index length. Loop over names; for each name, delete - // hidden fields by choosing the one dominant field that survives. - out := fields[:0] - for advance, i := 0, 0; i < len(fields); i += advance { - // One iteration per name. - // Find the sequence of fields with the name of this first field. - fi := fields[i] - name := fi.Name - for advance = 1; i+advance < len(fields); advance++ { - fj := fields[i+advance] - if fj.Name != name { - break - } - } - if advance == 1 { // Only one field with this name - out = append(out, fi) - continue - } - dominant, ok := dominantField(fields[i : i+advance]) - if ok { - out = append(out, dominant) - } - } - - fields = out - sort.Sort(fieldsByIndex(fields)) - - return fields -} - -// dominantField looks through the fields, all of which are known to -// have the same name, to find the single field that dominates the -// others using Go's embedding rules, modified by the presence of -// JSON tags. If there are multiple top-level fields, the boolean -// will be false: This condition is an error in Go and we skip all -// the fields. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go dominantField func. -func dominantField(fields []field) (field, bool) { - // The fields are sorted in increasing index-length order. The winner - // must therefore be one with the shortest index length. Drop all - // longer entries, which is easy: just truncate the slice. - length := len(fields[0].Index) - tagged := -1 // Index of first tagged field. - for i, f := range fields { - if len(f.Index) > length { - fields = fields[:i] - break - } - if f.NameFromTag { - if tagged >= 0 { - // Multiple tagged fields at the same level: conflict. - // Return no field. - return field{}, false - } - tagged = i - } - } - if tagged >= 0 { - return fields[tagged], true - } - // All remaining fields have the same length. If there's more than one, - // we have a conflict (two fields named "X" at the same level) and we - // return no field. - if len(fields) > 1 { - return field{}, false - } - return fields[0], true -} - -// fieldsByName sorts field by name, breaking ties with depth, -// then breaking ties with "name came from json tag", then -// breaking ties with index sequence. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go fieldsByName type. -type fieldsByName []field - -func (x fieldsByName) Len() int { return len(x) } - -func (x fieldsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x fieldsByName) Less(i, j int) bool { - if x[i].Name != x[j].Name { - return x[i].Name < x[j].Name - } - if len(x[i].Index) != len(x[j].Index) { - return len(x[i].Index) < len(x[j].Index) - } - if x[i].NameFromTag != x[j].NameFromTag { - return x[i].NameFromTag - } - return fieldsByIndex(x).Less(i, j) -} - -// fieldsByIndex sorts field by index sequence. -// -// Based on the enoding/json field filtering of the Go Stdlib -// https://golang.org/src/encoding/json/encode.go fieldsByIndex type. -type fieldsByIndex []field - -func (x fieldsByIndex) Len() int { return len(x) } - -func (x fieldsByIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x fieldsByIndex) Less(i, j int) bool { - for k, xik := range x[i].Index { - if k >= len(x[j].Index) { - return false - } - if xik != x[j].Index[k] { - return xik < x[j].Index[k] - } - } - return len(x[i].Index) < len(x[j].Index) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field_test.go deleted file mode 100644 index 58ee17b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package dynamodbattribute - -import ( - "reflect" - "testing" - - "github.com/stretchr/testify/assert" -) - -type testUnionValues struct { - Name string - Value interface{} -} - -type unionSimple struct { - A int - B string - C []string -} - -type unionComplex struct { - unionSimple - A int -} - -type unionTagged struct { - A int `json:"A"` -} - -type unionTaggedComplex struct { - unionSimple - unionTagged - B string -} - -func TestUnionStructFields(t *testing.T) { - var cases = []struct { - in interface{} - expect []testUnionValues - }{ - { - in: unionSimple{1, "2", []string{"abc"}}, - expect: []testUnionValues{ - {"A", 1}, - {"B", "2"}, - {"C", []string{"abc"}}, - }, - }, - { - in: unionComplex{ - unionSimple: unionSimple{1, "2", []string{"abc"}}, - A: 2, - }, - expect: []testUnionValues{ - {"B", "2"}, - {"C", []string{"abc"}}, - {"A", 2}, - }, - }, - { - in: unionTaggedComplex{ - unionSimple: unionSimple{1, "2", []string{"abc"}}, - unionTagged: unionTagged{3}, - B: "3", - }, - expect: []testUnionValues{ - {"C", []string{"abc"}}, - {"A", 3}, - {"B", "3"}, - }, - }, - } - - for i, c := range cases { - v := reflect.ValueOf(c.in) - - fields := unionStructFields(v.Type(), MarshalOptions{SupportJSONTags: true}) - for j, f := range fields { - expected := c.expect[j] - assert.Equal(t, expected.Name, f.Name, "case %d, field %d", i, j) - actual := v.FieldByIndex(f.Index).Interface() - assert.EqualValues(t, expected.Value, actual, "case %d, field %d", i, j) - } - } -} - -func TestFieldByName(t *testing.T) { - fields := []field{ - {Name: "Abc"}, {Name: "mixCase"}, {Name: "UPPERCASE"}, - } - - cases := []struct { - Name, FieldName string - Found bool - }{ - {"abc", "Abc", true}, {"ABC", "Abc", true}, {"Abc", "Abc", true}, - {"123", "", false}, - {"ab", "", false}, - {"MixCase", "mixCase", true}, - {"uppercase", "UPPERCASE", true}, {"UPPERCASE", "UPPERCASE", true}, - } - - for _, c := range cases { - f, ok := fieldByName(fields, c.Name) - assert.Equal(t, c.Found, ok) - if ok { - assert.Equal(t, c.FieldName, f.Name) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/marshaler_examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/marshaler_examples_test.go deleted file mode 100644 index 049d3e7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/marshaler_examples_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package dynamodbattribute_test - -import ( - "fmt" - "reflect" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" -) - -func ExampleMarshal() { - type Record struct { - Bytes []byte - MyField string - Letters []string - Numbers []int - } - - r := Record{ - Bytes: []byte{48, 49}, - MyField: "MyFieldValue", - Letters: []string{"a", "b", "c", "d"}, - Numbers: []int{1, 2, 3}, - } - av, err := dynamodbattribute.Marshal(r) - fmt.Println("err", err) - fmt.Println("Bytes", av.M["Bytes"]) - fmt.Println("MyField", av.M["MyField"]) - fmt.Println("Letters", av.M["Letters"]) - fmt.Println("Numbers", av.M["Numbers"]) - - // Output: - // err - // Bytes { - // B: len 2 - // } - // MyField { - // S: "MyFieldValue" - // } - // Letters { - // L: [ - // { - // S: "a" - // }, - // { - // S: "b" - // }, - // { - // S: "c" - // }, - // { - // S: "d" - // } - // ] - // } - // Numbers { - // L: [{ - // N: "1" - // },{ - // N: "2" - // },{ - // N: "3" - // }] - // } -} - -func ExampleUnmarshal() { - type Record struct { - Bytes []byte - MyField string - Letters []string - A2Num map[string]int - } - - expect := Record{ - Bytes: []byte{48, 49}, - MyField: "MyFieldValue", - Letters: []string{"a", "b", "c", "d"}, - A2Num: map[string]int{"a": 1, "b": 2, "c": 3}, - } - - av := &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Bytes": {B: []byte{48, 49}}, - "MyField": {S: aws.String("MyFieldValue")}, - "Letters": {L: []*dynamodb.AttributeValue{ - {S: aws.String("a")}, {S: aws.String("b")}, {S: aws.String("c")}, {S: aws.String("d")}, - }}, - "A2Num": {M: map[string]*dynamodb.AttributeValue{ - "a": {N: aws.String("1")}, - "b": {N: aws.String("2")}, - "c": {N: aws.String("3")}, - }}, - }, - } - - actual := Record{} - err := dynamodbattribute.Unmarshal(av, &actual) - fmt.Println(err, reflect.DeepEqual(expect, actual)) - - // Output: - // true -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/marshaler_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/marshaler_test.go deleted file mode 100644 index 819bbc6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/marshaler_test.go +++ /dev/null @@ -1,526 +0,0 @@ -package dynamodbattribute - -import ( - "math" - "reflect" - "testing" - - "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/service/dynamodb" -) - -type simpleMarshalStruct struct { - Byte []byte - String string - Int int - Uint uint - Float32 float32 - Float64 float64 - Bool bool - Null *interface{} -} - -type complexMarshalStruct struct { - Simple []simpleMarshalStruct -} - -type myByteStruct struct { - Byte []byte -} - -type myByteSetStruct struct { - ByteSet [][]byte -} - -type marshallerTestInput struct { - input interface{} - expected interface{} - err awserr.Error -} - -var marshalerScalarInputs = []marshallerTestInput{ - { - input: nil, - expected: &dynamodb.AttributeValue{NULL: &trueValue}, - }, - { - input: "some string", - expected: &dynamodb.AttributeValue{S: aws.String("some string")}, - }, - { - input: true, - expected: &dynamodb.AttributeValue{BOOL: &trueValue}, - }, - { - input: false, - expected: &dynamodb.AttributeValue{BOOL: &falseValue}, - }, - { - input: 3.14, - expected: &dynamodb.AttributeValue{N: aws.String("3.14")}, - }, - { - input: math.MaxFloat32, - expected: &dynamodb.AttributeValue{N: aws.String("340282346638528860000000000000000000000")}, - }, - { - input: math.MaxFloat64, - expected: &dynamodb.AttributeValue{N: aws.String("179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")}, - }, - { - input: 12, - expected: &dynamodb.AttributeValue{N: aws.String("12")}, - }, - { - input: Number("12"), - expected: &dynamodb.AttributeValue{N: aws.String("12")}, - }, - { - input: simpleMarshalStruct{}, - expected: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Byte": {NULL: &trueValue}, - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {NULL: &trueValue}, - "Uint": {N: aws.String("0")}, - }, - }, - }, -} - -var marshallerMapTestInputs = []marshallerTestInput{ - // Scalar tests - { - input: nil, - expected: map[string]*dynamodb.AttributeValue{}, - }, - { - input: map[string]interface{}{"string": "some string"}, - expected: map[string]*dynamodb.AttributeValue{"string": {S: aws.String("some string")}}, - }, - { - input: map[string]interface{}{"bool": true}, - expected: map[string]*dynamodb.AttributeValue{"bool": {BOOL: &trueValue}}, - }, - { - input: map[string]interface{}{"bool": false}, - expected: map[string]*dynamodb.AttributeValue{"bool": {BOOL: &falseValue}}, - }, - { - input: map[string]interface{}{"null": nil}, - expected: map[string]*dynamodb.AttributeValue{"null": {NULL: &trueValue}}, - }, - { - input: map[string]interface{}{"float": 3.14}, - expected: map[string]*dynamodb.AttributeValue{"float": {N: aws.String("3.14")}}, - }, - { - input: map[string]interface{}{"float": math.MaxFloat32}, - expected: map[string]*dynamodb.AttributeValue{"float": {N: aws.String("340282346638528860000000000000000000000")}}, - }, - { - input: map[string]interface{}{"float": math.MaxFloat64}, - expected: map[string]*dynamodb.AttributeValue{"float": {N: aws.String("179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")}}, - }, - { - input: map[string]interface{}{"num": 12.}, - expected: map[string]*dynamodb.AttributeValue{"num": {N: aws.String("12")}}, - }, - { - input: map[string]interface{}{"byte": []byte{48, 49}}, - expected: map[string]*dynamodb.AttributeValue{"byte": {B: []byte{48, 49}}}, - }, - { - input: struct{ Byte []byte }{Byte: []byte{48, 49}}, - expected: map[string]*dynamodb.AttributeValue{"Byte": {B: []byte{48, 49}}}, - }, - { - input: map[string]interface{}{"byte_set": [][]byte{{48, 49}, {50, 51}}}, - expected: map[string]*dynamodb.AttributeValue{"byte_set": {BS: [][]byte{{48, 49}, {50, 51}}}}, - }, - { - input: struct{ ByteSet [][]byte }{ByteSet: [][]byte{{48, 49}, {50, 51}}}, - expected: map[string]*dynamodb.AttributeValue{"ByteSet": {BS: [][]byte{{48, 49}, {50, 51}}}}, - }, - // List - { - input: map[string]interface{}{"list": []interface{}{"a string", 12., 3.14, true, nil, false}}, - expected: map[string]*dynamodb.AttributeValue{ - "list": { - L: []*dynamodb.AttributeValue{ - {S: aws.String("a string")}, - {N: aws.String("12")}, - {N: aws.String("3.14")}, - {BOOL: &trueValue}, - {NULL: &trueValue}, - {BOOL: &falseValue}, - }, - }, - }, - }, - // Map - { - input: map[string]interface{}{"map": map[string]interface{}{"nestednum": 12.}}, - expected: map[string]*dynamodb.AttributeValue{ - "map": { - M: map[string]*dynamodb.AttributeValue{ - "nestednum": { - N: aws.String("12"), - }, - }, - }, - }, - }, - // Structs - { - input: simpleMarshalStruct{}, - expected: map[string]*dynamodb.AttributeValue{ - "Byte": {NULL: &trueValue}, - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {NULL: &trueValue}, - "Uint": {N: aws.String("0")}, - }, - }, - { - input: complexMarshalStruct{}, - expected: map[string]*dynamodb.AttributeValue{ - "Simple": {NULL: &trueValue}, - }, - }, - { - input: struct { - Simple []string `json:"simple"` - }{}, - expected: map[string]*dynamodb.AttributeValue{ - "simple": {NULL: &trueValue}, - }, - }, - { - input: struct { - Simple []string `json:"simple,omitempty"` - }{}, - expected: map[string]*dynamodb.AttributeValue{}, - }, - { - input: struct { - Simple []string `json:"-"` - }{}, - expected: map[string]*dynamodb.AttributeValue{}, - }, - { - input: complexMarshalStruct{Simple: []simpleMarshalStruct{{Int: -2}, {Uint: 5}}}, - expected: map[string]*dynamodb.AttributeValue{ - "Simple": { - L: []*dynamodb.AttributeValue{ - { - M: map[string]*dynamodb.AttributeValue{ - "Byte": {NULL: &trueValue}, - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("-2")}, - "Null": {NULL: &trueValue}, - "String": {NULL: &trueValue}, - "Uint": {N: aws.String("0")}, - }, - }, - { - M: map[string]*dynamodb.AttributeValue{ - "Byte": {NULL: &trueValue}, - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {NULL: &trueValue}, - "Uint": {N: aws.String("5")}, - }, - }, - }, - }, - }, - }, -} - -var marshallerListTestInputs = []marshallerTestInput{ - { - input: nil, - expected: []*dynamodb.AttributeValue{}, - }, - { - input: []interface{}{}, - expected: []*dynamodb.AttributeValue{}, - }, - { - input: []simpleMarshalStruct{}, - expected: []*dynamodb.AttributeValue{}, - }, - { - input: []interface{}{"a string", 12., 3.14, true, nil, false}, - expected: []*dynamodb.AttributeValue{ - {S: aws.String("a string")}, - {N: aws.String("12")}, - {N: aws.String("3.14")}, - {BOOL: &trueValue}, - {NULL: &trueValue}, - {BOOL: &falseValue}, - }, - }, - { - input: []simpleMarshalStruct{{}}, - expected: []*dynamodb.AttributeValue{ - { - M: map[string]*dynamodb.AttributeValue{ - "Byte": {NULL: &trueValue}, - "Bool": {BOOL: &falseValue}, - "Float32": {N: aws.String("0")}, - "Float64": {N: aws.String("0")}, - "Int": {N: aws.String("0")}, - "Null": {NULL: &trueValue}, - "String": {NULL: &trueValue}, - "Uint": {N: aws.String("0")}, - }, - }, - }, - }, -} - -func Test_New_Marshal(t *testing.T) { - for _, test := range marshalerScalarInputs { - testMarshal(t, test) - } -} - -func testMarshal(t *testing.T, test marshallerTestInput) { - actual, err := Marshal(test.input) - if test.err != nil { - if err == nil { - t.Errorf("Marshal with input %#v retured %#v, expected error `%s`", test.input, actual, test.err) - } else if err.Error() != test.err.Error() { - t.Errorf("Marshal with input %#v retured error `%s`, expected error `%s`", test.input, err, test.err) - } - } else { - if err != nil { - t.Errorf("Marshal with input %#v retured error `%s`", test.input, err) - } - compareObjects(t, test.expected, actual) - } -} - -func Test_New_Unmarshal(t *testing.T) { - // Using the same inputs from Marshal, test the reverse mapping. - for i, test := range marshalerScalarInputs { - if test.input == nil { - continue - } - actual := reflect.New(reflect.TypeOf(test.input)).Interface() - if err := Unmarshal(test.expected.(*dynamodb.AttributeValue), actual); err != nil { - t.Errorf("Unmarshal %d, with input %#v retured error `%s`", i+1, test.expected, err) - } - compareObjects(t, test.input, reflect.ValueOf(actual).Elem().Interface()) - } -} - -func Test_New_UnmarshalError(t *testing.T) { - // Test that we get an error using Unmarshal to convert to a nil value. - expected := &InvalidUnmarshalError{Type: reflect.TypeOf(nil)} - if err := Unmarshal(nil, nil); err == nil { - t.Errorf("Unmarshal with input %T returned no error, expected error `%v`", nil, expected) - } else if err.Error() != expected.Error() { - t.Errorf("Unmarshal with input %T returned error `%v`, expected error `%v`", nil, err, expected) - } - - // Test that we get an error using Unmarshal to convert to a non-pointer value. - var actual map[string]interface{} - expected = &InvalidUnmarshalError{Type: reflect.TypeOf(actual)} - if err := Unmarshal(nil, actual); err == nil { - t.Errorf("Unmarshal with input %T returned no error, expected error `%v`", actual, expected) - } else if err.Error() != expected.Error() { - t.Errorf("Unmarshal with input %T returned error `%v`, expected error `%v`", actual, err, expected) - } - - // Test that we get an error using Unmarshal to convert to nil struct. - var actual2 *struct{ A int } - expected = &InvalidUnmarshalError{Type: reflect.TypeOf(actual2)} - if err := Unmarshal(nil, actual2); err == nil { - t.Errorf("Unmarshal with input %T returned no error, expected error `%v`", actual2, expected) - } else if err.Error() != expected.Error() { - t.Errorf("Unmarshal with input %T returned error `%v`, expected error `%v`", actual2, err, expected) - } -} - -func Test_New_MarshalMap(t *testing.T) { - for _, test := range marshallerMapTestInputs { - testMarshalMap(t, test) - } -} - -func testMarshalMap(t *testing.T, test marshallerTestInput) { - actual, err := MarshalMap(test.input) - if test.err != nil { - if err == nil { - t.Errorf("MarshalMap with input %#v retured %#v, expected error `%s`", test.input, actual, test.err) - } else if err.Error() != test.err.Error() { - t.Errorf("MarshalMap with input %#v retured error `%s`, expected error `%s`", test.input, err, test.err) - } - } else { - if err != nil { - t.Errorf("MarshalMap with input %#v retured error `%s`", test.input, err) - } - compareObjects(t, test.expected, actual) - } -} - -func Test_New_UnmarshalMap(t *testing.T) { - // Using the same inputs from MarshalMap, test the reverse mapping. - for i, test := range marshallerMapTestInputs { - if test.input == nil { - continue - } - actual := reflect.New(reflect.TypeOf(test.input)).Interface() - if err := UnmarshalMap(test.expected.(map[string]*dynamodb.AttributeValue), actual); err != nil { - t.Errorf("Unmarshal %d, with input %#v retured error `%s`", i+1, test.expected, err) - } - compareObjects(t, test.input, reflect.ValueOf(actual).Elem().Interface()) - } -} - -func Test_New_UnmarshalMapError(t *testing.T) { - // Test that we get an error using UnmarshalMap to convert to a nil value. - expected := &InvalidUnmarshalError{Type: reflect.TypeOf(nil)} - if err := UnmarshalMap(nil, nil); err == nil { - t.Errorf("UnmarshalMap with input %T returned no error, expected error `%v`", nil, expected) - } else if err.Error() != expected.Error() { - t.Errorf("UnmarshalMap with input %T returned error `%v`, expected error `%v`", nil, err, expected) - } - - // Test that we get an error using UnmarshalMap to convert to a non-pointer value. - var actual map[string]interface{} - expected = &InvalidUnmarshalError{Type: reflect.TypeOf(actual)} - if err := UnmarshalMap(nil, actual); err == nil { - t.Errorf("UnmarshalMap with input %T returned no error, expected error `%v`", actual, expected) - } else if err.Error() != expected.Error() { - t.Errorf("UnmarshalMap with input %T returned error `%v`, expected error `%v`", actual, err, expected) - } - - // Test that we get an error using UnmarshalMap to convert to nil struct. - var actual2 *struct{ A int } - expected = &InvalidUnmarshalError{Type: reflect.TypeOf(actual2)} - if err := UnmarshalMap(nil, actual2); err == nil { - t.Errorf("UnmarshalMap with input %T returned no error, expected error `%v`", actual2, expected) - } else if err.Error() != expected.Error() { - t.Errorf("UnmarshalMap with input %T returned error `%v`, expected error `%v`", actual2, err, expected) - } -} - -func Test_New_MarshalList(t *testing.T) { - for _, test := range marshallerListTestInputs { - testMarshalList(t, test) - } -} - -func testMarshalList(t *testing.T, test marshallerTestInput) { - actual, err := MarshalList(test.input) - if test.err != nil { - if err == nil { - t.Errorf("MarshalList with input %#v retured %#v, expected error `%s`", test.input, actual, test.err) - } else if err.Error() != test.err.Error() { - t.Errorf("MarshalList with input %#v retured error `%s`, expected error `%s`", test.input, err, test.err) - } - } else { - if err != nil { - t.Errorf("MarshalList with input %#v retured error `%s`", test.input, err) - } - compareObjects(t, test.expected, actual) - } -} - -func Test_New_UnmarshalList(t *testing.T) { - // Using the same inputs from MarshalList, test the reverse mapping. - for i, test := range marshallerListTestInputs { - if test.input == nil { - continue - } - iv := reflect.ValueOf(test.input) - - actual := reflect.New(iv.Type()) - if iv.Kind() == reflect.Slice { - actual.Elem().Set(reflect.MakeSlice(iv.Type(), iv.Len(), iv.Cap())) - } - - if err := UnmarshalList(test.expected.([]*dynamodb.AttributeValue), actual.Interface()); err != nil { - t.Errorf("Unmarshal %d, with input %#v retured error `%s`", i+1, test.expected, err) - } - compareObjects(t, test.input, actual.Elem().Interface()) - } -} - -func Test_New_UnmarshalListError(t *testing.T) { - // Test that we get an error using UnmarshalList to convert to a nil value. - expected := &InvalidUnmarshalError{Type: reflect.TypeOf(nil)} - if err := UnmarshalList(nil, nil); err == nil { - t.Errorf("UnmarshalList with input %T returned no error, expected error `%v`", nil, expected) - } else if err.Error() != expected.Error() { - t.Errorf("UnmarshalList with input %T returned error `%v`, expected error `%v`", nil, err, expected) - } - - // Test that we get an error using UnmarshalList to convert to a non-pointer value. - var actual map[string]interface{} - expected = &InvalidUnmarshalError{Type: reflect.TypeOf(actual)} - if err := UnmarshalList(nil, actual); err == nil { - t.Errorf("UnmarshalList with input %T returned no error, expected error `%v`", actual, expected) - } else if err.Error() != expected.Error() { - t.Errorf("UnmarshalList with input %T returned error `%v`, expected error `%v`", actual, err, expected) - } - - // Test that we get an error using UnmarshalList to convert to nil struct. - var actual2 *struct{ A int } - expected = &InvalidUnmarshalError{Type: reflect.TypeOf(actual2)} - if err := UnmarshalList(nil, actual2); err == nil { - t.Errorf("UnmarshalList with input %T returned no error, expected error `%v`", actual2, expected) - } else if err.Error() != expected.Error() { - t.Errorf("UnmarshalList with input %T returned error `%v`, expected error `%v`", actual2, err, expected) - } -} - -func compareObjects(t *testing.T, expected interface{}, actual interface{}) { - if !reflect.DeepEqual(expected, actual) { - ev := reflect.ValueOf(expected) - av := reflect.ValueOf(actual) - t.Errorf("\nExpected kind(%s,%T):\n%s\nActual kind(%s,%T):\n%s\n", - ev.Kind(), - ev.Interface(), - awsutil.Prettify(expected), - av.Kind(), - ev.Interface(), - awsutil.Prettify(actual)) - } -} - -func BenchmarkMarshal(b *testing.B) { - d := simpleMarshalStruct{ - String: "abc", - Int: 123, - Uint: 123, - Float32: 123.321, - Float64: 123.321, - Bool: true, - Null: nil, - } - for i := 0; i < b.N; i++ { - _, err := Marshal(d) - if err != nil { - b.Fatal("unexpected error", err) - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/shared_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/shared_test.go deleted file mode 100644 index 480fe16..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/shared_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package dynamodbattribute - -import ( - "reflect" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/stretchr/testify/assert" -) - -type testBinarySetStruct struct { - Binarys [][]byte `dynamodbav:",binaryset"` -} -type testNumberSetStruct struct { - Numbers []int `dynamodbav:",numberset"` -} -type testStringSetStruct struct { - Strings []string `dynamodbav:",stringset"` -} - -type testIntAsStringStruct struct { - Value int `dynamodbav:",string"` -} - -type testOmitEmptyStruct struct { - Value string `dynamodbav:",omitempty"` - Value2 *string `dynamodbav:",omitempty"` - Value3 int -} - -type testAliasedString string -type testAliasedStringSlice []string -type testAliasedInt int -type testAliasedIntSlice []int -type testAliasedMap map[string]int -type testAliasedSlice []string -type testAliasedByteSlice []byte -type testAliasedBool bool -type testAliasedBoolSlice []bool - -type testAliasedStruct struct { - Value testAliasedString - Value2 testAliasedInt - Value3 testAliasedMap - Value4 testAliasedSlice - - Value5 testAliasedByteSlice - Value6 []testAliasedInt - Value7 []testAliasedString - - Value8 []testAliasedByteSlice `dynamodbav:",binaryset"` - Value9 []testAliasedInt `dynamodbav:",numberset"` - Value10 []testAliasedString `dynamodbav:",stringset"` - - Value11 testAliasedIntSlice - Value12 testAliasedStringSlice - - Value13 testAliasedBool - Value14 testAliasedBoolSlice -} - -type testNamedPointer *int - -var testDate, _ = time.Parse(time.RFC3339, "2016-05-03T17:06:26.209072Z") - -var sharedTestCases = []struct { - in *dynamodb.AttributeValue - actual, expected interface{} - err error -}{ - { // Binary slice - in: &dynamodb.AttributeValue{B: []byte{48, 49}}, - actual: &[]byte{}, - expected: []byte{48, 49}, - }, - { // Binary slice - in: &dynamodb.AttributeValue{B: []byte{48, 49}}, - actual: &[]byte{}, - expected: []byte{48, 49}, - }, - { // Binary slice oversized - in: &dynamodb.AttributeValue{B: []byte{48, 49}}, - actual: func() *[]byte { - v := make([]byte, 0, 10) - return &v - }(), - expected: []byte{48, 49}, - }, - { // Binary slice pointer - in: &dynamodb.AttributeValue{B: []byte{48, 49}}, - actual: func() **[]byte { - v := make([]byte, 0, 10) - v2 := &v - return &v2 - }(), - expected: []byte{48, 49}, - }, - { // Bool - in: &dynamodb.AttributeValue{BOOL: aws.Bool(true)}, - actual: new(bool), - expected: true, - }, - { // List - in: &dynamodb.AttributeValue{L: []*dynamodb.AttributeValue{ - {N: aws.String("123")}, - }}, - actual: &[]int{}, - expected: []int{123}, - }, - { // Map, interface - in: &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - "abc": {N: aws.String("123")}, - }}, - actual: &map[string]int{}, - expected: map[string]int{"abc": 123}, - }, - { // Map, struct - in: &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - "Abc": {N: aws.String("123")}, - }}, - actual: &struct{ Abc int }{}, - expected: struct{ Abc int }{Abc: 123}, - }, - { // Map, struct - in: &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - "abc": {N: aws.String("123")}, - }}, - actual: &struct { - Abc int `json:"abc" dynamodbav:"abc"` - }{}, - expected: struct { - Abc int `json:"abc" dynamodbav:"abc"` - }{Abc: 123}, - }, - { // Number, int - in: &dynamodb.AttributeValue{N: aws.String("123")}, - actual: new(int), - expected: 123, - }, - { // Number, Float - in: &dynamodb.AttributeValue{N: aws.String("123.1")}, - actual: new(float64), - expected: float64(123.1), - }, - { // Null - in: &dynamodb.AttributeValue{NULL: aws.Bool(true)}, - actual: new(string), - expected: "", - }, - { // Null ptr - in: &dynamodb.AttributeValue{NULL: aws.Bool(true)}, - actual: new(*string), - expected: nil, - }, - { // String - in: &dynamodb.AttributeValue{S: aws.String("abc")}, - actual: new(string), - expected: "abc", - }, - { // Binary Set - in: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Binarys": {BS: [][]byte{{48, 49}, {50, 51}}}, - }, - }, - actual: &testBinarySetStruct{}, - expected: testBinarySetStruct{Binarys: [][]byte{{48, 49}, {50, 51}}}, - }, - { // Number Set - in: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Numbers": {NS: []*string{aws.String("123"), aws.String("321")}}, - }, - }, - actual: &testNumberSetStruct{}, - expected: testNumberSetStruct{Numbers: []int{123, 321}}, - }, - { // String Set - in: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Strings": {SS: []*string{aws.String("abc"), aws.String("efg")}}, - }, - }, - actual: &testStringSetStruct{}, - expected: testStringSetStruct{Strings: []string{"abc", "efg"}}, - }, - { // Int value as string - in: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Value": {S: aws.String("123")}, - }, - }, - actual: &testIntAsStringStruct{}, - expected: testIntAsStringStruct{Value: 123}, - }, - { // Omitempty - in: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Value3": {N: aws.String("0")}, - }, - }, - actual: &testOmitEmptyStruct{}, - expected: testOmitEmptyStruct{Value: "", Value2: nil, Value3: 0}, - }, - { // aliased type - in: &dynamodb.AttributeValue{ - M: map[string]*dynamodb.AttributeValue{ - "Value": {S: aws.String("123")}, - "Value2": {N: aws.String("123")}, - "Value3": {M: map[string]*dynamodb.AttributeValue{ - "Key": {N: aws.String("321")}, - }}, - "Value4": {L: []*dynamodb.AttributeValue{ - {S: aws.String("1")}, - {S: aws.String("2")}, - {S: aws.String("3")}, - }}, - "Value5": {B: []byte{0, 1, 2}}, - "Value6": {L: []*dynamodb.AttributeValue{ - {N: aws.String("1")}, - {N: aws.String("2")}, - {N: aws.String("3")}, - }}, - "Value7": {L: []*dynamodb.AttributeValue{ - {S: aws.String("1")}, - {S: aws.String("2")}, - {S: aws.String("3")}, - }}, - "Value8": {BS: [][]byte{ - {0, 1, 2}, {3, 4, 5}, - }}, - "Value9": {NS: []*string{ - aws.String("1"), - aws.String("2"), - aws.String("3"), - }}, - "Value10": {SS: []*string{ - aws.String("1"), - aws.String("2"), - aws.String("3"), - }}, - "Value11": {L: []*dynamodb.AttributeValue{ - {N: aws.String("1")}, - {N: aws.String("2")}, - {N: aws.String("3")}, - }}, - "Value12": {L: []*dynamodb.AttributeValue{ - {S: aws.String("1")}, - {S: aws.String("2")}, - {S: aws.String("3")}, - }}, - "Value13": {BOOL: aws.Bool(true)}, - "Value14": {L: []*dynamodb.AttributeValue{ - {BOOL: aws.Bool(true)}, - {BOOL: aws.Bool(false)}, - {BOOL: aws.Bool(true)}, - }}, - }, - }, - actual: &testAliasedStruct{}, - expected: testAliasedStruct{ - Value: "123", Value2: 123, - Value3: testAliasedMap{ - "Key": 321, - }, - Value4: testAliasedSlice{"1", "2", "3"}, - Value5: testAliasedByteSlice{0, 1, 2}, - Value6: []testAliasedInt{1, 2, 3}, - Value7: []testAliasedString{"1", "2", "3"}, - Value8: []testAliasedByteSlice{ - {0, 1, 2}, - {3, 4, 5}, - }, - Value9: []testAliasedInt{1, 2, 3}, - Value10: []testAliasedString{"1", "2", "3"}, - Value11: testAliasedIntSlice{1, 2, 3}, - Value12: testAliasedStringSlice{"1", "2", "3"}, - Value13: true, - Value14: testAliasedBoolSlice{true, false, true}, - }, - }, - { - in: &dynamodb.AttributeValue{N: aws.String("123")}, - actual: new(testNamedPointer), - expected: testNamedPointer(aws.Int(123)), - }, - { // time.Time - in: &dynamodb.AttributeValue{S: aws.String("2016-05-03T17:06:26.209072Z")}, - actual: new(time.Time), - expected: testDate, - }, - { // time.Time List - in: &dynamodb.AttributeValue{L: []*dynamodb.AttributeValue{ - {S: aws.String("2016-05-03T17:06:26.209072Z")}, - {S: aws.String("2016-05-04T17:06:26.209072Z")}, - }}, - actual: new([]time.Time), - expected: []time.Time{testDate, testDate.Add(24 * time.Hour)}, - }, - { // time.Time struct - in: &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - "abc": {S: aws.String("2016-05-03T17:06:26.209072Z")}, - }}, - actual: &struct { - Abc time.Time `json:"abc" dynamodbav:"abc"` - }{}, - expected: struct { - Abc time.Time `json:"abc" dynamodbav:"abc"` - }{Abc: testDate}, - }, - { // time.Time ptr struct - in: &dynamodb.AttributeValue{M: map[string]*dynamodb.AttributeValue{ - "abc": {S: aws.String("2016-05-03T17:06:26.209072Z")}, - }}, - actual: &struct { - Abc *time.Time `json:"abc" dynamodbav:"abc"` - }{}, - expected: struct { - Abc *time.Time `json:"abc" dynamodbav:"abc"` - }{Abc: &testDate}, - }, -} - -var sharedListTestCases = []struct { - in []*dynamodb.AttributeValue - actual, expected interface{} - err error -}{ - { - in: []*dynamodb.AttributeValue{ - {B: []byte{48, 49}}, - {BOOL: aws.Bool(true)}, - {N: aws.String("123")}, - {S: aws.String("123")}, - }, - actual: func() *[]interface{} { - v := []interface{}{} - return &v - }(), - expected: []interface{}{[]byte{48, 49}, true, 123., "123"}, - }, - { - in: []*dynamodb.AttributeValue{ - {N: aws.String("1")}, - {N: aws.String("2")}, - {N: aws.String("3")}, - }, - actual: &[]interface{}{}, - expected: []interface{}{1., 2., 3.}, - }, -} - -var sharedMapTestCases = []struct { - in map[string]*dynamodb.AttributeValue - actual, expected interface{} - err error -}{ - { - in: map[string]*dynamodb.AttributeValue{ - "B": {B: []byte{48, 49}}, - "BOOL": {BOOL: aws.Bool(true)}, - "N": {N: aws.String("123")}, - "S": {S: aws.String("123")}, - }, - actual: &map[string]interface{}{}, - expected: map[string]interface{}{ - "B": []byte{48, 49}, "BOOL": true, - "N": 123., "S": "123", - }, - }, -} - -func assertConvertTest(t *testing.T, i int, actual, expected interface{}, err, expectedErr error) { - i++ - if expectedErr != nil { - if err != nil { - assert.Equal(t, expectedErr, err, "case %d", i) - } else { - assert.Fail(t, "", "case %d, expected error, %v", i) - } - } else if err != nil { - assert.Fail(t, "", "case %d, expect no error, got %v", i, err) - } else { - assert.Equal(t, ptrToValue(expected), ptrToValue(actual), "case %d", i) - } -} - -func ptrToValue(in interface{}) interface{} { - v := reflect.ValueOf(in) - if v.Kind() == reflect.Ptr { - v = v.Elem() - } - if !v.IsValid() { - return nil - } - if v.Kind() == reflect.Ptr { - return ptrToValue(v.Interface()) - } - return v.Interface() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go deleted file mode 100644 index 60bd609..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go +++ /dev/null @@ -1,68 +0,0 @@ -package dynamodbattribute - -import ( - "reflect" - "strings" -) - -type tag struct { - Name string - Ignore bool - OmitEmpty bool - OmitEmptyElem bool - AsString bool - AsBinSet, AsNumSet, AsStrSet bool - AsUnixTime bool -} - -func (t *tag) parseAVTag(structTag reflect.StructTag) { - tagStr := structTag.Get("dynamodbav") - if len(tagStr) == 0 { - return - } - - t.parseTagStr(tagStr) -} - -func (t *tag) parseJSONTag(structTag reflect.StructTag) { - tagStr := structTag.Get("json") - if len(tagStr) == 0 { - return - } - - t.parseTagStr(tagStr) -} - -func (t *tag) parseTagStr(tagStr string) { - parts := strings.Split(tagStr, ",") - if len(parts) == 0 { - return - } - - if name := parts[0]; name == "-" { - t.Name = "" - t.Ignore = true - } else { - t.Name = name - t.Ignore = false - } - - for _, opt := range parts[1:] { - switch opt { - case "omitempty": - t.OmitEmpty = true - case "omitemptyelem": - t.OmitEmptyElem = true - case "string": - t.AsString = true - case "binaryset": - t.AsBinSet = true - case "numberset": - t.AsNumSet = true - case "stringset": - t.AsStrSet = true - case "unixtime": - t.AsUnixTime = true - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag_test.go deleted file mode 100644 index 46d0a68..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package dynamodbattribute - -import ( - "reflect" - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestTagParse(t *testing.T) { - cases := []struct { - in reflect.StructTag - json, av bool - expect tag - }{ - {`json:""`, true, false, tag{}}, - {`json:"name"`, true, false, tag{Name: "name"}}, - {`json:"name,omitempty"`, true, false, tag{Name: "name", OmitEmpty: true}}, - {`json:"-"`, true, false, tag{Ignore: true}}, - {`json:",omitempty"`, true, false, tag{OmitEmpty: true}}, - {`json:",string"`, true, false, tag{AsString: true}}, - {`dynamodbav:""`, false, true, tag{}}, - {`dynamodbav:","`, false, true, tag{}}, - {`dynamodbav:"name"`, false, true, tag{Name: "name"}}, - {`dynamodbav:"name"`, false, true, tag{Name: "name"}}, - {`dynamodbav:"-"`, false, true, tag{Ignore: true}}, - {`dynamodbav:",omitempty"`, false, true, tag{OmitEmpty: true}}, - {`dynamodbav:",omitemptyelem"`, false, true, tag{OmitEmptyElem: true}}, - {`dynamodbav:",string"`, false, true, tag{AsString: true}}, - {`dynamodbav:",binaryset"`, false, true, tag{AsBinSet: true}}, - {`dynamodbav:",numberset"`, false, true, tag{AsNumSet: true}}, - {`dynamodbav:",stringset"`, false, true, tag{AsStrSet: true}}, - {`dynamodbav:",stringset,omitemptyelem"`, false, true, tag{AsStrSet: true, OmitEmptyElem: true}}, - {`dynamodbav:"name,stringset,omitemptyelem"`, false, true, tag{Name: "name", AsStrSet: true, OmitEmptyElem: true}}, - } - - for i, c := range cases { - actual := tag{} - if c.json { - actual.parseJSONTag(c.in) - } - if c.av { - actual.parseAVTag(c.in) - } - assert.Equal(t, c.expect, actual, "case %d", i+1) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go deleted file mode 100644 index d47a104..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb - -const ( - - // ErrCodeConditionalCheckFailedException for service response error code - // "ConditionalCheckFailedException". - // - // A condition specified in the operation could not be evaluated. - ErrCodeConditionalCheckFailedException = "ConditionalCheckFailedException" - - // ErrCodeInternalServerError for service response error code - // "InternalServerError". - // - // An error occurred on the server side. - ErrCodeInternalServerError = "InternalServerError" - - // ErrCodeItemCollectionSizeLimitExceededException for service response error code - // "ItemCollectionSizeLimitExceededException". - // - // An item collection is too large. This exception is only returned for tables - // that have one or more local secondary indexes. - ErrCodeItemCollectionSizeLimitExceededException = "ItemCollectionSizeLimitExceededException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The number of concurrent table requests (cumulative number of tables in the - // CREATING, DELETING or UPDATING state) exceeds the maximum allowed of 10. - // - // Also, for tables with secondary indexes, only one of those tables can be - // in the CREATING state at any point in time. Do not attempt to create more - // than one such table simultaneously. - // - // The total limit of tables in the ACTIVE state is 250. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeProvisionedThroughputExceededException for service response error code - // "ProvisionedThroughputExceededException". - // - // Your request rate is too high. The AWS SDKs for DynamoDB automatically retry - // requests that receive this exception. Your request is eventually successful, - // unless your retry queue is too large to finish. Reduce the frequency of requests - // and use exponential backoff. For more information, go to Error Retries and - // Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) - // in the Amazon DynamoDB Developer Guide. - ErrCodeProvisionedThroughputExceededException = "ProvisionedThroughputExceededException" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // The operation conflicts with the resource's availability. For example, you - // attempted to recreate an existing table, or tried to delete a table currently - // in the CREATING state. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The operation tried to access a nonexistent table or index. The resource - // might not be specified correctly, or its status might not be ACTIVE. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/examples_test.go deleted file mode 100644 index a29286f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/examples_test.go +++ /dev/null @@ -1,1502 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleDynamoDB_BatchGetItem() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.BatchGetItemInput{ - RequestItems: map[string]*dynamodb.KeysAndAttributes{ // Required - "Key": { // Required - Keys: []map[string]*dynamodb.AttributeValue{ // Required - { // Required - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - // More values... - }, - AttributesToGet: []*string{ - aws.String("AttributeName"), // Required - // More values... - }, - ConsistentRead: aws.Bool(true), - ExpressionAttributeNames: map[string]*string{ - "Key": aws.String("AttributeName"), // Required - // More values... - }, - ProjectionExpression: aws.String("ProjectionExpression"), - }, - // More values... - }, - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - } - resp, err := svc.BatchGetItem(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_BatchWriteItem() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.BatchWriteItemInput{ - RequestItems: map[string][]*dynamodb.WriteRequest{ // Required - "Key": { // Required - { // Required - DeleteRequest: &dynamodb.DeleteRequest{ - Key: map[string]*dynamodb.AttributeValue{ // Required - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - }, - PutRequest: &dynamodb.PutRequest{ - Item: map[string]*dynamodb.AttributeValue{ // Required - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - }, - }, - // More values... - }, - // More values... - }, - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - ReturnItemCollectionMetrics: aws.String("ReturnItemCollectionMetrics"), - } - resp, err := svc.BatchWriteItem(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_CreateTable() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.CreateTableInput{ - AttributeDefinitions: []*dynamodb.AttributeDefinition{ // Required - { // Required - AttributeName: aws.String("KeySchemaAttributeName"), // Required - AttributeType: aws.String("ScalarAttributeType"), // Required - }, - // More values... - }, - KeySchema: []*dynamodb.KeySchemaElement{ // Required - { // Required - AttributeName: aws.String("KeySchemaAttributeName"), // Required - KeyType: aws.String("KeyType"), // Required - }, - // More values... - }, - ProvisionedThroughput: &dynamodb.ProvisionedThroughput{ // Required - ReadCapacityUnits: aws.Int64(1), // Required - WriteCapacityUnits: aws.Int64(1), // Required - }, - TableName: aws.String("TableName"), // Required - GlobalSecondaryIndexes: []*dynamodb.GlobalSecondaryIndex{ - { // Required - IndexName: aws.String("IndexName"), // Required - KeySchema: []*dynamodb.KeySchemaElement{ // Required - { // Required - AttributeName: aws.String("KeySchemaAttributeName"), // Required - KeyType: aws.String("KeyType"), // Required - }, - // More values... - }, - Projection: &dynamodb.Projection{ // Required - NonKeyAttributes: []*string{ - aws.String("NonKeyAttributeName"), // Required - // More values... - }, - ProjectionType: aws.String("ProjectionType"), - }, - ProvisionedThroughput: &dynamodb.ProvisionedThroughput{ // Required - ReadCapacityUnits: aws.Int64(1), // Required - WriteCapacityUnits: aws.Int64(1), // Required - }, - }, - // More values... - }, - LocalSecondaryIndexes: []*dynamodb.LocalSecondaryIndex{ - { // Required - IndexName: aws.String("IndexName"), // Required - KeySchema: []*dynamodb.KeySchemaElement{ // Required - { // Required - AttributeName: aws.String("KeySchemaAttributeName"), // Required - KeyType: aws.String("KeyType"), // Required - }, - // More values... - }, - Projection: &dynamodb.Projection{ // Required - NonKeyAttributes: []*string{ - aws.String("NonKeyAttributeName"), // Required - // More values... - }, - ProjectionType: aws.String("ProjectionType"), - }, - }, - // More values... - }, - StreamSpecification: &dynamodb.StreamSpecification{ - StreamEnabled: aws.Bool(true), - StreamViewType: aws.String("StreamViewType"), - }, - } - resp, err := svc.CreateTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_DeleteItem() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.DeleteItemInput{ - Key: map[string]*dynamodb.AttributeValue{ // Required - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - TableName: aws.String("TableName"), // Required - ConditionExpression: aws.String("ConditionExpression"), - ConditionalOperator: aws.String("ConditionalOperator"), - Expected: map[string]*dynamodb.ExpectedAttributeValue{ - "Key": { // Required - AttributeValueList: []*dynamodb.AttributeValue{ - { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ComparisonOperator: aws.String("ComparisonOperator"), - Exists: aws.Bool(true), - Value: &dynamodb.AttributeValue{ - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - }, - // More values... - }, - ExpressionAttributeNames: map[string]*string{ - "Key": aws.String("AttributeName"), // Required - // More values... - }, - ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - ReturnItemCollectionMetrics: aws.String("ReturnItemCollectionMetrics"), - ReturnValues: aws.String("ReturnValue"), - } - resp, err := svc.DeleteItem(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_DeleteTable() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.DeleteTableInput{ - TableName: aws.String("TableName"), // Required - } - resp, err := svc.DeleteTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_DescribeLimits() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - var params *dynamodb.DescribeLimitsInput - resp, err := svc.DescribeLimits(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_DescribeTable() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.DescribeTableInput{ - TableName: aws.String("TableName"), // Required - } - resp, err := svc.DescribeTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_DescribeTimeToLive() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.DescribeTimeToLiveInput{ - TableName: aws.String("TableName"), // Required - } - resp, err := svc.DescribeTimeToLive(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_GetItem() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.GetItemInput{ - Key: map[string]*dynamodb.AttributeValue{ // Required - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - TableName: aws.String("TableName"), // Required - AttributesToGet: []*string{ - aws.String("AttributeName"), // Required - // More values... - }, - ConsistentRead: aws.Bool(true), - ExpressionAttributeNames: map[string]*string{ - "Key": aws.String("AttributeName"), // Required - // More values... - }, - ProjectionExpression: aws.String("ProjectionExpression"), - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - } - resp, err := svc.GetItem(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_ListTables() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.ListTablesInput{ - ExclusiveStartTableName: aws.String("TableName"), - Limit: aws.Int64(1), - } - resp, err := svc.ListTables(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_ListTagsOfResource() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.ListTagsOfResourceInput{ - ResourceArn: aws.String("ResourceArnString"), // Required - NextToken: aws.String("NextTokenString"), - } - resp, err := svc.ListTagsOfResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_PutItem() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.PutItemInput{ - Item: map[string]*dynamodb.AttributeValue{ // Required - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - TableName: aws.String("TableName"), // Required - ConditionExpression: aws.String("ConditionExpression"), - ConditionalOperator: aws.String("ConditionalOperator"), - Expected: map[string]*dynamodb.ExpectedAttributeValue{ - "Key": { // Required - AttributeValueList: []*dynamodb.AttributeValue{ - { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ComparisonOperator: aws.String("ComparisonOperator"), - Exists: aws.Bool(true), - Value: &dynamodb.AttributeValue{ - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - }, - // More values... - }, - ExpressionAttributeNames: map[string]*string{ - "Key": aws.String("AttributeName"), // Required - // More values... - }, - ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - ReturnItemCollectionMetrics: aws.String("ReturnItemCollectionMetrics"), - ReturnValues: aws.String("ReturnValue"), - } - resp, err := svc.PutItem(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_Query() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.QueryInput{ - TableName: aws.String("TableName"), // Required - AttributesToGet: []*string{ - aws.String("AttributeName"), // Required - // More values... - }, - ConditionalOperator: aws.String("ConditionalOperator"), - ConsistentRead: aws.Bool(true), - ExclusiveStartKey: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ExpressionAttributeNames: map[string]*string{ - "Key": aws.String("AttributeName"), // Required - // More values... - }, - ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - FilterExpression: aws.String("ConditionExpression"), - IndexName: aws.String("IndexName"), - KeyConditionExpression: aws.String("KeyExpression"), - KeyConditions: map[string]*dynamodb.Condition{ - "Key": { // Required - ComparisonOperator: aws.String("ComparisonOperator"), // Required - AttributeValueList: []*dynamodb.AttributeValue{ - { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - }, - // More values... - }, - Limit: aws.Int64(1), - ProjectionExpression: aws.String("ProjectionExpression"), - QueryFilter: map[string]*dynamodb.Condition{ - "Key": { // Required - ComparisonOperator: aws.String("ComparisonOperator"), // Required - AttributeValueList: []*dynamodb.AttributeValue{ - { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - }, - // More values... - }, - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - ScanIndexForward: aws.Bool(true), - Select: aws.String("Select"), - } - resp, err := svc.Query(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_Scan() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.ScanInput{ - TableName: aws.String("TableName"), // Required - AttributesToGet: []*string{ - aws.String("AttributeName"), // Required - // More values... - }, - ConditionalOperator: aws.String("ConditionalOperator"), - ConsistentRead: aws.Bool(true), - ExclusiveStartKey: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ExpressionAttributeNames: map[string]*string{ - "Key": aws.String("AttributeName"), // Required - // More values... - }, - ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - FilterExpression: aws.String("ConditionExpression"), - IndexName: aws.String("IndexName"), - Limit: aws.Int64(1), - ProjectionExpression: aws.String("ProjectionExpression"), - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - ScanFilter: map[string]*dynamodb.Condition{ - "Key": { // Required - ComparisonOperator: aws.String("ComparisonOperator"), // Required - AttributeValueList: []*dynamodb.AttributeValue{ - { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - }, - // More values... - }, - Segment: aws.Int64(1), - Select: aws.String("Select"), - TotalSegments: aws.Int64(1), - } - resp, err := svc.Scan(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_TagResource() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.TagResourceInput{ - ResourceArn: aws.String("ResourceArnString"), // Required - Tags: []*dynamodb.Tag{ // Required - { // Required - Key: aws.String("TagKeyString"), // Required - Value: aws.String("TagValueString"), // Required - }, - // More values... - }, - } - resp, err := svc.TagResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_UntagResource() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.UntagResourceInput{ - ResourceArn: aws.String("ResourceArnString"), // Required - TagKeys: []*string{ // Required - aws.String("TagKeyString"), // Required - // More values... - }, - } - resp, err := svc.UntagResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_UpdateItem() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.UpdateItemInput{ - Key: map[string]*dynamodb.AttributeValue{ // Required - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - TableName: aws.String("TableName"), // Required - AttributeUpdates: map[string]*dynamodb.AttributeValueUpdate{ - "Key": { // Required - Action: aws.String("AttributeAction"), - Value: &dynamodb.AttributeValue{ - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - }, - // More values... - }, - ConditionExpression: aws.String("ConditionExpression"), - ConditionalOperator: aws.String("ConditionalOperator"), - Expected: map[string]*dynamodb.ExpectedAttributeValue{ - "Key": { // Required - AttributeValueList: []*dynamodb.AttributeValue{ - { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ComparisonOperator: aws.String("ComparisonOperator"), - Exists: aws.Bool(true), - Value: &dynamodb.AttributeValue{ - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - }, - // More values... - }, - ExpressionAttributeNames: map[string]*string{ - "Key": aws.String("AttributeName"), // Required - // More values... - }, - ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - B: []byte("PAYLOAD"), - BOOL: aws.Bool(true), - BS: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - L: []*dynamodb.AttributeValue{ - { // Required - // Recursive values... - }, - // More values... - }, - M: map[string]*dynamodb.AttributeValue{ - "Key": { // Required - // Recursive values... - }, - // More values... - }, - N: aws.String("NumberAttributeValue"), - NS: []*string{ - aws.String("NumberAttributeValue"), // Required - // More values... - }, - NULL: aws.Bool(true), - S: aws.String("StringAttributeValue"), - SS: []*string{ - aws.String("StringAttributeValue"), // Required - // More values... - }, - }, - // More values... - }, - ReturnConsumedCapacity: aws.String("ReturnConsumedCapacity"), - ReturnItemCollectionMetrics: aws.String("ReturnItemCollectionMetrics"), - ReturnValues: aws.String("ReturnValue"), - UpdateExpression: aws.String("UpdateExpression"), - } - resp, err := svc.UpdateItem(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_UpdateTable() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.UpdateTableInput{ - TableName: aws.String("TableName"), // Required - AttributeDefinitions: []*dynamodb.AttributeDefinition{ - { // Required - AttributeName: aws.String("KeySchemaAttributeName"), // Required - AttributeType: aws.String("ScalarAttributeType"), // Required - }, - // More values... - }, - GlobalSecondaryIndexUpdates: []*dynamodb.GlobalSecondaryIndexUpdate{ - { // Required - Create: &dynamodb.CreateGlobalSecondaryIndexAction{ - IndexName: aws.String("IndexName"), // Required - KeySchema: []*dynamodb.KeySchemaElement{ // Required - { // Required - AttributeName: aws.String("KeySchemaAttributeName"), // Required - KeyType: aws.String("KeyType"), // Required - }, - // More values... - }, - Projection: &dynamodb.Projection{ // Required - NonKeyAttributes: []*string{ - aws.String("NonKeyAttributeName"), // Required - // More values... - }, - ProjectionType: aws.String("ProjectionType"), - }, - ProvisionedThroughput: &dynamodb.ProvisionedThroughput{ // Required - ReadCapacityUnits: aws.Int64(1), // Required - WriteCapacityUnits: aws.Int64(1), // Required - }, - }, - Delete: &dynamodb.DeleteGlobalSecondaryIndexAction{ - IndexName: aws.String("IndexName"), // Required - }, - Update: &dynamodb.UpdateGlobalSecondaryIndexAction{ - IndexName: aws.String("IndexName"), // Required - ProvisionedThroughput: &dynamodb.ProvisionedThroughput{ // Required - ReadCapacityUnits: aws.Int64(1), // Required - WriteCapacityUnits: aws.Int64(1), // Required - }, - }, - }, - // More values... - }, - ProvisionedThroughput: &dynamodb.ProvisionedThroughput{ - ReadCapacityUnits: aws.Int64(1), // Required - WriteCapacityUnits: aws.Int64(1), // Required - }, - StreamSpecification: &dynamodb.StreamSpecification{ - StreamEnabled: aws.Bool(true), - StreamViewType: aws.String("StreamViewType"), - }, - } - resp, err := svc.UpdateTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleDynamoDB_UpdateTimeToLive() { - sess := session.Must(session.NewSession()) - - svc := dynamodb.New(sess) - - params := &dynamodb.UpdateTimeToLiveInput{ - TableName: aws.String("TableName"), // Required - TimeToLiveSpecification: &dynamodb.TimeToLiveSpecification{ // Required - AttributeName: aws.String("TimeToLiveAttributeName"), // Required - Enabled: aws.Bool(true), // Required - }, - } - resp, err := svc.UpdateTimeToLive(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go deleted file mode 100644 index 7782769..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb - -import ( - "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/private/protocol/jsonrpc" -) - -// Amazon DynamoDB is a fully managed NoSQL database service that provides fast -// and predictable performance with seamless scalability. DynamoDB lets you -// offload the administrative burdens of operating and scaling a distributed -// database, so that you don't have to worry about hardware provisioning, setup -// and configuration, replication, software patching, or cluster scaling. -// -// With DynamoDB, you can create database tables that can store and retrieve -// any amount of data, and serve any level of request traffic. You can scale -// up or scale down your tables' throughput capacity without downtime or performance -// degradation, and use the AWS Management Console to monitor resource utilization -// and performance metrics. -// -// DynamoDB automatically spreads the data and traffic for your tables over -// a sufficient number of servers to handle your throughput and storage requirements, -// while maintaining consistent and fast performance. All of your data is stored -// on solid state disks (SSDs) and automatically replicated across multiple -// Availability Zones in an AWS region, providing built-in high availability -// and data durability. -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10 -type DynamoDB struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "dynamodb" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the DynamoDB 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: -// // Create a DynamoDB client from just a session. -// svc := dynamodb.New(mySession) -// -// // Create a DynamoDB client with additional configuration -// svc := dynamodb.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *DynamoDB { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DynamoDB { - svc := &DynamoDB{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2012-08-10", - JSONVersion: "1.0", - TargetPrefix: "DynamoDB_20120810", - }, - handlers, - ), - } - - // 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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a DynamoDB operation and runs any -// custom request initialization. -func (c *DynamoDB) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go deleted file mode 100644 index 07c75c4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/waiters.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package dynamodb - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilTableExists uses the DynamoDB API operation -// DescribeTable to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *DynamoDB) WaitUntilTableExists(input *DescribeTableInput) error { - return c.WaitUntilTableExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTableExistsWithContext is an extended version of WaitUntilTableExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *DynamoDB) WaitUntilTableExistsWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTableExists", - MaxAttempts: 25, - Delay: request.ConstantWaiterDelay(20 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "Table.TableStatus", - Expected: "ACTIVE", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "ResourceNotFoundException", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeTableInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTableRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilTableNotExists uses the DynamoDB API operation -// DescribeTable to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *DynamoDB) WaitUntilTableNotExists(input *DescribeTableInput) error { - return c.WaitUntilTableNotExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTableNotExistsWithContext is an extended version of WaitUntilTableNotExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *DynamoDB) WaitUntilTableNotExistsWithContext(ctx aws.Context, input *DescribeTableInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTableNotExists", - MaxAttempts: 25, - Delay: request.ConstantWaiterDelay(20 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "ResourceNotFoundException", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeTableInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTableRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go deleted file mode 100644 index 63e7dbc..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ /dev/null @@ -1,57887 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ec2 provides a client for Amazon Elastic Compute Cloud. -package ec2 - -import ( - "fmt" - "time" - - "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/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/ec2query" -) - -const opAcceptReservedInstancesExchangeQuote = "AcceptReservedInstancesExchangeQuote" - -// AcceptReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the -// client's request for the AcceptReservedInstancesExchangeQuote operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AcceptReservedInstancesExchangeQuote for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AcceptReservedInstancesExchangeQuote method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AcceptReservedInstancesExchangeQuoteRequest method. -// req, resp := client.AcceptReservedInstancesExchangeQuoteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuote -func (c *EC2) AcceptReservedInstancesExchangeQuoteRequest(input *AcceptReservedInstancesExchangeQuoteInput) (req *request.Request, output *AcceptReservedInstancesExchangeQuoteOutput) { - op := &request.Operation{ - Name: opAcceptReservedInstancesExchangeQuote, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcceptReservedInstancesExchangeQuoteInput{} - } - - output = &AcceptReservedInstancesExchangeQuoteOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptReservedInstancesExchangeQuote API operation for Amazon Elastic Compute Cloud. -// -// Accepts the Convertible Reserved Instance exchange quote described in the -// GetReservedInstancesExchangeQuote call. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AcceptReservedInstancesExchangeQuote for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuote -func (c *EC2) AcceptReservedInstancesExchangeQuote(input *AcceptReservedInstancesExchangeQuoteInput) (*AcceptReservedInstancesExchangeQuoteOutput, error) { - req, out := c.AcceptReservedInstancesExchangeQuoteRequest(input) - return out, req.Send() -} - -// AcceptReservedInstancesExchangeQuoteWithContext is the same as AcceptReservedInstancesExchangeQuote with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptReservedInstancesExchangeQuote 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 *EC2) AcceptReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *AcceptReservedInstancesExchangeQuoteInput, opts ...request.Option) (*AcceptReservedInstancesExchangeQuoteOutput, error) { - req, out := c.AcceptReservedInstancesExchangeQuoteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection" - -// AcceptVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the AcceptVpcPeeringConnection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AcceptVpcPeeringConnection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AcceptVpcPeeringConnection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AcceptVpcPeeringConnectionRequest method. -// req, resp := client.AcceptVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnection -func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectionInput) (req *request.Request, output *AcceptVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opAcceptVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcceptVpcPeeringConnectionInput{} - } - - output = &AcceptVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Accept a VPC peering connection request. To accept a request, the VPC peering -// connection must be in the pending-acceptance state, and you must be the owner -// of the peer VPC. Use the DescribeVpcPeeringConnections request to view your -// outstanding VPC peering connection requests. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AcceptVpcPeeringConnection for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnection -func (c *EC2) AcceptVpcPeeringConnection(input *AcceptVpcPeeringConnectionInput) (*AcceptVpcPeeringConnectionOutput, error) { - req, out := c.AcceptVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// AcceptVpcPeeringConnectionWithContext is the same as AcceptVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptVpcPeeringConnection 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 *EC2) AcceptVpcPeeringConnectionWithContext(ctx aws.Context, input *AcceptVpcPeeringConnectionInput, opts ...request.Option) (*AcceptVpcPeeringConnectionOutput, error) { - req, out := c.AcceptVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAllocateAddress = "AllocateAddress" - -// AllocateAddressRequest generates a "aws/request.Request" representing the -// client's request for the AllocateAddress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AllocateAddress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AllocateAddress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AllocateAddressRequest method. -// req, resp := client.AllocateAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddress -func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.Request, output *AllocateAddressOutput) { - op := &request.Operation{ - Name: opAllocateAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AllocateAddressInput{} - } - - output = &AllocateAddressOutput{} - req = c.newRequest(op, input, output) - return -} - -// AllocateAddress API operation for Amazon Elastic Compute Cloud. -// -// Acquires an Elastic IP address. -// -// An Elastic IP address is for use either in the EC2-Classic platform or in -// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AllocateAddress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddress -func (c *EC2) AllocateAddress(input *AllocateAddressInput) (*AllocateAddressOutput, error) { - req, out := c.AllocateAddressRequest(input) - return out, req.Send() -} - -// AllocateAddressWithContext is the same as AllocateAddress with the addition of -// the ability to pass a context and additional request options. -// -// See AllocateAddress 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 *EC2) AllocateAddressWithContext(ctx aws.Context, input *AllocateAddressInput, opts ...request.Option) (*AllocateAddressOutput, error) { - req, out := c.AllocateAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAllocateHosts = "AllocateHosts" - -// AllocateHostsRequest generates a "aws/request.Request" representing the -// client's request for the AllocateHosts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AllocateHosts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AllocateHosts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AllocateHostsRequest method. -// req, resp := client.AllocateHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHosts -func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) (req *request.Request, output *AllocateHostsOutput) { - op := &request.Operation{ - Name: opAllocateHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AllocateHostsInput{} - } - - output = &AllocateHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AllocateHosts API operation for Amazon Elastic Compute Cloud. -// -// Allocates a Dedicated Host to your account. At minimum you need to specify -// the instance size type, Availability Zone, and quantity of hosts you want -// to allocate. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AllocateHosts for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHosts -func (c *EC2) AllocateHosts(input *AllocateHostsInput) (*AllocateHostsOutput, error) { - req, out := c.AllocateHostsRequest(input) - return out, req.Send() -} - -// AllocateHostsWithContext is the same as AllocateHosts with the addition of -// the ability to pass a context and additional request options. -// -// See AllocateHosts 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 *EC2) AllocateHostsWithContext(ctx aws.Context, input *AllocateHostsInput, opts ...request.Option) (*AllocateHostsOutput, error) { - req, out := c.AllocateHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssignIpv6Addresses = "AssignIpv6Addresses" - -// AssignIpv6AddressesRequest generates a "aws/request.Request" representing the -// client's request for the AssignIpv6Addresses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssignIpv6Addresses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssignIpv6Addresses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssignIpv6AddressesRequest method. -// req, resp := client.AssignIpv6AddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6Addresses -func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) (req *request.Request, output *AssignIpv6AddressesOutput) { - op := &request.Operation{ - Name: opAssignIpv6Addresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssignIpv6AddressesInput{} - } - - output = &AssignIpv6AddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssignIpv6Addresses API operation for Amazon Elastic Compute Cloud. -// -// Assigns one or more IPv6 addresses to the specified network interface. You -// can specify one or more specific IPv6 addresses, or you can specify the number -// of IPv6 addresses to be automatically assigned from within the subnet's IPv6 -// CIDR block range. You can assign as many IPv6 addresses to a network interface -// as you can assign private IPv4 addresses, and the limit varies per instance -// type. For information, see IP Addresses Per Network Interface Per Instance -// Type (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssignIpv6Addresses for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6Addresses -func (c *EC2) AssignIpv6Addresses(input *AssignIpv6AddressesInput) (*AssignIpv6AddressesOutput, error) { - req, out := c.AssignIpv6AddressesRequest(input) - return out, req.Send() -} - -// AssignIpv6AddressesWithContext is the same as AssignIpv6Addresses with the addition of -// the ability to pass a context and additional request options. -// -// See AssignIpv6Addresses 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 *EC2) AssignIpv6AddressesWithContext(ctx aws.Context, input *AssignIpv6AddressesInput, opts ...request.Option) (*AssignIpv6AddressesOutput, error) { - req, out := c.AssignIpv6AddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses" - -// AssignPrivateIpAddressesRequest generates a "aws/request.Request" representing the -// client's request for the AssignPrivateIpAddresses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssignPrivateIpAddresses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssignPrivateIpAddresses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssignPrivateIpAddressesRequest method. -// req, resp := client.AssignPrivateIpAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddresses -func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInput) (req *request.Request, output *AssignPrivateIpAddressesOutput) { - op := &request.Operation{ - Name: opAssignPrivateIpAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssignPrivateIpAddressesInput{} - } - - output = &AssignPrivateIpAddressesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssignPrivateIpAddresses API operation for Amazon Elastic Compute Cloud. -// -// Assigns one or more secondary private IP addresses to the specified network -// interface. You can specify one or more specific secondary IP addresses, or -// you can specify the number of secondary IP addresses to be automatically -// assigned within the subnet's CIDR block range. The number of secondary IP -// addresses that you can assign to an instance varies by instance type. For -// information about instance types, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) -// in the Amazon Elastic Compute Cloud User Guide. For more information about -// Elastic IP addresses, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// AssignPrivateIpAddresses is available only in EC2-VPC. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssignPrivateIpAddresses for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddresses -func (c *EC2) AssignPrivateIpAddresses(input *AssignPrivateIpAddressesInput) (*AssignPrivateIpAddressesOutput, error) { - req, out := c.AssignPrivateIpAddressesRequest(input) - return out, req.Send() -} - -// AssignPrivateIpAddressesWithContext is the same as AssignPrivateIpAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See AssignPrivateIpAddresses 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 *EC2) AssignPrivateIpAddressesWithContext(ctx aws.Context, input *AssignPrivateIpAddressesInput, opts ...request.Option) (*AssignPrivateIpAddressesOutput, error) { - req, out := c.AssignPrivateIpAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateAddress = "AssociateAddress" - -// AssociateAddressRequest generates a "aws/request.Request" representing the -// client's request for the AssociateAddress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateAddress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateAddress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateAddressRequest method. -// req, resp := client.AssociateAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddress -func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *request.Request, output *AssociateAddressOutput) { - op := &request.Operation{ - Name: opAssociateAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateAddressInput{} - } - - output = &AssociateAddressOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateAddress API operation for Amazon Elastic Compute Cloud. -// -// Associates an Elastic IP address with an instance or a network interface. -// -// An Elastic IP address is for use in either the EC2-Classic platform or in -// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// [EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is -// already associated with a different instance, it is disassociated from that -// instance and associated with the specified instance. -// -// [VPC in an EC2-Classic account] If you don't specify a private IP address, -// the Elastic IP address is associated with the primary IP address. If the -// Elastic IP address is already associated with a different instance or a network -// interface, you get an error unless you allow reassociation. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error, and you may be charged for each time -// the Elastic IP address is remapped to the same instance. For more information, -// see the Elastic IP Addresses section of Amazon EC2 Pricing (http://aws.amazon.com/ec2/pricing/). -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssociateAddress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddress -func (c *EC2) AssociateAddress(input *AssociateAddressInput) (*AssociateAddressOutput, error) { - req, out := c.AssociateAddressRequest(input) - return out, req.Send() -} - -// AssociateAddressWithContext is the same as AssociateAddress with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateAddress 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 *EC2) AssociateAddressWithContext(ctx aws.Context, input *AssociateAddressInput, opts ...request.Option) (*AssociateAddressOutput, error) { - req, out := c.AssociateAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateDhcpOptions = "AssociateDhcpOptions" - -// AssociateDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the AssociateDhcpOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateDhcpOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateDhcpOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateDhcpOptionsRequest method. -// req, resp := client.AssociateDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptions -func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req *request.Request, output *AssociateDhcpOptionsOutput) { - op := &request.Operation{ - Name: opAssociateDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateDhcpOptionsInput{} - } - - output = &AssociateDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssociateDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Associates a set of DHCP options (that you've previously created) with the -// specified VPC, or associates no DHCP options with the VPC. -// -// After you associate the options with the VPC, any existing instances and -// all new instances that you launch in that VPC use the options. You don't -// need to restart or relaunch the instances. They automatically pick up the -// changes within a few hours, depending on how frequently the instance renews -// its DHCP lease. You can explicitly renew the lease using the operating system -// on the instance. -// -// For more information, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssociateDhcpOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptions -func (c *EC2) AssociateDhcpOptions(input *AssociateDhcpOptionsInput) (*AssociateDhcpOptionsOutput, error) { - req, out := c.AssociateDhcpOptionsRequest(input) - return out, req.Send() -} - -// AssociateDhcpOptionsWithContext is the same as AssociateDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateDhcpOptions 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 *EC2) AssociateDhcpOptionsWithContext(ctx aws.Context, input *AssociateDhcpOptionsInput, opts ...request.Option) (*AssociateDhcpOptionsOutput, error) { - req, out := c.AssociateDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateIamInstanceProfile = "AssociateIamInstanceProfile" - -// AssociateIamInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the AssociateIamInstanceProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateIamInstanceProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateIamInstanceProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateIamInstanceProfileRequest method. -// req, resp := client.AssociateIamInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile -func (c *EC2) AssociateIamInstanceProfileRequest(input *AssociateIamInstanceProfileInput) (req *request.Request, output *AssociateIamInstanceProfileOutput) { - op := &request.Operation{ - Name: opAssociateIamInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateIamInstanceProfileInput{} - } - - output = &AssociateIamInstanceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud. -// -// Associates an IAM instance profile with a running or stopped instance. You -// cannot associate more than one IAM instance profile with an instance. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssociateIamInstanceProfile for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile -func (c *EC2) AssociateIamInstanceProfile(input *AssociateIamInstanceProfileInput) (*AssociateIamInstanceProfileOutput, error) { - req, out := c.AssociateIamInstanceProfileRequest(input) - return out, req.Send() -} - -// AssociateIamInstanceProfileWithContext is the same as AssociateIamInstanceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateIamInstanceProfile 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 *EC2) AssociateIamInstanceProfileWithContext(ctx aws.Context, input *AssociateIamInstanceProfileInput, opts ...request.Option) (*AssociateIamInstanceProfileOutput, error) { - req, out := c.AssociateIamInstanceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateRouteTable = "AssociateRouteTable" - -// AssociateRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the AssociateRouteTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateRouteTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateRouteTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateRouteTableRequest method. -// req, resp := client.AssociateRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTable -func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *request.Request, output *AssociateRouteTableOutput) { - op := &request.Operation{ - Name: opAssociateRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateRouteTableInput{} - } - - output = &AssociateRouteTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Associates a subnet with a route table. The subnet and route table must be -// in the same VPC. This association causes traffic originating from the subnet -// to be routed according to the routes in the route table. The action returns -// an association ID, which you need in order to disassociate the route table -// from the subnet later. A route table can be associated with multiple subnets. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssociateRouteTable for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTable -func (c *EC2) AssociateRouteTable(input *AssociateRouteTableInput) (*AssociateRouteTableOutput, error) { - req, out := c.AssociateRouteTableRequest(input) - return out, req.Send() -} - -// AssociateRouteTableWithContext is the same as AssociateRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateRouteTable 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 *EC2) AssociateRouteTableWithContext(ctx aws.Context, input *AssociateRouteTableInput, opts ...request.Option) (*AssociateRouteTableOutput, error) { - req, out := c.AssociateRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateSubnetCidrBlock = "AssociateSubnetCidrBlock" - -// AssociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the AssociateSubnetCidrBlock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateSubnetCidrBlock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateSubnetCidrBlock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateSubnetCidrBlockRequest method. -// req, resp := client.AssociateSubnetCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlock -func (c *EC2) AssociateSubnetCidrBlockRequest(input *AssociateSubnetCidrBlockInput) (req *request.Request, output *AssociateSubnetCidrBlockOutput) { - op := &request.Operation{ - Name: opAssociateSubnetCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateSubnetCidrBlockInput{} - } - - output = &AssociateSubnetCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateSubnetCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Associates a CIDR block with your subnet. You can only associate a single -// IPv6 CIDR block with your subnet. An IPv6 CIDR block must have a prefix length -// of /64. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssociateSubnetCidrBlock for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlock -func (c *EC2) AssociateSubnetCidrBlock(input *AssociateSubnetCidrBlockInput) (*AssociateSubnetCidrBlockOutput, error) { - req, out := c.AssociateSubnetCidrBlockRequest(input) - return out, req.Send() -} - -// AssociateSubnetCidrBlockWithContext is the same as AssociateSubnetCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateSubnetCidrBlock 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 *EC2) AssociateSubnetCidrBlockWithContext(ctx aws.Context, input *AssociateSubnetCidrBlockInput, opts ...request.Option) (*AssociateSubnetCidrBlockOutput, error) { - req, out := c.AssociateSubnetCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateVpcCidrBlock = "AssociateVpcCidrBlock" - -// AssociateVpcCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the AssociateVpcCidrBlock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateVpcCidrBlock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateVpcCidrBlock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateVpcCidrBlockRequest method. -// req, resp := client.AssociateVpcCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlock -func (c *EC2) AssociateVpcCidrBlockRequest(input *AssociateVpcCidrBlockInput) (req *request.Request, output *AssociateVpcCidrBlockOutput) { - op := &request.Operation{ - Name: opAssociateVpcCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateVpcCidrBlockInput{} - } - - output = &AssociateVpcCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Associates a CIDR block with your VPC. You can only associate a single Amazon-provided -// IPv6 CIDR block with your VPC. The IPv6 CIDR block size is fixed at /56. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AssociateVpcCidrBlock for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlock -func (c *EC2) AssociateVpcCidrBlock(input *AssociateVpcCidrBlockInput) (*AssociateVpcCidrBlockOutput, error) { - req, out := c.AssociateVpcCidrBlockRequest(input) - return out, req.Send() -} - -// AssociateVpcCidrBlockWithContext is the same as AssociateVpcCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateVpcCidrBlock 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 *EC2) AssociateVpcCidrBlockWithContext(ctx aws.Context, input *AssociateVpcCidrBlockInput, opts ...request.Option) (*AssociateVpcCidrBlockOutput, error) { - req, out := c.AssociateVpcCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachClassicLinkVpc = "AttachClassicLinkVpc" - -// AttachClassicLinkVpcRequest generates a "aws/request.Request" representing the -// client's request for the AttachClassicLinkVpc operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachClassicLinkVpc for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachClassicLinkVpc method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachClassicLinkVpcRequest method. -// req, resp := client.AttachClassicLinkVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpc -func (c *EC2) AttachClassicLinkVpcRequest(input *AttachClassicLinkVpcInput) (req *request.Request, output *AttachClassicLinkVpcOutput) { - op := &request.Operation{ - Name: opAttachClassicLinkVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachClassicLinkVpcInput{} - } - - output = &AttachClassicLinkVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachClassicLinkVpc API operation for Amazon Elastic Compute Cloud. -// -// Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or -// more of the VPC's security groups. You cannot link an EC2-Classic instance -// to more than one VPC at a time. You can only link an instance that's in the -// running state. An instance is automatically unlinked from a VPC when it's -// stopped - you can link it to the VPC again when you restart it. -// -// After you've linked an instance, you cannot change the VPC security groups -// that are associated with it. To change the security groups, you must first -// unlink the instance, and then link it again. -// -// Linking your instance to a VPC is sometimes referred to as attaching your -// instance. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AttachClassicLinkVpc for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpc -func (c *EC2) AttachClassicLinkVpc(input *AttachClassicLinkVpcInput) (*AttachClassicLinkVpcOutput, error) { - req, out := c.AttachClassicLinkVpcRequest(input) - return out, req.Send() -} - -// AttachClassicLinkVpcWithContext is the same as AttachClassicLinkVpc with the addition of -// the ability to pass a context and additional request options. -// -// See AttachClassicLinkVpc 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 *EC2) AttachClassicLinkVpcWithContext(ctx aws.Context, input *AttachClassicLinkVpcInput, opts ...request.Option) (*AttachClassicLinkVpcOutput, error) { - req, out := c.AttachClassicLinkVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachInternetGateway = "AttachInternetGateway" - -// AttachInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the AttachInternetGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachInternetGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachInternetGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachInternetGatewayRequest method. -// req, resp := client.AttachInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGateway -func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (req *request.Request, output *AttachInternetGatewayOutput) { - op := &request.Operation{ - Name: opAttachInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachInternetGatewayInput{} - } - - output = &AttachInternetGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Attaches an Internet gateway to a VPC, enabling connectivity between the -// Internet and the VPC. For more information about your VPC and Internet gateway, -// see the Amazon Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/). -// -// 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 Amazon Elastic Compute Cloud's -// API operation AttachInternetGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGateway -func (c *EC2) AttachInternetGateway(input *AttachInternetGatewayInput) (*AttachInternetGatewayOutput, error) { - req, out := c.AttachInternetGatewayRequest(input) - return out, req.Send() -} - -// AttachInternetGatewayWithContext is the same as AttachInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See AttachInternetGateway 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 *EC2) AttachInternetGatewayWithContext(ctx aws.Context, input *AttachInternetGatewayInput, opts ...request.Option) (*AttachInternetGatewayOutput, error) { - req, out := c.AttachInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachNetworkInterface = "AttachNetworkInterface" - -// AttachNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the AttachNetworkInterface operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachNetworkInterface for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachNetworkInterface method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachNetworkInterfaceRequest method. -// req, resp := client.AttachNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterface -func (c *EC2) AttachNetworkInterfaceRequest(input *AttachNetworkInterfaceInput) (req *request.Request, output *AttachNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opAttachNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachNetworkInterfaceInput{} - } - - output = &AttachNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Attaches a network interface to an instance. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AttachNetworkInterface for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterface -func (c *EC2) AttachNetworkInterface(input *AttachNetworkInterfaceInput) (*AttachNetworkInterfaceOutput, error) { - req, out := c.AttachNetworkInterfaceRequest(input) - return out, req.Send() -} - -// AttachNetworkInterfaceWithContext is the same as AttachNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See AttachNetworkInterface 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 *EC2) AttachNetworkInterfaceWithContext(ctx aws.Context, input *AttachNetworkInterfaceInput, opts ...request.Option) (*AttachNetworkInterfaceOutput, error) { - req, out := c.AttachNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachVolume = "AttachVolume" - -// AttachVolumeRequest generates a "aws/request.Request" representing the -// client's request for the AttachVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachVolumeRequest method. -// req, resp := client.AttachVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolume -func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Request, output *VolumeAttachment) { - op := &request.Operation{ - Name: opAttachVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachVolumeInput{} - } - - output = &VolumeAttachment{} - req = c.newRequest(op, input, output) - return -} - -// AttachVolume API operation for Amazon Elastic Compute Cloud. -// -// Attaches an EBS volume to a running or stopped instance and exposes it to -// the instance with the specified device name. -// -// Encrypted EBS volumes may only be attached to instances that support Amazon -// EBS encryption. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For a list of supported device names, see Attaching an EBS Volume to an Instance -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html). -// Any device names that aren't reserved for instance store volumes can be used -// for EBS volumes. For more information, see Amazon EC2 Instance Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// If a volume has an AWS Marketplace product code: -// -// * The volume can be attached only to a stopped instance. -// -// * AWS Marketplace product codes are copied from the volume to the instance. -// -// * You must be subscribed to the product. -// -// * The instance type and operating system of the instance must support -// the product. For example, you can't detach a volume from a Windows instance -// and attach it to a Linux instance. -// -// For an overview of the AWS Marketplace, see Introducing AWS Marketplace (https://aws.amazon.com/marketplace/help/200900000). -// -// For more information about EBS volumes, see Attaching Amazon EBS Volumes -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AttachVolume for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolume -func (c *EC2) AttachVolume(input *AttachVolumeInput) (*VolumeAttachment, error) { - req, out := c.AttachVolumeRequest(input) - return out, req.Send() -} - -// AttachVolumeWithContext is the same as AttachVolume with the addition of -// the ability to pass a context and additional request options. -// -// See AttachVolume 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 *EC2) AttachVolumeWithContext(ctx aws.Context, input *AttachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { - req, out := c.AttachVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachVpnGateway = "AttachVpnGateway" - -// AttachVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the AttachVpnGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AttachVpnGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AttachVpnGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AttachVpnGatewayRequest method. -// req, resp := client.AttachVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGateway -func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *request.Request, output *AttachVpnGatewayOutput) { - op := &request.Operation{ - Name: opAttachVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachVpnGatewayInput{} - } - - output = &AttachVpnGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// AttachVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Attaches a virtual private gateway to a VPC. You can attach one virtual private -// gateway to one VPC at a time. -// -// For more information, see Adding a Hardware Virtual Private Gateway to Your -// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AttachVpnGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGateway -func (c *EC2) AttachVpnGateway(input *AttachVpnGatewayInput) (*AttachVpnGatewayOutput, error) { - req, out := c.AttachVpnGatewayRequest(input) - return out, req.Send() -} - -// AttachVpnGatewayWithContext is the same as AttachVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See AttachVpnGateway 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 *EC2) AttachVpnGatewayWithContext(ctx aws.Context, input *AttachVpnGatewayInput, opts ...request.Option) (*AttachVpnGatewayOutput, error) { - req, out := c.AttachVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress" - -// AuthorizeSecurityGroupEgressRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeSecurityGroupEgress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AuthorizeSecurityGroupEgress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AuthorizeSecurityGroupEgress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AuthorizeSecurityGroupEgressRequest method. -// req, resp := client.AuthorizeSecurityGroupEgressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgress -func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupEgressInput) (req *request.Request, output *AuthorizeSecurityGroupEgressOutput) { - op := &request.Operation{ - Name: opAuthorizeSecurityGroupEgress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeSecurityGroupEgressInput{} - } - - output = &AuthorizeSecurityGroupEgressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AuthorizeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Adds one or more egress rules to a security group for use -// with a VPC. Specifically, this action permits instances to send traffic to -// one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more -// destination security groups for the same VPC. This action doesn't apply to -// security groups for use in EC2-Classic. For more information, see Security -// Groups for Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) -// in the Amazon Virtual Private Cloud User Guide. For more information about -// security group limits, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html). -// -// Each rule consists of the protocol (for example, TCP), plus either a CIDR -// range or a source group. For the TCP and UDP protocols, you must also specify -// the destination port or port range. For the ICMP protocol, you must also -// specify the ICMP type and code. You can use -1 for the type or code to mean -// all types or all codes. -// -// Rule changes are propagated to affected instances as quickly as possible. -// However, a small delay might occur. -// -// 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 Amazon Elastic Compute Cloud's -// API operation AuthorizeSecurityGroupEgress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgress -func (c *EC2) AuthorizeSecurityGroupEgress(input *AuthorizeSecurityGroupEgressInput) (*AuthorizeSecurityGroupEgressOutput, error) { - req, out := c.AuthorizeSecurityGroupEgressRequest(input) - return out, req.Send() -} - -// AuthorizeSecurityGroupEgressWithContext is the same as AuthorizeSecurityGroupEgress with the addition of -// the ability to pass a context and additional request options. -// -// See AuthorizeSecurityGroupEgress 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 *EC2) AuthorizeSecurityGroupEgressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupEgressInput, opts ...request.Option) (*AuthorizeSecurityGroupEgressOutput, error) { - req, out := c.AuthorizeSecurityGroupEgressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress" - -// AuthorizeSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the AuthorizeSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AuthorizeSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AuthorizeSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AuthorizeSecurityGroupIngressRequest method. -// req, resp := client.AuthorizeSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngress -func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroupIngressInput) (req *request.Request, output *AuthorizeSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opAuthorizeSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AuthorizeSecurityGroupIngressInput{} - } - - output = &AuthorizeSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AuthorizeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. -// -// Adds one or more ingress rules to a security group. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -// -// [EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission -// to access a security group in your account, or gives one or more security -// groups (called the source groups) permission to access a security group for -// your account. A source group can be for your own AWS account, or another. -// You can have up to 100 rules per group. -// -// [EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges -// permission to access a security group in your VPC, or gives one or more other -// security groups (called the source groups) permission to access a security -// group for your VPC. The security groups must all be for the same VPC or a -// peer VPC in a VPC peering connection. For more information about VPC security -// group limits, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html). -// -// 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 Amazon Elastic Compute Cloud's -// API operation AuthorizeSecurityGroupIngress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngress -func (c *EC2) AuthorizeSecurityGroupIngress(input *AuthorizeSecurityGroupIngressInput) (*AuthorizeSecurityGroupIngressOutput, error) { - req, out := c.AuthorizeSecurityGroupIngressRequest(input) - return out, req.Send() -} - -// AuthorizeSecurityGroupIngressWithContext is the same as AuthorizeSecurityGroupIngress with the addition of -// the ability to pass a context and additional request options. -// -// See AuthorizeSecurityGroupIngress 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 *EC2) AuthorizeSecurityGroupIngressWithContext(ctx aws.Context, input *AuthorizeSecurityGroupIngressInput, opts ...request.Option) (*AuthorizeSecurityGroupIngressOutput, error) { - req, out := c.AuthorizeSecurityGroupIngressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBundleInstance = "BundleInstance" - -// BundleInstanceRequest generates a "aws/request.Request" representing the -// client's request for the BundleInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See BundleInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the BundleInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the BundleInstanceRequest method. -// req, resp := client.BundleInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance -func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *request.Request, output *BundleInstanceOutput) { - op := &request.Operation{ - Name: opBundleInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BundleInstanceInput{} - } - - output = &BundleInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// BundleInstance API operation for Amazon Elastic Compute Cloud. -// -// Bundles an Amazon instance store-backed Windows instance. -// -// During bundling, only the root device volume (C:\) is bundled. Data on other -// instance store volumes is not preserved. -// -// This action is not applicable for Linux/Unix instances or Windows instances -// that are backed by Amazon EBS. -// -// For more information, see Creating an Instance Store-Backed Windows AMI (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_InstanceStoreBacked_WinAMI.html). -// -// 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 Amazon Elastic Compute Cloud's -// API operation BundleInstance for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstance -func (c *EC2) BundleInstance(input *BundleInstanceInput) (*BundleInstanceOutput, error) { - req, out := c.BundleInstanceRequest(input) - return out, req.Send() -} - -// BundleInstanceWithContext is the same as BundleInstance with the addition of -// the ability to pass a context and additional request options. -// -// See BundleInstance 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 *EC2) BundleInstanceWithContext(ctx aws.Context, input *BundleInstanceInput, opts ...request.Option) (*BundleInstanceOutput, error) { - req, out := c.BundleInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelBundleTask = "CancelBundleTask" - -// CancelBundleTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelBundleTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelBundleTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelBundleTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelBundleTaskRequest method. -// req, resp := client.CancelBundleTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTask -func (c *EC2) CancelBundleTaskRequest(input *CancelBundleTaskInput) (req *request.Request, output *CancelBundleTaskOutput) { - op := &request.Operation{ - Name: opCancelBundleTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelBundleTaskInput{} - } - - output = &CancelBundleTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelBundleTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels a bundling operation for an instance store-backed Windows instance. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CancelBundleTask for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTask -func (c *EC2) CancelBundleTask(input *CancelBundleTaskInput) (*CancelBundleTaskOutput, error) { - req, out := c.CancelBundleTaskRequest(input) - return out, req.Send() -} - -// CancelBundleTaskWithContext is the same as CancelBundleTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelBundleTask 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 *EC2) CancelBundleTaskWithContext(ctx aws.Context, input *CancelBundleTaskInput, opts ...request.Option) (*CancelBundleTaskOutput, error) { - req, out := c.CancelBundleTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelConversionTask = "CancelConversionTask" - -// CancelConversionTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelConversionTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelConversionTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelConversionTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelConversionTaskRequest method. -// req, resp := client.CancelConversionTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTask -func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req *request.Request, output *CancelConversionTaskOutput) { - op := &request.Operation{ - Name: opCancelConversionTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelConversionTaskInput{} - } - - output = &CancelConversionTaskOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelConversionTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels an active conversion task. The task can be the import of an instance -// or volume. The action removes all artifacts of the conversion, including -// a partially uploaded volume or instance. If the conversion is complete or -// is in the process of transferring the final disk image, the command fails -// and returns an exception. -// -// For more information, see Importing a Virtual Machine Using the Amazon EC2 -// CLI (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html). -// -// 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 Amazon Elastic Compute Cloud's -// API operation CancelConversionTask for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTask -func (c *EC2) CancelConversionTask(input *CancelConversionTaskInput) (*CancelConversionTaskOutput, error) { - req, out := c.CancelConversionTaskRequest(input) - return out, req.Send() -} - -// CancelConversionTaskWithContext is the same as CancelConversionTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelConversionTask 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 *EC2) CancelConversionTaskWithContext(ctx aws.Context, input *CancelConversionTaskInput, opts ...request.Option) (*CancelConversionTaskOutput, error) { - req, out := c.CancelConversionTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelExportTask = "CancelExportTask" - -// CancelExportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelExportTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelExportTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelExportTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelExportTaskRequest method. -// req, resp := client.CancelExportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTask -func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *request.Request, output *CancelExportTaskOutput) { - op := &request.Operation{ - Name: opCancelExportTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelExportTaskInput{} - } - - output = &CancelExportTaskOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelExportTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels an active export task. The request removes all artifacts of the export, -// including any partially-created Amazon S3 objects. If the export task is -// complete or is in the process of transferring the final disk image, the command -// fails and returns an error. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CancelExportTask for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTask -func (c *EC2) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) { - req, out := c.CancelExportTaskRequest(input) - return out, req.Send() -} - -// CancelExportTaskWithContext is the same as CancelExportTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelExportTask 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 *EC2) CancelExportTaskWithContext(ctx aws.Context, input *CancelExportTaskInput, opts ...request.Option) (*CancelExportTaskOutput, error) { - req, out := c.CancelExportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelImportTask = "CancelImportTask" - -// CancelImportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CancelImportTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelImportTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelImportTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelImportTaskRequest method. -// req, resp := client.CancelImportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask -func (c *EC2) CancelImportTaskRequest(input *CancelImportTaskInput) (req *request.Request, output *CancelImportTaskOutput) { - op := &request.Operation{ - Name: opCancelImportTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelImportTaskInput{} - } - - output = &CancelImportTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelImportTask API operation for Amazon Elastic Compute Cloud. -// -// Cancels an in-process import virtual machine or import snapshot task. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CancelImportTask for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTask -func (c *EC2) CancelImportTask(input *CancelImportTaskInput) (*CancelImportTaskOutput, error) { - req, out := c.CancelImportTaskRequest(input) - return out, req.Send() -} - -// CancelImportTaskWithContext is the same as CancelImportTask with the addition of -// the ability to pass a context and additional request options. -// -// See CancelImportTask 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 *EC2) CancelImportTaskWithContext(ctx aws.Context, input *CancelImportTaskInput, opts ...request.Option) (*CancelImportTaskOutput, error) { - req, out := c.CancelImportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelReservedInstancesListing = "CancelReservedInstancesListing" - -// CancelReservedInstancesListingRequest generates a "aws/request.Request" representing the -// client's request for the CancelReservedInstancesListing operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelReservedInstancesListing for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelReservedInstancesListing method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelReservedInstancesListingRequest method. -// req, resp := client.CancelReservedInstancesListingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListing -func (c *EC2) CancelReservedInstancesListingRequest(input *CancelReservedInstancesListingInput) (req *request.Request, output *CancelReservedInstancesListingOutput) { - op := &request.Operation{ - Name: opCancelReservedInstancesListing, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelReservedInstancesListingInput{} - } - - output = &CancelReservedInstancesListingOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelReservedInstancesListing API operation for Amazon Elastic Compute Cloud. -// -// Cancels the specified Reserved Instance listing in the Reserved Instance -// Marketplace. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CancelReservedInstancesListing for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListing -func (c *EC2) CancelReservedInstancesListing(input *CancelReservedInstancesListingInput) (*CancelReservedInstancesListingOutput, error) { - req, out := c.CancelReservedInstancesListingRequest(input) - return out, req.Send() -} - -// CancelReservedInstancesListingWithContext is the same as CancelReservedInstancesListing with the addition of -// the ability to pass a context and additional request options. -// -// See CancelReservedInstancesListing 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 *EC2) CancelReservedInstancesListingWithContext(ctx aws.Context, input *CancelReservedInstancesListingInput, opts ...request.Option) (*CancelReservedInstancesListingOutput, error) { - req, out := c.CancelReservedInstancesListingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelSpotFleetRequests = "CancelSpotFleetRequests" - -// CancelSpotFleetRequestsRequest generates a "aws/request.Request" representing the -// client's request for the CancelSpotFleetRequests operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelSpotFleetRequests for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelSpotFleetRequests method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelSpotFleetRequestsRequest method. -// req, resp := client.CancelSpotFleetRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequests -func (c *EC2) CancelSpotFleetRequestsRequest(input *CancelSpotFleetRequestsInput) (req *request.Request, output *CancelSpotFleetRequestsOutput) { - op := &request.Operation{ - Name: opCancelSpotFleetRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelSpotFleetRequestsInput{} - } - - output = &CancelSpotFleetRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelSpotFleetRequests API operation for Amazon Elastic Compute Cloud. -// -// Cancels the specified Spot fleet requests. -// -// After you cancel a Spot fleet request, the Spot fleet launches no new Spot -// instances. You must specify whether the Spot fleet should also terminate -// its Spot instances. If you terminate the instances, the Spot fleet request -// enters the cancelled_terminating state. Otherwise, the Spot fleet request -// enters the cancelled_running state and the instances continue to run until -// they are interrupted or you terminate them manually. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CancelSpotFleetRequests for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequests -func (c *EC2) CancelSpotFleetRequests(input *CancelSpotFleetRequestsInput) (*CancelSpotFleetRequestsOutput, error) { - req, out := c.CancelSpotFleetRequestsRequest(input) - return out, req.Send() -} - -// CancelSpotFleetRequestsWithContext is the same as CancelSpotFleetRequests with the addition of -// the ability to pass a context and additional request options. -// -// See CancelSpotFleetRequests 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 *EC2) CancelSpotFleetRequestsWithContext(ctx aws.Context, input *CancelSpotFleetRequestsInput, opts ...request.Option) (*CancelSpotFleetRequestsOutput, error) { - req, out := c.CancelSpotFleetRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests" - -// CancelSpotInstanceRequestsRequest generates a "aws/request.Request" representing the -// client's request for the CancelSpotInstanceRequests operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelSpotInstanceRequests for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelSpotInstanceRequests method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelSpotInstanceRequestsRequest method. -// req, resp := client.CancelSpotInstanceRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequests -func (c *EC2) CancelSpotInstanceRequestsRequest(input *CancelSpotInstanceRequestsInput) (req *request.Request, output *CancelSpotInstanceRequestsOutput) { - op := &request.Operation{ - Name: opCancelSpotInstanceRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelSpotInstanceRequestsInput{} - } - - output = &CancelSpotInstanceRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelSpotInstanceRequests API operation for Amazon Elastic Compute Cloud. -// -// Cancels one or more Spot instance requests. Spot instances are instances -// that Amazon EC2 starts on your behalf when the bid price that you specify -// exceeds the current Spot price. Amazon EC2 periodically sets the Spot price -// based on available Spot instance capacity and current Spot instance requests. -// For more information, see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Canceling a Spot instance request does not terminate running Spot instances -// associated with the request. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CancelSpotInstanceRequests for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequests -func (c *EC2) CancelSpotInstanceRequests(input *CancelSpotInstanceRequestsInput) (*CancelSpotInstanceRequestsOutput, error) { - req, out := c.CancelSpotInstanceRequestsRequest(input) - return out, req.Send() -} - -// CancelSpotInstanceRequestsWithContext is the same as CancelSpotInstanceRequests with the addition of -// the ability to pass a context and additional request options. -// -// See CancelSpotInstanceRequests 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 *EC2) CancelSpotInstanceRequestsWithContext(ctx aws.Context, input *CancelSpotInstanceRequestsInput, opts ...request.Option) (*CancelSpotInstanceRequestsOutput, error) { - req, out := c.CancelSpotInstanceRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opConfirmProductInstance = "ConfirmProductInstance" - -// ConfirmProductInstanceRequest generates a "aws/request.Request" representing the -// client's request for the ConfirmProductInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ConfirmProductInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ConfirmProductInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ConfirmProductInstanceRequest method. -// req, resp := client.ConfirmProductInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstance -func (c *EC2) ConfirmProductInstanceRequest(input *ConfirmProductInstanceInput) (req *request.Request, output *ConfirmProductInstanceOutput) { - op := &request.Operation{ - Name: opConfirmProductInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ConfirmProductInstanceInput{} - } - - output = &ConfirmProductInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConfirmProductInstance API operation for Amazon Elastic Compute Cloud. -// -// Determines whether a product code is associated with an instance. This action -// can only be used by the owner of the product code. It is useful when a product -// code owner needs to verify whether another user's instance is eligible for -// support. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ConfirmProductInstance for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstance -func (c *EC2) ConfirmProductInstance(input *ConfirmProductInstanceInput) (*ConfirmProductInstanceOutput, error) { - req, out := c.ConfirmProductInstanceRequest(input) - return out, req.Send() -} - -// ConfirmProductInstanceWithContext is the same as ConfirmProductInstance with the addition of -// the ability to pass a context and additional request options. -// -// See ConfirmProductInstance 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 *EC2) ConfirmProductInstanceWithContext(ctx aws.Context, input *ConfirmProductInstanceInput, opts ...request.Option) (*ConfirmProductInstanceOutput, error) { - req, out := c.ConfirmProductInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCopyImage = "CopyImage" - -// CopyImageRequest generates a "aws/request.Request" representing the -// client's request for the CopyImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyImageRequest method. -// req, resp := client.CopyImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImage -func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, output *CopyImageOutput) { - op := &request.Operation{ - Name: opCopyImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopyImageInput{} - } - - output = &CopyImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyImage API operation for Amazon Elastic Compute Cloud. -// -// Initiates the copy of an AMI from the specified source region to the current -// region. You specify the destination region by using its endpoint when making -// the request. -// -// For more information, see Copying AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CopyImage for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImage -func (c *EC2) CopyImage(input *CopyImageInput) (*CopyImageOutput, error) { - req, out := c.CopyImageRequest(input) - return out, req.Send() -} - -// CopyImageWithContext is the same as CopyImage with the addition of -// the ability to pass a context and additional request options. -// -// See CopyImage 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 *EC2) CopyImageWithContext(ctx aws.Context, input *CopyImageInput, opts ...request.Option) (*CopyImageOutput, error) { - req, out := c.CopyImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCopySnapshot = "CopySnapshot" - -// CopySnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CopySnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopySnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopySnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopySnapshotRequest method. -// req, resp := client.CopySnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshot -func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Request, output *CopySnapshotOutput) { - op := &request.Operation{ - Name: opCopySnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CopySnapshotInput{} - } - - output = &CopySnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopySnapshot API operation for Amazon Elastic Compute Cloud. -// -// Copies a point-in-time snapshot of an EBS volume and stores it in Amazon -// S3. You can copy the snapshot within the same region or from one region to -// another. You can use the snapshot to create EBS volumes or Amazon Machine -// Images (AMIs). The snapshot is copied to the regional endpoint that you send -// the HTTP request to. -// -// Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted -// snapshots remain unencrypted, unless the Encrypted flag is specified during -// the snapshot copy operation. By default, encrypted snapshot copies use the -// default AWS Key Management Service (AWS KMS) customer master key (CMK); however, -// you can specify a non-default CMK with the KmsKeyId parameter. -// -// To copy an encrypted snapshot that has been shared from another account, -// you must have permissions for the CMK used to encrypt the snapshot. -// -// Snapshots created by the CopySnapshot action have an arbitrary volume ID -// that should not be used for any purpose. -// -// For more information, see Copying an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CopySnapshot for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshot -func (c *EC2) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) { - req, out := c.CopySnapshotRequest(input) - return out, req.Send() -} - -// CopySnapshotWithContext is the same as CopySnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See CopySnapshot 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 *EC2) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput, opts ...request.Option) (*CopySnapshotOutput, error) { - req, out := c.CopySnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCustomerGateway = "CreateCustomerGateway" - -// CreateCustomerGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateCustomerGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateCustomerGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateCustomerGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateCustomerGatewayRequest method. -// req, resp := client.CreateCustomerGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway -func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (req *request.Request, output *CreateCustomerGatewayOutput) { - op := &request.Operation{ - Name: opCreateCustomerGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCustomerGatewayInput{} - } - - output = &CreateCustomerGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCustomerGateway API operation for Amazon Elastic Compute Cloud. -// -// Provides information to AWS about your VPN customer gateway device. The customer -// gateway is the appliance at your end of the VPN connection. (The device on -// the AWS side of the VPN connection is the virtual private gateway.) You must -// provide the Internet-routable IP address of the customer gateway's external -// interface. The IP address must be static and may be behind a device performing -// network address translation (NAT). -// -// For devices that use Border Gateway Protocol (BGP), you can also provide -// the device's BGP Autonomous System Number (ASN). You can use an existing -// ASN assigned to your network. If you don't have an ASN already, you can use -// a private ASN (in the 64512 - 65534 range). -// -// Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with -// the exception of 7224, which is reserved in the us-east-1 region, and 9059, -// which is reserved in the eu-west-1 region. -// -// For more information about VPN customer gateways, see Adding a Hardware Virtual -// Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// You cannot create more than one customer gateway with the same VPN type, -// IP address, and BGP ASN parameter values. If you run an identical request -// more than one time, the first request creates the customer gateway, and subsequent -// requests return information about the existing customer gateway. The subsequent -// requests do not create new customer gateway resources. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateCustomerGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGateway -func (c *EC2) CreateCustomerGateway(input *CreateCustomerGatewayInput) (*CreateCustomerGatewayOutput, error) { - req, out := c.CreateCustomerGatewayRequest(input) - return out, req.Send() -} - -// CreateCustomerGatewayWithContext is the same as CreateCustomerGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCustomerGateway 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 *EC2) CreateCustomerGatewayWithContext(ctx aws.Context, input *CreateCustomerGatewayInput, opts ...request.Option) (*CreateCustomerGatewayOutput, error) { - req, out := c.CreateCustomerGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDhcpOptions = "CreateDhcpOptions" - -// CreateDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the CreateDhcpOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateDhcpOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateDhcpOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateDhcpOptionsRequest method. -// req, resp := client.CreateDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptions -func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *request.Request, output *CreateDhcpOptionsOutput) { - op := &request.Operation{ - Name: opCreateDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDhcpOptionsInput{} - } - - output = &CreateDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Creates a set of DHCP options for your VPC. After creating the set, you must -// associate it with the VPC, causing all existing and new instances that you -// launch in the VPC to use this set of DHCP options. The following are the -// individual DHCP options you can specify. For more information about the options, -// see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt). -// -// * domain-name-servers - The IP addresses of up to four domain name servers, -// or AmazonProvidedDNS. The default DHCP option set specifies AmazonProvidedDNS. -// If specifying more than one domain name server, specify the IP addresses -// in a single parameter, separated by commas. If you want your instance -// to receive a custom DNS hostname as specified in domain-name, you must -// set domain-name-servers to a custom DNS server. -// -// * domain-name - If you're using AmazonProvidedDNS in "us-east-1", specify -// "ec2.internal". If you're using AmazonProvidedDNS in another region, specify -// "region.compute.internal" (for example, "ap-northeast-1.compute.internal"). -// Otherwise, specify a domain name (for example, "MyCompany.com"). This -// value is used to complete unqualified DNS hostnames. Important: Some Linux -// operating systems accept multiple domain names separated by spaces. However, -// Windows and other Linux operating systems treat the value as a single -// domain, which results in unexpected behavior. If your DHCP options set -// is associated with a VPC that has instances with multiple operating systems, -// specify only one domain name. -// -// * ntp-servers - The IP addresses of up to four Network Time Protocol (NTP) -// servers. -// -// * netbios-name-servers - The IP addresses of up to four NetBIOS name servers. -// -// * netbios-node-type - The NetBIOS node type (1, 2, 4, or 8). We recommend -// that you specify 2 (broadcast and multicast are not currently supported). -// For more information about these node types, see RFC 2132 (http://www.ietf.org/rfc/rfc2132.txt). -// -// Your VPC automatically starts out with a set of DHCP options that includes -// only a DNS server that we provide (AmazonProvidedDNS). If you create a set -// of options, and if your VPC has an Internet gateway, make sure to set the -// domain-name-servers option either to AmazonProvidedDNS or to a domain name -// server of your choice. For more information about DHCP options, see DHCP -// Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateDhcpOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptions -func (c *EC2) CreateDhcpOptions(input *CreateDhcpOptionsInput) (*CreateDhcpOptionsOutput, error) { - req, out := c.CreateDhcpOptionsRequest(input) - return out, req.Send() -} - -// CreateDhcpOptionsWithContext is the same as CreateDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDhcpOptions 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 *EC2) CreateDhcpOptionsWithContext(ctx aws.Context, input *CreateDhcpOptionsInput, opts ...request.Option) (*CreateDhcpOptionsOutput, error) { - req, out := c.CreateDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateEgressOnlyInternetGateway = "CreateEgressOnlyInternetGateway" - -// CreateEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateEgressOnlyInternetGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateEgressOnlyInternetGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateEgressOnlyInternetGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateEgressOnlyInternetGatewayRequest method. -// req, resp := client.CreateEgressOnlyInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGateway -func (c *EC2) CreateEgressOnlyInternetGatewayRequest(input *CreateEgressOnlyInternetGatewayInput) (req *request.Request, output *CreateEgressOnlyInternetGatewayOutput) { - op := &request.Operation{ - Name: opCreateEgressOnlyInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEgressOnlyInternetGatewayInput{} - } - - output = &CreateEgressOnlyInternetGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// [IPv6 only] Creates an egress-only Internet gateway for your VPC. An egress-only -// Internet gateway is used to enable outbound communication over IPv6 from -// instances in your VPC to the Internet, and prevents hosts outside of your -// VPC from initiating an IPv6 connection with your instance. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateEgressOnlyInternetGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGateway -func (c *EC2) CreateEgressOnlyInternetGateway(input *CreateEgressOnlyInternetGatewayInput) (*CreateEgressOnlyInternetGatewayOutput, error) { - req, out := c.CreateEgressOnlyInternetGatewayRequest(input) - return out, req.Send() -} - -// CreateEgressOnlyInternetGatewayWithContext is the same as CreateEgressOnlyInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEgressOnlyInternetGateway 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 *EC2) CreateEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *CreateEgressOnlyInternetGatewayInput, opts ...request.Option) (*CreateEgressOnlyInternetGatewayOutput, error) { - req, out := c.CreateEgressOnlyInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateFlowLogs = "CreateFlowLogs" - -// CreateFlowLogsRequest generates a "aws/request.Request" representing the -// client's request for the CreateFlowLogs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateFlowLogs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateFlowLogs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateFlowLogsRequest method. -// req, resp := client.CreateFlowLogsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogs -func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Request, output *CreateFlowLogsOutput) { - op := &request.Operation{ - Name: opCreateFlowLogs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateFlowLogsInput{} - } - - output = &CreateFlowLogsOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateFlowLogs API operation for Amazon Elastic Compute Cloud. -// -// Creates one or more flow logs to capture IP traffic for a specific network -// interface, subnet, or VPC. Flow logs are delivered to a specified log group -// in Amazon CloudWatch Logs. If you specify a VPC or subnet in the request, -// a log stream is created in CloudWatch Logs for each network interface in -// the subnet or VPC. Log streams can include information about accepted and -// rejected traffic to a network interface. You can view the data in your log -// streams using Amazon CloudWatch Logs. -// -// In your request, you must also specify an IAM role that has permission to -// publish logs to CloudWatch Logs. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateFlowLogs for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogs -func (c *EC2) CreateFlowLogs(input *CreateFlowLogsInput) (*CreateFlowLogsOutput, error) { - req, out := c.CreateFlowLogsRequest(input) - return out, req.Send() -} - -// CreateFlowLogsWithContext is the same as CreateFlowLogs with the addition of -// the ability to pass a context and additional request options. -// -// See CreateFlowLogs 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 *EC2) CreateFlowLogsWithContext(ctx aws.Context, input *CreateFlowLogsInput, opts ...request.Option) (*CreateFlowLogsOutput, error) { - req, out := c.CreateFlowLogsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateImage = "CreateImage" - -// CreateImageRequest generates a "aws/request.Request" representing the -// client's request for the CreateImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateImageRequest method. -// req, resp := client.CreateImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImage -func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *request.Request, output *CreateImageOutput) { - op := &request.Operation{ - Name: opCreateImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateImageInput{} - } - - output = &CreateImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateImage API operation for Amazon Elastic Compute Cloud. -// -// Creates an Amazon EBS-backed AMI from an Amazon EBS-backed instance that -// is either running or stopped. -// -// If you customized your instance with instance store volumes or EBS volumes -// in addition to the root device volume, the new AMI contains block device -// mapping information for those volumes. When you launch an instance from this -// new AMI, the instance automatically launches with those additional volumes. -// -// For more information, see Creating Amazon EBS-Backed Linux AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateImage for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImage -func (c *EC2) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { - req, out := c.CreateImageRequest(input) - return out, req.Send() -} - -// CreateImageWithContext is the same as CreateImage with the addition of -// the ability to pass a context and additional request options. -// -// See CreateImage 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 *EC2) CreateImageWithContext(ctx aws.Context, input *CreateImageInput, opts ...request.Option) (*CreateImageOutput, error) { - req, out := c.CreateImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateInstanceExportTask = "CreateInstanceExportTask" - -// CreateInstanceExportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CreateInstanceExportTask operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInstanceExportTask for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInstanceExportTask method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInstanceExportTaskRequest method. -// req, resp := client.CreateInstanceExportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTask -func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInput) (req *request.Request, output *CreateInstanceExportTaskOutput) { - op := &request.Operation{ - Name: opCreateInstanceExportTask, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInstanceExportTaskInput{} - } - - output = &CreateInstanceExportTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInstanceExportTask API operation for Amazon Elastic Compute Cloud. -// -// Exports a running or stopped instance to an S3 bucket. -// -// For information about the supported operating systems, image formats, and -// known limitations for the types of instances you can export, see Exporting -// an Instance as a VM Using VM Import/Export (http://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html) -// in the VM Import/Export User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateInstanceExportTask for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTask -func (c *EC2) CreateInstanceExportTask(input *CreateInstanceExportTaskInput) (*CreateInstanceExportTaskOutput, error) { - req, out := c.CreateInstanceExportTaskRequest(input) - return out, req.Send() -} - -// CreateInstanceExportTaskWithContext is the same as CreateInstanceExportTask with the addition of -// the ability to pass a context and additional request options. -// -// See CreateInstanceExportTask 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 *EC2) CreateInstanceExportTaskWithContext(ctx aws.Context, input *CreateInstanceExportTaskInput, opts ...request.Option) (*CreateInstanceExportTaskOutput, error) { - req, out := c.CreateInstanceExportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateInternetGateway = "CreateInternetGateway" - -// CreateInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateInternetGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateInternetGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateInternetGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateInternetGatewayRequest method. -// req, resp := client.CreateInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGateway -func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (req *request.Request, output *CreateInternetGatewayOutput) { - op := &request.Operation{ - Name: opCreateInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateInternetGatewayInput{} - } - - output = &CreateInternetGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Creates an Internet gateway for use with a VPC. After creating the Internet -// gateway, you attach it to a VPC using AttachInternetGateway. -// -// For more information about your VPC and Internet gateway, see the Amazon -// Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/). -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateInternetGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGateway -func (c *EC2) CreateInternetGateway(input *CreateInternetGatewayInput) (*CreateInternetGatewayOutput, error) { - req, out := c.CreateInternetGatewayRequest(input) - return out, req.Send() -} - -// CreateInternetGatewayWithContext is the same as CreateInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateInternetGateway 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 *EC2) CreateInternetGatewayWithContext(ctx aws.Context, input *CreateInternetGatewayInput, opts ...request.Option) (*CreateInternetGatewayOutput, error) { - req, out := c.CreateInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateKeyPair = "CreateKeyPair" - -// CreateKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the CreateKeyPair operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateKeyPair for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateKeyPair method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateKeyPairRequest method. -// req, resp := client.CreateKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPair -func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Request, output *CreateKeyPairOutput) { - op := &request.Operation{ - Name: opCreateKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateKeyPairInput{} - } - - output = &CreateKeyPairOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateKeyPair API operation for Amazon Elastic Compute Cloud. -// -// Creates a 2048-bit RSA key pair with the specified name. Amazon EC2 stores -// the public key and displays the private key for you to save to a file. The -// private key is returned as an unencrypted PEM encoded PKCS#8 private key. -// If a key with the specified name already exists, Amazon EC2 returns an error. -// -// You can have up to five thousand key pairs per region. -// -// The key pair returned to you is available only in the region in which you -// create it. To create a key pair that is available in all regions, use ImportKeyPair. -// -// For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateKeyPair for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPair -func (c *EC2) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error) { - req, out := c.CreateKeyPairRequest(input) - return out, req.Send() -} - -// CreateKeyPairWithContext is the same as CreateKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See CreateKeyPair 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 *EC2) CreateKeyPairWithContext(ctx aws.Context, input *CreateKeyPairInput, opts ...request.Option) (*CreateKeyPairOutput, error) { - req, out := c.CreateKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNatGateway = "CreateNatGateway" - -// CreateNatGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateNatGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateNatGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateNatGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateNatGatewayRequest method. -// req, resp := client.CreateNatGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway -func (c *EC2) CreateNatGatewayRequest(input *CreateNatGatewayInput) (req *request.Request, output *CreateNatGatewayOutput) { - op := &request.Operation{ - Name: opCreateNatGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNatGatewayInput{} - } - - output = &CreateNatGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNatGateway API operation for Amazon Elastic Compute Cloud. -// -// Creates a NAT gateway in the specified subnet. A NAT gateway can be used -// to enable instances in a private subnet to connect to the Internet. This -// action creates a network interface in the specified subnet with a private -// IP address from the IP address range of the subnet. For more information, -// see NAT Gateways (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateNatGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGateway -func (c *EC2) CreateNatGateway(input *CreateNatGatewayInput) (*CreateNatGatewayOutput, error) { - req, out := c.CreateNatGatewayRequest(input) - return out, req.Send() -} - -// CreateNatGatewayWithContext is the same as CreateNatGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNatGateway 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 *EC2) CreateNatGatewayWithContext(ctx aws.Context, input *CreateNatGatewayInput, opts ...request.Option) (*CreateNatGatewayOutput, error) { - req, out := c.CreateNatGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkAcl = "CreateNetworkAcl" - -// CreateNetworkAclRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkAcl operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateNetworkAcl for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateNetworkAcl method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateNetworkAclRequest method. -// req, resp := client.CreateNetworkAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAcl -func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) (req *request.Request, output *CreateNetworkAclOutput) { - op := &request.Operation{ - Name: opCreateNetworkAcl, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNetworkAclInput{} - } - - output = &CreateNetworkAclOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNetworkAcl API operation for Amazon Elastic Compute Cloud. -// -// Creates a network ACL in a VPC. Network ACLs provide an optional layer of -// security (in addition to security groups) for the instances in your VPC. -// -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateNetworkAcl for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAcl -func (c *EC2) CreateNetworkAcl(input *CreateNetworkAclInput) (*CreateNetworkAclOutput, error) { - req, out := c.CreateNetworkAclRequest(input) - return out, req.Send() -} - -// CreateNetworkAclWithContext is the same as CreateNetworkAcl with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkAcl 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 *EC2) CreateNetworkAclWithContext(ctx aws.Context, input *CreateNetworkAclInput, opts ...request.Option) (*CreateNetworkAclOutput, error) { - req, out := c.CreateNetworkAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkAclEntry = "CreateNetworkAclEntry" - -// CreateNetworkAclEntryRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkAclEntry operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateNetworkAclEntry for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateNetworkAclEntry method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateNetworkAclEntryRequest method. -// req, resp := client.CreateNetworkAclEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntry -func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (req *request.Request, output *CreateNetworkAclEntryOutput) { - op := &request.Operation{ - Name: opCreateNetworkAclEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNetworkAclEntryInput{} - } - - output = &CreateNetworkAclEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateNetworkAclEntry API operation for Amazon Elastic Compute Cloud. -// -// Creates an entry (a rule) in a network ACL with the specified rule number. -// Each network ACL has a set of numbered ingress rules and a separate set of -// numbered egress rules. When determining whether a packet should be allowed -// in or out of a subnet associated with the ACL, we process the entries in -// the ACL according to the rule numbers, in ascending order. Each network ACL -// has a set of ingress rules and a separate set of egress rules. -// -// We recommend that you leave room between the rule numbers (for example, 100, -// 110, 120, ...), and not number them one right after the other (for example, -// 101, 102, 103, ...). This makes it easier to add a rule between existing -// ones without having to renumber the rules. -// -// After you add an entry, you can't modify it; you must either replace it, -// or create an entry and delete the old one. -// -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateNetworkAclEntry for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntry -func (c *EC2) CreateNetworkAclEntry(input *CreateNetworkAclEntryInput) (*CreateNetworkAclEntryOutput, error) { - req, out := c.CreateNetworkAclEntryRequest(input) - return out, req.Send() -} - -// CreateNetworkAclEntryWithContext is the same as CreateNetworkAclEntry with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkAclEntry 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 *EC2) CreateNetworkAclEntryWithContext(ctx aws.Context, input *CreateNetworkAclEntryInput, opts ...request.Option) (*CreateNetworkAclEntryOutput, error) { - req, out := c.CreateNetworkAclEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkInterface = "CreateNetworkInterface" - -// CreateNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkInterface operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateNetworkInterface for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateNetworkInterface method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateNetworkInterfaceRequest method. -// req, resp := client.CreateNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterface -func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput) (req *request.Request, output *CreateNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opCreateNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNetworkInterfaceInput{} - } - - output = &CreateNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Creates a network interface in the specified subnet. -// -// For more information about network interfaces, see Elastic Network Interfaces -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in the -// Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateNetworkInterface for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterface -func (c *EC2) CreateNetworkInterface(input *CreateNetworkInterfaceInput) (*CreateNetworkInterfaceOutput, error) { - req, out := c.CreateNetworkInterfaceRequest(input) - return out, req.Send() -} - -// CreateNetworkInterfaceWithContext is the same as CreateNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkInterface 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 *EC2) CreateNetworkInterfaceWithContext(ctx aws.Context, input *CreateNetworkInterfaceInput, opts ...request.Option) (*CreateNetworkInterfaceOutput, error) { - req, out := c.CreateNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePlacementGroup = "CreatePlacementGroup" - -// CreatePlacementGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreatePlacementGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePlacementGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePlacementGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePlacementGroupRequest method. -// req, resp := client.CreatePlacementGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroup -func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req *request.Request, output *CreatePlacementGroupOutput) { - op := &request.Operation{ - Name: opCreatePlacementGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePlacementGroupInput{} - } - - output = &CreatePlacementGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreatePlacementGroup API operation for Amazon Elastic Compute Cloud. -// -// Creates a placement group that you launch cluster instances into. You must -// give the group a name that's unique within the scope of your account. -// -// For more information about placement groups and cluster instances, see Cluster -// Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreatePlacementGroup for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroup -func (c *EC2) CreatePlacementGroup(input *CreatePlacementGroupInput) (*CreatePlacementGroupOutput, error) { - req, out := c.CreatePlacementGroupRequest(input) - return out, req.Send() -} - -// CreatePlacementGroupWithContext is the same as CreatePlacementGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePlacementGroup 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 *EC2) CreatePlacementGroupWithContext(ctx aws.Context, input *CreatePlacementGroupInput, opts ...request.Option) (*CreatePlacementGroupOutput, error) { - req, out := c.CreatePlacementGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateReservedInstancesListing = "CreateReservedInstancesListing" - -// CreateReservedInstancesListingRequest generates a "aws/request.Request" representing the -// client's request for the CreateReservedInstancesListing operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReservedInstancesListing for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReservedInstancesListing method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReservedInstancesListingRequest method. -// req, resp := client.CreateReservedInstancesListingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListing -func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstancesListingInput) (req *request.Request, output *CreateReservedInstancesListingOutput) { - op := &request.Operation{ - Name: opCreateReservedInstancesListing, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateReservedInstancesListingInput{} - } - - output = &CreateReservedInstancesListingOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReservedInstancesListing API operation for Amazon Elastic Compute Cloud. -// -// Creates a listing for Amazon EC2 Standard Reserved Instances to be sold in -// the Reserved Instance Marketplace. You can submit one Standard Reserved Instance -// listing at a time. To get a list of your Standard Reserved Instances, you -// can use the DescribeReservedInstances operation. -// -// Only Standard Reserved Instances with a capacity reservation can be sold -// in the Reserved Instance Marketplace. Convertible Reserved Instances and -// Standard Reserved Instances with a regional benefit cannot be sold. -// -// The Reserved Instance Marketplace matches sellers who want to resell Standard -// Reserved Instance capacity that they no longer need with buyers who want -// to purchase additional capacity. Reserved Instances bought and sold through -// the Reserved Instance Marketplace work like any other Reserved Instances. -// -// To sell your Standard Reserved Instances, you must first register as a seller -// in the Reserved Instance Marketplace. After completing the registration process, -// you can create a Reserved Instance Marketplace listing of some or all of -// your Standard Reserved Instances, and specify the upfront price to receive -// for them. Your Standard Reserved Instance listings then become available -// for purchase. To view the details of your Standard Reserved Instance listing, -// you can use the DescribeReservedInstancesListings operation. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateReservedInstancesListing for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListing -func (c *EC2) CreateReservedInstancesListing(input *CreateReservedInstancesListingInput) (*CreateReservedInstancesListingOutput, error) { - req, out := c.CreateReservedInstancesListingRequest(input) - return out, req.Send() -} - -// CreateReservedInstancesListingWithContext is the same as CreateReservedInstancesListing with the addition of -// the ability to pass a context and additional request options. -// -// See CreateReservedInstancesListing 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 *EC2) CreateReservedInstancesListingWithContext(ctx aws.Context, input *CreateReservedInstancesListingInput, opts ...request.Option) (*CreateReservedInstancesListingOutput, error) { - req, out := c.CreateReservedInstancesListingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRoute = "CreateRoute" - -// CreateRouteRequest generates a "aws/request.Request" representing the -// client's request for the CreateRoute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRoute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRoute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRouteRequest method. -// req, resp := client.CreateRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRoute -func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request, output *CreateRouteOutput) { - op := &request.Operation{ - Name: opCreateRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRouteInput{} - } - - output = &CreateRouteOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRoute API operation for Amazon Elastic Compute Cloud. -// -// Creates a route in a route table within a VPC. -// -// You must specify one of the following targets: Internet gateway or virtual -// private gateway, NAT instance, NAT gateway, VPC peering connection, network -// interface, or egress-only Internet gateway. -// -// When determining how to route traffic, we use the route with the most specific -// match. For example, traffic is destined for the IPv4 address 192.0.2.3, and -// the route table includes the following two IPv4 routes: -// -// * 192.0.2.0/24 (goes to some target A) -// -// * 192.0.2.0/28 (goes to some target B) -// -// Both routes apply to the traffic destined for 192.0.2.3. However, the second -// route in the list covers a smaller number of IP addresses and is therefore -// more specific, so we use that route to determine where to target the traffic. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateRoute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRoute -func (c *EC2) CreateRoute(input *CreateRouteInput) (*CreateRouteOutput, error) { - req, out := c.CreateRouteRequest(input) - return out, req.Send() -} - -// CreateRouteWithContext is the same as CreateRoute with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRoute 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 *EC2) CreateRouteWithContext(ctx aws.Context, input *CreateRouteInput, opts ...request.Option) (*CreateRouteOutput, error) { - req, out := c.CreateRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRouteTable = "CreateRouteTable" - -// CreateRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the CreateRouteTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateRouteTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateRouteTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateRouteTableRequest method. -// req, resp := client.CreateRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTable -func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *request.Request, output *CreateRouteTableOutput) { - op := &request.Operation{ - Name: opCreateRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRouteTableInput{} - } - - output = &CreateRouteTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Creates a route table for the specified VPC. After you create a route table, -// you can add routes and associate the table with a subnet. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateRouteTable for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTable -func (c *EC2) CreateRouteTable(input *CreateRouteTableInput) (*CreateRouteTableOutput, error) { - req, out := c.CreateRouteTableRequest(input) - return out, req.Send() -} - -// CreateRouteTableWithContext is the same as CreateRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRouteTable 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 *EC2) CreateRouteTableWithContext(ctx aws.Context, input *CreateRouteTableInput, opts ...request.Option) (*CreateRouteTableOutput, error) { - req, out := c.CreateRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSecurityGroup = "CreateSecurityGroup" - -// CreateSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSecurityGroupRequest method. -// req, resp := client.CreateSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroup -func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *request.Request, output *CreateSecurityGroupOutput) { - op := &request.Operation{ - Name: opCreateSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSecurityGroupInput{} - } - - output = &CreateSecurityGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSecurityGroup API operation for Amazon Elastic Compute Cloud. -// -// Creates a security group. -// -// A security group is for use with instances either in the EC2-Classic platform -// or in a specific VPC. For more information, see Amazon EC2 Security Groups -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) -// in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your -// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// EC2-Classic: You can have up to 500 security groups. -// -// EC2-VPC: You can create up to 500 security groups per VPC. -// -// When you create a security group, you specify a friendly name of your choice. -// You can have a security group for use in EC2-Classic with the same name as -// a security group for use in a VPC. However, you can't have two security groups -// for use in EC2-Classic with the same name or two security groups for use -// in a VPC with the same name. -// -// You have a default security group for use in EC2-Classic and a default security -// group for use in your VPC. If you don't specify a security group when you -// launch an instance, the instance is launched into the appropriate default -// security group. A default security group includes a default rule that grants -// instances unrestricted network access to each other. -// -// You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, -// AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateSecurityGroup for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroup -func (c *EC2) CreateSecurityGroup(input *CreateSecurityGroupInput) (*CreateSecurityGroupOutput, error) { - req, out := c.CreateSecurityGroupRequest(input) - return out, req.Send() -} - -// CreateSecurityGroupWithContext is the same as CreateSecurityGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSecurityGroup 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 *EC2) CreateSecurityGroupWithContext(ctx aws.Context, input *CreateSecurityGroupInput, opts ...request.Option) (*CreateSecurityGroupOutput, error) { - req, out := c.CreateSecurityGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSnapshot = "CreateSnapshot" - -// CreateSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSnapshotRequest method. -// req, resp := client.CreateSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshot -func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *Snapshot) { - op := &request.Operation{ - Name: opCreateSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSnapshotInput{} - } - - output = &Snapshot{} - req = c.newRequest(op, input, output) - return -} - -// CreateSnapshot API operation for Amazon Elastic Compute Cloud. -// -// Creates a snapshot of an EBS volume and stores it in Amazon S3. You can use -// snapshots for backups, to make copies of EBS volumes, and to save data before -// shutting down an instance. -// -// When a snapshot is created, any AWS Marketplace product codes that are associated -// with the source volume are propagated to the snapshot. -// -// You can take a snapshot of an attached volume that is in use. However, snapshots -// only capture data that has been written to your EBS volume at the time the -// snapshot command is issued; this may exclude any data that has been cached -// by any applications or the operating system. If you can pause any file systems -// on the volume long enough to take a snapshot, your snapshot should be complete. -// However, if you cannot pause all file writes to the volume, you should unmount -// the volume from within the instance, issue the snapshot command, and then -// remount the volume to ensure a consistent and complete snapshot. You may -// remount and use your volume while the snapshot status is pending. -// -// To create a snapshot for EBS volumes that serve as root devices, you should -// stop the instance before taking the snapshot. -// -// Snapshots that are taken from encrypted volumes are automatically encrypted. -// Volumes that are created from encrypted snapshots are also automatically -// encrypted. Your encrypted volumes and any associated snapshots always remain -// protected. -// -// For more information, see Amazon Elastic Block Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html) -// and Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateSnapshot for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshot -func (c *EC2) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error) { - req, out := c.CreateSnapshotRequest(input) - return out, req.Send() -} - -// CreateSnapshotWithContext is the same as CreateSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSnapshot 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 *EC2) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*Snapshot, error) { - req, out := c.CreateSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription" - -// CreateSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the CreateSpotDatafeedSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSpotDatafeedSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSpotDatafeedSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSpotDatafeedSubscriptionRequest method. -// req, resp := client.CreateSpotDatafeedSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscription -func (c *EC2) CreateSpotDatafeedSubscriptionRequest(input *CreateSpotDatafeedSubscriptionInput) (req *request.Request, output *CreateSpotDatafeedSubscriptionOutput) { - op := &request.Operation{ - Name: opCreateSpotDatafeedSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSpotDatafeedSubscriptionInput{} - } - - output = &CreateSpotDatafeedSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. -// -// Creates a data feed for Spot instances, enabling you to view Spot instance -// usage logs. You can create one data feed per AWS account. For more information, -// see Spot Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateSpotDatafeedSubscription for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscription -func (c *EC2) CreateSpotDatafeedSubscription(input *CreateSpotDatafeedSubscriptionInput) (*CreateSpotDatafeedSubscriptionOutput, error) { - req, out := c.CreateSpotDatafeedSubscriptionRequest(input) - return out, req.Send() -} - -// CreateSpotDatafeedSubscriptionWithContext is the same as CreateSpotDatafeedSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSpotDatafeedSubscription 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 *EC2) CreateSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *CreateSpotDatafeedSubscriptionInput, opts ...request.Option) (*CreateSpotDatafeedSubscriptionOutput, error) { - req, out := c.CreateSpotDatafeedSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSubnet = "CreateSubnet" - -// CreateSubnetRequest generates a "aws/request.Request" representing the -// client's request for the CreateSubnet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateSubnet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateSubnet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateSubnetRequest method. -// req, resp := client.CreateSubnetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnet -func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Request, output *CreateSubnetOutput) { - op := &request.Operation{ - Name: opCreateSubnet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSubnetInput{} - } - - output = &CreateSubnetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSubnet API operation for Amazon Elastic Compute Cloud. -// -// Creates a subnet in an existing VPC. -// -// When you create each subnet, you provide the VPC ID and the CIDR block you -// want for the subnet. After you create a subnet, you can't change its CIDR -// block. The subnet's IPv4 CIDR block can be the same as the VPC's IPv4 CIDR -// block (assuming you want only a single subnet in the VPC), or a subset of -// the VPC's IPv4 CIDR block. If you create more than one subnet in a VPC, the -// subnets' CIDR blocks must not overlap. The smallest IPv4 subnet (and VPC) -// you can create uses a /28 netmask (16 IPv4 addresses), and the largest uses -// a /16 netmask (65,536 IPv4 addresses). -// -// If you've associated an IPv6 CIDR block with your VPC, you can create a subnet -// with an IPv6 CIDR block that uses a /64 prefix length. -// -// AWS reserves both the first four and the last IP address in each subnet's -// CIDR block. They're not available for use. -// -// If you add more than one subnet to a VPC, they're set up in a star topology -// with a logical router in the middle. -// -// If you launch an instance in a VPC using an Amazon EBS-backed AMI, the IP -// address doesn't change if you stop and restart the instance (unlike a similar -// instance launched outside a VPC, which gets a new IP address when restarted). -// It's therefore possible to have a subnet with no running instances (they're -// all stopped), but no remaining IP addresses available. -// -// For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateSubnet for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnet -func (c *EC2) CreateSubnet(input *CreateSubnetInput) (*CreateSubnetOutput, error) { - req, out := c.CreateSubnetRequest(input) - return out, req.Send() -} - -// CreateSubnetWithContext is the same as CreateSubnet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSubnet 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 *EC2) CreateSubnetWithContext(ctx aws.Context, input *CreateSubnetInput, opts ...request.Option) (*CreateSubnetOutput, error) { - req, out := c.CreateSubnetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTags = "CreateTags" - -// CreateTagsRequest generates a "aws/request.Request" representing the -// client's request for the CreateTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTagsRequest method. -// req, resp := client.CreateTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTags -func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput) { - op := &request.Operation{ - Name: opCreateTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTagsInput{} - } - - output = &CreateTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateTags API operation for Amazon Elastic Compute Cloud. -// -// Adds or overwrites one or more tags for the specified Amazon EC2 resource -// or resources. Each resource can have a maximum of 50 tags. Each tag consists -// of a key and optional value. Tag keys must be unique per resource. -// -// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon Elastic Compute Cloud User Guide. For more information about -// creating IAM policies that control users' access to resources based on tags, -// see Supported Resource-Level Permissions for Amazon EC2 API Actions (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateTags for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTags -func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - return out, req.Send() -} - -// CreateTagsWithContext is the same as CreateTags with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTags 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 *EC2) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVolume = "CreateVolume" - -// CreateVolumeRequest generates a "aws/request.Request" representing the -// client's request for the CreateVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVolumeRequest method. -// req, resp := client.CreateVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolume -func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Request, output *Volume) { - op := &request.Operation{ - Name: opCreateVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVolumeInput{} - } - - output = &Volume{} - req = c.newRequest(op, input, output) - return -} - -// CreateVolume API operation for Amazon Elastic Compute Cloud. -// -// Creates an EBS volume that can be attached to an instance in the same Availability -// Zone. The volume is created in the regional endpoint that you send the HTTP -// request to. For more information see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html). -// -// You can create a new empty volume or restore a volume from an EBS snapshot. -// Any AWS Marketplace product codes from the snapshot are propagated to the -// volume. -// -// You can create encrypted volumes with the Encrypted parameter. Encrypted -// volumes may only be attached to instances that support Amazon EBS encryption. -// Volumes that are created from encrypted snapshots are also automatically -// encrypted. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// You can tag your volumes during creation. For more information, see Tagging -// Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). -// -// For more information, see Creating an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateVolume for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolume -func (c *EC2) CreateVolume(input *CreateVolumeInput) (*Volume, error) { - req, out := c.CreateVolumeRequest(input) - return out, req.Send() -} - -// CreateVolumeWithContext is the same as CreateVolume with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVolume 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 *EC2) CreateVolumeWithContext(ctx aws.Context, input *CreateVolumeInput, opts ...request.Option) (*Volume, error) { - req, out := c.CreateVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpc = "CreateVpc" - -// CreateVpcRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpc operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVpc for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVpc method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVpcRequest method. -// req, resp := client.CreateVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpc -func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, output *CreateVpcOutput) { - op := &request.Operation{ - Name: opCreateVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcInput{} - } - - output = &CreateVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpc API operation for Amazon Elastic Compute Cloud. -// -// Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can -// create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16 -// netmask (65,536 IPv4 addresses). To help you decide how big to make your -// VPC, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// You can optionally request an Amazon-provided IPv6 CIDR block for the VPC. -// The IPv6 CIDR block uses a /56 prefix length, and is allocated from Amazon's -// pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC. -// -// By default, each instance you launch in the VPC has the default DHCP options, -// which includes only a default DNS server that we provide (AmazonProvidedDNS). -// For more information about DHCP options, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// You can specify the instance tenancy value for the VPC when you create it. -// You can't change this value for the VPC after you create it. For more information, -// see Dedicated Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateVpc for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpc -func (c *EC2) CreateVpc(input *CreateVpcInput) (*CreateVpcOutput, error) { - req, out := c.CreateVpcRequest(input) - return out, req.Send() -} - -// CreateVpcWithContext is the same as CreateVpc with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpc 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 *EC2) CreateVpcWithContext(ctx aws.Context, input *CreateVpcInput, opts ...request.Option) (*CreateVpcOutput, error) { - req, out := c.CreateVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpcEndpoint = "CreateVpcEndpoint" - -// CreateVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpcEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVpcEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVpcEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVpcEndpointRequest method. -// req, resp := client.CreateVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpoint -func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *request.Request, output *CreateVpcEndpointOutput) { - op := &request.Operation{ - Name: opCreateVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcEndpointInput{} - } - - output = &CreateVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpcEndpoint API operation for Amazon Elastic Compute Cloud. -// -// Creates a VPC endpoint for a specified AWS service. An endpoint enables you -// to create a private connection between your VPC and another AWS service in -// your account. You can specify an endpoint policy to attach to the endpoint -// that will control access to the service from your VPC. You can also specify -// the VPC route tables that use the endpoint. -// -// Use DescribeVpcEndpointServices to get a list of supported AWS services. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateVpcEndpoint for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpoint -func (c *EC2) CreateVpcEndpoint(input *CreateVpcEndpointInput) (*CreateVpcEndpointOutput, error) { - req, out := c.CreateVpcEndpointRequest(input) - return out, req.Send() -} - -// CreateVpcEndpointWithContext is the same as CreateVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpcEndpoint 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 *EC2) CreateVpcEndpointWithContext(ctx aws.Context, input *CreateVpcEndpointInput, opts ...request.Option) (*CreateVpcEndpointOutput, error) { - req, out := c.CreateVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection" - -// CreateVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpcPeeringConnection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVpcPeeringConnection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVpcPeeringConnection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVpcPeeringConnectionRequest method. -// req, resp := client.CreateVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnection -func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectionInput) (req *request.Request, output *CreateVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opCreateVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcPeeringConnectionInput{} - } - - output = &CreateVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Requests a VPC peering connection between two VPCs: a requester VPC that -// you own and a peer VPC with which to create the connection. The peer VPC -// can belong to another AWS account. The requester VPC and peer VPC cannot -// have overlapping CIDR blocks. -// -// The owner of the peer VPC must accept the peering request to activate the -// peering connection. The VPC peering connection request expires after 7 days, -// after which it cannot be accepted or rejected. -// -// A CreateVpcPeeringConnection request between VPCs with overlapping CIDR blocks -// results in the VPC peering connection having a status of failed. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateVpcPeeringConnection for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnection -func (c *EC2) CreateVpcPeeringConnection(input *CreateVpcPeeringConnectionInput) (*CreateVpcPeeringConnectionOutput, error) { - req, out := c.CreateVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// CreateVpcPeeringConnectionWithContext is the same as CreateVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpcPeeringConnection 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 *EC2) CreateVpcPeeringConnectionWithContext(ctx aws.Context, input *CreateVpcPeeringConnectionInput, opts ...request.Option) (*CreateVpcPeeringConnectionOutput, error) { - req, out := c.CreateVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpnConnection = "CreateVpnConnection" - -// CreateVpnConnectionRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpnConnection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVpnConnection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVpnConnection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVpnConnectionRequest method. -// req, resp := client.CreateVpnConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnection -func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req *request.Request, output *CreateVpnConnectionOutput) { - op := &request.Operation{ - Name: opCreateVpnConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpnConnectionInput{} - } - - output = &CreateVpnConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpnConnection API operation for Amazon Elastic Compute Cloud. -// -// Creates a VPN connection between an existing virtual private gateway and -// a VPN customer gateway. The only supported connection type is ipsec.1. -// -// The response includes information that you need to give to your network administrator -// to configure your customer gateway. -// -// We strongly recommend that you use HTTPS when calling this operation because -// the response contains sensitive cryptographic information for configuring -// your customer gateway. -// -// If you decide to shut down your VPN connection for any reason and later create -// a new VPN connection, you must reconfigure your customer gateway with the -// new information returned from this call. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error. -// -// For more information about VPN connections, see Adding a Hardware Virtual -// Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateVpnConnection for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnection -func (c *EC2) CreateVpnConnection(input *CreateVpnConnectionInput) (*CreateVpnConnectionOutput, error) { - req, out := c.CreateVpnConnectionRequest(input) - return out, req.Send() -} - -// CreateVpnConnectionWithContext is the same as CreateVpnConnection with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpnConnection 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 *EC2) CreateVpnConnectionWithContext(ctx aws.Context, input *CreateVpnConnectionInput, opts ...request.Option) (*CreateVpnConnectionOutput, error) { - req, out := c.CreateVpnConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute" - -// CreateVpnConnectionRouteRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpnConnectionRoute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVpnConnectionRoute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVpnConnectionRoute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVpnConnectionRouteRequest method. -// req, resp := client.CreateVpnConnectionRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRoute -func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInput) (req *request.Request, output *CreateVpnConnectionRouteOutput) { - op := &request.Operation{ - Name: opCreateVpnConnectionRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpnConnectionRouteInput{} - } - - output = &CreateVpnConnectionRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateVpnConnectionRoute API operation for Amazon Elastic Compute Cloud. -// -// Creates a static route associated with a VPN connection between an existing -// virtual private gateway and a VPN customer gateway. The static route allows -// traffic to be routed from the virtual private gateway to the VPN customer -// gateway. -// -// For more information about VPN connections, see Adding a Hardware Virtual -// Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateVpnConnectionRoute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRoute -func (c *EC2) CreateVpnConnectionRoute(input *CreateVpnConnectionRouteInput) (*CreateVpnConnectionRouteOutput, error) { - req, out := c.CreateVpnConnectionRouteRequest(input) - return out, req.Send() -} - -// CreateVpnConnectionRouteWithContext is the same as CreateVpnConnectionRoute with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpnConnectionRoute 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 *EC2) CreateVpnConnectionRouteWithContext(ctx aws.Context, input *CreateVpnConnectionRouteInput, opts ...request.Option) (*CreateVpnConnectionRouteOutput, error) { - req, out := c.CreateVpnConnectionRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpnGateway = "CreateVpnGateway" - -// CreateVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpnGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVpnGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVpnGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVpnGatewayRequest method. -// req, resp := client.CreateVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGateway -func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) (req *request.Request, output *CreateVpnGatewayOutput) { - op := &request.Operation{ - Name: opCreateVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpnGatewayInput{} - } - - output = &CreateVpnGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Creates a virtual private gateway. A virtual private gateway is the endpoint -// on the VPC side of your VPN connection. You can create a virtual private -// gateway before creating the VPC itself. -// -// For more information about virtual private gateways, see Adding a Hardware -// Virtual Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation CreateVpnGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGateway -func (c *EC2) CreateVpnGateway(input *CreateVpnGatewayInput) (*CreateVpnGatewayOutput, error) { - req, out := c.CreateVpnGatewayRequest(input) - return out, req.Send() -} - -// CreateVpnGatewayWithContext is the same as CreateVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpnGateway 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 *EC2) CreateVpnGatewayWithContext(ctx aws.Context, input *CreateVpnGatewayInput, opts ...request.Option) (*CreateVpnGatewayOutput, error) { - req, out := c.CreateVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCustomerGateway = "DeleteCustomerGateway" - -// DeleteCustomerGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCustomerGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteCustomerGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteCustomerGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteCustomerGatewayRequest method. -// req, resp := client.DeleteCustomerGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGateway -func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (req *request.Request, output *DeleteCustomerGatewayOutput) { - op := &request.Operation{ - Name: opDeleteCustomerGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCustomerGatewayInput{} - } - - output = &DeleteCustomerGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCustomerGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified customer gateway. You must delete the VPN connection -// before you can delete the customer gateway. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteCustomerGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGateway -func (c *EC2) DeleteCustomerGateway(input *DeleteCustomerGatewayInput) (*DeleteCustomerGatewayOutput, error) { - req, out := c.DeleteCustomerGatewayRequest(input) - return out, req.Send() -} - -// DeleteCustomerGatewayWithContext is the same as DeleteCustomerGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCustomerGateway 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 *EC2) DeleteCustomerGatewayWithContext(ctx aws.Context, input *DeleteCustomerGatewayInput, opts ...request.Option) (*DeleteCustomerGatewayOutput, error) { - req, out := c.DeleteCustomerGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDhcpOptions = "DeleteDhcpOptions" - -// DeleteDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDhcpOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteDhcpOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteDhcpOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteDhcpOptionsRequest method. -// req, resp := client.DeleteDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptions -func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) (req *request.Request, output *DeleteDhcpOptionsOutput) { - op := &request.Operation{ - Name: opDeleteDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDhcpOptionsInput{} - } - - output = &DeleteDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified set of DHCP options. You must disassociate the set -// of DHCP options before you can delete it. You can disassociate the set of -// DHCP options by associating either a new set of options or the default set -// of options with the VPC. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteDhcpOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptions -func (c *EC2) DeleteDhcpOptions(input *DeleteDhcpOptionsInput) (*DeleteDhcpOptionsOutput, error) { - req, out := c.DeleteDhcpOptionsRequest(input) - return out, req.Send() -} - -// DeleteDhcpOptionsWithContext is the same as DeleteDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDhcpOptions 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 *EC2) DeleteDhcpOptionsWithContext(ctx aws.Context, input *DeleteDhcpOptionsInput, opts ...request.Option) (*DeleteDhcpOptionsOutput, error) { - req, out := c.DeleteDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEgressOnlyInternetGateway = "DeleteEgressOnlyInternetGateway" - -// DeleteEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEgressOnlyInternetGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteEgressOnlyInternetGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteEgressOnlyInternetGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteEgressOnlyInternetGatewayRequest method. -// req, resp := client.DeleteEgressOnlyInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGateway -func (c *EC2) DeleteEgressOnlyInternetGatewayRequest(input *DeleteEgressOnlyInternetGatewayInput) (req *request.Request, output *DeleteEgressOnlyInternetGatewayOutput) { - op := &request.Operation{ - Name: opDeleteEgressOnlyInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEgressOnlyInternetGatewayInput{} - } - - output = &DeleteEgressOnlyInternetGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes an egress-only Internet gateway. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteEgressOnlyInternetGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGateway -func (c *EC2) DeleteEgressOnlyInternetGateway(input *DeleteEgressOnlyInternetGatewayInput) (*DeleteEgressOnlyInternetGatewayOutput, error) { - req, out := c.DeleteEgressOnlyInternetGatewayRequest(input) - return out, req.Send() -} - -// DeleteEgressOnlyInternetGatewayWithContext is the same as DeleteEgressOnlyInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEgressOnlyInternetGateway 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 *EC2) DeleteEgressOnlyInternetGatewayWithContext(ctx aws.Context, input *DeleteEgressOnlyInternetGatewayInput, opts ...request.Option) (*DeleteEgressOnlyInternetGatewayOutput, error) { - req, out := c.DeleteEgressOnlyInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteFlowLogs = "DeleteFlowLogs" - -// DeleteFlowLogsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFlowLogs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteFlowLogs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteFlowLogs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteFlowLogsRequest method. -// req, resp := client.DeleteFlowLogsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogs -func (c *EC2) DeleteFlowLogsRequest(input *DeleteFlowLogsInput) (req *request.Request, output *DeleteFlowLogsOutput) { - op := &request.Operation{ - Name: opDeleteFlowLogs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteFlowLogsInput{} - } - - output = &DeleteFlowLogsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteFlowLogs API operation for Amazon Elastic Compute Cloud. -// -// Deletes one or more flow logs. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteFlowLogs for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogs -func (c *EC2) DeleteFlowLogs(input *DeleteFlowLogsInput) (*DeleteFlowLogsOutput, error) { - req, out := c.DeleteFlowLogsRequest(input) - return out, req.Send() -} - -// DeleteFlowLogsWithContext is the same as DeleteFlowLogs with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteFlowLogs 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 *EC2) DeleteFlowLogsWithContext(ctx aws.Context, input *DeleteFlowLogsInput, opts ...request.Option) (*DeleteFlowLogsOutput, error) { - req, out := c.DeleteFlowLogsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteInternetGateway = "DeleteInternetGateway" - -// DeleteInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteInternetGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteInternetGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteInternetGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteInternetGatewayRequest method. -// req, resp := client.DeleteInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGateway -func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (req *request.Request, output *DeleteInternetGatewayOutput) { - op := &request.Operation{ - Name: opDeleteInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInternetGatewayInput{} - } - - output = &DeleteInternetGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified Internet gateway. You must detach the Internet gateway -// from the VPC before you can delete it. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteInternetGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGateway -func (c *EC2) DeleteInternetGateway(input *DeleteInternetGatewayInput) (*DeleteInternetGatewayOutput, error) { - req, out := c.DeleteInternetGatewayRequest(input) - return out, req.Send() -} - -// DeleteInternetGatewayWithContext is the same as DeleteInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteInternetGateway 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 *EC2) DeleteInternetGatewayWithContext(ctx aws.Context, input *DeleteInternetGatewayInput, opts ...request.Option) (*DeleteInternetGatewayOutput, error) { - req, out := c.DeleteInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteKeyPair = "DeleteKeyPair" - -// DeleteKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the DeleteKeyPair operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteKeyPair for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteKeyPair method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteKeyPairRequest method. -// req, resp := client.DeleteKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPair -func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *request.Request, output *DeleteKeyPairOutput) { - op := &request.Operation{ - Name: opDeleteKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteKeyPairInput{} - } - - output = &DeleteKeyPairOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteKeyPair API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified key pair, by removing the public key from Amazon EC2. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteKeyPair for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPair -func (c *EC2) DeleteKeyPair(input *DeleteKeyPairInput) (*DeleteKeyPairOutput, error) { - req, out := c.DeleteKeyPairRequest(input) - return out, req.Send() -} - -// DeleteKeyPairWithContext is the same as DeleteKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKeyPair 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 *EC2) DeleteKeyPairWithContext(ctx aws.Context, input *DeleteKeyPairInput, opts ...request.Option) (*DeleteKeyPairOutput, error) { - req, out := c.DeleteKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNatGateway = "DeleteNatGateway" - -// DeleteNatGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNatGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteNatGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteNatGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteNatGatewayRequest method. -// req, resp := client.DeleteNatGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGateway -func (c *EC2) DeleteNatGatewayRequest(input *DeleteNatGatewayInput) (req *request.Request, output *DeleteNatGatewayOutput) { - op := &request.Operation{ - Name: opDeleteNatGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNatGatewayInput{} - } - - output = &DeleteNatGatewayOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteNatGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified NAT gateway. Deleting a NAT gateway disassociates its -// Elastic IP address, but does not release the address from your account. Deleting -// a NAT gateway does not delete any NAT gateway routes in your route tables. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteNatGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGateway -func (c *EC2) DeleteNatGateway(input *DeleteNatGatewayInput) (*DeleteNatGatewayOutput, error) { - req, out := c.DeleteNatGatewayRequest(input) - return out, req.Send() -} - -// DeleteNatGatewayWithContext is the same as DeleteNatGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNatGateway 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 *EC2) DeleteNatGatewayWithContext(ctx aws.Context, input *DeleteNatGatewayInput, opts ...request.Option) (*DeleteNatGatewayOutput, error) { - req, out := c.DeleteNatGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkAcl = "DeleteNetworkAcl" - -// DeleteNetworkAclRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkAcl operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteNetworkAcl for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteNetworkAcl method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteNetworkAclRequest method. -// req, resp := client.DeleteNetworkAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAcl -func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) (req *request.Request, output *DeleteNetworkAclOutput) { - op := &request.Operation{ - Name: opDeleteNetworkAcl, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNetworkAclInput{} - } - - output = &DeleteNetworkAclOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteNetworkAcl API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified network ACL. You can't delete the ACL if it's associated -// with any subnets. You can't delete the default network ACL. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteNetworkAcl for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAcl -func (c *EC2) DeleteNetworkAcl(input *DeleteNetworkAclInput) (*DeleteNetworkAclOutput, error) { - req, out := c.DeleteNetworkAclRequest(input) - return out, req.Send() -} - -// DeleteNetworkAclWithContext is the same as DeleteNetworkAcl with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkAcl 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 *EC2) DeleteNetworkAclWithContext(ctx aws.Context, input *DeleteNetworkAclInput, opts ...request.Option) (*DeleteNetworkAclOutput, error) { - req, out := c.DeleteNetworkAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry" - -// DeleteNetworkAclEntryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkAclEntry operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteNetworkAclEntry for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteNetworkAclEntry method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteNetworkAclEntryRequest method. -// req, resp := client.DeleteNetworkAclEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntry -func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) (req *request.Request, output *DeleteNetworkAclEntryOutput) { - op := &request.Operation{ - Name: opDeleteNetworkAclEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNetworkAclEntryInput{} - } - - output = &DeleteNetworkAclEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteNetworkAclEntry API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified ingress or egress entry (rule) from the specified network -// ACL. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteNetworkAclEntry for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntry -func (c *EC2) DeleteNetworkAclEntry(input *DeleteNetworkAclEntryInput) (*DeleteNetworkAclEntryOutput, error) { - req, out := c.DeleteNetworkAclEntryRequest(input) - return out, req.Send() -} - -// DeleteNetworkAclEntryWithContext is the same as DeleteNetworkAclEntry with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkAclEntry 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 *EC2) DeleteNetworkAclEntryWithContext(ctx aws.Context, input *DeleteNetworkAclEntryInput, opts ...request.Option) (*DeleteNetworkAclEntryOutput, error) { - req, out := c.DeleteNetworkAclEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkInterface = "DeleteNetworkInterface" - -// DeleteNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkInterface operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteNetworkInterface for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteNetworkInterface method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteNetworkInterfaceRequest method. -// req, resp := client.DeleteNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterface -func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput) (req *request.Request, output *DeleteNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opDeleteNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNetworkInterfaceInput{} - } - - output = &DeleteNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified network interface. You must detach the network interface -// before you can delete it. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteNetworkInterface for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterface -func (c *EC2) DeleteNetworkInterface(input *DeleteNetworkInterfaceInput) (*DeleteNetworkInterfaceOutput, error) { - req, out := c.DeleteNetworkInterfaceRequest(input) - return out, req.Send() -} - -// DeleteNetworkInterfaceWithContext is the same as DeleteNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkInterface 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 *EC2) DeleteNetworkInterfaceWithContext(ctx aws.Context, input *DeleteNetworkInterfaceInput, opts ...request.Option) (*DeleteNetworkInterfaceOutput, error) { - req, out := c.DeleteNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePlacementGroup = "DeletePlacementGroup" - -// DeletePlacementGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeletePlacementGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePlacementGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePlacementGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePlacementGroupRequest method. -// req, resp := client.DeletePlacementGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroup -func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req *request.Request, output *DeletePlacementGroupOutput) { - op := &request.Operation{ - Name: opDeletePlacementGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePlacementGroupInput{} - } - - output = &DeletePlacementGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePlacementGroup API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified placement group. You must terminate all instances in -// the placement group before you can delete the placement group. For more information -// about placement groups and cluster instances, see Cluster Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeletePlacementGroup for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroup -func (c *EC2) DeletePlacementGroup(input *DeletePlacementGroupInput) (*DeletePlacementGroupOutput, error) { - req, out := c.DeletePlacementGroupRequest(input) - return out, req.Send() -} - -// DeletePlacementGroupWithContext is the same as DeletePlacementGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePlacementGroup 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 *EC2) DeletePlacementGroupWithContext(ctx aws.Context, input *DeletePlacementGroupInput, opts ...request.Option) (*DeletePlacementGroupOutput, error) { - req, out := c.DeletePlacementGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRoute = "DeleteRoute" - -// DeleteRouteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRoute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRoute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRoute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRouteRequest method. -// req, resp := client.DeleteRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRoute -func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Request, output *DeleteRouteOutput) { - op := &request.Operation{ - Name: opDeleteRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRouteInput{} - } - - output = &DeleteRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRoute API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified route from the specified route table. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteRoute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRoute -func (c *EC2) DeleteRoute(input *DeleteRouteInput) (*DeleteRouteOutput, error) { - req, out := c.DeleteRouteRequest(input) - return out, req.Send() -} - -// DeleteRouteWithContext is the same as DeleteRoute with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRoute 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 *EC2) DeleteRouteWithContext(ctx aws.Context, input *DeleteRouteInput, opts ...request.Option) (*DeleteRouteOutput, error) { - req, out := c.DeleteRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRouteTable = "DeleteRouteTable" - -// DeleteRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRouteTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteRouteTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteRouteTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteRouteTableRequest method. -// req, resp := client.DeleteRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTable -func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *request.Request, output *DeleteRouteTableOutput) { - op := &request.Operation{ - Name: opDeleteRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRouteTableInput{} - } - - output = &DeleteRouteTableOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified route table. You must disassociate the route table -// from any subnets before you can delete it. You can't delete the main route -// table. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteRouteTable for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTable -func (c *EC2) DeleteRouteTable(input *DeleteRouteTableInput) (*DeleteRouteTableOutput, error) { - req, out := c.DeleteRouteTableRequest(input) - return out, req.Send() -} - -// DeleteRouteTableWithContext is the same as DeleteRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRouteTable 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 *EC2) DeleteRouteTableWithContext(ctx aws.Context, input *DeleteRouteTableInput, opts ...request.Option) (*DeleteRouteTableOutput, error) { - req, out := c.DeleteRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSecurityGroup = "DeleteSecurityGroup" - -// DeleteSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSecurityGroup operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSecurityGroup for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSecurityGroup method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSecurityGroupRequest method. -// req, resp := client.DeleteSecurityGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroup -func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *request.Request, output *DeleteSecurityGroupOutput) { - op := &request.Operation{ - Name: opDeleteSecurityGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSecurityGroupInput{} - } - - output = &DeleteSecurityGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSecurityGroup API operation for Amazon Elastic Compute Cloud. -// -// Deletes a security group. -// -// If you attempt to delete a security group that is associated with an instance, -// or is referenced by another security group, the operation fails with InvalidGroup.InUse -// in EC2-Classic or DependencyViolation in EC2-VPC. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteSecurityGroup for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroup -func (c *EC2) DeleteSecurityGroup(input *DeleteSecurityGroupInput) (*DeleteSecurityGroupOutput, error) { - req, out := c.DeleteSecurityGroupRequest(input) - return out, req.Send() -} - -// DeleteSecurityGroupWithContext is the same as DeleteSecurityGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSecurityGroup 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 *EC2) DeleteSecurityGroupWithContext(ctx aws.Context, input *DeleteSecurityGroupInput, opts ...request.Option) (*DeleteSecurityGroupOutput, error) { - req, out := c.DeleteSecurityGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSnapshot = "DeleteSnapshot" - -// DeleteSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSnapshotRequest method. -// req, resp := client.DeleteSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshot -func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Request, output *DeleteSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSnapshotInput{} - } - - output = &DeleteSnapshotOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSnapshot API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified snapshot. -// -// When you make periodic snapshots of a volume, the snapshots are incremental, -// and only the blocks on the device that have changed since your last snapshot -// are saved in the new snapshot. When you delete a snapshot, only the data -// not needed for any other snapshot is removed. So regardless of which prior -// snapshots have been deleted, all active snapshots will have access to all -// the information needed to restore the volume. -// -// You cannot delete a snapshot of the root device of an EBS volume used by -// a registered AMI. You must first de-register the AMI before you can delete -// the snapshot. -// -// For more information, see Deleting an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteSnapshot for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshot -func (c *EC2) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - return out, req.Send() -} - -// DeleteSnapshotWithContext is the same as DeleteSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSnapshot 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 *EC2) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription" - -// DeleteSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSpotDatafeedSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSpotDatafeedSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSpotDatafeedSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSpotDatafeedSubscriptionRequest method. -// req, resp := client.DeleteSpotDatafeedSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscription -func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSubscriptionInput) (req *request.Request, output *DeleteSpotDatafeedSubscriptionOutput) { - op := &request.Operation{ - Name: opDeleteSpotDatafeedSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSpotDatafeedSubscriptionInput{} - } - - output = &DeleteSpotDatafeedSubscriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. -// -// Deletes the data feed for Spot instances. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteSpotDatafeedSubscription for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscription -func (c *EC2) DeleteSpotDatafeedSubscription(input *DeleteSpotDatafeedSubscriptionInput) (*DeleteSpotDatafeedSubscriptionOutput, error) { - req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) - return out, req.Send() -} - -// DeleteSpotDatafeedSubscriptionWithContext is the same as DeleteSpotDatafeedSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSpotDatafeedSubscription 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 *EC2) DeleteSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DeleteSpotDatafeedSubscriptionInput, opts ...request.Option) (*DeleteSpotDatafeedSubscriptionOutput, error) { - req, out := c.DeleteSpotDatafeedSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSubnet = "DeleteSubnet" - -// DeleteSubnetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubnet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteSubnet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteSubnet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteSubnetRequest method. -// req, resp := client.DeleteSubnetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnet -func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *request.Request, output *DeleteSubnetOutput) { - op := &request.Operation{ - Name: opDeleteSubnet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSubnetInput{} - } - - output = &DeleteSubnetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSubnet API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified subnet. You must terminate all running instances in -// the subnet before you can delete the subnet. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteSubnet for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnet -func (c *EC2) DeleteSubnet(input *DeleteSubnetInput) (*DeleteSubnetOutput, error) { - req, out := c.DeleteSubnetRequest(input) - return out, req.Send() -} - -// DeleteSubnetWithContext is the same as DeleteSubnet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSubnet 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 *EC2) DeleteSubnetWithContext(ctx aws.Context, input *DeleteSubnetInput, opts ...request.Option) (*DeleteSubnetOutput, error) { - req, out := c.DeleteSubnetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTags = "DeleteTags" - -// DeleteTagsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTagsRequest method. -// req, resp := client.DeleteTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTags -func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { - op := &request.Operation{ - Name: opDeleteTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTagsInput{} - } - - output = &DeleteTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTags API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified set of tags from the specified set of resources. This -// call is designed to follow a DescribeTags request. -// -// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteTags for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTags -func (c *EC2) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - return out, req.Send() -} - -// DeleteTagsWithContext is the same as DeleteTags with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTags 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 *EC2) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVolume = "DeleteVolume" - -// DeleteVolumeRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVolumeRequest method. -// req, resp := client.DeleteVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolume -func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Request, output *DeleteVolumeOutput) { - op := &request.Operation{ - Name: opDeleteVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVolumeInput{} - } - - output = &DeleteVolumeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVolume API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified EBS volume. The volume must be in the available state -// (not attached to an instance). -// -// The volume may remain in the deleting state for several minutes. -// -// For more information, see Deleting an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteVolume for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolume -func (c *EC2) DeleteVolume(input *DeleteVolumeInput) (*DeleteVolumeOutput, error) { - req, out := c.DeleteVolumeRequest(input) - return out, req.Send() -} - -// DeleteVolumeWithContext is the same as DeleteVolume with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVolume 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 *EC2) DeleteVolumeWithContext(ctx aws.Context, input *DeleteVolumeInput, opts ...request.Option) (*DeleteVolumeOutput, error) { - req, out := c.DeleteVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpc = "DeleteVpc" - -// DeleteVpcRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpc operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVpc for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVpc method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVpcRequest method. -// req, resp := client.DeleteVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpc -func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) (req *request.Request, output *DeleteVpcOutput) { - op := &request.Operation{ - Name: opDeleteVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcInput{} - } - - output = &DeleteVpcOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpc API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified VPC. You must detach or delete all gateways and resources -// that are associated with the VPC before you can delete it. For example, you -// must terminate all instances running in the VPC, delete all security groups -// associated with the VPC (except the default one), delete all route tables -// associated with the VPC (except the default one), and so on. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteVpc for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpc -func (c *EC2) DeleteVpc(input *DeleteVpcInput) (*DeleteVpcOutput, error) { - req, out := c.DeleteVpcRequest(input) - return out, req.Send() -} - -// DeleteVpcWithContext is the same as DeleteVpc with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpc 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 *EC2) DeleteVpcWithContext(ctx aws.Context, input *DeleteVpcInput, opts ...request.Option) (*DeleteVpcOutput, error) { - req, out := c.DeleteVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpcEndpoints = "DeleteVpcEndpoints" - -// DeleteVpcEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpcEndpoints operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVpcEndpoints for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVpcEndpoints method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVpcEndpointsRequest method. -// req, resp := client.DeleteVpcEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpoints -func (c *EC2) DeleteVpcEndpointsRequest(input *DeleteVpcEndpointsInput) (req *request.Request, output *DeleteVpcEndpointsOutput) { - op := &request.Operation{ - Name: opDeleteVpcEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcEndpointsInput{} - } - - output = &DeleteVpcEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVpcEndpoints API operation for Amazon Elastic Compute Cloud. -// -// Deletes one or more specified VPC endpoints. Deleting the endpoint also deletes -// the endpoint routes in the route tables that were associated with the endpoint. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteVpcEndpoints for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpoints -func (c *EC2) DeleteVpcEndpoints(input *DeleteVpcEndpointsInput) (*DeleteVpcEndpointsOutput, error) { - req, out := c.DeleteVpcEndpointsRequest(input) - return out, req.Send() -} - -// DeleteVpcEndpointsWithContext is the same as DeleteVpcEndpoints with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpcEndpoints 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 *EC2) DeleteVpcEndpointsWithContext(ctx aws.Context, input *DeleteVpcEndpointsInput, opts ...request.Option) (*DeleteVpcEndpointsOutput, error) { - req, out := c.DeleteVpcEndpointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection" - -// DeleteVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpcPeeringConnection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVpcPeeringConnection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVpcPeeringConnection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVpcPeeringConnectionRequest method. -// req, resp := client.DeleteVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnection -func (c *EC2) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConnectionInput) (req *request.Request, output *DeleteVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opDeleteVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcPeeringConnectionInput{} - } - - output = &DeleteVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Deletes a VPC peering connection. Either the owner of the requester VPC or -// the owner of the peer VPC can delete the VPC peering connection if it's in -// the active state. The owner of the requester VPC can delete a VPC peering -// connection in the pending-acceptance state. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteVpcPeeringConnection for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnection -func (c *EC2) DeleteVpcPeeringConnection(input *DeleteVpcPeeringConnectionInput) (*DeleteVpcPeeringConnectionOutput, error) { - req, out := c.DeleteVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// DeleteVpcPeeringConnectionWithContext is the same as DeleteVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpcPeeringConnection 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 *EC2) DeleteVpcPeeringConnectionWithContext(ctx aws.Context, input *DeleteVpcPeeringConnectionInput, opts ...request.Option) (*DeleteVpcPeeringConnectionOutput, error) { - req, out := c.DeleteVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpnConnection = "DeleteVpnConnection" - -// DeleteVpnConnectionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpnConnection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVpnConnection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVpnConnection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVpnConnectionRequest method. -// req, resp := client.DeleteVpnConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnection -func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) (req *request.Request, output *DeleteVpnConnectionOutput) { - op := &request.Operation{ - Name: opDeleteVpnConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpnConnectionInput{} - } - - output = &DeleteVpnConnectionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpnConnection API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified VPN connection. -// -// If you're deleting the VPC and its associated components, we recommend that -// you detach the virtual private gateway from the VPC and delete the VPC before -// deleting the VPN connection. If you believe that the tunnel credentials for -// your VPN connection have been compromised, you can delete the VPN connection -// and create a new one that has new keys, without needing to delete the VPC -// or virtual private gateway. If you create a new VPN connection, you must -// reconfigure the customer gateway using the new configuration information -// returned with the new VPN connection ID. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteVpnConnection for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnection -func (c *EC2) DeleteVpnConnection(input *DeleteVpnConnectionInput) (*DeleteVpnConnectionOutput, error) { - req, out := c.DeleteVpnConnectionRequest(input) - return out, req.Send() -} - -// DeleteVpnConnectionWithContext is the same as DeleteVpnConnection with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpnConnection 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 *EC2) DeleteVpnConnectionWithContext(ctx aws.Context, input *DeleteVpnConnectionInput, opts ...request.Option) (*DeleteVpnConnectionOutput, error) { - req, out := c.DeleteVpnConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute" - -// DeleteVpnConnectionRouteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpnConnectionRoute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVpnConnectionRoute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVpnConnectionRoute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVpnConnectionRouteRequest method. -// req, resp := client.DeleteVpnConnectionRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRoute -func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInput) (req *request.Request, output *DeleteVpnConnectionRouteOutput) { - op := &request.Operation{ - Name: opDeleteVpnConnectionRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpnConnectionRouteInput{} - } - - output = &DeleteVpnConnectionRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpnConnectionRoute API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified static route associated with a VPN connection between -// an existing virtual private gateway and a VPN customer gateway. The static -// route allows traffic to be routed from the virtual private gateway to the -// VPN customer gateway. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteVpnConnectionRoute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRoute -func (c *EC2) DeleteVpnConnectionRoute(input *DeleteVpnConnectionRouteInput) (*DeleteVpnConnectionRouteOutput, error) { - req, out := c.DeleteVpnConnectionRouteRequest(input) - return out, req.Send() -} - -// DeleteVpnConnectionRouteWithContext is the same as DeleteVpnConnectionRoute with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpnConnectionRoute 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 *EC2) DeleteVpnConnectionRouteWithContext(ctx aws.Context, input *DeleteVpnConnectionRouteInput, opts ...request.Option) (*DeleteVpnConnectionRouteOutput, error) { - req, out := c.DeleteVpnConnectionRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpnGateway = "DeleteVpnGateway" - -// DeleteVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpnGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVpnGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVpnGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVpnGatewayRequest method. -// req, resp := client.DeleteVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGateway -func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) (req *request.Request, output *DeleteVpnGatewayOutput) { - op := &request.Operation{ - Name: opDeleteVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpnGatewayInput{} - } - - output = &DeleteVpnGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Deletes the specified virtual private gateway. We recommend that before you -// delete a virtual private gateway, you detach it from the VPC and delete the -// VPN connection. Note that you don't need to delete the virtual private gateway -// if you plan to delete and recreate the VPN connection between your VPC and -// your network. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeleteVpnGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGateway -func (c *EC2) DeleteVpnGateway(input *DeleteVpnGatewayInput) (*DeleteVpnGatewayOutput, error) { - req, out := c.DeleteVpnGatewayRequest(input) - return out, req.Send() -} - -// DeleteVpnGatewayWithContext is the same as DeleteVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpnGateway 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 *EC2) DeleteVpnGatewayWithContext(ctx aws.Context, input *DeleteVpnGatewayInput, opts ...request.Option) (*DeleteVpnGatewayOutput, error) { - req, out := c.DeleteVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterImage = "DeregisterImage" - -// DeregisterImageRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeregisterImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeregisterImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeregisterImageRequest method. -// req, resp := client.DeregisterImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImage -func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *request.Request, output *DeregisterImageOutput) { - op := &request.Operation{ - Name: opDeregisterImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterImageInput{} - } - - output = &DeregisterImageOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterImage API operation for Amazon Elastic Compute Cloud. -// -// Deregisters the specified AMI. After you deregister an AMI, it can't be used -// to launch new instances. -// -// This command does not delete the AMI. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DeregisterImage for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImage -func (c *EC2) DeregisterImage(input *DeregisterImageInput) (*DeregisterImageOutput, error) { - req, out := c.DeregisterImageRequest(input) - return out, req.Send() -} - -// DeregisterImageWithContext is the same as DeregisterImage with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterImage 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 *EC2) DeregisterImageWithContext(ctx aws.Context, input *DeregisterImageInput, opts ...request.Option) (*DeregisterImageOutput, error) { - req, out := c.DeregisterImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAccountAttributes = "DescribeAccountAttributes" - -// DescribeAccountAttributesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAccountAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAccountAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAccountAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAccountAttributesRequest method. -// req, resp := client.DescribeAccountAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributes -func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesInput) (req *request.Request, output *DescribeAccountAttributesOutput) { - op := &request.Operation{ - Name: opDescribeAccountAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAccountAttributesInput{} - } - - output = &DescribeAccountAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAccountAttributes API operation for Amazon Elastic Compute Cloud. -// -// Describes attributes of your AWS account. The following are the supported -// account attributes: -// -// * supported-platforms: Indicates whether your account can launch instances -// into EC2-Classic and EC2-VPC, or only into EC2-VPC. -// -// * default-vpc: The ID of the default VPC for your account, or none. -// -// * max-instances: The maximum number of On-Demand instances that you can -// run. -// -// * vpc-max-security-groups-per-interface: The maximum number of security -// groups that you can assign to a network interface. -// -// * max-elastic-ips: The maximum number of Elastic IP addresses that you -// can allocate for use with EC2-Classic. -// -// * vpc-max-elastic-ips: The maximum number of Elastic IP addresses that -// you can allocate for use with EC2-VPC. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeAccountAttributes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributes -func (c *EC2) DescribeAccountAttributes(input *DescribeAccountAttributesInput) (*DescribeAccountAttributesOutput, error) { - req, out := c.DescribeAccountAttributesRequest(input) - return out, req.Send() -} - -// DescribeAccountAttributesWithContext is the same as DescribeAccountAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAccountAttributes 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 *EC2) DescribeAccountAttributesWithContext(ctx aws.Context, input *DescribeAccountAttributesInput, opts ...request.Option) (*DescribeAccountAttributesOutput, error) { - req, out := c.DescribeAccountAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAddresses = "DescribeAddresses" - -// DescribeAddressesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAddresses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAddresses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAddresses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAddressesRequest method. -// req, resp := client.DescribeAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddresses -func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *request.Request, output *DescribeAddressesOutput) { - op := &request.Operation{ - Name: opDescribeAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAddressesInput{} - } - - output = &DescribeAddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAddresses API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Elastic IP addresses. -// -// An Elastic IP address is for use in either the EC2-Classic platform or in -// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeAddresses for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddresses -func (c *EC2) DescribeAddresses(input *DescribeAddressesInput) (*DescribeAddressesOutput, error) { - req, out := c.DescribeAddressesRequest(input) - return out, req.Send() -} - -// DescribeAddressesWithContext is the same as DescribeAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAddresses 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 *EC2) DescribeAddressesWithContext(ctx aws.Context, input *DescribeAddressesInput, opts ...request.Option) (*DescribeAddressesOutput, error) { - req, out := c.DescribeAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAvailabilityZones = "DescribeAvailabilityZones" - -// DescribeAvailabilityZonesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAvailabilityZones operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeAvailabilityZones for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeAvailabilityZones method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeAvailabilityZonesRequest method. -// req, resp := client.DescribeAvailabilityZonesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZones -func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesInput) (req *request.Request, output *DescribeAvailabilityZonesOutput) { - op := &request.Operation{ - Name: opDescribeAvailabilityZones, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAvailabilityZonesInput{} - } - - output = &DescribeAvailabilityZonesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAvailabilityZones API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the Availability Zones that are available to you. -// The results include zones only for the region you're currently using. If -// there is an event impacting an Availability Zone, you can use this request -// to view the state and any provided message for that Availability Zone. -// -// For more information, see Regions and Availability Zones (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeAvailabilityZones for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZones -func (c *EC2) DescribeAvailabilityZones(input *DescribeAvailabilityZonesInput) (*DescribeAvailabilityZonesOutput, error) { - req, out := c.DescribeAvailabilityZonesRequest(input) - return out, req.Send() -} - -// DescribeAvailabilityZonesWithContext is the same as DescribeAvailabilityZones with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAvailabilityZones 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 *EC2) DescribeAvailabilityZonesWithContext(ctx aws.Context, input *DescribeAvailabilityZonesInput, opts ...request.Option) (*DescribeAvailabilityZonesOutput, error) { - req, out := c.DescribeAvailabilityZonesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeBundleTasks = "DescribeBundleTasks" - -// DescribeBundleTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeBundleTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeBundleTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeBundleTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeBundleTasksRequest method. -// req, resp := client.DescribeBundleTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasks -func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *request.Request, output *DescribeBundleTasksOutput) { - op := &request.Operation{ - Name: opDescribeBundleTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeBundleTasksInput{} - } - - output = &DescribeBundleTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeBundleTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your bundling tasks. -// -// Completed bundle tasks are listed for only a limited time. If your bundle -// task is no longer in the list, you can still register an AMI from it. Just -// use RegisterImage with the Amazon S3 bucket name and image manifest name -// you provided to the bundle task. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeBundleTasks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasks -func (c *EC2) DescribeBundleTasks(input *DescribeBundleTasksInput) (*DescribeBundleTasksOutput, error) { - req, out := c.DescribeBundleTasksRequest(input) - return out, req.Send() -} - -// DescribeBundleTasksWithContext is the same as DescribeBundleTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeBundleTasks 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 *EC2) DescribeBundleTasksWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.Option) (*DescribeBundleTasksOutput, error) { - req, out := c.DescribeBundleTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" - -// DescribeClassicLinkInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeClassicLinkInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeClassicLinkInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeClassicLinkInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeClassicLinkInstancesRequest method. -// req, resp := client.DescribeClassicLinkInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstances -func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInstancesInput) (req *request.Request, output *DescribeClassicLinkInstancesOutput) { - op := &request.Operation{ - Name: opDescribeClassicLinkInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeClassicLinkInstancesInput{} - } - - output = &DescribeClassicLinkInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeClassicLinkInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your linked EC2-Classic instances. This request -// only returns information about EC2-Classic instances linked to a VPC through -// ClassicLink; you cannot use this request to return information about other -// instances. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeClassicLinkInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstances -func (c *EC2) DescribeClassicLinkInstances(input *DescribeClassicLinkInstancesInput) (*DescribeClassicLinkInstancesOutput, error) { - req, out := c.DescribeClassicLinkInstancesRequest(input) - return out, req.Send() -} - -// DescribeClassicLinkInstancesWithContext is the same as DescribeClassicLinkInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeClassicLinkInstances 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 *EC2) DescribeClassicLinkInstancesWithContext(ctx aws.Context, input *DescribeClassicLinkInstancesInput, opts ...request.Option) (*DescribeClassicLinkInstancesOutput, error) { - req, out := c.DescribeClassicLinkInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeConversionTasks = "DescribeConversionTasks" - -// DescribeConversionTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeConversionTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeConversionTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeConversionTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeConversionTasksRequest method. -// req, resp := client.DescribeConversionTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeConversionTasks -func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput) (req *request.Request, output *DescribeConversionTasksOutput) { - op := &request.Operation{ - Name: opDescribeConversionTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeConversionTasksInput{} - } - - output = &DescribeConversionTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeConversionTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your conversion tasks. For more information, see -// the VM Import/Export User Guide (http://docs.aws.amazon.com/vm-import/latest/userguide/). -// -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeConversionTasks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeConversionTasks -func (c *EC2) DescribeConversionTasks(input *DescribeConversionTasksInput) (*DescribeConversionTasksOutput, error) { - req, out := c.DescribeConversionTasksRequest(input) - return out, req.Send() -} - -// DescribeConversionTasksWithContext is the same as DescribeConversionTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeConversionTasks 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 *EC2) DescribeConversionTasksWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.Option) (*DescribeConversionTasksOutput, error) { - req, out := c.DescribeConversionTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeCustomerGateways = "DescribeCustomerGateways" - -// DescribeCustomerGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCustomerGateways operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeCustomerGateways for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeCustomerGateways method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeCustomerGatewaysRequest method. -// req, resp := client.DescribeCustomerGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCustomerGateways -func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInput) (req *request.Request, output *DescribeCustomerGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeCustomerGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCustomerGatewaysInput{} - } - - output = &DescribeCustomerGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCustomerGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPN customer gateways. -// -// For more information about VPN customer gateways, see Adding a Hardware Virtual -// Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeCustomerGateways for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCustomerGateways -func (c *EC2) DescribeCustomerGateways(input *DescribeCustomerGatewaysInput) (*DescribeCustomerGatewaysOutput, error) { - req, out := c.DescribeCustomerGatewaysRequest(input) - return out, req.Send() -} - -// DescribeCustomerGatewaysWithContext is the same as DescribeCustomerGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeCustomerGateways 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 *EC2) DescribeCustomerGatewaysWithContext(ctx aws.Context, input *DescribeCustomerGatewaysInput, opts ...request.Option) (*DescribeCustomerGatewaysOutput, error) { - req, out := c.DescribeCustomerGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeDhcpOptions = "DescribeDhcpOptions" - -// DescribeDhcpOptionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDhcpOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeDhcpOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeDhcpOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeDhcpOptionsRequest method. -// req, resp := client.DescribeDhcpOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeDhcpOptions -func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req *request.Request, output *DescribeDhcpOptionsOutput) { - op := &request.Operation{ - Name: opDescribeDhcpOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDhcpOptionsInput{} - } - - output = &DescribeDhcpOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeDhcpOptions API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your DHCP options sets. -// -// For more information about DHCP options sets, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeDhcpOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeDhcpOptions -func (c *EC2) DescribeDhcpOptions(input *DescribeDhcpOptionsInput) (*DescribeDhcpOptionsOutput, error) { - req, out := c.DescribeDhcpOptionsRequest(input) - return out, req.Send() -} - -// DescribeDhcpOptionsWithContext is the same as DescribeDhcpOptions with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeDhcpOptions 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 *EC2) DescribeDhcpOptionsWithContext(ctx aws.Context, input *DescribeDhcpOptionsInput, opts ...request.Option) (*DescribeDhcpOptionsOutput, error) { - req, out := c.DescribeDhcpOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeEgressOnlyInternetGateways = "DescribeEgressOnlyInternetGateways" - -// DescribeEgressOnlyInternetGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEgressOnlyInternetGateways operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeEgressOnlyInternetGateways for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeEgressOnlyInternetGateways method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeEgressOnlyInternetGatewaysRequest method. -// req, resp := client.DescribeEgressOnlyInternetGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeEgressOnlyInternetGateways -func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnlyInternetGatewaysInput) (req *request.Request, output *DescribeEgressOnlyInternetGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeEgressOnlyInternetGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEgressOnlyInternetGatewaysInput{} - } - - output = &DescribeEgressOnlyInternetGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEgressOnlyInternetGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your egress-only Internet gateways. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeEgressOnlyInternetGateways for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeEgressOnlyInternetGateways -func (c *EC2) DescribeEgressOnlyInternetGateways(input *DescribeEgressOnlyInternetGatewaysInput) (*DescribeEgressOnlyInternetGatewaysOutput, error) { - req, out := c.DescribeEgressOnlyInternetGatewaysRequest(input) - return out, req.Send() -} - -// DescribeEgressOnlyInternetGatewaysWithContext is the same as DescribeEgressOnlyInternetGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeEgressOnlyInternetGateways 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 *EC2) DescribeEgressOnlyInternetGatewaysWithContext(ctx aws.Context, input *DescribeEgressOnlyInternetGatewaysInput, opts ...request.Option) (*DescribeEgressOnlyInternetGatewaysOutput, error) { - req, out := c.DescribeEgressOnlyInternetGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeExportTasks = "DescribeExportTasks" - -// DescribeExportTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeExportTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeExportTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeExportTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeExportTasksRequest method. -// req, resp := client.DescribeExportTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeExportTasks -func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) { - op := &request.Operation{ - Name: opDescribeExportTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeExportTasksInput{} - } - - output = &DescribeExportTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeExportTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your export tasks. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeExportTasks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeExportTasks -func (c *EC2) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) { - req, out := c.DescribeExportTasksRequest(input) - return out, req.Send() -} - -// DescribeExportTasksWithContext is the same as DescribeExportTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeExportTasks 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 *EC2) DescribeExportTasksWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.Option) (*DescribeExportTasksOutput, error) { - req, out := c.DescribeExportTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeFlowLogs = "DescribeFlowLogs" - -// DescribeFlowLogsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFlowLogs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeFlowLogs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeFlowLogs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeFlowLogsRequest method. -// req, resp := client.DescribeFlowLogsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogs -func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *request.Request, output *DescribeFlowLogsOutput) { - op := &request.Operation{ - Name: opDescribeFlowLogs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeFlowLogsInput{} - } - - output = &DescribeFlowLogsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeFlowLogs API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more flow logs. To view the information in your flow logs -// (the log streams for the network interfaces), you must use the CloudWatch -// Logs console or the CloudWatch Logs API. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeFlowLogs for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogs -func (c *EC2) DescribeFlowLogs(input *DescribeFlowLogsInput) (*DescribeFlowLogsOutput, error) { - req, out := c.DescribeFlowLogsRequest(input) - return out, req.Send() -} - -// DescribeFlowLogsWithContext is the same as DescribeFlowLogs with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeFlowLogs 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 *EC2) DescribeFlowLogsWithContext(ctx aws.Context, input *DescribeFlowLogsInput, opts ...request.Option) (*DescribeFlowLogsOutput, error) { - req, out := c.DescribeFlowLogsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings" - -// DescribeHostReservationOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHostReservationOfferings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeHostReservationOfferings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeHostReservationOfferings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeHostReservationOfferingsRequest method. -// req, resp := client.DescribeHostReservationOfferingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationOfferings -func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReservationOfferingsInput) (req *request.Request, output *DescribeHostReservationOfferingsOutput) { - op := &request.Operation{ - Name: opDescribeHostReservationOfferings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeHostReservationOfferingsInput{} - } - - output = &DescribeHostReservationOfferingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHostReservationOfferings API operation for Amazon Elastic Compute Cloud. -// -// Describes the Dedicated Host Reservations that are available to purchase. -// -// The results describe all the Dedicated Host Reservation offerings, including -// offerings that may not match the instance family and region of your Dedicated -// Hosts. When purchasing an offering, ensure that the the instance family and -// region of the offering matches that of the Dedicated Host/s it will be associated -// with. For an overview of supported instance types, see Dedicated Hosts Overview -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeHostReservationOfferings for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationOfferings -func (c *EC2) DescribeHostReservationOfferings(input *DescribeHostReservationOfferingsInput) (*DescribeHostReservationOfferingsOutput, error) { - req, out := c.DescribeHostReservationOfferingsRequest(input) - return out, req.Send() -} - -// DescribeHostReservationOfferingsWithContext is the same as DescribeHostReservationOfferings with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeHostReservationOfferings 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 *EC2) DescribeHostReservationOfferingsWithContext(ctx aws.Context, input *DescribeHostReservationOfferingsInput, opts ...request.Option) (*DescribeHostReservationOfferingsOutput, error) { - req, out := c.DescribeHostReservationOfferingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeHostReservations = "DescribeHostReservations" - -// DescribeHostReservationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHostReservations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeHostReservations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeHostReservations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeHostReservationsRequest method. -// req, resp := client.DescribeHostReservationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservations -func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInput) (req *request.Request, output *DescribeHostReservationsOutput) { - op := &request.Operation{ - Name: opDescribeHostReservations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeHostReservationsInput{} - } - - output = &DescribeHostReservationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHostReservations API operation for Amazon Elastic Compute Cloud. -// -// Describes Dedicated Host Reservations which are associated with Dedicated -// Hosts in your account. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeHostReservations for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservations -func (c *EC2) DescribeHostReservations(input *DescribeHostReservationsInput) (*DescribeHostReservationsOutput, error) { - req, out := c.DescribeHostReservationsRequest(input) - return out, req.Send() -} - -// DescribeHostReservationsWithContext is the same as DescribeHostReservations with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeHostReservations 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 *EC2) DescribeHostReservationsWithContext(ctx aws.Context, input *DescribeHostReservationsInput, opts ...request.Option) (*DescribeHostReservationsOutput, error) { - req, out := c.DescribeHostReservationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeHosts = "DescribeHosts" - -// DescribeHostsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHosts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeHosts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeHosts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeHostsRequest method. -// req, resp := client.DescribeHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHosts -func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Request, output *DescribeHostsOutput) { - op := &request.Operation{ - Name: opDescribeHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeHostsInput{} - } - - output = &DescribeHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHosts API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Dedicated Hosts. -// -// The results describe only the Dedicated Hosts in the region you're currently -// using. All listed instances consume capacity on your Dedicated Host. Dedicated -// Hosts that have recently been released will be listed with the state released. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeHosts for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHosts -func (c *EC2) DescribeHosts(input *DescribeHostsInput) (*DescribeHostsOutput, error) { - req, out := c.DescribeHostsRequest(input) - return out, req.Send() -} - -// DescribeHostsWithContext is the same as DescribeHosts with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeHosts 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 *EC2) DescribeHostsWithContext(ctx aws.Context, input *DescribeHostsInput, opts ...request.Option) (*DescribeHostsOutput, error) { - req, out := c.DescribeHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations" - -// DescribeIamInstanceProfileAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeIamInstanceProfileAssociations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeIamInstanceProfileAssociations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeIamInstanceProfileAssociations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeIamInstanceProfileAssociationsRequest method. -// req, resp := client.DescribeIamInstanceProfileAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociations -func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamInstanceProfileAssociationsInput) (req *request.Request, output *DescribeIamInstanceProfileAssociationsOutput) { - op := &request.Operation{ - Name: opDescribeIamInstanceProfileAssociations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeIamInstanceProfileAssociationsInput{} - } - - output = &DescribeIamInstanceProfileAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeIamInstanceProfileAssociations API operation for Amazon Elastic Compute Cloud. -// -// Describes your IAM instance profile associations. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeIamInstanceProfileAssociations for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociations -func (c *EC2) DescribeIamInstanceProfileAssociations(input *DescribeIamInstanceProfileAssociationsInput) (*DescribeIamInstanceProfileAssociationsOutput, error) { - req, out := c.DescribeIamInstanceProfileAssociationsRequest(input) - return out, req.Send() -} - -// DescribeIamInstanceProfileAssociationsWithContext is the same as DescribeIamInstanceProfileAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeIamInstanceProfileAssociations 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 *EC2) DescribeIamInstanceProfileAssociationsWithContext(ctx aws.Context, input *DescribeIamInstanceProfileAssociationsInput, opts ...request.Option) (*DescribeIamInstanceProfileAssociationsOutput, error) { - req, out := c.DescribeIamInstanceProfileAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeIdFormat = "DescribeIdFormat" - -// DescribeIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the DescribeIdFormat operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeIdFormat for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeIdFormat method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeIdFormatRequest method. -// req, resp := client.DescribeIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormat -func (c *EC2) DescribeIdFormatRequest(input *DescribeIdFormatInput) (req *request.Request, output *DescribeIdFormatOutput) { - op := &request.Operation{ - Name: opDescribeIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeIdFormatInput{} - } - - output = &DescribeIdFormatOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Describes the ID format settings for your resources on a per-region basis, -// for example, to view which resource types are enabled for longer IDs. This -// request only returns information about resource types whose ID formats can -// be modified; it does not return information about other resource types. -// -// The following resource types support longer IDs: instance | reservation | -// snapshot | volume. -// -// These settings apply to the IAM user who makes the request; they do not apply -// to the entire AWS account. By default, an IAM user defaults to the same settings -// as the root user, unless they explicitly override the settings by running -// the ModifyIdFormat command. Resources created with longer IDs are visible -// to all IAM users, regardless of these settings and provided that they have -// permission to use the relevant Describe command for the resource type. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeIdFormat for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormat -func (c *EC2) DescribeIdFormat(input *DescribeIdFormatInput) (*DescribeIdFormatOutput, error) { - req, out := c.DescribeIdFormatRequest(input) - return out, req.Send() -} - -// DescribeIdFormatWithContext is the same as DescribeIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeIdFormat 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 *EC2) DescribeIdFormatWithContext(ctx aws.Context, input *DescribeIdFormatInput, opts ...request.Option) (*DescribeIdFormatOutput, error) { - req, out := c.DescribeIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeIdentityIdFormat = "DescribeIdentityIdFormat" - -// DescribeIdentityIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the DescribeIdentityIdFormat operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeIdentityIdFormat for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeIdentityIdFormat method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeIdentityIdFormatRequest method. -// req, resp := client.DescribeIdentityIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdentityIdFormat -func (c *EC2) DescribeIdentityIdFormatRequest(input *DescribeIdentityIdFormatInput) (req *request.Request, output *DescribeIdentityIdFormatOutput) { - op := &request.Operation{ - Name: opDescribeIdentityIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeIdentityIdFormatInput{} - } - - output = &DescribeIdentityIdFormatOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeIdentityIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Describes the ID format settings for resources for the specified IAM user, -// IAM role, or root user. For example, you can view the resource types that -// are enabled for longer IDs. This request only returns information about resource -// types whose ID formats can be modified; it does not return information about -// other resource types. For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// The following resource types support longer IDs: instance | reservation | -// snapshot | volume. -// -// These settings apply to the principal specified in the request. They do not -// apply to the principal that makes the request. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeIdentityIdFormat for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdentityIdFormat -func (c *EC2) DescribeIdentityIdFormat(input *DescribeIdentityIdFormatInput) (*DescribeIdentityIdFormatOutput, error) { - req, out := c.DescribeIdentityIdFormatRequest(input) - return out, req.Send() -} - -// DescribeIdentityIdFormatWithContext is the same as DescribeIdentityIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeIdentityIdFormat 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 *EC2) DescribeIdentityIdFormatWithContext(ctx aws.Context, input *DescribeIdentityIdFormatInput, opts ...request.Option) (*DescribeIdentityIdFormatOutput, error) { - req, out := c.DescribeIdentityIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImageAttribute = "DescribeImageAttribute" - -// DescribeImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImageAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeImageAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeImageAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeImageAttributeRequest method. -// req, resp := client.DescribeImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImageAttribute -func (c *EC2) DescribeImageAttributeRequest(input *DescribeImageAttributeInput) (req *request.Request, output *DescribeImageAttributeOutput) { - op := &request.Operation{ - Name: opDescribeImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImageAttributeInput{} - } - - output = &DescribeImageAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified AMI. You can specify only -// one attribute at a time. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeImageAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImageAttribute -func (c *EC2) DescribeImageAttribute(input *DescribeImageAttributeInput) (*DescribeImageAttributeOutput, error) { - req, out := c.DescribeImageAttributeRequest(input) - return out, req.Send() -} - -// DescribeImageAttributeWithContext is the same as DescribeImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImageAttribute 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 *EC2) DescribeImageAttributeWithContext(ctx aws.Context, input *DescribeImageAttributeInput, opts ...request.Option) (*DescribeImageAttributeOutput, error) { - req, out := c.DescribeImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImages = "DescribeImages" - -// DescribeImagesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImages operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeImages for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeImages method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeImagesRequest method. -// req, resp := client.DescribeImagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImages -func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Request, output *DescribeImagesOutput) { - op := &request.Operation{ - Name: opDescribeImages, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImagesInput{} - } - - output = &DescribeImagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImages API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the images (AMIs, AKIs, and ARIs) available to you. -// Images available to you include public images, private images that you own, -// and private images owned by other AWS accounts but for which you have explicit -// launch permissions. -// -// Deregistered images are included in the returned results for an unspecified -// interval after deregistration. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeImages for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImages -func (c *EC2) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, error) { - req, out := c.DescribeImagesRequest(input) - return out, req.Send() -} - -// DescribeImagesWithContext is the same as DescribeImages with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImages 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 *EC2) DescribeImagesWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.Option) (*DescribeImagesOutput, error) { - req, out := c.DescribeImagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImportImageTasks = "DescribeImportImageTasks" - -// DescribeImportImageTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImportImageTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeImportImageTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeImportImageTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeImportImageTasksRequest method. -// req, resp := client.DescribeImportImageTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportImageTasks -func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInput) (req *request.Request, output *DescribeImportImageTasksOutput) { - op := &request.Operation{ - Name: opDescribeImportImageTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImportImageTasksInput{} - } - - output = &DescribeImportImageTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImportImageTasks API operation for Amazon Elastic Compute Cloud. -// -// Displays details about an import virtual machine or import snapshot tasks -// that are already created. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeImportImageTasks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportImageTasks -func (c *EC2) DescribeImportImageTasks(input *DescribeImportImageTasksInput) (*DescribeImportImageTasksOutput, error) { - req, out := c.DescribeImportImageTasksRequest(input) - return out, req.Send() -} - -// DescribeImportImageTasksWithContext is the same as DescribeImportImageTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImportImageTasks 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 *EC2) DescribeImportImageTasksWithContext(ctx aws.Context, input *DescribeImportImageTasksInput, opts ...request.Option) (*DescribeImportImageTasksOutput, error) { - req, out := c.DescribeImportImageTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" - -// DescribeImportSnapshotTasksRequest generates a "aws/request.Request" representing the -// client's request for the DescribeImportSnapshotTasks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeImportSnapshotTasks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeImportSnapshotTasks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeImportSnapshotTasksRequest method. -// req, resp := client.DescribeImportSnapshotTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportSnapshotTasks -func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTasksInput) (req *request.Request, output *DescribeImportSnapshotTasksOutput) { - op := &request.Operation{ - Name: opDescribeImportSnapshotTasks, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImportSnapshotTasksInput{} - } - - output = &DescribeImportSnapshotTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeImportSnapshotTasks API operation for Amazon Elastic Compute Cloud. -// -// Describes your import snapshot tasks. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeImportSnapshotTasks for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportSnapshotTasks -func (c *EC2) DescribeImportSnapshotTasks(input *DescribeImportSnapshotTasksInput) (*DescribeImportSnapshotTasksOutput, error) { - req, out := c.DescribeImportSnapshotTasksRequest(input) - return out, req.Send() -} - -// DescribeImportSnapshotTasksWithContext is the same as DescribeImportSnapshotTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImportSnapshotTasks 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 *EC2) DescribeImportSnapshotTasksWithContext(ctx aws.Context, input *DescribeImportSnapshotTasksInput, opts ...request.Option) (*DescribeImportSnapshotTasksOutput, error) { - req, out := c.DescribeImportSnapshotTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceAttribute = "DescribeInstanceAttribute" - -// DescribeInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstanceAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstanceAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstanceAttributeRequest method. -// req, resp := client.DescribeInstanceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceAttribute -func (c *EC2) DescribeInstanceAttributeRequest(input *DescribeInstanceAttributeInput) (req *request.Request, output *DescribeInstanceAttributeOutput) { - op := &request.Operation{ - Name: opDescribeInstanceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceAttributeInput{} - } - - output = &DescribeInstanceAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified instance. You can specify -// only one attribute at a time. Valid attribute values are: instanceType | -// kernel | ramdisk | userData | disableApiTermination | instanceInitiatedShutdownBehavior -// | rootDeviceName | blockDeviceMapping | productCodes | sourceDestCheck | -// groupSet | ebsOptimized | sriovNetSupport -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeInstanceAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceAttribute -func (c *EC2) DescribeInstanceAttribute(input *DescribeInstanceAttributeInput) (*DescribeInstanceAttributeOutput, error) { - req, out := c.DescribeInstanceAttributeRequest(input) - return out, req.Send() -} - -// DescribeInstanceAttributeWithContext is the same as DescribeInstanceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceAttribute 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 *EC2) DescribeInstanceAttributeWithContext(ctx aws.Context, input *DescribeInstanceAttributeInput, opts ...request.Option) (*DescribeInstanceAttributeOutput, error) { - req, out := c.DescribeInstanceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceStatus = "DescribeInstanceStatus" - -// DescribeInstanceStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstanceStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstanceStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstanceStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstanceStatusRequest method. -// req, resp := client.DescribeInstanceStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceStatus -func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput) (req *request.Request, output *DescribeInstanceStatusOutput) { - op := &request.Operation{ - Name: opDescribeInstanceStatus, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeInstanceStatusInput{} - } - - output = &DescribeInstanceStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstanceStatus API operation for Amazon Elastic Compute Cloud. -// -// Describes the status of one or more instances. By default, only running instances -// are described, unless specified otherwise. -// -// Instance status includes the following components: -// -// * Status checks - Amazon EC2 performs status checks on running EC2 instances -// to identify hardware and software issues. For more information, see Status -// Checks for Your Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html) -// and Troubleshooting Instances with Failed Status Checks (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// * Scheduled events - Amazon EC2 can schedule events (such as reboot, stop, -// or terminate) for your instances related to hardware issues, software -// updates, or system maintenance. For more information, see Scheduled Events -// for Your Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// * Instance state - You can manage your instances from the moment you launch -// them through their termination. For more information, see Instance Lifecycle -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeInstanceStatus for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceStatus -func (c *EC2) DescribeInstanceStatus(input *DescribeInstanceStatusInput) (*DescribeInstanceStatusOutput, error) { - req, out := c.DescribeInstanceStatusRequest(input) - return out, req.Send() -} - -// DescribeInstanceStatusWithContext is the same as DescribeInstanceStatus with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceStatus 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 *EC2) DescribeInstanceStatusWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.Option) (*DescribeInstanceStatusOutput, error) { - req, out := c.DescribeInstanceStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeInstanceStatusPages iterates over the pages of a DescribeInstanceStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstanceStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeInstanceStatus operation. -// pageNum := 0 -// err := client.DescribeInstanceStatusPages(params, -// func(page *DescribeInstanceStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeInstanceStatusPages(input *DescribeInstanceStatusInput, fn func(*DescribeInstanceStatusOutput, bool) bool) error { - return c.DescribeInstanceStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeInstanceStatusPagesWithContext same as DescribeInstanceStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeInstanceStatusPagesWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, fn func(*DescribeInstanceStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeInstanceStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstanceStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstanceStatusOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeInstances = "DescribeInstances" - -// DescribeInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInstancesRequest method. -// req, resp := client.DescribeInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstances -func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *request.Request, output *DescribeInstancesOutput) { - op := &request.Operation{ - Name: opDescribeInstances, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeInstancesInput{} - } - - output = &DescribeInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your instances. -// -// If you specify one or more instance IDs, Amazon EC2 returns information for -// those instances. If you do not specify instance IDs, Amazon EC2 returns information -// for all relevant instances. If you specify an instance ID that is not valid, -// an error is returned. If you specify an instance that you do not own, it -// is not included in the returned results. -// -// Recently terminated instances might appear in the returned results. This -// interval is usually less than one hour. -// -// If you describe instances in the rare case where an Availability Zone is -// experiencing a service disruption and you specify instance IDs that are in -// the affected zone, or do not specify any instance IDs at all, the call fails. -// If you describe instances and specify only instance IDs that are in an unaffected -// zone, the call works normally. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstances -func (c *EC2) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstancesOutput, error) { - req, out := c.DescribeInstancesRequest(input) - return out, req.Send() -} - -// DescribeInstancesWithContext is the same as DescribeInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstances 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 *EC2) DescribeInstancesWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.Option) (*DescribeInstancesOutput, error) { - req, out := c.DescribeInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeInstancesPages iterates over the pages of a DescribeInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeInstances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeInstances operation. -// pageNum := 0 -// err := client.DescribeInstancesPages(params, -// func(page *DescribeInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeInstancesPages(input *DescribeInstancesInput, fn func(*DescribeInstancesOutput, bool) bool) error { - return c.DescribeInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeInstancesPagesWithContext same as DescribeInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeInstancesPagesWithContext(ctx aws.Context, input *DescribeInstancesInput, fn func(*DescribeInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstancesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeInternetGateways = "DescribeInternetGateways" - -// DescribeInternetGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeInternetGateways operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeInternetGateways for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeInternetGateways method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeInternetGatewaysRequest method. -// req, resp := client.DescribeInternetGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInternetGateways -func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInput) (req *request.Request, output *DescribeInternetGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeInternetGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInternetGatewaysInput{} - } - - output = &DescribeInternetGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeInternetGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Internet gateways. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeInternetGateways for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInternetGateways -func (c *EC2) DescribeInternetGateways(input *DescribeInternetGatewaysInput) (*DescribeInternetGatewaysOutput, error) { - req, out := c.DescribeInternetGatewaysRequest(input) - return out, req.Send() -} - -// DescribeInternetGatewaysWithContext is the same as DescribeInternetGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInternetGateways 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 *EC2) DescribeInternetGatewaysWithContext(ctx aws.Context, input *DescribeInternetGatewaysInput, opts ...request.Option) (*DescribeInternetGatewaysOutput, error) { - req, out := c.DescribeInternetGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeKeyPairs = "DescribeKeyPairs" - -// DescribeKeyPairsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeKeyPairs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeKeyPairs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeKeyPairs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeKeyPairsRequest method. -// req, resp := client.DescribeKeyPairsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeKeyPairs -func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *request.Request, output *DescribeKeyPairsOutput) { - op := &request.Operation{ - Name: opDescribeKeyPairs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeKeyPairsInput{} - } - - output = &DescribeKeyPairsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeKeyPairs API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your key pairs. -// -// For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeKeyPairs for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeKeyPairs -func (c *EC2) DescribeKeyPairs(input *DescribeKeyPairsInput) (*DescribeKeyPairsOutput, error) { - req, out := c.DescribeKeyPairsRequest(input) - return out, req.Send() -} - -// DescribeKeyPairsWithContext is the same as DescribeKeyPairs with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeKeyPairs 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 *EC2) DescribeKeyPairsWithContext(ctx aws.Context, input *DescribeKeyPairsInput, opts ...request.Option) (*DescribeKeyPairsOutput, error) { - req, out := c.DescribeKeyPairsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeMovingAddresses = "DescribeMovingAddresses" - -// DescribeMovingAddressesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMovingAddresses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeMovingAddresses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeMovingAddresses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeMovingAddressesRequest method. -// req, resp := client.DescribeMovingAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddresses -func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *request.Request, output *DescribeMovingAddressesOutput) { - op := &request.Operation{ - Name: opDescribeMovingAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeMovingAddressesInput{} - } - - output = &DescribeMovingAddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeMovingAddresses API operation for Amazon Elastic Compute Cloud. -// -// Describes your Elastic IP addresses that are being moved to the EC2-VPC platform, -// or that are being restored to the EC2-Classic platform. This request does -// not return information about any other Elastic IP addresses in your account. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeMovingAddresses for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddresses -func (c *EC2) DescribeMovingAddresses(input *DescribeMovingAddressesInput) (*DescribeMovingAddressesOutput, error) { - req, out := c.DescribeMovingAddressesRequest(input) - return out, req.Send() -} - -// DescribeMovingAddressesWithContext is the same as DescribeMovingAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeMovingAddresses 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 *EC2) DescribeMovingAddressesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, opts ...request.Option) (*DescribeMovingAddressesOutput, error) { - req, out := c.DescribeMovingAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeNatGateways = "DescribeNatGateways" - -// DescribeNatGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNatGateways operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeNatGateways for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeNatGateways method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeNatGatewaysRequest method. -// req, resp := client.DescribeNatGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGateways -func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req *request.Request, output *DescribeNatGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeNatGateways, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeNatGatewaysInput{} - } - - output = &DescribeNatGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNatGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the your NAT gateways. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeNatGateways for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGateways -func (c *EC2) DescribeNatGateways(input *DescribeNatGatewaysInput) (*DescribeNatGatewaysOutput, error) { - req, out := c.DescribeNatGatewaysRequest(input) - return out, req.Send() -} - -// DescribeNatGatewaysWithContext is the same as DescribeNatGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNatGateways 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 *EC2) DescribeNatGatewaysWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.Option) (*DescribeNatGatewaysOutput, error) { - req, out := c.DescribeNatGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeNatGatewaysPages iterates over the pages of a DescribeNatGateways operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeNatGateways method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeNatGateways operation. -// pageNum := 0 -// err := client.DescribeNatGatewaysPages(params, -// func(page *DescribeNatGatewaysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeNatGatewaysPages(input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool) error { - return c.DescribeNatGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeNatGatewaysPagesWithContext same as DescribeNatGatewaysPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeNatGatewaysPagesWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeNatGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeNatGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNatGatewaysOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeNetworkAcls = "DescribeNetworkAcls" - -// DescribeNetworkAclsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkAcls operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeNetworkAcls for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeNetworkAcls method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeNetworkAclsRequest method. -// req, resp := client.DescribeNetworkAclsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAcls -func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *request.Request, output *DescribeNetworkAclsOutput) { - op := &request.Operation{ - Name: opDescribeNetworkAcls, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeNetworkAclsInput{} - } - - output = &DescribeNetworkAclsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNetworkAcls API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your network ACLs. -// -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeNetworkAcls for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAcls -func (c *EC2) DescribeNetworkAcls(input *DescribeNetworkAclsInput) (*DescribeNetworkAclsOutput, error) { - req, out := c.DescribeNetworkAclsRequest(input) - return out, req.Send() -} - -// DescribeNetworkAclsWithContext is the same as DescribeNetworkAcls with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNetworkAcls 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 *EC2) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, opts ...request.Option) (*DescribeNetworkAclsOutput, error) { - req, out := c.DescribeNetworkAclsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" - -// DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfaceAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeNetworkInterfaceAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeNetworkInterfaceAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeNetworkInterfaceAttributeRequest method. -// req, resp := client.DescribeNetworkInterfaceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttribute -func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInterfaceAttributeInput) (req *request.Request, output *DescribeNetworkInterfaceAttributeOutput) { - op := &request.Operation{ - Name: opDescribeNetworkInterfaceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeNetworkInterfaceAttributeInput{} - } - - output = &DescribeNetworkInterfaceAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes a network interface attribute. You can specify only one attribute -// at a time. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeNetworkInterfaceAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttribute -func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceAttributeInput) (*DescribeNetworkInterfaceAttributeOutput, error) { - req, out := c.DescribeNetworkInterfaceAttributeRequest(input) - return out, req.Send() -} - -// DescribeNetworkInterfaceAttributeWithContext is the same as DescribeNetworkInterfaceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNetworkInterfaceAttribute 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 *EC2) DescribeNetworkInterfaceAttributeWithContext(ctx aws.Context, input *DescribeNetworkInterfaceAttributeInput, opts ...request.Option) (*DescribeNetworkInterfaceAttributeOutput, error) { - req, out := c.DescribeNetworkInterfaceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" - -// DescribeNetworkInterfacesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfaces operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeNetworkInterfaces for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeNetworkInterfaces method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeNetworkInterfacesRequest method. -// req, resp := client.DescribeNetworkInterfacesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaces -func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesInput) (req *request.Request, output *DescribeNetworkInterfacesOutput) { - op := &request.Operation{ - Name: opDescribeNetworkInterfaces, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeNetworkInterfacesInput{} - } - - output = &DescribeNetworkInterfacesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeNetworkInterfaces API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your network interfaces. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeNetworkInterfaces for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaces -func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) (*DescribeNetworkInterfacesOutput, error) { - req, out := c.DescribeNetworkInterfacesRequest(input) - return out, req.Send() -} - -// DescribeNetworkInterfacesWithContext is the same as DescribeNetworkInterfaces with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeNetworkInterfaces 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 *EC2) DescribeNetworkInterfacesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.Option) (*DescribeNetworkInterfacesOutput, error) { - req, out := c.DescribeNetworkInterfacesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribePlacementGroups = "DescribePlacementGroups" - -// DescribePlacementGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePlacementGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePlacementGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePlacementGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePlacementGroupsRequest method. -// req, resp := client.DescribePlacementGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroups -func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput) (req *request.Request, output *DescribePlacementGroupsOutput) { - op := &request.Operation{ - Name: opDescribePlacementGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePlacementGroupsInput{} - } - - output = &DescribePlacementGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePlacementGroups API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your placement groups. For more information about -// placement groups and cluster instances, see Cluster Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribePlacementGroups for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroups -func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (*DescribePlacementGroupsOutput, error) { - req, out := c.DescribePlacementGroupsRequest(input) - return out, req.Send() -} - -// DescribePlacementGroupsWithContext is the same as DescribePlacementGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribePlacementGroups 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 *EC2) DescribePlacementGroupsWithContext(ctx aws.Context, input *DescribePlacementGroupsInput, opts ...request.Option) (*DescribePlacementGroupsOutput, error) { - req, out := c.DescribePlacementGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribePrefixLists = "DescribePrefixLists" - -// DescribePrefixListsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePrefixLists operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribePrefixLists for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribePrefixLists method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribePrefixListsRequest method. -// req, resp := client.DescribePrefixListsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixLists -func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *request.Request, output *DescribePrefixListsOutput) { - op := &request.Operation{ - Name: opDescribePrefixLists, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePrefixListsInput{} - } - - output = &DescribePrefixListsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePrefixLists API operation for Amazon Elastic Compute Cloud. -// -// Describes available AWS services in a prefix list format, which includes -// the prefix list name and prefix list ID of the service and the IP address -// range for the service. A prefix list ID is required for creating an outbound -// security group rule that allows traffic from a VPC to access an AWS service -// through a VPC endpoint. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribePrefixLists for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixLists -func (c *EC2) DescribePrefixLists(input *DescribePrefixListsInput) (*DescribePrefixListsOutput, error) { - req, out := c.DescribePrefixListsRequest(input) - return out, req.Send() -} - -// DescribePrefixListsWithContext is the same as DescribePrefixLists with the addition of -// the ability to pass a context and additional request options. -// -// See DescribePrefixLists 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 *EC2) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePrefixListsInput, opts ...request.Option) (*DescribePrefixListsOutput, error) { - req, out := c.DescribePrefixListsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeRegions = "DescribeRegions" - -// DescribeRegionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRegions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRegions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRegions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRegionsRequest method. -// req, resp := client.DescribeRegionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegions -func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request.Request, output *DescribeRegionsOutput) { - op := &request.Operation{ - Name: opDescribeRegions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRegionsInput{} - } - - output = &DescribeRegionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRegions API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more regions that are currently available to you. -// -// For a list of the regions supported by Amazon EC2, see Regions and Endpoints -// (http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region). -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeRegions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegions -func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (*DescribeRegionsOutput, error) { - req, out := c.DescribeRegionsRequest(input) - return out, req.Send() -} - -// DescribeRegionsWithContext is the same as DescribeRegions with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeRegions 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 *EC2) DescribeRegionsWithContext(ctx aws.Context, input *DescribeRegionsInput, opts ...request.Option) (*DescribeRegionsOutput, error) { - req, out := c.DescribeRegionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeReservedInstances = "DescribeReservedInstances" - -// DescribeReservedInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedInstancesRequest method. -// req, resp := client.DescribeReservedInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstances -func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesInput) (req *request.Request, output *DescribeReservedInstancesOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReservedInstancesInput{} - } - - output = &DescribeReservedInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the Reserved Instances that you purchased. -// -// For more information about Reserved Instances, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstances -func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (*DescribeReservedInstancesOutput, error) { - req, out := c.DescribeReservedInstancesRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesWithContext is the same as DescribeReservedInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstances 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 *EC2) DescribeReservedInstancesWithContext(ctx aws.Context, input *DescribeReservedInstancesInput, opts ...request.Option) (*DescribeReservedInstancesOutput, error) { - req, out := c.DescribeReservedInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" - -// DescribeReservedInstancesListingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesListings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedInstancesListings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedInstancesListings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedInstancesListingsRequest method. -// req, resp := client.DescribeReservedInstancesListingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListings -func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedInstancesListingsInput) (req *request.Request, output *DescribeReservedInstancesListingsOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstancesListings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReservedInstancesListingsInput{} - } - - output = &DescribeReservedInstancesListingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstancesListings API operation for Amazon Elastic Compute Cloud. -// -// Describes your account's Reserved Instance listings in the Reserved Instance -// Marketplace. -// -// The Reserved Instance Marketplace matches sellers who want to resell Reserved -// Instance capacity that they no longer need with buyers who want to purchase -// additional capacity. Reserved Instances bought and sold through the Reserved -// Instance Marketplace work like any other Reserved Instances. -// -// As a seller, you choose to list some or all of your Reserved Instances, and -// you specify the upfront price to receive for them. Your Reserved Instances -// are then listed in the Reserved Instance Marketplace and are available for -// purchase. -// -// As a buyer, you specify the configuration of the Reserved Instance to purchase, -// and the Marketplace matches what you're searching for with what's available. -// The Marketplace first sells the lowest priced Reserved Instances to you, -// and continues to sell available Reserved Instance listings to you until your -// demand is met. You are charged based on the total price of all of the listings -// that you purchase. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstancesListings for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListings -func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstancesListingsInput) (*DescribeReservedInstancesListingsOutput, error) { - req, out := c.DescribeReservedInstancesListingsRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesListingsWithContext is the same as DescribeReservedInstancesListings with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstancesListings 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 *EC2) DescribeReservedInstancesListingsWithContext(ctx aws.Context, input *DescribeReservedInstancesListingsInput, opts ...request.Option) (*DescribeReservedInstancesListingsOutput, error) { - req, out := c.DescribeReservedInstancesListingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" - -// DescribeReservedInstancesModificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesModifications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedInstancesModifications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedInstancesModifications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedInstancesModificationsRequest method. -// req, resp := client.DescribeReservedInstancesModificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModifications -func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReservedInstancesModificationsInput) (req *request.Request, output *DescribeReservedInstancesModificationsOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstancesModifications, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedInstancesModificationsInput{} - } - - output = &DescribeReservedInstancesModificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstancesModifications API operation for Amazon Elastic Compute Cloud. -// -// Describes the modifications made to your Reserved Instances. If no parameter -// is specified, information about all your Reserved Instances modification -// requests is returned. If a modification ID is specified, only information -// about the specific modification is returned. -// -// For more information, see Modifying Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstancesModifications for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModifications -func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInstancesModificationsInput) (*DescribeReservedInstancesModificationsOutput, error) { - req, out := c.DescribeReservedInstancesModificationsRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesModificationsWithContext is the same as DescribeReservedInstancesModifications with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstancesModifications 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 *EC2) DescribeReservedInstancesModificationsWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, opts ...request.Option) (*DescribeReservedInstancesModificationsOutput, error) { - req, out := c.DescribeReservedInstancesModificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeReservedInstancesModificationsPages iterates over the pages of a DescribeReservedInstancesModifications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedInstancesModifications method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeReservedInstancesModifications operation. -// pageNum := 0 -// err := client.DescribeReservedInstancesModificationsPages(params, -// func(page *DescribeReservedInstancesModificationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool) error { - return c.DescribeReservedInstancesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedInstancesModificationsPagesWithContext same as DescribeReservedInstancesModificationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeReservedInstancesModificationsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeReservedInstancesModificationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeReservedInstancesModificationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesModificationsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" - -// DescribeReservedInstancesOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesOfferings operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeReservedInstancesOfferings for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeReservedInstancesOfferings method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeReservedInstancesOfferingsRequest method. -// req, resp := client.DescribeReservedInstancesOfferingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings -func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) (req *request.Request, output *DescribeReservedInstancesOfferingsOutput) { - op := &request.Operation{ - Name: opDescribeReservedInstancesOfferings, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeReservedInstancesOfferingsInput{} - } - - output = &DescribeReservedInstancesOfferingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReservedInstancesOfferings API operation for Amazon Elastic Compute Cloud. -// -// Describes Reserved Instance offerings that are available for purchase. With -// Reserved Instances, you purchase the right to launch instances for a period -// of time. During that time period, you do not receive insufficient capacity -// errors, and you pay a lower usage rate than the rate charged for On-Demand -// instances for the actual time used. -// -// If you have listed your own Reserved Instances for sale in the Reserved Instance -// Marketplace, they will be excluded from these results. This is to ensure -// that you do not purchase your own Reserved Instances. -// -// For more information, see Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstancesOfferings for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings -func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstancesOfferingsInput) (*DescribeReservedInstancesOfferingsOutput, error) { - req, out := c.DescribeReservedInstancesOfferingsRequest(input) - return out, req.Send() -} - -// DescribeReservedInstancesOfferingsWithContext is the same as DescribeReservedInstancesOfferings with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstancesOfferings 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 *EC2) DescribeReservedInstancesOfferingsWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, opts ...request.Option) (*DescribeReservedInstancesOfferingsOutput, error) { - req, out := c.DescribeReservedInstancesOfferingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeReservedInstancesOfferingsPages iterates over the pages of a DescribeReservedInstancesOfferings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeReservedInstancesOfferings method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeReservedInstancesOfferings operation. -// pageNum := 0 -// err := client.DescribeReservedInstancesOfferingsPages(params, -// func(page *DescribeReservedInstancesOfferingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool) error { - return c.DescribeReservedInstancesOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeReservedInstancesOfferingsPagesWithContext same as DescribeReservedInstancesOfferingsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeReservedInstancesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeReservedInstancesOfferingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeReservedInstancesOfferingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesOfferingsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeRouteTables = "DescribeRouteTables" - -// DescribeRouteTablesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRouteTables operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeRouteTables for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeRouteTables method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeRouteTablesRequest method. -// req, resp := client.DescribeRouteTablesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTables -func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *request.Request, output *DescribeRouteTablesOutput) { - op := &request.Operation{ - Name: opDescribeRouteTables, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRouteTablesInput{} - } - - output = &DescribeRouteTablesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRouteTables API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your route tables. -// -// Each subnet in your VPC must be associated with a route table. If a subnet -// is not explicitly associated with any route table, it is implicitly associated -// with the main route table. This command does not return the subnet ID for -// implicit associations. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeRouteTables for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTables -func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRouteTablesOutput, error) { - req, out := c.DescribeRouteTablesRequest(input) - return out, req.Send() -} - -// DescribeRouteTablesWithContext is the same as DescribeRouteTables with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeRouteTables 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 *EC2) DescribeRouteTablesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, opts ...request.Option) (*DescribeRouteTablesOutput, error) { - req, out := c.DescribeRouteTablesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvailability" - -// DescribeScheduledInstanceAvailabilityRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScheduledInstanceAvailability operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScheduledInstanceAvailability for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScheduledInstanceAvailability method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScheduledInstanceAvailabilityRequest method. -// req, resp := client.DescribeScheduledInstanceAvailabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailability -func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeScheduledInstanceAvailabilityInput) (req *request.Request, output *DescribeScheduledInstanceAvailabilityOutput) { - op := &request.Operation{ - Name: opDescribeScheduledInstanceAvailability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScheduledInstanceAvailabilityInput{} - } - - output = &DescribeScheduledInstanceAvailabilityOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScheduledInstanceAvailability API operation for Amazon Elastic Compute Cloud. -// -// Finds available schedules that meet the specified criteria. -// -// You can search for an available schedule no more than 3 months in advance. -// You must meet the minimum required duration of 1,200 hours per year. For -// example, the minimum daily schedule is 4 hours, the minimum weekly schedule -// is 24 hours, and the minimum monthly schedule is 100 hours. -// -// After you find a schedule that meets your needs, call PurchaseScheduledInstances -// to purchase Scheduled Instances with that schedule. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeScheduledInstanceAvailability for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailability -func (c *EC2) DescribeScheduledInstanceAvailability(input *DescribeScheduledInstanceAvailabilityInput) (*DescribeScheduledInstanceAvailabilityOutput, error) { - req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) - return out, req.Send() -} - -// DescribeScheduledInstanceAvailabilityWithContext is the same as DescribeScheduledInstanceAvailability with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScheduledInstanceAvailability 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 *EC2) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, opts ...request.Option) (*DescribeScheduledInstanceAvailabilityOutput, error) { - req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScheduledInstances = "DescribeScheduledInstances" - -// DescribeScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScheduledInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeScheduledInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeScheduledInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeScheduledInstancesRequest method. -// req, resp := client.DescribeScheduledInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstances -func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstancesInput) (req *request.Request, output *DescribeScheduledInstancesOutput) { - op := &request.Operation{ - Name: opDescribeScheduledInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScheduledInstancesInput{} - } - - output = &DescribeScheduledInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeScheduledInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your Scheduled Instances. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeScheduledInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstances -func (c *EC2) DescribeScheduledInstances(input *DescribeScheduledInstancesInput) (*DescribeScheduledInstancesOutput, error) { - req, out := c.DescribeScheduledInstancesRequest(input) - return out, req.Send() -} - -// DescribeScheduledInstancesWithContext is the same as DescribeScheduledInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScheduledInstances 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 *EC2) DescribeScheduledInstancesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, opts ...request.Option) (*DescribeScheduledInstancesOutput, error) { - req, out := c.DescribeScheduledInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" - -// DescribeSecurityGroupReferencesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSecurityGroupReferences operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSecurityGroupReferences for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSecurityGroupReferences method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSecurityGroupReferencesRequest method. -// req, resp := client.DescribeSecurityGroupReferencesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences -func (c *EC2) DescribeSecurityGroupReferencesRequest(input *DescribeSecurityGroupReferencesInput) (req *request.Request, output *DescribeSecurityGroupReferencesOutput) { - op := &request.Operation{ - Name: opDescribeSecurityGroupReferences, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSecurityGroupReferencesInput{} - } - - output = &DescribeSecurityGroupReferencesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSecurityGroupReferences API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Describes the VPCs on the other side of a VPC peering connection -// that are referencing the security groups you've specified in this request. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSecurityGroupReferences for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences -func (c *EC2) DescribeSecurityGroupReferences(input *DescribeSecurityGroupReferencesInput) (*DescribeSecurityGroupReferencesOutput, error) { - req, out := c.DescribeSecurityGroupReferencesRequest(input) - return out, req.Send() -} - -// DescribeSecurityGroupReferencesWithContext is the same as DescribeSecurityGroupReferences with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSecurityGroupReferences 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 *EC2) DescribeSecurityGroupReferencesWithContext(ctx aws.Context, input *DescribeSecurityGroupReferencesInput, opts ...request.Option) (*DescribeSecurityGroupReferencesOutput, error) { - req, out := c.DescribeSecurityGroupReferencesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSecurityGroups = "DescribeSecurityGroups" - -// DescribeSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSecurityGroupsRequest method. -// req, resp := client.DescribeSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroups -func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) (req *request.Request, output *DescribeSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSecurityGroupsInput{} - } - - output = &DescribeSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSecurityGroups API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your security groups. -// -// A security group is for use with instances either in the EC2-Classic platform -// or in a specific VPC. For more information, see Amazon EC2 Security Groups -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) -// in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your -// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSecurityGroups for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroups -func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (*DescribeSecurityGroupsOutput, error) { - req, out := c.DescribeSecurityGroupsRequest(input) - return out, req.Send() -} - -// DescribeSecurityGroupsWithContext is the same as DescribeSecurityGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSecurityGroups 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 *EC2) DescribeSecurityGroupsWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, opts ...request.Option) (*DescribeSecurityGroupsOutput, error) { - req, out := c.DescribeSecurityGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" - -// DescribeSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshotAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSnapshotAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSnapshotAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSnapshotAttributeRequest method. -// req, resp := client.DescribeSnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute -func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeInput) (req *request.Request, output *DescribeSnapshotAttributeOutput) { - op := &request.Operation{ - Name: opDescribeSnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSnapshotAttributeInput{} - } - - output = &DescribeSnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSnapshotAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified snapshot. You can specify -// only one attribute at a time. -// -// For more information about EBS snapshots, see Amazon EBS Snapshots (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSnapshotAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute -func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) (*DescribeSnapshotAttributeOutput, error) { - req, out := c.DescribeSnapshotAttributeRequest(input) - return out, req.Send() -} - -// DescribeSnapshotAttributeWithContext is the same as DescribeSnapshotAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSnapshotAttribute 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 *EC2) DescribeSnapshotAttributeWithContext(ctx aws.Context, input *DescribeSnapshotAttributeInput, opts ...request.Option) (*DescribeSnapshotAttributeOutput, error) { - req, out := c.DescribeSnapshotAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSnapshots = "DescribeSnapshots" - -// DescribeSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshots operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSnapshots for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSnapshots method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSnapshotsRequest method. -// req, resp := client.DescribeSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshots -func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput) { - op := &request.Operation{ - Name: opDescribeSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSnapshotsInput{} - } - - output = &DescribeSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSnapshots API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the EBS snapshots available to you. Available snapshots -// include public snapshots available for any AWS account to launch, private -// snapshots that you own, and private snapshots owned by another AWS account -// but for which you've been given explicit create volume permissions. -// -// The create volume permissions fall into the following categories: -// -// * public: The owner of the snapshot granted create volume permissions -// for the snapshot to the all group. All AWS accounts have create volume -// permissions for these snapshots. -// -// * explicit: The owner of the snapshot granted create volume permissions -// to a specific AWS account. -// -// * implicit: An AWS account has implicit create volume permissions for -// all snapshots it owns. -// -// The list of snapshots returned can be modified by specifying snapshot IDs, -// snapshot owners, or AWS accounts with create volume permissions. If no options -// are specified, Amazon EC2 returns all snapshots for which you have create -// volume permissions. -// -// If you specify one or more snapshot IDs, only snapshots that have the specified -// IDs are returned. If you specify an invalid snapshot ID, an error is returned. -// If you specify a snapshot ID for which you do not have access, it is not -// included in the returned results. -// -// If you specify one or more snapshot owners using the OwnerIds option, only -// snapshots from the specified owners and for which you have access are returned. -// The results can include the AWS account IDs of the specified owners, amazon -// for snapshots owned by Amazon, or self for snapshots that you own. -// -// If you specify a list of restorable users, only snapshots with create snapshot -// permissions for those users are returned. You can specify AWS account IDs -// (if you own the snapshots), self for snapshots for which you own or have -// explicit permissions, or all for public snapshots. -// -// If you are describing a long list of snapshots, you can paginate the output -// to make the list more manageable. The MaxResults parameter sets the maximum -// number of results returned in a single page. If the list of results exceeds -// your MaxResults value, then that number of results is returned along with -// a NextToken value that can be passed to a subsequent DescribeSnapshots request -// to retrieve the remaining results. -// -// For more information about EBS snapshots, see Amazon EBS Snapshots (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSnapshots for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshots -func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { - req, out := c.DescribeSnapshotsRequest(input) - return out, req.Send() -} - -// DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSnapshots 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 *EC2) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error) { - req, out := c.DescribeSnapshotsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSnapshots method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeSnapshots operation. -// pageNum := 0 -// err := client.DescribeSnapshotsPages(params, -// func(page *DescribeSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool) error { - return c.DescribeSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSnapshotsPagesWithContext same as DescribeSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeSnapshotsPagesWithContext(ctx aws.Context, input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" - -// DescribeSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotDatafeedSubscription operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSpotDatafeedSubscription for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSpotDatafeedSubscription method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSpotDatafeedSubscriptionRequest method. -// req, resp := client.DescribeSpotDatafeedSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscription -func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafeedSubscriptionInput) (req *request.Request, output *DescribeSpotDatafeedSubscriptionOutput) { - op := &request.Operation{ - Name: opDescribeSpotDatafeedSubscription, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotDatafeedSubscriptionInput{} - } - - output = &DescribeSpotDatafeedSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. -// -// Describes the data feed for Spot instances. For more information, see Spot -// Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSpotDatafeedSubscription for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscription -func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscriptionInput) (*DescribeSpotDatafeedSubscriptionOutput, error) { - req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) - return out, req.Send() -} - -// DescribeSpotDatafeedSubscriptionWithContext is the same as DescribeSpotDatafeedSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotDatafeedSubscription 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 *EC2) DescribeSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DescribeSpotDatafeedSubscriptionInput, opts ...request.Option) (*DescribeSpotDatafeedSubscriptionOutput, error) { - req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" - -// DescribeSpotFleetInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSpotFleetInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSpotFleetInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSpotFleetInstancesRequest method. -// req, resp := client.DescribeSpotFleetInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstances -func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *request.Request, output *DescribeSpotFleetInstancesOutput) { - op := &request.Operation{ - Name: opDescribeSpotFleetInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotFleetInstancesInput{} - } - - output = &DescribeSpotFleetInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotFleetInstances API operation for Amazon Elastic Compute Cloud. -// -// Describes the running instances for the specified Spot fleet. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSpotFleetInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstances -func (c *EC2) DescribeSpotFleetInstances(input *DescribeSpotFleetInstancesInput) (*DescribeSpotFleetInstancesOutput, error) { - req, out := c.DescribeSpotFleetInstancesRequest(input) - return out, req.Send() -} - -// DescribeSpotFleetInstancesWithContext is the same as DescribeSpotFleetInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotFleetInstances 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 *EC2) DescribeSpotFleetInstancesWithContext(ctx aws.Context, input *DescribeSpotFleetInstancesInput, opts ...request.Option) (*DescribeSpotFleetInstancesOutput, error) { - req, out := c.DescribeSpotFleetInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" - -// DescribeSpotFleetRequestHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetRequestHistory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSpotFleetRequestHistory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSpotFleetRequestHistory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSpotFleetRequestHistoryRequest method. -// req, resp := client.DescribeSpotFleetRequestHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistory -func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *request.Request, output *DescribeSpotFleetRequestHistoryOutput) { - op := &request.Operation{ - Name: opDescribeSpotFleetRequestHistory, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotFleetRequestHistoryInput{} - } - - output = &DescribeSpotFleetRequestHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotFleetRequestHistory API operation for Amazon Elastic Compute Cloud. -// -// Describes the events for the specified Spot fleet request during the specified -// time. -// -// Spot fleet events are delayed by up to 30 seconds before they can be described. -// This ensures that you can query by the last evaluated time and not miss a -// recorded event. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSpotFleetRequestHistory for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistory -func (c *EC2) DescribeSpotFleetRequestHistory(input *DescribeSpotFleetRequestHistoryInput) (*DescribeSpotFleetRequestHistoryOutput, error) { - req, out := c.DescribeSpotFleetRequestHistoryRequest(input) - return out, req.Send() -} - -// DescribeSpotFleetRequestHistoryWithContext is the same as DescribeSpotFleetRequestHistory with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotFleetRequestHistory 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 *EC2) DescribeSpotFleetRequestHistoryWithContext(ctx aws.Context, input *DescribeSpotFleetRequestHistoryInput, opts ...request.Option) (*DescribeSpotFleetRequestHistoryOutput, error) { - req, out := c.DescribeSpotFleetRequestHistoryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" - -// DescribeSpotFleetRequestsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetRequests operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSpotFleetRequests for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSpotFleetRequests method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSpotFleetRequestsRequest method. -// req, resp := client.DescribeSpotFleetRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequests -func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *request.Request, output *DescribeSpotFleetRequestsOutput) { - op := &request.Operation{ - Name: opDescribeSpotFleetRequests, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSpotFleetRequestsInput{} - } - - output = &DescribeSpotFleetRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotFleetRequests API operation for Amazon Elastic Compute Cloud. -// -// Describes your Spot fleet requests. -// -// Spot fleet requests are deleted 48 hours after they are canceled and their -// instances are terminated. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSpotFleetRequests for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequests -func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) (*DescribeSpotFleetRequestsOutput, error) { - req, out := c.DescribeSpotFleetRequestsRequest(input) - return out, req.Send() -} - -// DescribeSpotFleetRequestsWithContext is the same as DescribeSpotFleetRequests with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotFleetRequests 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 *EC2) DescribeSpotFleetRequestsWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, opts ...request.Option) (*DescribeSpotFleetRequestsOutput, error) { - req, out := c.DescribeSpotFleetRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeSpotFleetRequestsPages iterates over the pages of a DescribeSpotFleetRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSpotFleetRequests method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeSpotFleetRequests operation. -// pageNum := 0 -// err := client.DescribeSpotFleetRequestsPages(params, -// func(page *DescribeSpotFleetRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSpotFleetRequestsPages(input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool) error { - return c.DescribeSpotFleetRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSpotFleetRequestsPagesWithContext same as DescribeSpotFleetRequestsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeSpotFleetRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSpotFleetRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSpotFleetRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotFleetRequestsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" - -// DescribeSpotInstanceRequestsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotInstanceRequests operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSpotInstanceRequests for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSpotInstanceRequests method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSpotInstanceRequestsRequest method. -// req, resp := client.DescribeSpotInstanceRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests -func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *request.Request, output *DescribeSpotInstanceRequestsOutput) { - op := &request.Operation{ - Name: opDescribeSpotInstanceRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSpotInstanceRequestsInput{} - } - - output = &DescribeSpotInstanceRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotInstanceRequests API operation for Amazon Elastic Compute Cloud. -// -// Describes the Spot instance requests that belong to your account. Spot instances -// are instances that Amazon EC2 launches when the bid price that you specify -// exceeds the current Spot price. Amazon EC2 periodically sets the Spot price -// based on available Spot instance capacity and current Spot instance requests. -// For more information, see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// You can use DescribeSpotInstanceRequests to find a running Spot instance -// by examining the response. If the status of the Spot instance is fulfilled, -// the instance ID appears in the response and contains the identifier of the -// instance. Alternatively, you can use DescribeInstances with a filter to look -// for instances where the instance lifecycle is spot. -// -// Spot instance requests are deleted 4 hours after they are canceled and their -// instances are terminated. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSpotInstanceRequests for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests -func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsInput) (*DescribeSpotInstanceRequestsOutput, error) { - req, out := c.DescribeSpotInstanceRequestsRequest(input) - return out, req.Send() -} - -// DescribeSpotInstanceRequestsWithContext is the same as DescribeSpotInstanceRequests with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotInstanceRequests 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 *EC2) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.Option) (*DescribeSpotInstanceRequestsOutput, error) { - req, out := c.DescribeSpotInstanceRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" - -// DescribeSpotPriceHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotPriceHistory operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSpotPriceHistory for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSpotPriceHistory method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSpotPriceHistoryRequest method. -// req, resp := client.DescribeSpotPriceHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistory -func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInput) (req *request.Request, output *DescribeSpotPriceHistoryOutput) { - op := &request.Operation{ - Name: opDescribeSpotPriceHistory, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeSpotPriceHistoryInput{} - } - - output = &DescribeSpotPriceHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSpotPriceHistory API operation for Amazon Elastic Compute Cloud. -// -// Describes the Spot price history. For more information, see Spot Instance -// Pricing History (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// When you specify a start and end time, this operation returns the prices -// of the instance types within the time range that you specified and the time -// when the price changed. The price is valid within the time period that you -// specified; the response merely indicates the last time that the price changed. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSpotPriceHistory for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistory -func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*DescribeSpotPriceHistoryOutput, error) { - req, out := c.DescribeSpotPriceHistoryRequest(input) - return out, req.Send() -} - -// DescribeSpotPriceHistoryWithContext is the same as DescribeSpotPriceHistory with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSpotPriceHistory 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 *EC2) DescribeSpotPriceHistoryWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, opts ...request.Option) (*DescribeSpotPriceHistoryOutput, error) { - req, out := c.DescribeSpotPriceHistoryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeSpotPriceHistoryPages iterates over the pages of a DescribeSpotPriceHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSpotPriceHistory method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeSpotPriceHistory operation. -// pageNum := 0 -// err := client.DescribeSpotPriceHistoryPages(params, -// func(page *DescribeSpotPriceHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool) error { - return c.DescribeSpotPriceHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSpotPriceHistoryPagesWithContext same as DescribeSpotPriceHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeSpotPriceHistoryPagesWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSpotPriceHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSpotPriceHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotPriceHistoryOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups" - -// DescribeStaleSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStaleSecurityGroups operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStaleSecurityGroups for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStaleSecurityGroups method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStaleSecurityGroupsRequest method. -// req, resp := client.DescribeStaleSecurityGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroups -func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGroupsInput) (req *request.Request, output *DescribeStaleSecurityGroupsOutput) { - op := &request.Operation{ - Name: opDescribeStaleSecurityGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeStaleSecurityGroupsInput{} - } - - output = &DescribeStaleSecurityGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStaleSecurityGroups API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Describes the stale security group rules for security groups -// in a specified VPC. Rules are stale when they reference a deleted security -// group in a peer VPC, or a security group in a peer VPC for which the VPC -// peering connection has been deleted. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeStaleSecurityGroups for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroups -func (c *EC2) DescribeStaleSecurityGroups(input *DescribeStaleSecurityGroupsInput) (*DescribeStaleSecurityGroupsOutput, error) { - req, out := c.DescribeStaleSecurityGroupsRequest(input) - return out, req.Send() -} - -// DescribeStaleSecurityGroupsWithContext is the same as DescribeStaleSecurityGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeStaleSecurityGroups 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 *EC2) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, opts ...request.Option) (*DescribeStaleSecurityGroupsOutput, error) { - req, out := c.DescribeStaleSecurityGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSubnets = "DescribeSubnets" - -// DescribeSubnetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSubnets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeSubnets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeSubnets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeSubnetsRequest method. -// req, resp := client.DescribeSubnetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnets -func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.Request, output *DescribeSubnetsOutput) { - op := &request.Operation{ - Name: opDescribeSubnets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSubnetsInput{} - } - - output = &DescribeSubnetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSubnets API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your subnets. -// -// For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeSubnets for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnets -func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (*DescribeSubnetsOutput, error) { - req, out := c.DescribeSubnetsRequest(input) - return out, req.Send() -} - -// DescribeSubnetsWithContext is the same as DescribeSubnets with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSubnets 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 *EC2) DescribeSubnetsWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.Option) (*DescribeSubnetsOutput, error) { - req, out := c.DescribeSubnetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTags = "DescribeTags" - -// DescribeTagsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTags operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeTags for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeTags method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeTagsRequest method. -// req, resp := client.DescribeTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTags -func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { - op := &request.Operation{ - Name: opDescribeTags, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTags API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of the tags for your EC2 resources. -// -// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeTags for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTags -func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - return out, req.Send() -} - -// DescribeTagsWithContext is the same as DescribeTags with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTags 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 *EC2) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeTagsPages iterates over the pages of a DescribeTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeTags method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeTags operation. -// pageNum := 0 -// err := client.DescribeTagsPages(params, -// func(page *DescribeTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool) error { - return c.DescribeTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTagsPagesWithContext same as DescribeTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeVolumeAttribute = "DescribeVolumeAttribute" - -// DescribeVolumeAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumeAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVolumeAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVolumeAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVolumeAttributeRequest method. -// req, resp := client.DescribeVolumeAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttribute -func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput) (req *request.Request, output *DescribeVolumeAttributeOutput) { - op := &request.Operation{ - Name: opDescribeVolumeAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVolumeAttributeInput{} - } - - output = &DescribeVolumeAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumeAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified volume. You can specify -// only one attribute at a time. -// -// For more information about EBS volumes, see Amazon EBS Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVolumeAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttribute -func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (*DescribeVolumeAttributeOutput, error) { - req, out := c.DescribeVolumeAttributeRequest(input) - return out, req.Send() -} - -// DescribeVolumeAttributeWithContext is the same as DescribeVolumeAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumeAttribute 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 *EC2) DescribeVolumeAttributeWithContext(ctx aws.Context, input *DescribeVolumeAttributeInput, opts ...request.Option) (*DescribeVolumeAttributeOutput, error) { - req, out := c.DescribeVolumeAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVolumeStatus = "DescribeVolumeStatus" - -// DescribeVolumeStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumeStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVolumeStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVolumeStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVolumeStatusRequest method. -// req, resp := client.DescribeVolumeStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatus -func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req *request.Request, output *DescribeVolumeStatusOutput) { - op := &request.Operation{ - Name: opDescribeVolumeStatus, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeVolumeStatusInput{} - } - - output = &DescribeVolumeStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumeStatus API operation for Amazon Elastic Compute Cloud. -// -// Describes the status of the specified volumes. Volume status provides the -// result of the checks performed on your volumes to determine events that can -// impair the performance of your volumes. The performance of a volume can be -// affected if an issue occurs on the volume's underlying host. If the volume's -// underlying host experiences a power outage or system issue, after the system -// is restored, there could be data inconsistencies on the volume. Volume events -// notify you if this occurs. Volume actions notify you if any action needs -// to be taken in response to the event. -// -// The DescribeVolumeStatus operation provides the following information about -// the specified volumes: -// -// Status: Reflects the current status of the volume. The possible values are -// ok, impaired , warning, or insufficient-data. If all checks pass, the overall -// status of the volume is ok. If the check fails, the overall status is impaired. -// If the status is insufficient-data, then the checks may still be taking place -// on your volume at the time. We recommend that you retry the request. For -// more information on volume status, see Monitoring the Status of Your Volumes -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html). -// -// Events: Reflect the cause of a volume status and may require you to take -// action. For example, if your volume returns an impaired status, then the -// volume event might be potential-data-inconsistency. This means that your -// volume has been affected by an issue with the underlying host, has all I/O -// operations disabled, and may have inconsistent data. -// -// Actions: Reflect the actions you may have to take in response to an event. -// For example, if the status of the volume is impaired and the volume event -// shows potential-data-inconsistency, then the action shows enable-volume-io. -// This means that you may want to enable the I/O operations for the volume -// by calling the EnableVolumeIO action and then check the volume for data consistency. -// -// Volume status is based on the volume status checks, and does not reflect -// the volume state. Therefore, volume status does not indicate volumes in the -// error state (for example, when a volume is incapable of accepting I/O.) -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVolumeStatus for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatus -func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeVolumeStatusOutput, error) { - req, out := c.DescribeVolumeStatusRequest(input) - return out, req.Send() -} - -// DescribeVolumeStatusWithContext is the same as DescribeVolumeStatus with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumeStatus 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 *EC2) DescribeVolumeStatusWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, opts ...request.Option) (*DescribeVolumeStatusOutput, error) { - req, out := c.DescribeVolumeStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeVolumeStatusPages iterates over the pages of a DescribeVolumeStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVolumeStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeVolumeStatus operation. -// pageNum := 0 -// err := client.DescribeVolumeStatusPages(params, -// func(page *DescribeVolumeStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool) error { - return c.DescribeVolumeStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVolumeStatusPagesWithContext same as DescribeVolumeStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeVolumeStatusPagesWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVolumeStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumeStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumeStatusOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeVolumes = "DescribeVolumes" - -// DescribeVolumesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVolumes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVolumes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVolumesRequest method. -// req, resp := client.DescribeVolumesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumes -func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.Request, output *DescribeVolumesOutput) { - op := &request.Operation{ - Name: opDescribeVolumes, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &DescribeVolumesInput{} - } - - output = &DescribeVolumesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumes API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified EBS volumes. -// -// If you are describing a long list of volumes, you can paginate the output -// to make the list more manageable. The MaxResults parameter sets the maximum -// number of results returned in a single page. If the list of results exceeds -// your MaxResults value, then that number of results is returned along with -// a NextToken value that can be passed to a subsequent DescribeVolumes request -// to retrieve the remaining results. -// -// For more information about EBS volumes, see Amazon EBS Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVolumes for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumes -func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutput, error) { - req, out := c.DescribeVolumesRequest(input) - return out, req.Send() -} - -// DescribeVolumesWithContext is the same as DescribeVolumes with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumes 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 *EC2) DescribeVolumesWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.Option) (*DescribeVolumesOutput, error) { - req, out := c.DescribeVolumesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeVolumesPages iterates over the pages of a DescribeVolumes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVolumes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeVolumes operation. -// pageNum := 0 -// err := client.DescribeVolumesPages(params, -// func(page *DescribeVolumesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool) error { - return c.DescribeVolumesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVolumesPagesWithContext same as DescribeVolumesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EC2) DescribeVolumesPagesWithContext(ctx aws.Context, input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeVolumesModifications = "DescribeVolumesModifications" - -// DescribeVolumesModificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumesModifications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVolumesModifications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVolumesModifications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVolumesModificationsRequest method. -// req, resp := client.DescribeVolumesModificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications -func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModificationsInput) (req *request.Request, output *DescribeVolumesModificationsOutput) { - op := &request.Operation{ - Name: opDescribeVolumesModifications, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVolumesModificationsInput{} - } - - output = &DescribeVolumesModificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVolumesModifications API operation for Amazon Elastic Compute Cloud. -// -// Reports the current modification status of EBS volumes. -// -// Current-generation EBS volumes support modification of attributes including -// type, size, and (for io1 volumes) IOPS provisioning while either attached -// to or detached from an instance. Following an action from the API or the -// console to modify a volume, the status of the modification may be modifying, -// optimizing, completed, or failed. If a volume has never been modified, then -// certain elements of the returned VolumeModification objects are null. -// -// You can also use CloudWatch Events to check the status of a modification -// to an EBS volume. For information about CloudWatch Events, see the Amazon -// CloudWatch Events User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). -// For more information, see Monitoring Volume Modifications" (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVolumesModifications for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications -func (c *EC2) DescribeVolumesModifications(input *DescribeVolumesModificationsInput) (*DescribeVolumesModificationsOutput, error) { - req, out := c.DescribeVolumesModificationsRequest(input) - return out, req.Send() -} - -// DescribeVolumesModificationsWithContext is the same as DescribeVolumesModifications with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVolumesModifications 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 *EC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, opts ...request.Option) (*DescribeVolumesModificationsOutput, error) { - req, out := c.DescribeVolumesModificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcAttribute = "DescribeVpcAttribute" - -// DescribeVpcAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpcAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpcAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpcAttributeRequest method. -// req, resp := client.DescribeVpcAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttribute -func (c *EC2) DescribeVpcAttributeRequest(input *DescribeVpcAttributeInput) (req *request.Request, output *DescribeVpcAttributeOutput) { - op := &request.Operation{ - Name: opDescribeVpcAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcAttributeInput{} - } - - output = &DescribeVpcAttributeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcAttribute API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified attribute of the specified VPC. You can specify only -// one attribute at a time. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpcAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttribute -func (c *EC2) DescribeVpcAttribute(input *DescribeVpcAttributeInput) (*DescribeVpcAttributeOutput, error) { - req, out := c.DescribeVpcAttributeRequest(input) - return out, req.Send() -} - -// DescribeVpcAttributeWithContext is the same as DescribeVpcAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcAttribute 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 *EC2) DescribeVpcAttributeWithContext(ctx aws.Context, input *DescribeVpcAttributeInput, opts ...request.Option) (*DescribeVpcAttributeOutput, error) { - req, out := c.DescribeVpcAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcClassicLink = "DescribeVpcClassicLink" - -// DescribeVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcClassicLink operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpcClassicLink for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpcClassicLink method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpcClassicLinkRequest method. -// req, resp := client.DescribeVpcClassicLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLink -func (c *EC2) DescribeVpcClassicLinkRequest(input *DescribeVpcClassicLinkInput) (req *request.Request, output *DescribeVpcClassicLinkOutput) { - op := &request.Operation{ - Name: opDescribeVpcClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcClassicLinkInput{} - } - - output = &DescribeVpcClassicLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcClassicLink API operation for Amazon Elastic Compute Cloud. -// -// Describes the ClassicLink status of one or more VPCs. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpcClassicLink for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLink -func (c *EC2) DescribeVpcClassicLink(input *DescribeVpcClassicLinkInput) (*DescribeVpcClassicLinkOutput, error) { - req, out := c.DescribeVpcClassicLinkRequest(input) - return out, req.Send() -} - -// DescribeVpcClassicLinkWithContext is the same as DescribeVpcClassicLink with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcClassicLink 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 *EC2) DescribeVpcClassicLinkWithContext(ctx aws.Context, input *DescribeVpcClassicLinkInput, opts ...request.Option) (*DescribeVpcClassicLinkOutput, error) { - req, out := c.DescribeVpcClassicLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport" - -// DescribeVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcClassicLinkDnsSupport operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpcClassicLinkDnsSupport for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpcClassicLinkDnsSupport method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpcClassicLinkDnsSupportRequest method. -// req, resp := client.DescribeVpcClassicLinkDnsSupportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupport -func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicLinkDnsSupportInput) (req *request.Request, output *DescribeVpcClassicLinkDnsSupportOutput) { - op := &request.Operation{ - Name: opDescribeVpcClassicLinkDnsSupport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcClassicLinkDnsSupportInput{} - } - - output = &DescribeVpcClassicLinkDnsSupportOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. -// -// Describes the ClassicLink DNS support status of one or more VPCs. If enabled, -// the DNS hostname of a linked EC2-Classic instance resolves to its private -// IP address when addressed from an instance in the VPC to which it's linked. -// Similarly, the DNS hostname of an instance in a VPC resolves to its private -// IP address when addressed from a linked EC2-Classic instance. For more information -// about ClassicLink, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpcClassicLinkDnsSupport for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupport -func (c *EC2) DescribeVpcClassicLinkDnsSupport(input *DescribeVpcClassicLinkDnsSupportInput) (*DescribeVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) - return out, req.Send() -} - -// DescribeVpcClassicLinkDnsSupportWithContext is the same as DescribeVpcClassicLinkDnsSupport with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcClassicLinkDnsSupport 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 *EC2) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DescribeVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" - -// DescribeVpcEndpointServicesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointServices operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpcEndpointServices for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpcEndpointServices method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpcEndpointServicesRequest method. -// req, resp := client.DescribeVpcEndpointServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServices -func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServicesInput) (req *request.Request, output *DescribeVpcEndpointServicesOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpointServices, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointServicesInput{} - } - - output = &DescribeVpcEndpointServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpointServices API operation for Amazon Elastic Compute Cloud. -// -// Describes all supported AWS services that can be specified when creating -// a VPC endpoint. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpointServices for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServices -func (c *EC2) DescribeVpcEndpointServices(input *DescribeVpcEndpointServicesInput) (*DescribeVpcEndpointServicesOutput, error) { - req, out := c.DescribeVpcEndpointServicesRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointServicesWithContext is the same as DescribeVpcEndpointServices with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpointServices 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 *EC2) DescribeVpcEndpointServicesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicesInput, opts ...request.Option) (*DescribeVpcEndpointServicesOutput, error) { - req, out := c.DescribeVpcEndpointServicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcEndpoints = "DescribeVpcEndpoints" - -// DescribeVpcEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpoints operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpcEndpoints for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpcEndpoints method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpcEndpointsRequest method. -// req, resp := client.DescribeVpcEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpoints -func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req *request.Request, output *DescribeVpcEndpointsOutput) { - op := &request.Operation{ - Name: opDescribeVpcEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcEndpointsInput{} - } - - output = &DescribeVpcEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcEndpoints API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPC endpoints. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpcEndpoints for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpoints -func (c *EC2) DescribeVpcEndpoints(input *DescribeVpcEndpointsInput) (*DescribeVpcEndpointsOutput, error) { - req, out := c.DescribeVpcEndpointsRequest(input) - return out, req.Send() -} - -// DescribeVpcEndpointsWithContext is the same as DescribeVpcEndpoints with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcEndpoints 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 *EC2) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, opts ...request.Option) (*DescribeVpcEndpointsOutput, error) { - req, out := c.DescribeVpcEndpointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" - -// DescribeVpcPeeringConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcPeeringConnections operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpcPeeringConnections for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpcPeeringConnections method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpcPeeringConnectionsRequest method. -// req, resp := client.DescribeVpcPeeringConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnections -func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConnectionsInput) (req *request.Request, output *DescribeVpcPeeringConnectionsOutput) { - op := &request.Operation{ - Name: opDescribeVpcPeeringConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcPeeringConnectionsInput{} - } - - output = &DescribeVpcPeeringConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcPeeringConnections API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPC peering connections. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpcPeeringConnections for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnections -func (c *EC2) DescribeVpcPeeringConnections(input *DescribeVpcPeeringConnectionsInput) (*DescribeVpcPeeringConnectionsOutput, error) { - req, out := c.DescribeVpcPeeringConnectionsRequest(input) - return out, req.Send() -} - -// DescribeVpcPeeringConnectionsWithContext is the same as DescribeVpcPeeringConnections with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcPeeringConnections 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 *EC2) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.Option) (*DescribeVpcPeeringConnectionsOutput, error) { - req, out := c.DescribeVpcPeeringConnectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpcs = "DescribeVpcs" - -// DescribeVpcsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcs operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpcs for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpcs method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpcsRequest method. -// req, resp := client.DescribeVpcsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcs -func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Request, output *DescribeVpcsOutput) { - op := &request.Operation{ - Name: opDescribeVpcs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpcsInput{} - } - - output = &DescribeVpcsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpcs API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPCs. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpcs for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcs -func (c *EC2) DescribeVpcs(input *DescribeVpcsInput) (*DescribeVpcsOutput, error) { - req, out := c.DescribeVpcsRequest(input) - return out, req.Send() -} - -// DescribeVpcsWithContext is the same as DescribeVpcs with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpcs 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 *EC2) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.Option) (*DescribeVpcsOutput, error) { - req, out := c.DescribeVpcsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpnConnections = "DescribeVpnConnections" - -// DescribeVpnConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpnConnections operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpnConnections for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpnConnections method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpnConnectionsRequest method. -// req, resp := client.DescribeVpnConnectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnections -func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput) (req *request.Request, output *DescribeVpnConnectionsOutput) { - op := &request.Operation{ - Name: opDescribeVpnConnections, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpnConnectionsInput{} - } - - output = &DescribeVpnConnectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpnConnections API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPN connections. -// -// For more information about VPN connections, see Adding a Hardware Virtual -// Private Gateway to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpnConnections for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnections -func (c *EC2) DescribeVpnConnections(input *DescribeVpnConnectionsInput) (*DescribeVpnConnectionsOutput, error) { - req, out := c.DescribeVpnConnectionsRequest(input) - return out, req.Send() -} - -// DescribeVpnConnectionsWithContext is the same as DescribeVpnConnections with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpnConnections 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 *EC2) DescribeVpnConnectionsWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.Option) (*DescribeVpnConnectionsOutput, error) { - req, out := c.DescribeVpnConnectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeVpnGateways = "DescribeVpnGateways" - -// DescribeVpnGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpnGateways operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeVpnGateways for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeVpnGateways method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeVpnGatewaysRequest method. -// req, resp := client.DescribeVpnGatewaysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGateways -func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) (req *request.Request, output *DescribeVpnGatewaysOutput) { - op := &request.Operation{ - Name: opDescribeVpnGateways, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeVpnGatewaysInput{} - } - - output = &DescribeVpnGatewaysOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeVpnGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your virtual private gateways. -// -// For more information about virtual private gateways, see Adding an IPsec -// Hardware VPN to Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DescribeVpnGateways for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGateways -func (c *EC2) DescribeVpnGateways(input *DescribeVpnGatewaysInput) (*DescribeVpnGatewaysOutput, error) { - req, out := c.DescribeVpnGatewaysRequest(input) - return out, req.Send() -} - -// DescribeVpnGatewaysWithContext is the same as DescribeVpnGateways with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeVpnGateways 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 *EC2) DescribeVpnGatewaysWithContext(ctx aws.Context, input *DescribeVpnGatewaysInput, opts ...request.Option) (*DescribeVpnGatewaysOutput, error) { - req, out := c.DescribeVpnGatewaysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachClassicLinkVpc = "DetachClassicLinkVpc" - -// DetachClassicLinkVpcRequest generates a "aws/request.Request" representing the -// client's request for the DetachClassicLinkVpc operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachClassicLinkVpc for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachClassicLinkVpc method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachClassicLinkVpcRequest method. -// req, resp := client.DetachClassicLinkVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpc -func (c *EC2) DetachClassicLinkVpcRequest(input *DetachClassicLinkVpcInput) (req *request.Request, output *DetachClassicLinkVpcOutput) { - op := &request.Operation{ - Name: opDetachClassicLinkVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachClassicLinkVpcInput{} - } - - output = &DetachClassicLinkVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// DetachClassicLinkVpc API operation for Amazon Elastic Compute Cloud. -// -// Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance -// has been unlinked, the VPC security groups are no longer associated with -// it. An instance is automatically unlinked from a VPC when it's stopped. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DetachClassicLinkVpc for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpc -func (c *EC2) DetachClassicLinkVpc(input *DetachClassicLinkVpcInput) (*DetachClassicLinkVpcOutput, error) { - req, out := c.DetachClassicLinkVpcRequest(input) - return out, req.Send() -} - -// DetachClassicLinkVpcWithContext is the same as DetachClassicLinkVpc with the addition of -// the ability to pass a context and additional request options. -// -// See DetachClassicLinkVpc 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 *EC2) DetachClassicLinkVpcWithContext(ctx aws.Context, input *DetachClassicLinkVpcInput, opts ...request.Option) (*DetachClassicLinkVpcOutput, error) { - req, out := c.DetachClassicLinkVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachInternetGateway = "DetachInternetGateway" - -// DetachInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DetachInternetGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachInternetGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachInternetGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachInternetGatewayRequest method. -// req, resp := client.DetachInternetGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGateway -func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (req *request.Request, output *DetachInternetGatewayOutput) { - op := &request.Operation{ - Name: opDetachInternetGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachInternetGatewayInput{} - } - - output = &DetachInternetGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachInternetGateway API operation for Amazon Elastic Compute Cloud. -// -// Detaches an Internet gateway from a VPC, disabling connectivity between the -// Internet and the VPC. The VPC must not contain any running instances with -// Elastic IP addresses. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DetachInternetGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGateway -func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachInternetGatewayOutput, error) { - req, out := c.DetachInternetGatewayRequest(input) - return out, req.Send() -} - -// DetachInternetGatewayWithContext is the same as DetachInternetGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DetachInternetGateway 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 *EC2) DetachInternetGatewayWithContext(ctx aws.Context, input *DetachInternetGatewayInput, opts ...request.Option) (*DetachInternetGatewayOutput, error) { - req, out := c.DetachInternetGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachNetworkInterface = "DetachNetworkInterface" - -// DetachNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the DetachNetworkInterface operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachNetworkInterface for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachNetworkInterface method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachNetworkInterfaceRequest method. -// req, resp := client.DetachNetworkInterfaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterface -func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) (req *request.Request, output *DetachNetworkInterfaceOutput) { - op := &request.Operation{ - Name: opDetachNetworkInterface, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachNetworkInterfaceInput{} - } - - output = &DetachNetworkInterfaceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachNetworkInterface API operation for Amazon Elastic Compute Cloud. -// -// Detaches a network interface from an instance. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DetachNetworkInterface for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterface -func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*DetachNetworkInterfaceOutput, error) { - req, out := c.DetachNetworkInterfaceRequest(input) - return out, req.Send() -} - -// DetachNetworkInterfaceWithContext is the same as DetachNetworkInterface with the addition of -// the ability to pass a context and additional request options. -// -// See DetachNetworkInterface 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 *EC2) DetachNetworkInterfaceWithContext(ctx aws.Context, input *DetachNetworkInterfaceInput, opts ...request.Option) (*DetachNetworkInterfaceOutput, error) { - req, out := c.DetachNetworkInterfaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachVolume = "DetachVolume" - -// DetachVolumeRequest generates a "aws/request.Request" representing the -// client's request for the DetachVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachVolumeRequest method. -// req, resp := client.DetachVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolume -func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Request, output *VolumeAttachment) { - op := &request.Operation{ - Name: opDetachVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachVolumeInput{} - } - - output = &VolumeAttachment{} - req = c.newRequest(op, input, output) - return -} - -// DetachVolume API operation for Amazon Elastic Compute Cloud. -// -// Detaches an EBS volume from an instance. Make sure to unmount any file systems -// on the device within your operating system before detaching the volume. Failure -// to do so can result in the volume becoming stuck in the busy state while -// detaching. If this happens, detachment can be delayed indefinitely until -// you unmount the volume, force detachment, reboot the instance, or all three. -// If an EBS volume is the root device of an instance, it can't be detached -// while the instance is running. To detach the root volume, stop the instance -// first. -// -// When a volume with an AWS Marketplace product code is detached from an instance, -// the product code is no longer associated with the instance. -// -// For more information, see Detaching an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DetachVolume for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolume -func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) { - req, out := c.DetachVolumeRequest(input) - return out, req.Send() -} - -// DetachVolumeWithContext is the same as DetachVolume with the addition of -// the ability to pass a context and additional request options. -// -// See DetachVolume 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 *EC2) DetachVolumeWithContext(ctx aws.Context, input *DetachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { - req, out := c.DetachVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachVpnGateway = "DetachVpnGateway" - -// DetachVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DetachVpnGateway operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DetachVpnGateway for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DetachVpnGateway method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DetachVpnGatewayRequest method. -// req, resp := client.DetachVpnGatewayRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway -func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) (req *request.Request, output *DetachVpnGatewayOutput) { - op := &request.Operation{ - Name: opDetachVpnGateway, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachVpnGatewayInput{} - } - - output = &DetachVpnGatewayOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachVpnGateway API operation for Amazon Elastic Compute Cloud. -// -// Detaches a virtual private gateway from a VPC. You do this if you're planning -// to turn off the VPC and not use it anymore. You can confirm a virtual private -// gateway has been completely detached from a VPC by describing the virtual -// private gateway (any attachments to the virtual private gateway are also -// described). -// -// You must wait for the attachment's state to switch to detached before you -// can delete the VPC or attach a different VPC to the virtual private gateway. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DetachVpnGateway for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway -func (c *EC2) DetachVpnGateway(input *DetachVpnGatewayInput) (*DetachVpnGatewayOutput, error) { - req, out := c.DetachVpnGatewayRequest(input) - return out, req.Send() -} - -// DetachVpnGatewayWithContext is the same as DetachVpnGateway with the addition of -// the ability to pass a context and additional request options. -// -// See DetachVpnGateway 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 *EC2) DetachVpnGatewayWithContext(ctx aws.Context, input *DetachVpnGatewayInput, opts ...request.Option) (*DetachVpnGatewayOutput, error) { - req, out := c.DetachVpnGatewayRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" - -// DisableVgwRoutePropagationRequest generates a "aws/request.Request" representing the -// client's request for the DisableVgwRoutePropagation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableVgwRoutePropagation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableVgwRoutePropagation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableVgwRoutePropagationRequest method. -// req, resp := client.DisableVgwRoutePropagationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagation -func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagationInput) (req *request.Request, output *DisableVgwRoutePropagationOutput) { - op := &request.Operation{ - Name: opDisableVgwRoutePropagation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableVgwRoutePropagationInput{} - } - - output = &DisableVgwRoutePropagationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. -// -// Disables a virtual private gateway (VGW) from propagating routes to a specified -// route table of a VPC. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisableVgwRoutePropagation for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagation -func (c *EC2) DisableVgwRoutePropagation(input *DisableVgwRoutePropagationInput) (*DisableVgwRoutePropagationOutput, error) { - req, out := c.DisableVgwRoutePropagationRequest(input) - return out, req.Send() -} - -// DisableVgwRoutePropagationWithContext is the same as DisableVgwRoutePropagation with the addition of -// the ability to pass a context and additional request options. -// -// See DisableVgwRoutePropagation 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 *EC2) DisableVgwRoutePropagationWithContext(ctx aws.Context, input *DisableVgwRoutePropagationInput, opts ...request.Option) (*DisableVgwRoutePropagationOutput, error) { - req, out := c.DisableVgwRoutePropagationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableVpcClassicLink = "DisableVpcClassicLink" - -// DisableVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the DisableVpcClassicLink operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableVpcClassicLink for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableVpcClassicLink method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableVpcClassicLinkRequest method. -// req, resp := client.DisableVpcClassicLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLink -func (c *EC2) DisableVpcClassicLinkRequest(input *DisableVpcClassicLinkInput) (req *request.Request, output *DisableVpcClassicLinkOutput) { - op := &request.Operation{ - Name: opDisableVpcClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableVpcClassicLinkInput{} - } - - output = &DisableVpcClassicLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableVpcClassicLink API operation for Amazon Elastic Compute Cloud. -// -// Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC -// that has EC2-Classic instances linked to it. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisableVpcClassicLink for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLink -func (c *EC2) DisableVpcClassicLink(input *DisableVpcClassicLinkInput) (*DisableVpcClassicLinkOutput, error) { - req, out := c.DisableVpcClassicLinkRequest(input) - return out, req.Send() -} - -// DisableVpcClassicLinkWithContext is the same as DisableVpcClassicLink with the addition of -// the ability to pass a context and additional request options. -// -// See DisableVpcClassicLink 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 *EC2) DisableVpcClassicLinkWithContext(ctx aws.Context, input *DisableVpcClassicLinkInput, opts ...request.Option) (*DisableVpcClassicLinkOutput, error) { - req, out := c.DisableVpcClassicLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport" - -// DisableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the DisableVpcClassicLinkDnsSupport operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableVpcClassicLinkDnsSupport for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableVpcClassicLinkDnsSupport method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableVpcClassicLinkDnsSupportRequest method. -// req, resp := client.DisableVpcClassicLinkDnsSupportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupport -func (c *EC2) DisableVpcClassicLinkDnsSupportRequest(input *DisableVpcClassicLinkDnsSupportInput) (req *request.Request, output *DisableVpcClassicLinkDnsSupportOutput) { - op := &request.Operation{ - Name: opDisableVpcClassicLinkDnsSupport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableVpcClassicLinkDnsSupportInput{} - } - - output = &DisableVpcClassicLinkDnsSupportOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. -// -// Disables ClassicLink DNS support for a VPC. If disabled, DNS hostnames resolve -// to public IP addresses when addressed between a linked EC2-Classic instance -// and instances in the VPC to which it's linked. For more information about -// ClassicLink, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisableVpcClassicLinkDnsSupport for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupport -func (c *EC2) DisableVpcClassicLinkDnsSupport(input *DisableVpcClassicLinkDnsSupportInput) (*DisableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) - return out, req.Send() -} - -// DisableVpcClassicLinkDnsSupportWithContext is the same as DisableVpcClassicLinkDnsSupport with the addition of -// the ability to pass a context and additional request options. -// -// See DisableVpcClassicLinkDnsSupport 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 *EC2) DisableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DisableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DisableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateAddress = "DisassociateAddress" - -// DisassociateAddressRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateAddress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisassociateAddress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisassociateAddress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisassociateAddressRequest method. -// req, resp := client.DisassociateAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddress -func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *request.Request, output *DisassociateAddressOutput) { - op := &request.Operation{ - Name: opDisassociateAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateAddressInput{} - } - - output = &DisassociateAddressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateAddress API operation for Amazon Elastic Compute Cloud. -// -// Disassociates an Elastic IP address from the instance or network interface -// it's associated with. -// -// An Elastic IP address is for use in either the EC2-Classic platform or in -// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisassociateAddress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddress -func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*DisassociateAddressOutput, error) { - req, out := c.DisassociateAddressRequest(input) - return out, req.Send() -} - -// DisassociateAddressWithContext is the same as DisassociateAddress with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateAddress 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 *EC2) DisassociateAddressWithContext(ctx aws.Context, input *DisassociateAddressInput, opts ...request.Option) (*DisassociateAddressOutput, error) { - req, out := c.DisassociateAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" - -// DisassociateIamInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateIamInstanceProfile operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisassociateIamInstanceProfile for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisassociateIamInstanceProfile method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisassociateIamInstanceProfileRequest method. -// req, resp := client.DisassociateIamInstanceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile -func (c *EC2) DisassociateIamInstanceProfileRequest(input *DisassociateIamInstanceProfileInput) (req *request.Request, output *DisassociateIamInstanceProfileOutput) { - op := &request.Operation{ - Name: opDisassociateIamInstanceProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateIamInstanceProfileInput{} - } - - output = &DisassociateIamInstanceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud. -// -// Disassociates an IAM instance profile from a running or stopped instance. -// -// Use DescribeIamInstanceProfileAssociations to get the association ID. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisassociateIamInstanceProfile for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile -func (c *EC2) DisassociateIamInstanceProfile(input *DisassociateIamInstanceProfileInput) (*DisassociateIamInstanceProfileOutput, error) { - req, out := c.DisassociateIamInstanceProfileRequest(input) - return out, req.Send() -} - -// DisassociateIamInstanceProfileWithContext is the same as DisassociateIamInstanceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateIamInstanceProfile 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 *EC2) DisassociateIamInstanceProfileWithContext(ctx aws.Context, input *DisassociateIamInstanceProfileInput, opts ...request.Option) (*DisassociateIamInstanceProfileOutput, error) { - req, out := c.DisassociateIamInstanceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateRouteTable = "DisassociateRouteTable" - -// DisassociateRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateRouteTable operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisassociateRouteTable for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisassociateRouteTable method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisassociateRouteTableRequest method. -// req, resp := client.DisassociateRouteTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTable -func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) (req *request.Request, output *DisassociateRouteTableOutput) { - op := &request.Operation{ - Name: opDisassociateRouteTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateRouteTableInput{} - } - - output = &DisassociateRouteTableOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateRouteTable API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a subnet from a route table. -// -// After you perform this action, the subnet no longer uses the routes in the -// route table. Instead, it uses the routes in the VPC's main route table. For -// more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisassociateRouteTable for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTable -func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (*DisassociateRouteTableOutput, error) { - req, out := c.DisassociateRouteTableRequest(input) - return out, req.Send() -} - -// DisassociateRouteTableWithContext is the same as DisassociateRouteTable with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateRouteTable 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 *EC2) DisassociateRouteTableWithContext(ctx aws.Context, input *DisassociateRouteTableInput, opts ...request.Option) (*DisassociateRouteTableOutput, error) { - req, out := c.DisassociateRouteTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock" - -// DisassociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateSubnetCidrBlock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisassociateSubnetCidrBlock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisassociateSubnetCidrBlock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisassociateSubnetCidrBlockRequest method. -// req, resp := client.DisassociateSubnetCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlock -func (c *EC2) DisassociateSubnetCidrBlockRequest(input *DisassociateSubnetCidrBlockInput) (req *request.Request, output *DisassociateSubnetCidrBlockOutput) { - op := &request.Operation{ - Name: opDisassociateSubnetCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateSubnetCidrBlockInput{} - } - - output = &DisassociateSubnetCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateSubnetCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a CIDR block from a subnet. Currently, you can disassociate -// an IPv6 CIDR block only. You must detach or delete all gateways and resources -// that are associated with the CIDR block before you can disassociate it. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisassociateSubnetCidrBlock for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlock -func (c *EC2) DisassociateSubnetCidrBlock(input *DisassociateSubnetCidrBlockInput) (*DisassociateSubnetCidrBlockOutput, error) { - req, out := c.DisassociateSubnetCidrBlockRequest(input) - return out, req.Send() -} - -// DisassociateSubnetCidrBlockWithContext is the same as DisassociateSubnetCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateSubnetCidrBlock 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 *EC2) DisassociateSubnetCidrBlockWithContext(ctx aws.Context, input *DisassociateSubnetCidrBlockInput, opts ...request.Option) (*DisassociateSubnetCidrBlockOutput, error) { - req, out := c.DisassociateSubnetCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock" - -// DisassociateVpcCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateVpcCidrBlock operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisassociateVpcCidrBlock for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisassociateVpcCidrBlock method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisassociateVpcCidrBlockRequest method. -// req, resp := client.DisassociateVpcCidrBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlock -func (c *EC2) DisassociateVpcCidrBlockRequest(input *DisassociateVpcCidrBlockInput) (req *request.Request, output *DisassociateVpcCidrBlockOutput) { - op := &request.Operation{ - Name: opDisassociateVpcCidrBlock, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateVpcCidrBlockInput{} - } - - output = &DisassociateVpcCidrBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a CIDR block from a VPC. Currently, you can disassociate an -// IPv6 CIDR block only. You must detach or delete all gateways and resources -// that are associated with the CIDR block before you can disassociate it. -// -// 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 Amazon Elastic Compute Cloud's -// API operation DisassociateVpcCidrBlock for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlock -func (c *EC2) DisassociateVpcCidrBlock(input *DisassociateVpcCidrBlockInput) (*DisassociateVpcCidrBlockOutput, error) { - req, out := c.DisassociateVpcCidrBlockRequest(input) - return out, req.Send() -} - -// DisassociateVpcCidrBlockWithContext is the same as DisassociateVpcCidrBlock with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateVpcCidrBlock 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 *EC2) DisassociateVpcCidrBlockWithContext(ctx aws.Context, input *DisassociateVpcCidrBlockInput, opts ...request.Option) (*DisassociateVpcCidrBlockOutput, error) { - req, out := c.DisassociateVpcCidrBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" - -// EnableVgwRoutePropagationRequest generates a "aws/request.Request" representing the -// client's request for the EnableVgwRoutePropagation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableVgwRoutePropagation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableVgwRoutePropagation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableVgwRoutePropagationRequest method. -// req, resp := client.EnableVgwRoutePropagationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagation -func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationInput) (req *request.Request, output *EnableVgwRoutePropagationOutput) { - op := &request.Operation{ - Name: opEnableVgwRoutePropagation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVgwRoutePropagationInput{} - } - - output = &EnableVgwRoutePropagationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. -// -// Enables a virtual private gateway (VGW) to propagate routes to the specified -// route table of a VPC. -// -// 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 Amazon Elastic Compute Cloud's -// API operation EnableVgwRoutePropagation for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagation -func (c *EC2) EnableVgwRoutePropagation(input *EnableVgwRoutePropagationInput) (*EnableVgwRoutePropagationOutput, error) { - req, out := c.EnableVgwRoutePropagationRequest(input) - return out, req.Send() -} - -// EnableVgwRoutePropagationWithContext is the same as EnableVgwRoutePropagation with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVgwRoutePropagation 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 *EC2) EnableVgwRoutePropagationWithContext(ctx aws.Context, input *EnableVgwRoutePropagationInput, opts ...request.Option) (*EnableVgwRoutePropagationOutput, error) { - req, out := c.EnableVgwRoutePropagationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVolumeIO = "EnableVolumeIO" - -// EnableVolumeIORequest generates a "aws/request.Request" representing the -// client's request for the EnableVolumeIO operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableVolumeIO for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableVolumeIO method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableVolumeIORequest method. -// req, resp := client.EnableVolumeIORequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIO -func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *request.Request, output *EnableVolumeIOOutput) { - op := &request.Operation{ - Name: opEnableVolumeIO, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVolumeIOInput{} - } - - output = &EnableVolumeIOOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableVolumeIO API operation for Amazon Elastic Compute Cloud. -// -// Enables I/O operations for a volume that had I/O operations disabled because -// the data on the volume was potentially inconsistent. -// -// 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 Amazon Elastic Compute Cloud's -// API operation EnableVolumeIO for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIO -func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, error) { - req, out := c.EnableVolumeIORequest(input) - return out, req.Send() -} - -// EnableVolumeIOWithContext is the same as EnableVolumeIO with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVolumeIO 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 *EC2) EnableVolumeIOWithContext(ctx aws.Context, input *EnableVolumeIOInput, opts ...request.Option) (*EnableVolumeIOOutput, error) { - req, out := c.EnableVolumeIORequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVpcClassicLink = "EnableVpcClassicLink" - -// EnableVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the EnableVpcClassicLink operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableVpcClassicLink for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableVpcClassicLink method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableVpcClassicLinkRequest method. -// req, resp := client.EnableVpcClassicLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLink -func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) (req *request.Request, output *EnableVpcClassicLinkOutput) { - op := &request.Operation{ - Name: opEnableVpcClassicLink, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVpcClassicLinkInput{} - } - - output = &EnableVpcClassicLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableVpcClassicLink API operation for Amazon Elastic Compute Cloud. -// -// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to -// your ClassicLink-enabled VPC to allow communication over private IP addresses. -// You cannot enable your VPC for ClassicLink if any of your VPC's route tables -// have existing routes for address ranges within the 10.0.0.0/8 IP address -// range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16 -// IP address ranges. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation EnableVpcClassicLink for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLink -func (c *EC2) EnableVpcClassicLink(input *EnableVpcClassicLinkInput) (*EnableVpcClassicLinkOutput, error) { - req, out := c.EnableVpcClassicLinkRequest(input) - return out, req.Send() -} - -// EnableVpcClassicLinkWithContext is the same as EnableVpcClassicLink with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVpcClassicLink 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 *EC2) EnableVpcClassicLinkWithContext(ctx aws.Context, input *EnableVpcClassicLinkInput, opts ...request.Option) (*EnableVpcClassicLinkOutput, error) { - req, out := c.EnableVpcClassicLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport" - -// EnableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the EnableVpcClassicLinkDnsSupport operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableVpcClassicLinkDnsSupport for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableVpcClassicLinkDnsSupport method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableVpcClassicLinkDnsSupportRequest method. -// req, resp := client.EnableVpcClassicLinkDnsSupportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupport -func (c *EC2) EnableVpcClassicLinkDnsSupportRequest(input *EnableVpcClassicLinkDnsSupportInput) (req *request.Request, output *EnableVpcClassicLinkDnsSupportOutput) { - op := &request.Operation{ - Name: opEnableVpcClassicLinkDnsSupport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableVpcClassicLinkDnsSupportInput{} - } - - output = &EnableVpcClassicLinkDnsSupportOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. -// -// Enables a VPC to support DNS hostname resolution for ClassicLink. If enabled, -// the DNS hostname of a linked EC2-Classic instance resolves to its private -// IP address when addressed from an instance in the VPC to which it's linked. -// Similarly, the DNS hostname of an instance in a VPC resolves to its private -// IP address when addressed from a linked EC2-Classic instance. For more information -// about ClassicLink, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation EnableVpcClassicLinkDnsSupport for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupport -func (c *EC2) EnableVpcClassicLinkDnsSupport(input *EnableVpcClassicLinkDnsSupportInput) (*EnableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) - return out, req.Send() -} - -// EnableVpcClassicLinkDnsSupportWithContext is the same as EnableVpcClassicLinkDnsSupport with the addition of -// the ability to pass a context and additional request options. -// -// See EnableVpcClassicLinkDnsSupport 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 *EC2) EnableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *EnableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*EnableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConsoleOutput = "GetConsoleOutput" - -// GetConsoleOutputRequest generates a "aws/request.Request" representing the -// client's request for the GetConsoleOutput operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetConsoleOutput for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetConsoleOutput method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetConsoleOutputRequest method. -// req, resp := client.GetConsoleOutputRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput -func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *request.Request, output *GetConsoleOutputOutput) { - op := &request.Operation{ - Name: opGetConsoleOutput, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetConsoleOutputInput{} - } - - output = &GetConsoleOutputOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConsoleOutput API operation for Amazon Elastic Compute Cloud. -// -// Gets the console output for the specified instance. -// -// Instances do not have a physical monitor through which you can view their -// console output. They also lack physical controls that allow you to power -// up, reboot, or shut them down. To allow these actions, we provide them through -// the Amazon EC2 API and command line interface. -// -// Instance console output is buffered and posted shortly after instance boot, -// reboot, and termination. Amazon EC2 preserves the most recent 64 KB output -// which is available for at least one hour after the most recent post. -// -// For Linux instances, the instance console output displays the exact console -// output that would normally be displayed on a physical monitor attached to -// a computer. This output is buffered because the instance produces it and -// then posts it to a store where the instance's owner can retrieve it. -// -// For Windows instances, the instance console output includes output from the -// EC2Config service. -// -// 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 Amazon Elastic Compute Cloud's -// API operation GetConsoleOutput for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput -func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (*GetConsoleOutputOutput, error) { - req, out := c.GetConsoleOutputRequest(input) - return out, req.Send() -} - -// GetConsoleOutputWithContext is the same as GetConsoleOutput with the addition of -// the ability to pass a context and additional request options. -// -// See GetConsoleOutput 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 *EC2) GetConsoleOutputWithContext(ctx aws.Context, input *GetConsoleOutputInput, opts ...request.Option) (*GetConsoleOutputOutput, error) { - req, out := c.GetConsoleOutputRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConsoleScreenshot = "GetConsoleScreenshot" - -// GetConsoleScreenshotRequest generates a "aws/request.Request" representing the -// client's request for the GetConsoleScreenshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetConsoleScreenshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetConsoleScreenshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetConsoleScreenshotRequest method. -// req, resp := client.GetConsoleScreenshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshot -func (c *EC2) GetConsoleScreenshotRequest(input *GetConsoleScreenshotInput) (req *request.Request, output *GetConsoleScreenshotOutput) { - op := &request.Operation{ - Name: opGetConsoleScreenshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetConsoleScreenshotInput{} - } - - output = &GetConsoleScreenshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConsoleScreenshot API operation for Amazon Elastic Compute Cloud. -// -// Retrieve a JPG-format screenshot of a running instance to help with troubleshooting. -// -// The returned content is Base64-encoded. -// -// 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 Amazon Elastic Compute Cloud's -// API operation GetConsoleScreenshot for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshot -func (c *EC2) GetConsoleScreenshot(input *GetConsoleScreenshotInput) (*GetConsoleScreenshotOutput, error) { - req, out := c.GetConsoleScreenshotRequest(input) - return out, req.Send() -} - -// GetConsoleScreenshotWithContext is the same as GetConsoleScreenshot with the addition of -// the ability to pass a context and additional request options. -// -// See GetConsoleScreenshot 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 *EC2) GetConsoleScreenshotWithContext(ctx aws.Context, input *GetConsoleScreenshotInput, opts ...request.Option) (*GetConsoleScreenshotOutput, error) { - req, out := c.GetConsoleScreenshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" - -// GetHostReservationPurchasePreviewRequest generates a "aws/request.Request" representing the -// client's request for the GetHostReservationPurchasePreview operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHostReservationPurchasePreview for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHostReservationPurchasePreview method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHostReservationPurchasePreviewRequest method. -// req, resp := client.GetHostReservationPurchasePreviewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreview -func (c *EC2) GetHostReservationPurchasePreviewRequest(input *GetHostReservationPurchasePreviewInput) (req *request.Request, output *GetHostReservationPurchasePreviewOutput) { - op := &request.Operation{ - Name: opGetHostReservationPurchasePreview, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetHostReservationPurchasePreviewInput{} - } - - output = &GetHostReservationPurchasePreviewOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHostReservationPurchasePreview API operation for Amazon Elastic Compute Cloud. -// -// Preview a reservation purchase with configurations that match those of your -// Dedicated Host. You must have active Dedicated Hosts in your account before -// you purchase a reservation. -// -// This is a preview of the PurchaseHostReservation action and does not result -// in the offering being purchased. -// -// 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 Amazon Elastic Compute Cloud's -// API operation GetHostReservationPurchasePreview for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreview -func (c *EC2) GetHostReservationPurchasePreview(input *GetHostReservationPurchasePreviewInput) (*GetHostReservationPurchasePreviewOutput, error) { - req, out := c.GetHostReservationPurchasePreviewRequest(input) - return out, req.Send() -} - -// GetHostReservationPurchasePreviewWithContext is the same as GetHostReservationPurchasePreview with the addition of -// the ability to pass a context and additional request options. -// -// See GetHostReservationPurchasePreview 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 *EC2) GetHostReservationPurchasePreviewWithContext(ctx aws.Context, input *GetHostReservationPurchasePreviewInput, opts ...request.Option) (*GetHostReservationPurchasePreviewOutput, error) { - req, out := c.GetHostReservationPurchasePreviewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPasswordData = "GetPasswordData" - -// GetPasswordDataRequest generates a "aws/request.Request" representing the -// client's request for the GetPasswordData operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetPasswordData for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetPasswordData method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetPasswordDataRequest method. -// req, resp := client.GetPasswordDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordData -func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request.Request, output *GetPasswordDataOutput) { - op := &request.Operation{ - Name: opGetPasswordData, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPasswordDataInput{} - } - - output = &GetPasswordDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPasswordData API operation for Amazon Elastic Compute Cloud. -// -// Retrieves the encrypted administrator password for an instance running Windows. -// -// The Windows password is generated at boot if the EC2Config service plugin, -// Ec2SetPassword, is enabled. This usually only happens the first time an AMI -// is launched, and then Ec2SetPassword is automatically disabled. The password -// is not generated for rebundled AMIs unless Ec2SetPassword is enabled before -// bundling. -// -// The password is encrypted using the key pair that you specified when you -// launched the instance. You must provide the corresponding key pair file. -// -// Password generation and encryption takes a few moments. We recommend that -// you wait up to 15 minutes after launching an instance before trying to retrieve -// the generated password. -// -// 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 Amazon Elastic Compute Cloud's -// API operation GetPasswordData for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordData -func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (*GetPasswordDataOutput, error) { - req, out := c.GetPasswordDataRequest(input) - return out, req.Send() -} - -// GetPasswordDataWithContext is the same as GetPasswordData with the addition of -// the ability to pass a context and additional request options. -// -// See GetPasswordData 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 *EC2) GetPasswordDataWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.Option) (*GetPasswordDataOutput, error) { - req, out := c.GetPasswordDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote" - -// GetReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the -// client's request for the GetReservedInstancesExchangeQuote operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetReservedInstancesExchangeQuote for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetReservedInstancesExchangeQuote method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetReservedInstancesExchangeQuoteRequest method. -// req, resp := client.GetReservedInstancesExchangeQuoteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuote -func (c *EC2) GetReservedInstancesExchangeQuoteRequest(input *GetReservedInstancesExchangeQuoteInput) (req *request.Request, output *GetReservedInstancesExchangeQuoteOutput) { - op := &request.Operation{ - Name: opGetReservedInstancesExchangeQuote, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetReservedInstancesExchangeQuoteInput{} - } - - output = &GetReservedInstancesExchangeQuoteOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetReservedInstancesExchangeQuote API operation for Amazon Elastic Compute Cloud. -// -// Returns details about the values and term of your specified Convertible Reserved -// Instances. When a target configuration is specified, it returns information -// about whether the exchange is valid and can be performed. -// -// 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 Amazon Elastic Compute Cloud's -// API operation GetReservedInstancesExchangeQuote for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuote -func (c *EC2) GetReservedInstancesExchangeQuote(input *GetReservedInstancesExchangeQuoteInput) (*GetReservedInstancesExchangeQuoteOutput, error) { - req, out := c.GetReservedInstancesExchangeQuoteRequest(input) - return out, req.Send() -} - -// GetReservedInstancesExchangeQuoteWithContext is the same as GetReservedInstancesExchangeQuote with the addition of -// the ability to pass a context and additional request options. -// -// See GetReservedInstancesExchangeQuote 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 *EC2) GetReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *GetReservedInstancesExchangeQuoteInput, opts ...request.Option) (*GetReservedInstancesExchangeQuoteOutput, error) { - req, out := c.GetReservedInstancesExchangeQuoteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportImage = "ImportImage" - -// ImportImageRequest generates a "aws/request.Request" representing the -// client's request for the ImportImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportImageRequest method. -// req, resp := client.ImportImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImage -func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request, output *ImportImageOutput) { - op := &request.Operation{ - Name: opImportImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportImageInput{} - } - - output = &ImportImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportImage API operation for Amazon Elastic Compute Cloud. -// -// Import single or multi-volume disk images or EBS snapshots into an Amazon -// Machine Image (AMI). For more information, see Importing a VM as an Image -// Using VM Import/Export (http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html) -// in the VM Import/Export User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ImportImage for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImage -func (c *EC2) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { - req, out := c.ImportImageRequest(input) - return out, req.Send() -} - -// ImportImageWithContext is the same as ImportImage with the addition of -// the ability to pass a context and additional request options. -// -// See ImportImage 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 *EC2) ImportImageWithContext(ctx aws.Context, input *ImportImageInput, opts ...request.Option) (*ImportImageOutput, error) { - req, out := c.ImportImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportInstance = "ImportInstance" - -// ImportInstanceRequest generates a "aws/request.Request" representing the -// client's request for the ImportInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportInstanceRequest method. -// req, resp := client.ImportInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstance -func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Request, output *ImportInstanceOutput) { - op := &request.Operation{ - Name: opImportInstance, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportInstanceInput{} - } - - output = &ImportInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportInstance API operation for Amazon Elastic Compute Cloud. -// -// Creates an import instance task using metadata from the specified disk image. -// ImportInstance only supports single-volume VMs. To import multi-volume VMs, -// use ImportImage. For more information, see Importing a Virtual Machine Using -// the Amazon EC2 CLI (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html). -// -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). -// -// 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 Amazon Elastic Compute Cloud's -// API operation ImportInstance for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstance -func (c *EC2) ImportInstance(input *ImportInstanceInput) (*ImportInstanceOutput, error) { - req, out := c.ImportInstanceRequest(input) - return out, req.Send() -} - -// ImportInstanceWithContext is the same as ImportInstance with the addition of -// the ability to pass a context and additional request options. -// -// See ImportInstance 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 *EC2) ImportInstanceWithContext(ctx aws.Context, input *ImportInstanceInput, opts ...request.Option) (*ImportInstanceOutput, error) { - req, out := c.ImportInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportKeyPair = "ImportKeyPair" - -// ImportKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the ImportKeyPair operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportKeyPair for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportKeyPair method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportKeyPairRequest method. -// req, resp := client.ImportKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPair -func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Request, output *ImportKeyPairOutput) { - op := &request.Operation{ - Name: opImportKeyPair, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportKeyPairInput{} - } - - output = &ImportKeyPairOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportKeyPair API operation for Amazon Elastic Compute Cloud. -// -// Imports the public key from an RSA key pair that you created with a third-party -// tool. Compare this with CreateKeyPair, in which AWS creates the key pair -// and gives the keys to you (AWS keeps a copy of the public key). With ImportKeyPair, -// you create the key pair and give AWS just the public key. The private key -// is never transferred between you and AWS. -// -// For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ImportKeyPair for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPair -func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) - return out, req.Send() -} - -// ImportKeyPairWithContext is the same as ImportKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See ImportKeyPair 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 *EC2) ImportKeyPairWithContext(ctx aws.Context, input *ImportKeyPairInput, opts ...request.Option) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportSnapshot = "ImportSnapshot" - -// ImportSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the ImportSnapshot operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportSnapshot for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportSnapshot method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportSnapshotRequest method. -// req, resp := client.ImportSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshot -func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *request.Request, output *ImportSnapshotOutput) { - op := &request.Operation{ - Name: opImportSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportSnapshotInput{} - } - - output = &ImportSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportSnapshot API operation for Amazon Elastic Compute Cloud. -// -// Imports a disk into an EBS snapshot. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ImportSnapshot for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshot -func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (*ImportSnapshotOutput, error) { - req, out := c.ImportSnapshotRequest(input) - return out, req.Send() -} - -// ImportSnapshotWithContext is the same as ImportSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See ImportSnapshot 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 *EC2) ImportSnapshotWithContext(ctx aws.Context, input *ImportSnapshotInput, opts ...request.Option) (*ImportSnapshotOutput, error) { - req, out := c.ImportSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportVolume = "ImportVolume" - -// ImportVolumeRequest generates a "aws/request.Request" representing the -// client's request for the ImportVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ImportVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ImportVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ImportVolumeRequest method. -// req, resp := client.ImportVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolume -func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Request, output *ImportVolumeOutput) { - op := &request.Operation{ - Name: opImportVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportVolumeInput{} - } - - output = &ImportVolumeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportVolume API operation for Amazon Elastic Compute Cloud. -// -// Creates an import volume task using metadata from the specified disk image.For -// more information, see Importing Disks to Amazon EBS (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/importing-your-volumes-into-amazon-ebs.html). -// -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). -// -// 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 Amazon Elastic Compute Cloud's -// API operation ImportVolume for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolume -func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error) { - req, out := c.ImportVolumeRequest(input) - return out, req.Send() -} - -// ImportVolumeWithContext is the same as ImportVolume with the addition of -// the ability to pass a context and additional request options. -// -// See ImportVolume 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 *EC2) ImportVolumeWithContext(ctx aws.Context, input *ImportVolumeInput, opts ...request.Option) (*ImportVolumeOutput, error) { - req, out := c.ImportVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyHosts = "ModifyHosts" - -// ModifyHostsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyHosts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyHosts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyHosts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyHostsRequest method. -// req, resp := client.ModifyHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHosts -func (c *EC2) ModifyHostsRequest(input *ModifyHostsInput) (req *request.Request, output *ModifyHostsOutput) { - op := &request.Operation{ - Name: opModifyHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyHostsInput{} - } - - output = &ModifyHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyHosts API operation for Amazon Elastic Compute Cloud. -// -// Modify the auto-placement setting of a Dedicated Host. When auto-placement -// is enabled, AWS will place instances that you launch with a tenancy of host, -// but without targeting a specific host ID, onto any available Dedicated Host -// in your account which has auto-placement enabled. When auto-placement is -// disabled, you need to provide a host ID if you want the instance to launch -// onto a specific host. If no host ID is provided, the instance will be launched -// onto a suitable host which has auto-placement enabled. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyHosts for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHosts -func (c *EC2) ModifyHosts(input *ModifyHostsInput) (*ModifyHostsOutput, error) { - req, out := c.ModifyHostsRequest(input) - return out, req.Send() -} - -// ModifyHostsWithContext is the same as ModifyHosts with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyHosts 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 *EC2) ModifyHostsWithContext(ctx aws.Context, input *ModifyHostsInput, opts ...request.Option) (*ModifyHostsOutput, error) { - req, out := c.ModifyHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyIdFormat = "ModifyIdFormat" - -// ModifyIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the ModifyIdFormat operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyIdFormat for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyIdFormat method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyIdFormatRequest method. -// req, resp := client.ModifyIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormat -func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) (req *request.Request, output *ModifyIdFormatOutput) { - op := &request.Operation{ - Name: opModifyIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyIdFormatInput{} - } - - output = &ModifyIdFormatOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Modifies the ID format for the specified resource on a per-region basis. -// You can specify that resources should receive longer IDs (17-character IDs) -// when they are created. The following resource types support longer IDs: instance -// | reservation | snapshot | volume. -// -// This setting applies to the IAM user who makes the request; it does not apply -// to the entire AWS account. By default, an IAM user defaults to the same settings -// as the root user. If you're using this action as the root user, then these -// settings apply to the entire account, unless an IAM user explicitly overrides -// these settings for themselves. For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// Resources created with longer IDs are visible to all IAM roles and users, -// regardless of these settings and provided that they have permission to use -// the relevant Describe command for the resource type. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyIdFormat for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormat -func (c *EC2) ModifyIdFormat(input *ModifyIdFormatInput) (*ModifyIdFormatOutput, error) { - req, out := c.ModifyIdFormatRequest(input) - return out, req.Send() -} - -// ModifyIdFormatWithContext is the same as ModifyIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyIdFormat 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 *EC2) ModifyIdFormatWithContext(ctx aws.Context, input *ModifyIdFormatInput, opts ...request.Option) (*ModifyIdFormatOutput, error) { - req, out := c.ModifyIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyIdentityIdFormat = "ModifyIdentityIdFormat" - -// ModifyIdentityIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the ModifyIdentityIdFormat operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyIdentityIdFormat for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyIdentityIdFormat method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyIdentityIdFormatRequest method. -// req, resp := client.ModifyIdentityIdFormatRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormat -func (c *EC2) ModifyIdentityIdFormatRequest(input *ModifyIdentityIdFormatInput) (req *request.Request, output *ModifyIdentityIdFormatOutput) { - op := &request.Operation{ - Name: opModifyIdentityIdFormat, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyIdentityIdFormatInput{} - } - - output = &ModifyIdentityIdFormatOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyIdentityIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Modifies the ID format of a resource for a specified IAM user, IAM role, -// or the root user for an account; or all IAM users, IAM roles, and the root -// user for an account. You can specify that resources should receive longer -// IDs (17-character IDs) when they are created. -// -// The following resource types support longer IDs: instance | reservation | -// snapshot | volume. For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// This setting applies to the principal specified in the request; it does not -// apply to the principal that makes the request. -// -// Resources created with longer IDs are visible to all IAM roles and users, -// regardless of these settings and provided that they have permission to use -// the relevant Describe command for the resource type. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyIdentityIdFormat for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormat -func (c *EC2) ModifyIdentityIdFormat(input *ModifyIdentityIdFormatInput) (*ModifyIdentityIdFormatOutput, error) { - req, out := c.ModifyIdentityIdFormatRequest(input) - return out, req.Send() -} - -// ModifyIdentityIdFormatWithContext is the same as ModifyIdentityIdFormat with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyIdentityIdFormat 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 *EC2) ModifyIdentityIdFormatWithContext(ctx aws.Context, input *ModifyIdentityIdFormatInput, opts ...request.Option) (*ModifyIdentityIdFormatOutput, error) { - req, out := c.ModifyIdentityIdFormatRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyImageAttribute = "ModifyImageAttribute" - -// ModifyImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyImageAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyImageAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyImageAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyImageAttributeRequest method. -// req, resp := client.ModifyImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttribute -func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req *request.Request, output *ModifyImageAttributeOutput) { - op := &request.Operation{ - Name: opModifyImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyImageAttributeInput{} - } - - output = &ModifyImageAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified attribute of the specified AMI. You can specify only -// one attribute at a time. -// -// AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace -// product code cannot be made public. -// -// The SriovNetSupport enhanced networking attribute cannot be changed using -// this command. Instead, enable SriovNetSupport on an instance and create an -// AMI from the instance. This will result in an image with SriovNetSupport -// enabled. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyImageAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttribute -func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - return out, req.Send() -} - -// ModifyImageAttributeWithContext is the same as ModifyImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyImageAttribute 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 *EC2) ModifyImageAttributeWithContext(ctx aws.Context, input *ModifyImageAttributeInput, opts ...request.Option) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstanceAttribute = "ModifyInstanceAttribute" - -// ModifyInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyInstanceAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyInstanceAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyInstanceAttributeRequest method. -// req, resp := client.ModifyInstanceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttribute -func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *request.Request, output *ModifyInstanceAttributeOutput) { - op := &request.Operation{ - Name: opModifyInstanceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceAttributeInput{} - } - - output = &ModifyInstanceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyInstanceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified attribute of the specified instance. You can specify -// only one attribute at a time. -// -// To modify some attributes, the instance must be stopped. For more information, -// see Modifying Attributes of a Stopped Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyInstanceAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttribute -func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*ModifyInstanceAttributeOutput, error) { - req, out := c.ModifyInstanceAttributeRequest(input) - return out, req.Send() -} - -// ModifyInstanceAttributeWithContext is the same as ModifyInstanceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceAttribute 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 *EC2) ModifyInstanceAttributeWithContext(ctx aws.Context, input *ModifyInstanceAttributeInput, opts ...request.Option) (*ModifyInstanceAttributeOutput, error) { - req, out := c.ModifyInstanceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstancePlacement = "ModifyInstancePlacement" - -// ModifyInstancePlacementRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstancePlacement operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyInstancePlacement for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyInstancePlacement method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyInstancePlacementRequest method. -// req, resp := client.ModifyInstancePlacementRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacement -func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput) (req *request.Request, output *ModifyInstancePlacementOutput) { - op := &request.Operation{ - Name: opModifyInstancePlacement, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstancePlacementInput{} - } - - output = &ModifyInstancePlacementOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyInstancePlacement API operation for Amazon Elastic Compute Cloud. -// -// Set the instance affinity value for a specific stopped instance and modify -// the instance tenancy setting. -// -// Instance affinity is disabled by default. When instance affinity is host -// and it is not associated with a specific Dedicated Host, the next time it -// is launched it will automatically be associated with the host it lands on. -// This relationship will persist if the instance is stopped/started, or rebooted. -// -// You can modify the host ID associated with a stopped instance. If a stopped -// instance has a new host ID association, the instance will target that host -// when restarted. -// -// You can modify the tenancy of a stopped instance with a tenancy of host or -// dedicated. -// -// Affinity, hostID, and tenancy are not required parameters, but at least one -// of them must be specified in the request. Affinity and tenancy can be modified -// in the same request, but tenancy can only be modified on instances that are -// stopped. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyInstancePlacement for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacement -func (c *EC2) ModifyInstancePlacement(input *ModifyInstancePlacementInput) (*ModifyInstancePlacementOutput, error) { - req, out := c.ModifyInstancePlacementRequest(input) - return out, req.Send() -} - -// ModifyInstancePlacementWithContext is the same as ModifyInstancePlacement with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstancePlacement 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 *EC2) ModifyInstancePlacementWithContext(ctx aws.Context, input *ModifyInstancePlacementInput, opts ...request.Option) (*ModifyInstancePlacementOutput, error) { - req, out := c.ModifyInstancePlacementRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" - -// ModifyNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyNetworkInterfaceAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyNetworkInterfaceAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyNetworkInterfaceAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyNetworkInterfaceAttributeRequest method. -// req, resp := client.ModifyNetworkInterfaceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttribute -func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfaceAttributeInput) (req *request.Request, output *ModifyNetworkInterfaceAttributeOutput) { - op := &request.Operation{ - Name: opModifyNetworkInterfaceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyNetworkInterfaceAttributeInput{} - } - - output = &ModifyNetworkInterfaceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified network interface attribute. You can specify only -// one attribute at a time. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyNetworkInterfaceAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttribute -func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttributeInput) (*ModifyNetworkInterfaceAttributeOutput, error) { - req, out := c.ModifyNetworkInterfaceAttributeRequest(input) - return out, req.Send() -} - -// ModifyNetworkInterfaceAttributeWithContext is the same as ModifyNetworkInterfaceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyNetworkInterfaceAttribute 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 *EC2) ModifyNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ModifyNetworkInterfaceAttributeInput, opts ...request.Option) (*ModifyNetworkInterfaceAttributeOutput, error) { - req, out := c.ModifyNetworkInterfaceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyReservedInstances = "ModifyReservedInstances" - -// ModifyReservedInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyReservedInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyReservedInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyReservedInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyReservedInstancesRequest method. -// req, resp := client.ModifyReservedInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstances -func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput) (req *request.Request, output *ModifyReservedInstancesOutput) { - op := &request.Operation{ - Name: opModifyReservedInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyReservedInstancesInput{} - } - - output = &ModifyReservedInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyReservedInstances API operation for Amazon Elastic Compute Cloud. -// -// Modifies the Availability Zone, instance count, instance type, or network -// platform (EC2-Classic or EC2-VPC) of your Standard Reserved Instances. The -// Reserved Instances to be modified must be identical, except for Availability -// Zone, network platform, and instance type. -// -// For more information, see Modifying Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyReservedInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstances -func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (*ModifyReservedInstancesOutput, error) { - req, out := c.ModifyReservedInstancesRequest(input) - return out, req.Send() -} - -// ModifyReservedInstancesWithContext is the same as ModifyReservedInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyReservedInstances 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 *EC2) ModifyReservedInstancesWithContext(ctx aws.Context, input *ModifyReservedInstancesInput, opts ...request.Option) (*ModifyReservedInstancesOutput, error) { - req, out := c.ModifyReservedInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifySnapshotAttribute = "ModifySnapshotAttribute" - -// ModifySnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifySnapshotAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifySnapshotAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifySnapshotAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifySnapshotAttributeRequest method. -// req, resp := client.ModifySnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttribute -func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput) (req *request.Request, output *ModifySnapshotAttributeOutput) { - op := &request.Operation{ - Name: opModifySnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifySnapshotAttributeInput{} - } - - output = &ModifySnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifySnapshotAttribute API operation for Amazon Elastic Compute Cloud. -// -// Adds or removes permission settings for the specified snapshot. You may add -// or remove specified AWS account IDs from a snapshot's list of create volume -// permissions, but you cannot do both in a single API call. If you need to -// both add and remove account IDs for a snapshot, you must use multiple API -// calls. -// -// Encrypted snapshots and snapshots with AWS Marketplace product codes cannot -// be made public. Snapshots encrypted with your default CMK cannot be shared -// with other accounts. -// -// For more information on modifying snapshot permissions, see Sharing Snapshots -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifySnapshotAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttribute -func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (*ModifySnapshotAttributeOutput, error) { - req, out := c.ModifySnapshotAttributeRequest(input) - return out, req.Send() -} - -// ModifySnapshotAttributeWithContext is the same as ModifySnapshotAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifySnapshotAttribute 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 *EC2) ModifySnapshotAttributeWithContext(ctx aws.Context, input *ModifySnapshotAttributeInput, opts ...request.Option) (*ModifySnapshotAttributeOutput, error) { - req, out := c.ModifySnapshotAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifySpotFleetRequest = "ModifySpotFleetRequest" - -// ModifySpotFleetRequestRequest generates a "aws/request.Request" representing the -// client's request for the ModifySpotFleetRequest operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifySpotFleetRequest for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifySpotFleetRequest method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifySpotFleetRequestRequest method. -// req, resp := client.ModifySpotFleetRequestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequest -func (c *EC2) ModifySpotFleetRequestRequest(input *ModifySpotFleetRequestInput) (req *request.Request, output *ModifySpotFleetRequestOutput) { - op := &request.Operation{ - Name: opModifySpotFleetRequest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifySpotFleetRequestInput{} - } - - output = &ModifySpotFleetRequestOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifySpotFleetRequest API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified Spot fleet request. -// -// While the Spot fleet request is being modified, it is in the modifying state. -// -// To scale up your Spot fleet, increase its target capacity. The Spot fleet -// launches the additional Spot instances according to the allocation strategy -// for the Spot fleet request. If the allocation strategy is lowestPrice, the -// Spot fleet launches instances using the Spot pool with the lowest price. -// If the allocation strategy is diversified, the Spot fleet distributes the -// instances across the Spot pools. -// -// To scale down your Spot fleet, decrease its target capacity. First, the Spot -// fleet cancels any open bids that exceed the new target capacity. You can -// request that the Spot fleet terminate Spot instances until the size of the -// fleet no longer exceeds the new target capacity. If the allocation strategy -// is lowestPrice, the Spot fleet terminates the instances with the highest -// price per unit. If the allocation strategy is diversified, the Spot fleet -// terminates instances across the Spot pools. Alternatively, you can request -// that the Spot fleet keep the fleet at its current size, but not replace any -// Spot instances that are interrupted or that you terminate manually. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifySpotFleetRequest for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequest -func (c *EC2) ModifySpotFleetRequest(input *ModifySpotFleetRequestInput) (*ModifySpotFleetRequestOutput, error) { - req, out := c.ModifySpotFleetRequestRequest(input) - return out, req.Send() -} - -// ModifySpotFleetRequestWithContext is the same as ModifySpotFleetRequest with the addition of -// the ability to pass a context and additional request options. -// -// See ModifySpotFleetRequest 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 *EC2) ModifySpotFleetRequestWithContext(ctx aws.Context, input *ModifySpotFleetRequestInput, opts ...request.Option) (*ModifySpotFleetRequestOutput, error) { - req, out := c.ModifySpotFleetRequestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifySubnetAttribute = "ModifySubnetAttribute" - -// ModifySubnetAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifySubnetAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifySubnetAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifySubnetAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifySubnetAttributeRequest method. -// req, resp := client.ModifySubnetAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttribute -func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (req *request.Request, output *ModifySubnetAttributeOutput) { - op := &request.Operation{ - Name: opModifySubnetAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifySubnetAttributeInput{} - } - - output = &ModifySubnetAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifySubnetAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies a subnet attribute. You can only modify one attribute at a time. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifySubnetAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttribute -func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifySubnetAttributeOutput, error) { - req, out := c.ModifySubnetAttributeRequest(input) - return out, req.Send() -} - -// ModifySubnetAttributeWithContext is the same as ModifySubnetAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifySubnetAttribute 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 *EC2) ModifySubnetAttributeWithContext(ctx aws.Context, input *ModifySubnetAttributeInput, opts ...request.Option) (*ModifySubnetAttributeOutput, error) { - req, out := c.ModifySubnetAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVolume = "ModifyVolume" - -// ModifyVolumeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVolume operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyVolume for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyVolume method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyVolumeRequest method. -// req, resp := client.ModifyVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume -func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Request, output *ModifyVolumeOutput) { - op := &request.Operation{ - Name: opModifyVolume, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVolumeInput{} - } - - output = &ModifyVolumeOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVolume API operation for Amazon Elastic Compute Cloud. -// -// You can modify several parameters of an existing EBS volume, including volume -// size, volume type, and IOPS capacity. If your EBS volume is attached to a -// current-generation EC2 instance type, you may be able to apply these changes -// without stopping the instance or detaching the volume from it. For more information -// about modifying an EBS volume running Linux, see Modifying the Size, IOPS, -// or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). -// For more information about modifying an EBS volume running Windows, see Modifying -// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). -// -// When you complete a resize operation on your volume, you need to extend the -// volume's file-system size to take advantage of the new storage capacity. -// For information about extending a Linux file system, see Extending a Linux -// File System (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux). -// For information about extending a Windows file system, see Extending a Windows -// File System (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows). -// -// You can use CloudWatch Events to check the status of a modification to an -// EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch -// Events User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). -// You can also track the status of a modification using the DescribeVolumesModifications -// API. For information about tracking status changes using either method, see -// Monitoring Volume Modifications (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). -// -// With previous-generation instance types, resizing an EBS volume may require -// detaching and reattaching the volume or stopping and restarting the instance. -// For more information about modifying an EBS volume running Linux, see Modifying -// the Size, IOPS, or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). -// For more information about modifying an EBS volume running Windows, see Modifying -// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). -// -// If you reach the maximum volume modification rate per volume limit, you will -// need to wait at least six hours before applying further modifications to -// the affected EBS volume. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyVolume for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume -func (c *EC2) ModifyVolume(input *ModifyVolumeInput) (*ModifyVolumeOutput, error) { - req, out := c.ModifyVolumeRequest(input) - return out, req.Send() -} - -// ModifyVolumeWithContext is the same as ModifyVolume with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVolume 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 *EC2) ModifyVolumeWithContext(ctx aws.Context, input *ModifyVolumeInput, opts ...request.Option) (*ModifyVolumeOutput, error) { - req, out := c.ModifyVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVolumeAttribute = "ModifyVolumeAttribute" - -// ModifyVolumeAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVolumeAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyVolumeAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyVolumeAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyVolumeAttributeRequest method. -// req, resp := client.ModifyVolumeAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttribute -func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *request.Request, output *ModifyVolumeAttributeOutput) { - op := &request.Operation{ - Name: opModifyVolumeAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVolumeAttributeInput{} - } - - output = &ModifyVolumeAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyVolumeAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies a volume attribute. -// -// By default, all I/O operations for the volume are suspended when the data -// on the volume is determined to be potentially inconsistent, to prevent undetectable, -// latent data corruption. The I/O access to the volume can be resumed by first -// enabling I/O access and then checking the data consistency on your volume. -// -// You can change the default behavior to resume I/O operations. We recommend -// that you change this only for boot volumes or for volumes that are stateless -// or disposable. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyVolumeAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttribute -func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyVolumeAttributeOutput, error) { - req, out := c.ModifyVolumeAttributeRequest(input) - return out, req.Send() -} - -// ModifyVolumeAttributeWithContext is the same as ModifyVolumeAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVolumeAttribute 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 *EC2) ModifyVolumeAttributeWithContext(ctx aws.Context, input *ModifyVolumeAttributeInput, opts ...request.Option) (*ModifyVolumeAttributeOutput, error) { - req, out := c.ModifyVolumeAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcAttribute = "ModifyVpcAttribute" - -// ModifyVpcAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyVpcAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyVpcAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyVpcAttributeRequest method. -// req, resp := client.ModifyVpcAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttribute -func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) (req *request.Request, output *ModifyVpcAttributeOutput) { - op := &request.Operation{ - Name: opModifyVpcAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcAttributeInput{} - } - - output = &ModifyVpcAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ModifyVpcAttribute API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified attribute of the specified VPC. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyVpcAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttribute -func (c *EC2) ModifyVpcAttribute(input *ModifyVpcAttributeInput) (*ModifyVpcAttributeOutput, error) { - req, out := c.ModifyVpcAttributeRequest(input) - return out, req.Send() -} - -// ModifyVpcAttributeWithContext is the same as ModifyVpcAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcAttribute 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 *EC2) ModifyVpcAttributeWithContext(ctx aws.Context, input *ModifyVpcAttributeInput, opts ...request.Option) (*ModifyVpcAttributeOutput, error) { - req, out := c.ModifyVpcAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcEndpoint = "ModifyVpcEndpoint" - -// ModifyVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpoint operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyVpcEndpoint for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyVpcEndpoint method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyVpcEndpointRequest method. -// req, resp := client.ModifyVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpoint -func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *request.Request, output *ModifyVpcEndpointOutput) { - op := &request.Operation{ - Name: opModifyVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcEndpointInput{} - } - - output = &ModifyVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcEndpoint API operation for Amazon Elastic Compute Cloud. -// -// Modifies attributes of a specified VPC endpoint. You can modify the policy -// associated with the endpoint, and you can add and remove route tables associated -// with the endpoint. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyVpcEndpoint for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpoint -func (c *EC2) ModifyVpcEndpoint(input *ModifyVpcEndpointInput) (*ModifyVpcEndpointOutput, error) { - req, out := c.ModifyVpcEndpointRequest(input) - return out, req.Send() -} - -// ModifyVpcEndpointWithContext is the same as ModifyVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcEndpoint 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 *EC2) ModifyVpcEndpointWithContext(ctx aws.Context, input *ModifyVpcEndpointInput, opts ...request.Option) (*ModifyVpcEndpointOutput, error) { - req, out := c.ModifyVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions" - -// ModifyVpcPeeringConnectionOptionsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcPeeringConnectionOptions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ModifyVpcPeeringConnectionOptions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ModifyVpcPeeringConnectionOptions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ModifyVpcPeeringConnectionOptionsRequest method. -// req, resp := client.ModifyVpcPeeringConnectionOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptions -func (c *EC2) ModifyVpcPeeringConnectionOptionsRequest(input *ModifyVpcPeeringConnectionOptionsInput) (req *request.Request, output *ModifyVpcPeeringConnectionOptionsOutput) { - op := &request.Operation{ - Name: opModifyVpcPeeringConnectionOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyVpcPeeringConnectionOptionsInput{} - } - - output = &ModifyVpcPeeringConnectionOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ModifyVpcPeeringConnectionOptions API operation for Amazon Elastic Compute Cloud. -// -// Modifies the VPC peering connection options on one side of a VPC peering -// connection. You can do the following: -// -// * Enable/disable communication over the peering connection between an -// EC2-Classic instance that's linked to your VPC (using ClassicLink) and -// instances in the peer VPC. -// -// * Enable/disable communication over the peering connection between instances -// in your VPC and an EC2-Classic instance that's linked to the peer VPC. -// -// * Enable/disable a local VPC to resolve public DNS hostnames to private -// IP addresses when queried from instances in the peer VPC. -// -// If the peered VPCs are in different accounts, each owner must initiate a -// separate request to modify the peering connection options, depending on whether -// their VPC was the requester or accepter for the VPC peering connection. If -// the peered VPCs are in the same account, you can modify the requester and -// accepter options in the same request. To confirm which VPC is the accepter -// and requester for a VPC peering connection, use the DescribeVpcPeeringConnections -// command. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ModifyVpcPeeringConnectionOptions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptions -func (c *EC2) ModifyVpcPeeringConnectionOptions(input *ModifyVpcPeeringConnectionOptionsInput) (*ModifyVpcPeeringConnectionOptionsOutput, error) { - req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) - return out, req.Send() -} - -// ModifyVpcPeeringConnectionOptionsWithContext is the same as ModifyVpcPeeringConnectionOptions with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyVpcPeeringConnectionOptions 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 *EC2) ModifyVpcPeeringConnectionOptionsWithContext(ctx aws.Context, input *ModifyVpcPeeringConnectionOptionsInput, opts ...request.Option) (*ModifyVpcPeeringConnectionOptionsOutput, error) { - req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opMonitorInstances = "MonitorInstances" - -// MonitorInstancesRequest generates a "aws/request.Request" representing the -// client's request for the MonitorInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See MonitorInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the MonitorInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the MonitorInstancesRequest method. -// req, resp := client.MonitorInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstances -func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *request.Request, output *MonitorInstancesOutput) { - op := &request.Operation{ - Name: opMonitorInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &MonitorInstancesInput{} - } - - output = &MonitorInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// MonitorInstances API operation for Amazon Elastic Compute Cloud. -// -// Enables detailed monitoring for a running instance. Otherwise, basic monitoring -// is enabled. For more information, see Monitoring Your Instances and Volumes -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// To disable detailed monitoring, see . -// -// 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 Amazon Elastic Compute Cloud's -// API operation MonitorInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstances -func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (*MonitorInstancesOutput, error) { - req, out := c.MonitorInstancesRequest(input) - return out, req.Send() -} - -// MonitorInstancesWithContext is the same as MonitorInstances with the addition of -// the ability to pass a context and additional request options. -// -// See MonitorInstances 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 *EC2) MonitorInstancesWithContext(ctx aws.Context, input *MonitorInstancesInput, opts ...request.Option) (*MonitorInstancesOutput, error) { - req, out := c.MonitorInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opMoveAddressToVpc = "MoveAddressToVpc" - -// MoveAddressToVpcRequest generates a "aws/request.Request" representing the -// client's request for the MoveAddressToVpc operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See MoveAddressToVpc for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the MoveAddressToVpc method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the MoveAddressToVpcRequest method. -// req, resp := client.MoveAddressToVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpc -func (c *EC2) MoveAddressToVpcRequest(input *MoveAddressToVpcInput) (req *request.Request, output *MoveAddressToVpcOutput) { - op := &request.Operation{ - Name: opMoveAddressToVpc, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &MoveAddressToVpcInput{} - } - - output = &MoveAddressToVpcOutput{} - req = c.newRequest(op, input, output) - return -} - -// MoveAddressToVpc API operation for Amazon Elastic Compute Cloud. -// -// Moves an Elastic IP address from the EC2-Classic platform to the EC2-VPC -// platform. The Elastic IP address must be allocated to your account for more -// than 24 hours, and it must not be associated with an instance. After the -// Elastic IP address is moved, it is no longer available for use in the EC2-Classic -// platform, unless you move it back using the RestoreAddressToClassic request. -// You cannot move an Elastic IP address that was originally allocated for use -// in the EC2-VPC platform to the EC2-Classic platform. -// -// 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 Amazon Elastic Compute Cloud's -// API operation MoveAddressToVpc for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpc -func (c *EC2) MoveAddressToVpc(input *MoveAddressToVpcInput) (*MoveAddressToVpcOutput, error) { - req, out := c.MoveAddressToVpcRequest(input) - return out, req.Send() -} - -// MoveAddressToVpcWithContext is the same as MoveAddressToVpc with the addition of -// the ability to pass a context and additional request options. -// -// See MoveAddressToVpc 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 *EC2) MoveAddressToVpcWithContext(ctx aws.Context, input *MoveAddressToVpcInput, opts ...request.Option) (*MoveAddressToVpcOutput, error) { - req, out := c.MoveAddressToVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPurchaseHostReservation = "PurchaseHostReservation" - -// PurchaseHostReservationRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseHostReservation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurchaseHostReservation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurchaseHostReservation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurchaseHostReservationRequest method. -// req, resp := client.PurchaseHostReservationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservation -func (c *EC2) PurchaseHostReservationRequest(input *PurchaseHostReservationInput) (req *request.Request, output *PurchaseHostReservationOutput) { - op := &request.Operation{ - Name: opPurchaseHostReservation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseHostReservationInput{} - } - - output = &PurchaseHostReservationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseHostReservation API operation for Amazon Elastic Compute Cloud. -// -// Purchase a reservation with configurations that match those of your Dedicated -// Host. You must have active Dedicated Hosts in your account before you purchase -// a reservation. This action results in the specified reservation being purchased -// and charged to your account. -// -// 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 Amazon Elastic Compute Cloud's -// API operation PurchaseHostReservation for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservation -func (c *EC2) PurchaseHostReservation(input *PurchaseHostReservationInput) (*PurchaseHostReservationOutput, error) { - req, out := c.PurchaseHostReservationRequest(input) - return out, req.Send() -} - -// PurchaseHostReservationWithContext is the same as PurchaseHostReservation with the addition of -// the ability to pass a context and additional request options. -// -// See PurchaseHostReservation 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 *EC2) PurchaseHostReservationWithContext(ctx aws.Context, input *PurchaseHostReservationInput, opts ...request.Option) (*PurchaseHostReservationOutput, error) { - req, out := c.PurchaseHostReservationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" - -// PurchaseReservedInstancesOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseReservedInstancesOffering operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurchaseReservedInstancesOffering for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurchaseReservedInstancesOffering method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurchaseReservedInstancesOfferingRequest method. -// req, resp := client.PurchaseReservedInstancesOfferingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOffering -func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *request.Request, output *PurchaseReservedInstancesOfferingOutput) { - op := &request.Operation{ - Name: opPurchaseReservedInstancesOffering, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseReservedInstancesOfferingInput{} - } - - output = &PurchaseReservedInstancesOfferingOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseReservedInstancesOffering API operation for Amazon Elastic Compute Cloud. -// -// Purchases a Reserved Instance for use with your account. With Reserved Instances, -// you pay a lower hourly rate compared to On-Demand instance pricing. -// -// Use DescribeReservedInstancesOfferings to get a list of Reserved Instance -// offerings that match your specifications. After you've purchased a Reserved -// Instance, you can check for your new Reserved Instance with DescribeReservedInstances. -// -// For more information, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) -// and Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation PurchaseReservedInstancesOffering for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOffering -func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstancesOfferingInput) (*PurchaseReservedInstancesOfferingOutput, error) { - req, out := c.PurchaseReservedInstancesOfferingRequest(input) - return out, req.Send() -} - -// PurchaseReservedInstancesOfferingWithContext is the same as PurchaseReservedInstancesOffering with the addition of -// the ability to pass a context and additional request options. -// -// See PurchaseReservedInstancesOffering 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 *EC2) PurchaseReservedInstancesOfferingWithContext(ctx aws.Context, input *PurchaseReservedInstancesOfferingInput, opts ...request.Option) (*PurchaseReservedInstancesOfferingOutput, error) { - req, out := c.PurchaseReservedInstancesOfferingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPurchaseScheduledInstances = "PurchaseScheduledInstances" - -// PurchaseScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseScheduledInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurchaseScheduledInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurchaseScheduledInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurchaseScheduledInstancesRequest method. -// req, resp := client.PurchaseScheduledInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstances -func (c *EC2) PurchaseScheduledInstancesRequest(input *PurchaseScheduledInstancesInput) (req *request.Request, output *PurchaseScheduledInstancesOutput) { - op := &request.Operation{ - Name: opPurchaseScheduledInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurchaseScheduledInstancesInput{} - } - - output = &PurchaseScheduledInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// PurchaseScheduledInstances API operation for Amazon Elastic Compute Cloud. -// -// Purchases one or more Scheduled Instances with the specified schedule. -// -// Scheduled Instances enable you to purchase Amazon EC2 compute capacity by -// the hour for a one-year term. Before you can purchase a Scheduled Instance, -// you must call DescribeScheduledInstanceAvailability to check for available -// schedules and obtain a purchase token. After you purchase a Scheduled Instance, -// you must call RunScheduledInstances during each scheduled time period. -// -// After you purchase a Scheduled Instance, you can't cancel, modify, or resell -// your purchase. -// -// 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 Amazon Elastic Compute Cloud's -// API operation PurchaseScheduledInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstances -func (c *EC2) PurchaseScheduledInstances(input *PurchaseScheduledInstancesInput) (*PurchaseScheduledInstancesOutput, error) { - req, out := c.PurchaseScheduledInstancesRequest(input) - return out, req.Send() -} - -// PurchaseScheduledInstancesWithContext is the same as PurchaseScheduledInstances with the addition of -// the ability to pass a context and additional request options. -// -// See PurchaseScheduledInstances 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 *EC2) PurchaseScheduledInstancesWithContext(ctx aws.Context, input *PurchaseScheduledInstancesInput, opts ...request.Option) (*PurchaseScheduledInstancesOutput, error) { - req, out := c.PurchaseScheduledInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRebootInstances = "RebootInstances" - -// RebootInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RebootInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RebootInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RebootInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RebootInstancesRequest method. -// req, resp := client.RebootInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstances -func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request.Request, output *RebootInstancesOutput) { - op := &request.Operation{ - Name: opRebootInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RebootInstancesInput{} - } - - output = &RebootInstancesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RebootInstances API operation for Amazon Elastic Compute Cloud. -// -// Requests a reboot of one or more instances. This operation is asynchronous; -// it only queues a request to reboot the specified instances. The operation -// succeeds if the instances are valid and belong to you. Requests to reboot -// terminated instances are ignored. -// -// If an instance does not cleanly shut down within four minutes, Amazon EC2 -// performs a hard reboot. -// -// For more information about troubleshooting, see Getting Console Output and -// Rebooting Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RebootInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstances -func (c *EC2) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutput, error) { - req, out := c.RebootInstancesRequest(input) - return out, req.Send() -} - -// RebootInstancesWithContext is the same as RebootInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RebootInstances 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 *EC2) RebootInstancesWithContext(ctx aws.Context, input *RebootInstancesInput, opts ...request.Option) (*RebootInstancesOutput, error) { - req, out := c.RebootInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterImage = "RegisterImage" - -// RegisterImageRequest generates a "aws/request.Request" representing the -// client's request for the RegisterImage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RegisterImage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RegisterImage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RegisterImageRequest method. -// req, resp := client.RegisterImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImage -func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Request, output *RegisterImageOutput) { - op := &request.Operation{ - Name: opRegisterImage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterImageInput{} - } - - output = &RegisterImageOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterImage API operation for Amazon Elastic Compute Cloud. -// -// Registers an AMI. When you're creating an AMI, this is the final step you -// must complete before you can launch an instance from the AMI. For more information -// about creating AMIs, see Creating Your Own AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For Amazon EBS-backed instances, CreateImage creates and registers the AMI -// in a single request, so you don't have to register the AMI yourself. -// -// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from -// a snapshot of a root device volume. You specify the snapshot using the block -// device mapping. For more information, see Launching a Linux Instance from -// a Backup (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// You can't register an image where a secondary (non-root) snapshot has AWS -// Marketplace product codes. -// -// Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE -// Linux Enterprise Server (SLES), use the EC2 billing product code associated -// with an AMI to verify the subscription status for package updates. Creating -// an AMI from an EBS snapshot does not maintain this billing code, and subsequent -// instances launched from such an AMI will not be able to connect to package -// update infrastructure. To create an AMI that must retain billing codes, see -// CreateImage. -// -// If needed, you can deregister an AMI at any time. Any modifications you make -// to an AMI backed by an instance store volume invalidates its registration. -// If you make changes to an image, deregister the previous image and register -// the new image. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RegisterImage for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImage -func (c *EC2) RegisterImage(input *RegisterImageInput) (*RegisterImageOutput, error) { - req, out := c.RegisterImageRequest(input) - return out, req.Send() -} - -// RegisterImageWithContext is the same as RegisterImage with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterImage 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 *EC2) RegisterImageWithContext(ctx aws.Context, input *RegisterImageInput, opts ...request.Option) (*RegisterImageOutput, error) { - req, out := c.RegisterImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" - -// RejectVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the RejectVpcPeeringConnection operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RejectVpcPeeringConnection for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RejectVpcPeeringConnection method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RejectVpcPeeringConnectionRequest method. -// req, resp := client.RejectVpcPeeringConnectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnection -func (c *EC2) RejectVpcPeeringConnectionRequest(input *RejectVpcPeeringConnectionInput) (req *request.Request, output *RejectVpcPeeringConnectionOutput) { - op := &request.Operation{ - Name: opRejectVpcPeeringConnection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RejectVpcPeeringConnectionInput{} - } - - output = &RejectVpcPeeringConnectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// RejectVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. -// -// Rejects a VPC peering connection request. The VPC peering connection must -// be in the pending-acceptance state. Use the DescribeVpcPeeringConnections -// request to view your outstanding VPC peering connection requests. To delete -// an active VPC peering connection, or to delete a VPC peering connection request -// that you initiated, use DeleteVpcPeeringConnection. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RejectVpcPeeringConnection for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnection -func (c *EC2) RejectVpcPeeringConnection(input *RejectVpcPeeringConnectionInput) (*RejectVpcPeeringConnectionOutput, error) { - req, out := c.RejectVpcPeeringConnectionRequest(input) - return out, req.Send() -} - -// RejectVpcPeeringConnectionWithContext is the same as RejectVpcPeeringConnection with the addition of -// the ability to pass a context and additional request options. -// -// See RejectVpcPeeringConnection 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 *EC2) RejectVpcPeeringConnectionWithContext(ctx aws.Context, input *RejectVpcPeeringConnectionInput, opts ...request.Option) (*RejectVpcPeeringConnectionOutput, error) { - req, out := c.RejectVpcPeeringConnectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReleaseAddress = "ReleaseAddress" - -// ReleaseAddressRequest generates a "aws/request.Request" representing the -// client's request for the ReleaseAddress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReleaseAddress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReleaseAddress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReleaseAddressRequest method. -// req, resp := client.ReleaseAddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddress -func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *request.Request, output *ReleaseAddressOutput) { - op := &request.Operation{ - Name: opReleaseAddress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReleaseAddressInput{} - } - - output = &ReleaseAddressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReleaseAddress API operation for Amazon Elastic Compute Cloud. -// -// Releases the specified Elastic IP address. -// -// After releasing an Elastic IP address, it is released to the IP address pool -// and might be unavailable to you. Be sure to update your DNS records and any -// servers or devices that communicate with the address. If you attempt to release -// an Elastic IP address that you already released, you'll get an AuthFailure -// error if the address is already allocated to another AWS account. -// -// [EC2-Classic, default VPC] Releasing an Elastic IP address automatically -// disassociates it from any instance that it's associated with. To disassociate -// an Elastic IP address without releasing it, use DisassociateAddress. -// -// [Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic -// IP address before you try to release it. Otherwise, Amazon EC2 returns an -// error (InvalidIPAddress.InUse). -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReleaseAddress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddress -func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, error) { - req, out := c.ReleaseAddressRequest(input) - return out, req.Send() -} - -// ReleaseAddressWithContext is the same as ReleaseAddress with the addition of -// the ability to pass a context and additional request options. -// -// See ReleaseAddress 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 *EC2) ReleaseAddressWithContext(ctx aws.Context, input *ReleaseAddressInput, opts ...request.Option) (*ReleaseAddressOutput, error) { - req, out := c.ReleaseAddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReleaseHosts = "ReleaseHosts" - -// ReleaseHostsRequest generates a "aws/request.Request" representing the -// client's request for the ReleaseHosts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReleaseHosts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReleaseHosts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReleaseHostsRequest method. -// req, resp := client.ReleaseHostsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHosts -func (c *EC2) ReleaseHostsRequest(input *ReleaseHostsInput) (req *request.Request, output *ReleaseHostsOutput) { - op := &request.Operation{ - Name: opReleaseHosts, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReleaseHostsInput{} - } - - output = &ReleaseHostsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReleaseHosts API operation for Amazon Elastic Compute Cloud. -// -// When you no longer want to use an On-Demand Dedicated Host it can be released. -// On-Demand billing is stopped and the host goes into released state. The host -// ID of Dedicated Hosts that have been released can no longer be specified -// in another request, e.g., ModifyHosts. You must stop or terminate all instances -// on a host before it can be released. -// -// When Dedicated Hosts are released, it make take some time for them to stop -// counting toward your limit and you may receive capacity errors when trying -// to allocate new Dedicated hosts. Try waiting a few minutes, and then try -// again. -// -// Released hosts will still appear in a DescribeHosts response. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReleaseHosts for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHosts -func (c *EC2) ReleaseHosts(input *ReleaseHostsInput) (*ReleaseHostsOutput, error) { - req, out := c.ReleaseHostsRequest(input) - return out, req.Send() -} - -// ReleaseHostsWithContext is the same as ReleaseHosts with the addition of -// the ability to pass a context and additional request options. -// -// See ReleaseHosts 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 *EC2) ReleaseHostsWithContext(ctx aws.Context, input *ReleaseHostsInput, opts ...request.Option) (*ReleaseHostsOutput, error) { - req, out := c.ReleaseHostsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssociation" - -// ReplaceIamInstanceProfileAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceIamInstanceProfileAssociation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReplaceIamInstanceProfileAssociation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReplaceIamInstanceProfileAssociation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReplaceIamInstanceProfileAssociationRequest method. -// req, resp := client.ReplaceIamInstanceProfileAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation -func (c *EC2) ReplaceIamInstanceProfileAssociationRequest(input *ReplaceIamInstanceProfileAssociationInput) (req *request.Request, output *ReplaceIamInstanceProfileAssociationOutput) { - op := &request.Operation{ - Name: opReplaceIamInstanceProfileAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceIamInstanceProfileAssociationInput{} - } - - output = &ReplaceIamInstanceProfileAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReplaceIamInstanceProfileAssociation API operation for Amazon Elastic Compute Cloud. -// -// Replaces an IAM instance profile for the specified running instance. You -// can use this action to change the IAM instance profile that's associated -// with an instance without having to disassociate the existing IAM instance -// profile first. -// -// Use DescribeIamInstanceProfileAssociations to get the association ID. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReplaceIamInstanceProfileAssociation for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation -func (c *EC2) ReplaceIamInstanceProfileAssociation(input *ReplaceIamInstanceProfileAssociationInput) (*ReplaceIamInstanceProfileAssociationOutput, error) { - req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) - return out, req.Send() -} - -// ReplaceIamInstanceProfileAssociationWithContext is the same as ReplaceIamInstanceProfileAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceIamInstanceProfileAssociation 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 *EC2) ReplaceIamInstanceProfileAssociationWithContext(ctx aws.Context, input *ReplaceIamInstanceProfileAssociationInput, opts ...request.Option) (*ReplaceIamInstanceProfileAssociationOutput, error) { - req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" - -// ReplaceNetworkAclAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceNetworkAclAssociation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReplaceNetworkAclAssociation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReplaceNetworkAclAssociation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReplaceNetworkAclAssociationRequest method. -// req, resp := client.ReplaceNetworkAclAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociation -func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssociationInput) (req *request.Request, output *ReplaceNetworkAclAssociationOutput) { - op := &request.Operation{ - Name: opReplaceNetworkAclAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceNetworkAclAssociationInput{} - } - - output = &ReplaceNetworkAclAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReplaceNetworkAclAssociation API operation for Amazon Elastic Compute Cloud. -// -// Changes which network ACL a subnet is associated with. By default when you -// create a subnet, it's automatically associated with the default network ACL. -// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReplaceNetworkAclAssociation for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociation -func (c *EC2) ReplaceNetworkAclAssociation(input *ReplaceNetworkAclAssociationInput) (*ReplaceNetworkAclAssociationOutput, error) { - req, out := c.ReplaceNetworkAclAssociationRequest(input) - return out, req.Send() -} - -// ReplaceNetworkAclAssociationWithContext is the same as ReplaceNetworkAclAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceNetworkAclAssociation 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 *EC2) ReplaceNetworkAclAssociationWithContext(ctx aws.Context, input *ReplaceNetworkAclAssociationInput, opts ...request.Option) (*ReplaceNetworkAclAssociationOutput, error) { - req, out := c.ReplaceNetworkAclAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" - -// ReplaceNetworkAclEntryRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceNetworkAclEntry operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReplaceNetworkAclEntry for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReplaceNetworkAclEntry method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReplaceNetworkAclEntryRequest method. -// req, resp := client.ReplaceNetworkAclEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntry -func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput) (req *request.Request, output *ReplaceNetworkAclEntryOutput) { - op := &request.Operation{ - Name: opReplaceNetworkAclEntry, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceNetworkAclEntryInput{} - } - - output = &ReplaceNetworkAclEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReplaceNetworkAclEntry API operation for Amazon Elastic Compute Cloud. -// -// Replaces an entry (rule) in a network ACL. For more information about network -// ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReplaceNetworkAclEntry for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntry -func (c *EC2) ReplaceNetworkAclEntry(input *ReplaceNetworkAclEntryInput) (*ReplaceNetworkAclEntryOutput, error) { - req, out := c.ReplaceNetworkAclEntryRequest(input) - return out, req.Send() -} - -// ReplaceNetworkAclEntryWithContext is the same as ReplaceNetworkAclEntry with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceNetworkAclEntry 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 *EC2) ReplaceNetworkAclEntryWithContext(ctx aws.Context, input *ReplaceNetworkAclEntryInput, opts ...request.Option) (*ReplaceNetworkAclEntryOutput, error) { - req, out := c.ReplaceNetworkAclEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceRoute = "ReplaceRoute" - -// ReplaceRouteRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceRoute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReplaceRoute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReplaceRoute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReplaceRouteRequest method. -// req, resp := client.ReplaceRouteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRoute -func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *request.Request, output *ReplaceRouteOutput) { - op := &request.Operation{ - Name: opReplaceRoute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceRouteInput{} - } - - output = &ReplaceRouteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReplaceRoute API operation for Amazon Elastic Compute Cloud. -// -// Replaces an existing route within a route table in a VPC. You must provide -// only one of the following: Internet gateway or virtual private gateway, NAT -// instance, NAT gateway, VPC peering connection, network interface, or egress-only -// Internet gateway. -// -// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReplaceRoute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRoute -func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (*ReplaceRouteOutput, error) { - req, out := c.ReplaceRouteRequest(input) - return out, req.Send() -} - -// ReplaceRouteWithContext is the same as ReplaceRoute with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceRoute 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 *EC2) ReplaceRouteWithContext(ctx aws.Context, input *ReplaceRouteInput, opts ...request.Option) (*ReplaceRouteOutput, error) { - req, out := c.ReplaceRouteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" - -// ReplaceRouteTableAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceRouteTableAssociation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReplaceRouteTableAssociation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReplaceRouteTableAssociation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReplaceRouteTableAssociationRequest method. -// req, resp := client.ReplaceRouteTableAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociation -func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssociationInput) (req *request.Request, output *ReplaceRouteTableAssociationOutput) { - op := &request.Operation{ - Name: opReplaceRouteTableAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceRouteTableAssociationInput{} - } - - output = &ReplaceRouteTableAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReplaceRouteTableAssociation API operation for Amazon Elastic Compute Cloud. -// -// Changes the route table associated with a given subnet in a VPC. After the -// operation completes, the subnet uses the routes in the new route table it's -// associated with. For more information about route tables, see Route Tables -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// You can also use ReplaceRouteTableAssociation to change which table is the -// main route table in the VPC. You just specify the main route table's association -// ID and the route table to be the new main route table. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReplaceRouteTableAssociation for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociation -func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationInput) (*ReplaceRouteTableAssociationOutput, error) { - req, out := c.ReplaceRouteTableAssociationRequest(input) - return out, req.Send() -} - -// ReplaceRouteTableAssociationWithContext is the same as ReplaceRouteTableAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceRouteTableAssociation 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 *EC2) ReplaceRouteTableAssociationWithContext(ctx aws.Context, input *ReplaceRouteTableAssociationInput, opts ...request.Option) (*ReplaceRouteTableAssociationOutput, error) { - req, out := c.ReplaceRouteTableAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReportInstanceStatus = "ReportInstanceStatus" - -// ReportInstanceStatusRequest generates a "aws/request.Request" representing the -// client's request for the ReportInstanceStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReportInstanceStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReportInstanceStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReportInstanceStatusRequest method. -// req, resp := client.ReportInstanceStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatus -func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req *request.Request, output *ReportInstanceStatusOutput) { - op := &request.Operation{ - Name: opReportInstanceStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReportInstanceStatusInput{} - } - - output = &ReportInstanceStatusOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ReportInstanceStatus API operation for Amazon Elastic Compute Cloud. -// -// Submits feedback about the status of an instance. The instance must be in -// the running state. If your experience with the instance differs from the -// instance status returned by DescribeInstanceStatus, use ReportInstanceStatus -// to report your experience with the instance. Amazon EC2 collects this information -// to improve the accuracy of status checks. -// -// Use of this action does not change the value returned by DescribeInstanceStatus. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ReportInstanceStatus for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatus -func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (*ReportInstanceStatusOutput, error) { - req, out := c.ReportInstanceStatusRequest(input) - return out, req.Send() -} - -// ReportInstanceStatusWithContext is the same as ReportInstanceStatus with the addition of -// the ability to pass a context and additional request options. -// -// See ReportInstanceStatus 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 *EC2) ReportInstanceStatusWithContext(ctx aws.Context, input *ReportInstanceStatusInput, opts ...request.Option) (*ReportInstanceStatusOutput, error) { - req, out := c.ReportInstanceStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRequestSpotFleet = "RequestSpotFleet" - -// RequestSpotFleetRequest generates a "aws/request.Request" representing the -// client's request for the RequestSpotFleet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RequestSpotFleet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RequestSpotFleet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RequestSpotFleetRequest method. -// req, resp := client.RequestSpotFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleet -func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *request.Request, output *RequestSpotFleetOutput) { - op := &request.Operation{ - Name: opRequestSpotFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RequestSpotFleetInput{} - } - - output = &RequestSpotFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// RequestSpotFleet API operation for Amazon Elastic Compute Cloud. -// -// Creates a Spot fleet request. -// -// You can submit a single request that includes multiple launch specifications -// that vary by instance type, AMI, Availability Zone, or subnet. -// -// By default, the Spot fleet requests Spot instances in the Spot pool where -// the price per unit is the lowest. Each launch specification can include its -// own instance weighting that reflects the value of the instance type to your -// application workload. -// -// Alternatively, you can specify that the Spot fleet distribute the target -// capacity across the Spot pools included in its launch specifications. By -// ensuring that the Spot instances in your Spot fleet are in different Spot -// pools, you can improve the availability of your fleet. -// -// For more information, see Spot Fleet Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RequestSpotFleet for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleet -func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetOutput, error) { - req, out := c.RequestSpotFleetRequest(input) - return out, req.Send() -} - -// RequestSpotFleetWithContext is the same as RequestSpotFleet with the addition of -// the ability to pass a context and additional request options. -// -// See RequestSpotFleet 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 *EC2) RequestSpotFleetWithContext(ctx aws.Context, input *RequestSpotFleetInput, opts ...request.Option) (*RequestSpotFleetOutput, error) { - req, out := c.RequestSpotFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRequestSpotInstances = "RequestSpotInstances" - -// RequestSpotInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RequestSpotInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RequestSpotInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RequestSpotInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RequestSpotInstancesRequest method. -// req, resp := client.RequestSpotInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstances -func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *request.Request, output *RequestSpotInstancesOutput) { - op := &request.Operation{ - Name: opRequestSpotInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RequestSpotInstancesInput{} - } - - output = &RequestSpotInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// RequestSpotInstances API operation for Amazon Elastic Compute Cloud. -// -// Creates a Spot instance request. Spot instances are instances that Amazon -// EC2 launches when the bid price that you specify exceeds the current Spot -// price. Amazon EC2 periodically sets the Spot price based on available Spot -// Instance capacity and current Spot instance requests. For more information, -// see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RequestSpotInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstances -func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSpotInstancesOutput, error) { - req, out := c.RequestSpotInstancesRequest(input) - return out, req.Send() -} - -// RequestSpotInstancesWithContext is the same as RequestSpotInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RequestSpotInstances 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 *EC2) RequestSpotInstancesWithContext(ctx aws.Context, input *RequestSpotInstancesInput, opts ...request.Option) (*RequestSpotInstancesOutput, error) { - req, out := c.RequestSpotInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetImageAttribute = "ResetImageAttribute" - -// ResetImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetImageAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetImageAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetImageAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetImageAttributeRequest method. -// req, resp := client.ResetImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttribute -func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *request.Request, output *ResetImageAttributeOutput) { - op := &request.Operation{ - Name: opResetImageAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetImageAttributeInput{} - } - - output = &ResetImageAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetImageAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets an attribute of an AMI to its default value. -// -// The productCodes attribute can't be reset. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ResetImageAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttribute -func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (*ResetImageAttributeOutput, error) { - req, out := c.ResetImageAttributeRequest(input) - return out, req.Send() -} - -// ResetImageAttributeWithContext is the same as ResetImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetImageAttribute 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 *EC2) ResetImageAttributeWithContext(ctx aws.Context, input *ResetImageAttributeInput, opts ...request.Option) (*ResetImageAttributeOutput, error) { - req, out := c.ResetImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetInstanceAttribute = "ResetInstanceAttribute" - -// ResetInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetInstanceAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetInstanceAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetInstanceAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetInstanceAttributeRequest method. -// req, resp := client.ResetInstanceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttribute -func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) (req *request.Request, output *ResetInstanceAttributeOutput) { - op := &request.Operation{ - Name: opResetInstanceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetInstanceAttributeInput{} - } - - output = &ResetInstanceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetInstanceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets an attribute of an instance to its default value. To reset the kernel -// or ramdisk, the instance must be in a stopped state. To reset the sourceDestCheck, -// the instance can be either running or stopped. -// -// The sourceDestCheck attribute controls whether source/destination checking -// is enabled. The default value is true, which means checking is enabled. This -// value must be false for a NAT instance to perform NAT. For more information, -// see NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) -// in the Amazon Virtual Private Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ResetInstanceAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttribute -func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (*ResetInstanceAttributeOutput, error) { - req, out := c.ResetInstanceAttributeRequest(input) - return out, req.Send() -} - -// ResetInstanceAttributeWithContext is the same as ResetInstanceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetInstanceAttribute 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 *EC2) ResetInstanceAttributeWithContext(ctx aws.Context, input *ResetInstanceAttributeInput, opts ...request.Option) (*ResetInstanceAttributeOutput, error) { - req, out := c.ResetInstanceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" - -// ResetNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetNetworkInterfaceAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetNetworkInterfaceAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetNetworkInterfaceAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetNetworkInterfaceAttributeRequest method. -// req, resp := client.ResetNetworkInterfaceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttribute -func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterfaceAttributeInput) (req *request.Request, output *ResetNetworkInterfaceAttributeOutput) { - op := &request.Operation{ - Name: opResetNetworkInterfaceAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetNetworkInterfaceAttributeInput{} - } - - output = &ResetNetworkInterfaceAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets a network interface attribute. You can specify only one attribute -// at a time. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ResetNetworkInterfaceAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttribute -func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttributeInput) (*ResetNetworkInterfaceAttributeOutput, error) { - req, out := c.ResetNetworkInterfaceAttributeRequest(input) - return out, req.Send() -} - -// ResetNetworkInterfaceAttributeWithContext is the same as ResetNetworkInterfaceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetNetworkInterfaceAttribute 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 *EC2) ResetNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ResetNetworkInterfaceAttributeInput, opts ...request.Option) (*ResetNetworkInterfaceAttributeOutput, error) { - req, out := c.ResetNetworkInterfaceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetSnapshotAttribute = "ResetSnapshotAttribute" - -// ResetSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetSnapshotAttribute operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ResetSnapshotAttribute for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ResetSnapshotAttribute method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ResetSnapshotAttributeRequest method. -// req, resp := client.ResetSnapshotAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttribute -func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) (req *request.Request, output *ResetSnapshotAttributeOutput) { - op := &request.Operation{ - Name: opResetSnapshotAttribute, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ResetSnapshotAttributeInput{} - } - - output = &ResetSnapshotAttributeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResetSnapshotAttribute API operation for Amazon Elastic Compute Cloud. -// -// Resets permission settings for the specified snapshot. -// -// For more information on modifying snapshot permissions, see Sharing Snapshots -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation ResetSnapshotAttribute for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttribute -func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (*ResetSnapshotAttributeOutput, error) { - req, out := c.ResetSnapshotAttributeRequest(input) - return out, req.Send() -} - -// ResetSnapshotAttributeWithContext is the same as ResetSnapshotAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ResetSnapshotAttribute 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 *EC2) ResetSnapshotAttributeWithContext(ctx aws.Context, input *ResetSnapshotAttributeInput, opts ...request.Option) (*ResetSnapshotAttributeOutput, error) { - req, out := c.ResetSnapshotAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreAddressToClassic = "RestoreAddressToClassic" - -// RestoreAddressToClassicRequest generates a "aws/request.Request" representing the -// client's request for the RestoreAddressToClassic operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreAddressToClassic for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreAddressToClassic method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreAddressToClassicRequest method. -// req, resp := client.RestoreAddressToClassicRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassic -func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *request.Request, output *RestoreAddressToClassicOutput) { - op := &request.Operation{ - Name: opRestoreAddressToClassic, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreAddressToClassicInput{} - } - - output = &RestoreAddressToClassicOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreAddressToClassic API operation for Amazon Elastic Compute Cloud. -// -// Restores an Elastic IP address that was previously moved to the EC2-VPC platform -// back to the EC2-Classic platform. You cannot move an Elastic IP address that -// was originally allocated for use in EC2-VPC. The Elastic IP address must -// not be associated with an instance or network interface. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RestoreAddressToClassic for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassic -func (c *EC2) RestoreAddressToClassic(input *RestoreAddressToClassicInput) (*RestoreAddressToClassicOutput, error) { - req, out := c.RestoreAddressToClassicRequest(input) - return out, req.Send() -} - -// RestoreAddressToClassicWithContext is the same as RestoreAddressToClassic with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreAddressToClassic 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 *EC2) RestoreAddressToClassicWithContext(ctx aws.Context, input *RestoreAddressToClassicInput, opts ...request.Option) (*RestoreAddressToClassicOutput, error) { - req, out := c.RestoreAddressToClassicRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" - -// RevokeSecurityGroupEgressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSecurityGroupEgress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RevokeSecurityGroupEgress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RevokeSecurityGroupEgress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RevokeSecurityGroupEgressRequest method. -// req, resp := client.RevokeSecurityGroupEgressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgress -func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *request.Request, output *RevokeSecurityGroupEgressOutput) { - op := &request.Operation{ - Name: opRevokeSecurityGroupEgress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeSecurityGroupEgressInput{} - } - - output = &RevokeSecurityGroupEgressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RevokeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. -// -// [EC2-VPC only] Removes one or more egress rules from a security group for -// EC2-VPC. This action doesn't apply to security groups for use in EC2-Classic. -// The values that you specify in the revoke request (for example, ports) must -// match the existing rule's values for the rule to be revoked. -// -// Each rule consists of the protocol and the IPv4 or IPv6 CIDR range or source -// security group. For the TCP and UDP protocols, you must also specify the -// destination port or range of ports. For the ICMP protocol, you must also -// specify the ICMP type and code. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RevokeSecurityGroupEgress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgress -func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) (*RevokeSecurityGroupEgressOutput, error) { - req, out := c.RevokeSecurityGroupEgressRequest(input) - return out, req.Send() -} - -// RevokeSecurityGroupEgressWithContext is the same as RevokeSecurityGroupEgress with the addition of -// the ability to pass a context and additional request options. -// -// See RevokeSecurityGroupEgress 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 *EC2) RevokeSecurityGroupEgressWithContext(ctx aws.Context, input *RevokeSecurityGroupEgressInput, opts ...request.Option) (*RevokeSecurityGroupEgressOutput, error) { - req, out := c.RevokeSecurityGroupEgressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" - -// RevokeSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSecurityGroupIngress operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RevokeSecurityGroupIngress for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RevokeSecurityGroupIngress method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RevokeSecurityGroupIngressRequest method. -// req, resp := client.RevokeSecurityGroupIngressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngress -func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngressInput) (req *request.Request, output *RevokeSecurityGroupIngressOutput) { - op := &request.Operation{ - Name: opRevokeSecurityGroupIngress, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RevokeSecurityGroupIngressInput{} - } - - output = &RevokeSecurityGroupIngressOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RevokeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. -// -// Removes one or more ingress rules from a security group. The values that -// you specify in the revoke request (for example, ports) must match the existing -// rule's values for the rule to be removed. -// -// Each rule consists of the protocol and the CIDR range or source security -// group. For the TCP and UDP protocols, you must also specify the destination -// port or range of ports. For the ICMP protocol, you must also specify the -// ICMP type and code. -// -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RevokeSecurityGroupIngress for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngress -func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) (*RevokeSecurityGroupIngressOutput, error) { - req, out := c.RevokeSecurityGroupIngressRequest(input) - return out, req.Send() -} - -// RevokeSecurityGroupIngressWithContext is the same as RevokeSecurityGroupIngress with the addition of -// the ability to pass a context and additional request options. -// -// See RevokeSecurityGroupIngress 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 *EC2) RevokeSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeSecurityGroupIngressInput, opts ...request.Option) (*RevokeSecurityGroupIngressOutput, error) { - req, out := c.RevokeSecurityGroupIngressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRunInstances = "RunInstances" - -// RunInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RunInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RunInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RunInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RunInstancesRequest method. -// req, resp := client.RunInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstances -func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Request, output *Reservation) { - op := &request.Operation{ - Name: opRunInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RunInstancesInput{} - } - - output = &Reservation{} - req = c.newRequest(op, input, output) - return -} - -// RunInstances API operation for Amazon Elastic Compute Cloud. -// -// Launches the specified number of instances using an AMI for which you have -// permissions. -// -// You can specify a number of options, or leave the default options. The following -// rules apply: -// -// * [EC2-VPC] If you don't specify a subnet ID, we choose a default subnet -// from your default VPC for you. If you don't have a default VPC, you must -// specify a subnet ID in the request. -// -// * [EC2-Classic] If don't specify an Availability Zone, we choose one for -// you. -// -// * Some instance types must be launched into a VPC. If you do not have -// a default VPC, or if you do not specify a subnet ID, the request fails. -// For more information, see Instance Types Available Only in a VPC (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html#vpc-only-instance-types). -// -// * [EC2-VPC] All instances have a network interface with a primary private -// IPv4 address. If you don't specify this address, we choose one from the -// IPv4 range of your subnet. -// -// * Not all instance types support IPv6 addresses. For more information, -// see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). -// -// * If you don't specify a security group ID, we use the default security -// group. For more information, see Security Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html). -// -// * If any of the AMIs have a product code attached for which the user has -// not subscribed, the request fails. -// -// To ensure faster instance launches, break up large requests into smaller -// batches. For example, create 5 separate launch requests for 100 instances -// each instead of 1 launch request for 500 instances. -// -// An instance is ready for you to use when it's in the running state. You can -// check the state of your instance using DescribeInstances. You can tag instances -// and EBS volumes during launch, after launch, or both. For more information, -// see CreateTags and Tagging Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). -// -// Linux instances have access to the public key of the key pair at boot. You -// can use this key to provide secure access to the instance. Amazon EC2 public -// images use this feature to provide secure access without passwords. For more -// information, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For troubleshooting, see What To Do If An Instance Immediately Terminates -// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html), -// and Troubleshooting Connecting to Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RunInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstances -func (c *EC2) RunInstances(input *RunInstancesInput) (*Reservation, error) { - req, out := c.RunInstancesRequest(input) - return out, req.Send() -} - -// RunInstancesWithContext is the same as RunInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RunInstances 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 *EC2) RunInstancesWithContext(ctx aws.Context, input *RunInstancesInput, opts ...request.Option) (*Reservation, error) { - req, out := c.RunInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRunScheduledInstances = "RunScheduledInstances" - -// RunScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RunScheduledInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RunScheduledInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RunScheduledInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RunScheduledInstancesRequest method. -// req, resp := client.RunScheduledInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstances -func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) (req *request.Request, output *RunScheduledInstancesOutput) { - op := &request.Operation{ - Name: opRunScheduledInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RunScheduledInstancesInput{} - } - - output = &RunScheduledInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// RunScheduledInstances API operation for Amazon Elastic Compute Cloud. -// -// Launches the specified Scheduled Instances. -// -// Before you can launch a Scheduled Instance, you must purchase it and obtain -// an identifier using PurchaseScheduledInstances. -// -// You must launch a Scheduled Instance during its scheduled time period. You -// can't stop or reboot a Scheduled Instance, but you can terminate it as needed. -// If you terminate a Scheduled Instance before the current scheduled time period -// ends, you can launch it again after a few minutes. For more information, -// see Scheduled Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation RunScheduledInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstances -func (c *EC2) RunScheduledInstances(input *RunScheduledInstancesInput) (*RunScheduledInstancesOutput, error) { - req, out := c.RunScheduledInstancesRequest(input) - return out, req.Send() -} - -// RunScheduledInstancesWithContext is the same as RunScheduledInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RunScheduledInstances 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 *EC2) RunScheduledInstancesWithContext(ctx aws.Context, input *RunScheduledInstancesInput, opts ...request.Option) (*RunScheduledInstancesOutput, error) { - req, out := c.RunScheduledInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartInstances = "StartInstances" - -// StartInstancesRequest generates a "aws/request.Request" representing the -// client's request for the StartInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StartInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StartInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StartInstancesRequest method. -// req, resp := client.StartInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstances -func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Request, output *StartInstancesOutput) { - op := &request.Operation{ - Name: opStartInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartInstancesInput{} - } - - output = &StartInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartInstances API operation for Amazon Elastic Compute Cloud. -// -// Starts an Amazon EBS-backed AMI that you've previously stopped. -// -// Instances that use Amazon EBS volumes as their root devices can be quickly -// stopped and started. When an instance is stopped, the compute resources are -// released and you are not billed for hourly instance usage. However, your -// root partition Amazon EBS volume remains, continues to persist your data, -// and you are charged for Amazon EBS volume usage. You can restart your instance -// at any time. Each time you transition an instance from stopped to started, -// Amazon EC2 charges a full instance hour, even if transitions happen multiple -// times within a single hour. -// -// Before stopping an instance, make sure it is in a state from which it can -// be restarted. Stopping an instance does not preserve data stored in RAM. -// -// Performing this operation on an instance that uses an instance store as its -// root device returns an error. -// -// For more information, see Stopping Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation StartInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstances -func (c *EC2) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, error) { - req, out := c.StartInstancesRequest(input) - return out, req.Send() -} - -// StartInstancesWithContext is the same as StartInstances with the addition of -// the ability to pass a context and additional request options. -// -// See StartInstances 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 *EC2) StartInstancesWithContext(ctx aws.Context, input *StartInstancesInput, opts ...request.Option) (*StartInstancesOutput, error) { - req, out := c.StartInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopInstances = "StopInstances" - -// StopInstancesRequest generates a "aws/request.Request" representing the -// client's request for the StopInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See StopInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the StopInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the StopInstancesRequest method. -// req, resp := client.StopInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstances -func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Request, output *StopInstancesOutput) { - op := &request.Operation{ - Name: opStopInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopInstancesInput{} - } - - output = &StopInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopInstances API operation for Amazon Elastic Compute Cloud. -// -// Stops an Amazon EBS-backed instance. -// -// We don't charge hourly usage for a stopped instance, or data transfer fees; -// however, your root partition Amazon EBS volume remains, continues to persist -// your data, and you are charged for Amazon EBS volume usage. Each time you -// transition an instance from stopped to started, Amazon EC2 charges a full -// instance hour, even if transitions happen multiple times within a single -// hour. -// -// You can't start or stop Spot instances, and you can't stop instance store-backed -// instances. -// -// When you stop an instance, we shut it down. You can restart your instance -// at any time. Before stopping an instance, make sure it is in a state from -// which it can be restarted. Stopping an instance does not preserve data stored -// in RAM. -// -// Stopping an instance is different to rebooting or terminating it. For example, -// when you stop an instance, the root device and any other devices attached -// to the instance persist. When you terminate an instance, the root device -// and any other devices attached during the instance launch are automatically -// deleted. For more information about the differences between rebooting, stopping, -// and terminating instances, see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// When you stop an instance, we attempt to shut it down forcibly after a short -// while. If your instance appears stuck in the stopping state after a period -// of time, there may be an issue with the underlying host computer. For more -// information, see Troubleshooting Stopping Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation StopInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstances -func (c *EC2) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, error) { - req, out := c.StopInstancesRequest(input) - return out, req.Send() -} - -// StopInstancesWithContext is the same as StopInstances with the addition of -// the ability to pass a context and additional request options. -// -// See StopInstances 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 *EC2) StopInstancesWithContext(ctx aws.Context, input *StopInstancesInput, opts ...request.Option) (*StopInstancesOutput, error) { - req, out := c.StopInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTerminateInstances = "TerminateInstances" - -// TerminateInstancesRequest generates a "aws/request.Request" representing the -// client's request for the TerminateInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TerminateInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TerminateInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TerminateInstancesRequest method. -// req, resp := client.TerminateInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstances -func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *request.Request, output *TerminateInstancesOutput) { - op := &request.Operation{ - Name: opTerminateInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TerminateInstancesInput{} - } - - output = &TerminateInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// TerminateInstances API operation for Amazon Elastic Compute Cloud. -// -// Shuts down one or more instances. This operation is idempotent; if you terminate -// an instance more than once, each call succeeds. -// -// If you specify multiple instances and the request fails (for example, because -// of a single incorrect instance ID), none of the instances are terminated. -// -// Terminated instances remain visible after termination (for approximately -// one hour). -// -// By default, Amazon EC2 deletes all EBS volumes that were attached when the -// instance launched. Volumes attached after instance launch continue running. -// -// You can stop, start, and terminate EBS-backed instances. You can only terminate -// instance store-backed instances. What happens to an instance differs if you -// stop it or terminate it. For example, when you stop an instance, the root -// device and any other devices attached to the instance persist. When you terminate -// an instance, any attached EBS volumes with the DeleteOnTermination block -// device mapping parameter set to true are automatically deleted. For more -// information about the differences between stopping and terminating instances, -// see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For more information about troubleshooting, see Troubleshooting Terminating -// Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation TerminateInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstances -func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (*TerminateInstancesOutput, error) { - req, out := c.TerminateInstancesRequest(input) - return out, req.Send() -} - -// TerminateInstancesWithContext is the same as TerminateInstances with the addition of -// the ability to pass a context and additional request options. -// -// See TerminateInstances 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 *EC2) TerminateInstancesWithContext(ctx aws.Context, input *TerminateInstancesInput, opts ...request.Option) (*TerminateInstancesOutput, error) { - req, out := c.TerminateInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUnassignIpv6Addresses = "UnassignIpv6Addresses" - -// UnassignIpv6AddressesRequest generates a "aws/request.Request" representing the -// client's request for the UnassignIpv6Addresses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UnassignIpv6Addresses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UnassignIpv6Addresses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnassignIpv6AddressesRequest method. -// req, resp := client.UnassignIpv6AddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6Addresses -func (c *EC2) UnassignIpv6AddressesRequest(input *UnassignIpv6AddressesInput) (req *request.Request, output *UnassignIpv6AddressesOutput) { - op := &request.Operation{ - Name: opUnassignIpv6Addresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnassignIpv6AddressesInput{} - } - - output = &UnassignIpv6AddressesOutput{} - req = c.newRequest(op, input, output) - return -} - -// UnassignIpv6Addresses API operation for Amazon Elastic Compute Cloud. -// -// Unassigns one or more IPv6 addresses from a network interface. -// -// 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 Amazon Elastic Compute Cloud's -// API operation UnassignIpv6Addresses for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6Addresses -func (c *EC2) UnassignIpv6Addresses(input *UnassignIpv6AddressesInput) (*UnassignIpv6AddressesOutput, error) { - req, out := c.UnassignIpv6AddressesRequest(input) - return out, req.Send() -} - -// UnassignIpv6AddressesWithContext is the same as UnassignIpv6Addresses with the addition of -// the ability to pass a context and additional request options. -// -// See UnassignIpv6Addresses 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 *EC2) UnassignIpv6AddressesWithContext(ctx aws.Context, input *UnassignIpv6AddressesInput, opts ...request.Option) (*UnassignIpv6AddressesOutput, error) { - req, out := c.UnassignIpv6AddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" - -// UnassignPrivateIpAddressesRequest generates a "aws/request.Request" representing the -// client's request for the UnassignPrivateIpAddresses operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UnassignPrivateIpAddresses for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UnassignPrivateIpAddresses method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnassignPrivateIpAddressesRequest method. -// req, resp := client.UnassignPrivateIpAddressesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddresses -func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddressesInput) (req *request.Request, output *UnassignPrivateIpAddressesOutput) { - op := &request.Operation{ - Name: opUnassignPrivateIpAddresses, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnassignPrivateIpAddressesInput{} - } - - output = &UnassignPrivateIpAddressesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// UnassignPrivateIpAddresses API operation for Amazon Elastic Compute Cloud. -// -// Unassigns one or more secondary private IP addresses from a network interface. -// -// 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 Amazon Elastic Compute Cloud's -// API operation UnassignPrivateIpAddresses for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddresses -func (c *EC2) UnassignPrivateIpAddresses(input *UnassignPrivateIpAddressesInput) (*UnassignPrivateIpAddressesOutput, error) { - req, out := c.UnassignPrivateIpAddressesRequest(input) - return out, req.Send() -} - -// UnassignPrivateIpAddressesWithContext is the same as UnassignPrivateIpAddresses with the addition of -// the ability to pass a context and additional request options. -// -// See UnassignPrivateIpAddresses 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 *EC2) UnassignPrivateIpAddressesWithContext(ctx aws.Context, input *UnassignPrivateIpAddressesInput, opts ...request.Option) (*UnassignPrivateIpAddressesOutput, error) { - req, out := c.UnassignPrivateIpAddressesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUnmonitorInstances = "UnmonitorInstances" - -// UnmonitorInstancesRequest generates a "aws/request.Request" representing the -// client's request for the UnmonitorInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UnmonitorInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UnmonitorInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UnmonitorInstancesRequest method. -// req, resp := client.UnmonitorInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstances -func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *request.Request, output *UnmonitorInstancesOutput) { - op := &request.Operation{ - Name: opUnmonitorInstances, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UnmonitorInstancesInput{} - } - - output = &UnmonitorInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// UnmonitorInstances API operation for Amazon Elastic Compute Cloud. -// -// Disables detailed monitoring for a running instance. For more information, -// see Monitoring Your Instances and Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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 Amazon Elastic Compute Cloud's -// API operation UnmonitorInstances for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstances -func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (*UnmonitorInstancesOutput, error) { - req, out := c.UnmonitorInstancesRequest(input) - return out, req.Send() -} - -// UnmonitorInstancesWithContext is the same as UnmonitorInstances with the addition of -// the ability to pass a context and additional request options. -// -// See UnmonitorInstances 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 *EC2) UnmonitorInstancesWithContext(ctx aws.Context, input *UnmonitorInstancesInput, opts ...request.Option) (*UnmonitorInstancesOutput, error) { - req, out := c.UnmonitorInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Contains the parameters for accepting the quote. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuoteRequest -type AcceptReservedInstancesExchangeQuoteInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The IDs of the Convertible Reserved Instances to exchange for other Convertible - // Reserved Instances of the same or higher value. - // - // ReservedInstanceIds is a required field - ReservedInstanceIds []*string `locationName:"ReservedInstanceId" locationNameList:"ReservedInstanceId" type:"list" required:"true"` - - // The configurations of the Convertible Reserved Instance offerings that you - // are purchasing in this exchange. - TargetConfigurations []*TargetConfigurationRequest `locationName:"TargetConfiguration" locationNameList:"TargetConfigurationRequest" type:"list"` -} - -// String returns the string representation -func (s AcceptReservedInstancesExchangeQuoteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptReservedInstancesExchangeQuoteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptReservedInstancesExchangeQuoteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptReservedInstancesExchangeQuoteInput"} - if s.ReservedInstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstanceIds")) - } - if s.TargetConfigurations != nil { - for i, v := range s.TargetConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetDryRun(v bool) *AcceptReservedInstancesExchangeQuoteInput { - s.DryRun = &v - return s -} - -// SetReservedInstanceIds sets the ReservedInstanceIds field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetReservedInstanceIds(v []*string) *AcceptReservedInstancesExchangeQuoteInput { - s.ReservedInstanceIds = v - return s -} - -// SetTargetConfigurations sets the TargetConfigurations field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetTargetConfigurations(v []*TargetConfigurationRequest) *AcceptReservedInstancesExchangeQuoteInput { - s.TargetConfigurations = v - return s -} - -// The result of the exchange and whether it was successful. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptReservedInstancesExchangeQuoteResult -type AcceptReservedInstancesExchangeQuoteOutput struct { - _ struct{} `type:"structure"` - - // The ID of the successful exchange. - ExchangeId *string `locationName:"exchangeId" type:"string"` -} - -// String returns the string representation -func (s AcceptReservedInstancesExchangeQuoteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptReservedInstancesExchangeQuoteOutput) GoString() string { - return s.String() -} - -// SetExchangeId sets the ExchangeId field's value. -func (s *AcceptReservedInstancesExchangeQuoteOutput) SetExchangeId(v string) *AcceptReservedInstancesExchangeQuoteOutput { - s.ExchangeId = &v - return s -} - -// Contains the parameters for AcceptVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnectionRequest -type AcceptVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s AcceptVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *AcceptVpcPeeringConnectionInput) SetDryRun(v bool) *AcceptVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *AcceptVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *AcceptVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of AcceptVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptVpcPeeringConnectionResult -type AcceptVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connection. - VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` -} - -// String returns the string representation -func (s AcceptVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AcceptVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. -func (s *AcceptVpcPeeringConnectionOutput) SetVpcPeeringConnection(v *VpcPeeringConnection) *AcceptVpcPeeringConnectionOutput { - s.VpcPeeringConnection = v - return s -} - -// Describes an account attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AccountAttribute -type AccountAttribute struct { - _ struct{} `type:"structure"` - - // The name of the account attribute. - AttributeName *string `locationName:"attributeName" type:"string"` - - // One or more values for the account attribute. - AttributeValues []*AccountAttributeValue `locationName:"attributeValueSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s AccountAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountAttribute) GoString() string { - return s.String() -} - -// SetAttributeName sets the AttributeName field's value. -func (s *AccountAttribute) SetAttributeName(v string) *AccountAttribute { - s.AttributeName = &v - return s -} - -// SetAttributeValues sets the AttributeValues field's value. -func (s *AccountAttribute) SetAttributeValues(v []*AccountAttributeValue) *AccountAttribute { - s.AttributeValues = v - return s -} - -// Describes a value of an account attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AccountAttributeValue -type AccountAttributeValue struct { - _ struct{} `type:"structure"` - - // The value of the attribute. - AttributeValue *string `locationName:"attributeValue" type:"string"` -} - -// String returns the string representation -func (s AccountAttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountAttributeValue) GoString() string { - return s.String() -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *AccountAttributeValue) SetAttributeValue(v string) *AccountAttributeValue { - s.AttributeValue = &v - return s -} - -// Describes a running instance in a Spot fleet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ActiveInstance -type ActiveInstance struct { - _ struct{} `type:"structure"` - - // The health status of the instance. If the status of either the instance status - // check or the system status check is impaired, the health status of the instance - // is unhealthy. Otherwise, the health status is healthy. - InstanceHealth *string `locationName:"instanceHealth" type:"string" enum:"InstanceHealthStatus"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The ID of the Spot instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` -} - -// String returns the string representation -func (s ActiveInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ActiveInstance) GoString() string { - return s.String() -} - -// SetInstanceHealth sets the InstanceHealth field's value. -func (s *ActiveInstance) SetInstanceHealth(v string) *ActiveInstance { - s.InstanceHealth = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ActiveInstance) SetInstanceId(v string) *ActiveInstance { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ActiveInstance) SetInstanceType(v string) *ActiveInstance { - s.InstanceType = &v - return s -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *ActiveInstance) SetSpotInstanceRequestId(v string) *ActiveInstance { - s.SpotInstanceRequestId = &v - return s -} - -// Describes an Elastic IP address. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Address -type Address struct { - _ struct{} `type:"structure"` - - // The ID representing the allocation of the address for use with EC2-VPC. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The ID representing the association of the address with an instance in a - // VPC. - AssociationId *string `locationName:"associationId" type:"string"` - - // Indicates whether this Elastic IP address is for use with instances in EC2-Classic - // (standard) or instances in a VPC (vpc). - Domain *string `locationName:"domain" type:"string" enum:"DomainType"` - - // The ID of the instance that the address is associated with (if any). - InstanceId *string `locationName:"instanceId" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the AWS account that owns the network interface. - NetworkInterfaceOwnerId *string `locationName:"networkInterfaceOwnerId" type:"string"` - - // The private IP address associated with the Elastic IP address. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Address) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *Address) SetAllocationId(v string) *Address { - s.AllocationId = &v - return s -} - -// SetAssociationId sets the AssociationId field's value. -func (s *Address) SetAssociationId(v string) *Address { - s.AssociationId = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *Address) SetDomain(v string) *Address { - s.Domain = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Address) SetInstanceId(v string) *Address { - s.InstanceId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *Address) SetNetworkInterfaceId(v string) *Address { - s.NetworkInterfaceId = &v - return s -} - -// SetNetworkInterfaceOwnerId sets the NetworkInterfaceOwnerId field's value. -func (s *Address) SetNetworkInterfaceOwnerId(v string) *Address { - s.NetworkInterfaceOwnerId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *Address) SetPrivateIpAddress(v string) *Address { - s.PrivateIpAddress = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *Address) SetPublicIp(v string) *Address { - s.PublicIp = &v - return s -} - -// Contains the parameters for AllocateAddress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddressRequest -type AllocateAddressInput struct { - _ struct{} `type:"structure"` - - // Set to vpc to allocate the address for use with instances in a VPC. - // - // Default: The address is for use with instances in EC2-Classic. - Domain *string `type:"string" enum:"DomainType"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s AllocateAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateAddressInput) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *AllocateAddressInput) SetDomain(v string) *AllocateAddressInput { - s.Domain = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AllocateAddressInput) SetDryRun(v bool) *AllocateAddressInput { - s.DryRun = &v - return s -} - -// Contains the output of AllocateAddress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateAddressResult -type AllocateAddressOutput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The ID that AWS assigns to represent the allocation of the Elastic - // IP address for use with instances in a VPC. - AllocationId *string `locationName:"allocationId" type:"string"` - - // Indicates whether this Elastic IP address is for use with instances in EC2-Classic - // (standard) or instances in a VPC (vpc). - Domain *string `locationName:"domain" type:"string" enum:"DomainType"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s AllocateAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateAddressOutput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *AllocateAddressOutput) SetAllocationId(v string) *AllocateAddressOutput { - s.AllocationId = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *AllocateAddressOutput) SetDomain(v string) *AllocateAddressOutput { - s.Domain = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *AllocateAddressOutput) SetPublicIp(v string) *AllocateAddressOutput { - s.PublicIp = &v - return s -} - -// Contains the parameters for AllocateHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHostsRequest -type AllocateHostsInput struct { - _ struct{} `type:"structure"` - - // This is enabled by default. This property allows instances to be automatically - // placed onto available Dedicated Hosts, when you are launching instances without - // specifying a host ID. - // - // Default: Enabled - AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` - - // The Availability Zone for the Dedicated Hosts. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Specify the instance type that you want your Dedicated Hosts to be configured - // for. When you specify the instance type, that is the only instance type that - // you can launch onto that host. - // - // InstanceType is a required field - InstanceType *string `locationName:"instanceType" type:"string" required:"true"` - - // The number of Dedicated Hosts you want to allocate to your account with these - // parameters. - // - // Quantity is a required field - Quantity *int64 `locationName:"quantity" type:"integer" required:"true"` -} - -// String returns the string representation -func (s AllocateHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateHostsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AllocateHostsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AllocateHostsInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - if s.Quantity == nil { - invalidParams.Add(request.NewErrParamRequired("Quantity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoPlacement sets the AutoPlacement field's value. -func (s *AllocateHostsInput) SetAutoPlacement(v string) *AllocateHostsInput { - s.AutoPlacement = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *AllocateHostsInput) SetAvailabilityZone(v string) *AllocateHostsInput { - s.AvailabilityZone = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *AllocateHostsInput) SetClientToken(v string) *AllocateHostsInput { - s.ClientToken = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *AllocateHostsInput) SetInstanceType(v string) *AllocateHostsInput { - s.InstanceType = &v - return s -} - -// SetQuantity sets the Quantity field's value. -func (s *AllocateHostsInput) SetQuantity(v int64) *AllocateHostsInput { - s.Quantity = &v - return s -} - -// Contains the output of AllocateHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AllocateHostsResult -type AllocateHostsOutput struct { - _ struct{} `type:"structure"` - - // The ID of the allocated Dedicated Host. This is used when you want to launch - // an instance onto a specific host. - HostIds []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s AllocateHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AllocateHostsOutput) GoString() string { - return s.String() -} - -// SetHostIds sets the HostIds field's value. -func (s *AllocateHostsOutput) SetHostIds(v []*string) *AllocateHostsOutput { - s.HostIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6AddressesRequest -type AssignIpv6AddressesInput struct { - _ struct{} `type:"structure"` - - // The number of IPv6 addresses to assign to the network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't - // use this option if specifying specific IPv6 addresses. - Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` - - // One or more specific IPv6 addresses to be assigned to the network interface. - // You can't use this option if you're specifying a number of IPv6 addresses. - Ipv6Addresses []*string `locationName:"ipv6Addresses" locationNameList:"item" type:"list"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssignIpv6AddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignIpv6AddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssignIpv6AddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssignIpv6AddressesInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *AssignIpv6AddressesInput) SetIpv6AddressCount(v int64) *AssignIpv6AddressesInput { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *AssignIpv6AddressesInput) SetIpv6Addresses(v []*string) *AssignIpv6AddressesInput { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignIpv6AddressesInput) SetNetworkInterfaceId(v string) *AssignIpv6AddressesInput { - s.NetworkInterfaceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignIpv6AddressesResult -type AssignIpv6AddressesOutput struct { - _ struct{} `type:"structure"` - - // The IPv6 addresses assigned to the network interface. - AssignedIpv6Addresses []*string `locationName:"assignedIpv6Addresses" locationNameList:"item" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` -} - -// String returns the string representation -func (s AssignIpv6AddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignIpv6AddressesOutput) GoString() string { - return s.String() -} - -// SetAssignedIpv6Addresses sets the AssignedIpv6Addresses field's value. -func (s *AssignIpv6AddressesOutput) SetAssignedIpv6Addresses(v []*string) *AssignIpv6AddressesOutput { - s.AssignedIpv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignIpv6AddressesOutput) SetNetworkInterfaceId(v string) *AssignIpv6AddressesOutput { - s.NetworkInterfaceId = &v - return s -} - -// Contains the parameters for AssignPrivateIpAddresses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddressesRequest -type AssignPrivateIpAddressesInput struct { - _ struct{} `type:"structure"` - - // Indicates whether to allow an IP address that is already assigned to another - // network interface or instance to be reassigned to the specified network interface. - AllowReassignment *bool `locationName:"allowReassignment" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // One or more IP addresses to be assigned as a secondary private IP address - // to the network interface. You can't specify this parameter when also specifying - // a number of secondary IP addresses. - // - // If you don't specify an IP address, Amazon EC2 automatically selects an IP - // address within the subnet range. - PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list"` - - // The number of secondary IP addresses to assign to the network interface. - // You can't specify this parameter when also specifying private IP addresses. - SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` -} - -// String returns the string representation -func (s AssignPrivateIpAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignPrivateIpAddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssignPrivateIpAddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssignPrivateIpAddressesInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowReassignment sets the AllowReassignment field's value. -func (s *AssignPrivateIpAddressesInput) SetAllowReassignment(v bool) *AssignPrivateIpAddressesInput { - s.AllowReassignment = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignPrivateIpAddressesInput) SetNetworkInterfaceId(v string) *AssignPrivateIpAddressesInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *AssignPrivateIpAddressesInput) SetPrivateIpAddresses(v []*string) *AssignPrivateIpAddressesInput { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *AssignPrivateIpAddressesInput) SetSecondaryPrivateIpAddressCount(v int64) *AssignPrivateIpAddressesInput { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssignPrivateIpAddressesOutput -type AssignPrivateIpAddressesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AssignPrivateIpAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssignPrivateIpAddressesOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AssociateAddress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddressRequest -type AssociateAddressInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The allocation ID. This is required for EC2-VPC. - AllocationId *string `type:"string"` - - // [EC2-VPC] For a VPC in an EC2-Classic account, specify true to allow an Elastic - // IP address that is already associated with an instance or network interface - // to be reassociated with the specified instance or network interface. Otherwise, - // the operation fails. In a VPC in an EC2-VPC-only account, reassociation is - // automatic, therefore you can specify false to ensure the operation fails - // if the Elastic IP address is already associated with another resource. - AllowReassociation *bool `locationName:"allowReassociation" type:"boolean"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. This is required for EC2-Classic. For EC2-VPC, you - // can specify either the instance ID or the network interface ID, but not both. - // The operation fails if you specify an instance ID unless exactly one network - // interface is attached. - InstanceId *string `type:"string"` - - // [EC2-VPC] The ID of the network interface. If the instance has more than - // one network interface, you must specify a network interface ID. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // [EC2-VPC] The primary or secondary private IP address to associate with the - // Elastic IP address. If no private IP address is specified, the Elastic IP - // address is associated with the primary private IP address. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The Elastic IP address. This is required for EC2-Classic. - PublicIp *string `type:"string"` -} - -// String returns the string representation -func (s AssociateAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateAddressInput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *AssociateAddressInput) SetAllocationId(v string) *AssociateAddressInput { - s.AllocationId = &v - return s -} - -// SetAllowReassociation sets the AllowReassociation field's value. -func (s *AssociateAddressInput) SetAllowReassociation(v bool) *AssociateAddressInput { - s.AllowReassociation = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AssociateAddressInput) SetDryRun(v bool) *AssociateAddressInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssociateAddressInput) SetInstanceId(v string) *AssociateAddressInput { - s.InstanceId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssociateAddressInput) SetNetworkInterfaceId(v string) *AssociateAddressInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *AssociateAddressInput) SetPrivateIpAddress(v string) *AssociateAddressInput { - s.PrivateIpAddress = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *AssociateAddressInput) SetPublicIp(v string) *AssociateAddressInput { - s.PublicIp = &v - return s -} - -// Contains the output of AssociateAddress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateAddressResult -type AssociateAddressOutput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The ID that represents the association of the Elastic IP address - // with an instance. - AssociationId *string `locationName:"associationId" type:"string"` -} - -// String returns the string representation -func (s AssociateAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateAddressOutput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *AssociateAddressOutput) SetAssociationId(v string) *AssociateAddressOutput { - s.AssociationId = &v - return s -} - -// Contains the parameters for AssociateDhcpOptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptionsRequest -type AssociateDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // The ID of the DHCP options set, or default to associate no DHCP options with - // the VPC. - // - // DhcpOptionsId is a required field - DhcpOptionsId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateDhcpOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateDhcpOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateDhcpOptionsInput"} - if s.DhcpOptionsId == nil { - invalidParams.Add(request.NewErrParamRequired("DhcpOptionsId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *AssociateDhcpOptionsInput) SetDhcpOptionsId(v string) *AssociateDhcpOptionsInput { - s.DhcpOptionsId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AssociateDhcpOptionsInput) SetDryRun(v bool) *AssociateDhcpOptionsInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AssociateDhcpOptionsInput) SetVpcId(v string) *AssociateDhcpOptionsInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateDhcpOptionsOutput -type AssociateDhcpOptionsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AssociateDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateDhcpOptionsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfileRequest -type AssociateIamInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The IAM instance profile. - // - // IamInstanceProfile is a required field - IamInstanceProfile *IamInstanceProfileSpecification `type:"structure" required:"true"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateIamInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateIamInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateIamInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateIamInstanceProfileInput"} - if s.IamInstanceProfile == nil { - invalidParams.Add(request.NewErrParamRequired("IamInstanceProfile")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *AssociateIamInstanceProfileInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *AssociateIamInstanceProfileInput { - s.IamInstanceProfile = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssociateIamInstanceProfileInput) SetInstanceId(v string) *AssociateIamInstanceProfileInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfileResult -type AssociateIamInstanceProfileOutput struct { - _ struct{} `type:"structure"` - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` -} - -// String returns the string representation -func (s AssociateIamInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateIamInstanceProfileOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. -func (s *AssociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *AssociateIamInstanceProfileOutput { - s.IamInstanceProfileAssociation = v - return s -} - -// Contains the parameters for AssociateRouteTable. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTableRequest -type AssociateRouteTableInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` - - // The ID of the subnet. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateRouteTableInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AssociateRouteTableInput) SetDryRun(v bool) *AssociateRouteTableInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *AssociateRouteTableInput) SetRouteTableId(v string) *AssociateRouteTableInput { - s.RouteTableId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateRouteTableInput) SetSubnetId(v string) *AssociateRouteTableInput { - s.SubnetId = &v - return s -} - -// Contains the output of AssociateRouteTable. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTableResult -type AssociateRouteTableOutput struct { - _ struct{} `type:"structure"` - - // The route table association ID (needed to disassociate the route table). - AssociationId *string `locationName:"associationId" type:"string"` -} - -// String returns the string representation -func (s AssociateRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateRouteTableOutput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *AssociateRouteTableOutput) SetAssociationId(v string) *AssociateRouteTableOutput { - s.AssociationId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlockRequest -type AssociateSubnetCidrBlockInput struct { - _ struct{} `type:"structure"` - - // The IPv6 CIDR block for your subnet. The subnet must have a /64 prefix length. - // - // Ipv6CidrBlock is a required field - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string" required:"true"` - - // The ID of your subnet. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateSubnetCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateSubnetCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateSubnetCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateSubnetCidrBlockInput"} - if s.Ipv6CidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("Ipv6CidrBlock")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *AssociateSubnetCidrBlockInput) SetIpv6CidrBlock(v string) *AssociateSubnetCidrBlockInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateSubnetCidrBlockInput) SetSubnetId(v string) *AssociateSubnetCidrBlockInput { - s.SubnetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateSubnetCidrBlockResult -type AssociateSubnetCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *SubnetIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s AssociateSubnetCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateSubnetCidrBlockOutput) GoString() string { - return s.String() -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *AssociateSubnetCidrBlockOutput) SetIpv6CidrBlockAssociation(v *SubnetIpv6CidrBlockAssociation) *AssociateSubnetCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateSubnetCidrBlockOutput) SetSubnetId(v string) *AssociateSubnetCidrBlockOutput { - s.SubnetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlockRequest -type AssociateVpcCidrBlockInput struct { - _ struct{} `type:"structure"` - - // Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for - // the VPC. You cannot specify the range of IPv6 addresses, or the size of the - // CIDR block. - AmazonProvidedIpv6CidrBlock *bool `locationName:"amazonProvidedIpv6CidrBlock" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateVpcCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateVpcCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateVpcCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateVpcCidrBlockInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmazonProvidedIpv6CidrBlock sets the AmazonProvidedIpv6CidrBlock field's value. -func (s *AssociateVpcCidrBlockInput) SetAmazonProvidedIpv6CidrBlock(v bool) *AssociateVpcCidrBlockInput { - s.AmazonProvidedIpv6CidrBlock = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AssociateVpcCidrBlockInput) SetVpcId(v string) *AssociateVpcCidrBlockInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateVpcCidrBlockResult -type AssociateVpcCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *VpcIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s AssociateVpcCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateVpcCidrBlockOutput) GoString() string { - return s.String() -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *AssociateVpcCidrBlockOutput) SetIpv6CidrBlockAssociation(v *VpcIpv6CidrBlockAssociation) *AssociateVpcCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AssociateVpcCidrBlockOutput) SetVpcId(v string) *AssociateVpcCidrBlockOutput { - s.VpcId = &v - return s -} - -// Contains the parameters for AttachClassicLinkVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpcRequest -type AttachClassicLinkVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of one or more of the VPC's security groups. You cannot specify security - // groups from a different VPC. - // - // Groups is a required field - Groups []*string `locationName:"SecurityGroupId" locationNameList:"groupId" type:"list" required:"true"` - - // The ID of an EC2-Classic instance to link to the ClassicLink-enabled VPC. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The ID of a ClassicLink-enabled VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachClassicLinkVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachClassicLinkVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachClassicLinkVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachClassicLinkVpcInput"} - if s.Groups == nil { - invalidParams.Add(request.NewErrParamRequired("Groups")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachClassicLinkVpcInput) SetDryRun(v bool) *AttachClassicLinkVpcInput { - s.DryRun = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *AttachClassicLinkVpcInput) SetGroups(v []*string) *AttachClassicLinkVpcInput { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AttachClassicLinkVpcInput) SetInstanceId(v string) *AttachClassicLinkVpcInput { - s.InstanceId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AttachClassicLinkVpcInput) SetVpcId(v string) *AttachClassicLinkVpcInput { - s.VpcId = &v - return s -} - -// Contains the output of AttachClassicLinkVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachClassicLinkVpcResult -type AttachClassicLinkVpcOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s AttachClassicLinkVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachClassicLinkVpcOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *AttachClassicLinkVpcOutput) SetReturn(v bool) *AttachClassicLinkVpcOutput { - s.Return = &v - return s -} - -// Contains the parameters for AttachInternetGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGatewayRequest -type AttachInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Internet gateway. - // - // InternetGatewayId is a required field - InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachInternetGatewayInput"} - if s.InternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("InternetGatewayId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachInternetGatewayInput) SetDryRun(v bool) *AttachInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *AttachInternetGatewayInput) SetInternetGatewayId(v string) *AttachInternetGatewayInput { - s.InternetGatewayId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AttachInternetGatewayInput) SetVpcId(v string) *AttachInternetGatewayInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachInternetGatewayOutput -type AttachInternetGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AttachInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInternetGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AttachNetworkInterface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterfaceRequest -type AttachNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // The index of the device for the network interface attachment. - // - // DeviceIndex is a required field - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachNetworkInterfaceInput"} - if s.DeviceIndex == nil { - invalidParams.Add(request.NewErrParamRequired("DeviceIndex")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *AttachNetworkInterfaceInput) SetDeviceIndex(v int64) *AttachNetworkInterfaceInput { - s.DeviceIndex = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachNetworkInterfaceInput) SetDryRun(v bool) *AttachNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AttachNetworkInterfaceInput) SetInstanceId(v string) *AttachNetworkInterfaceInput { - s.InstanceId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AttachNetworkInterfaceInput) SetNetworkInterfaceId(v string) *AttachNetworkInterfaceInput { - s.NetworkInterfaceId = &v - return s -} - -// Contains the output of AttachNetworkInterface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachNetworkInterfaceResult -type AttachNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` -} - -// String returns the string representation -func (s AttachNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *AttachNetworkInterfaceOutput) SetAttachmentId(v string) *AttachNetworkInterfaceOutput { - s.AttachmentId = &v - return s -} - -// Contains the parameters for AttachVolume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVolumeRequest -type AttachVolumeInput struct { - _ struct{} `type:"structure"` - - // The device name to expose to the instance (for example, /dev/sdh or xvdh). - // - // Device is a required field - Device *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The ID of the EBS volume. The volume and instance must be within the same - // Availability Zone. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachVolumeInput"} - if s.Device == nil { - invalidParams.Add(request.NewErrParamRequired("Device")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDevice sets the Device field's value. -func (s *AttachVolumeInput) SetDevice(v string) *AttachVolumeInput { - s.Device = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachVolumeInput) SetDryRun(v bool) *AttachVolumeInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AttachVolumeInput) SetInstanceId(v string) *AttachVolumeInput { - s.InstanceId = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *AttachVolumeInput) SetVolumeId(v string) *AttachVolumeInput { - s.VolumeId = &v - return s -} - -// Contains the parameters for AttachVpnGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGatewayRequest -type AttachVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AttachVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachVpnGatewayInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *AttachVpnGatewayInput) SetDryRun(v bool) *AttachVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *AttachVpnGatewayInput) SetVpcId(v string) *AttachVpnGatewayInput { - s.VpcId = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *AttachVpnGatewayInput) SetVpnGatewayId(v string) *AttachVpnGatewayInput { - s.VpnGatewayId = &v - return s -} - -// Contains the output of AttachVpnGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttachVpnGatewayResult -type AttachVpnGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the attachment. - VpcAttachment *VpcAttachment `locationName:"attachment" type:"structure"` -} - -// String returns the string representation -func (s AttachVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachVpnGatewayOutput) GoString() string { - return s.String() -} - -// SetVpcAttachment sets the VpcAttachment field's value. -func (s *AttachVpnGatewayOutput) SetVpcAttachment(v *VpcAttachment) *AttachVpnGatewayOutput { - s.VpcAttachment = v - return s -} - -// Describes a value for a resource attribute that is a Boolean value. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttributeBooleanValue -type AttributeBooleanValue struct { - _ struct{} `type:"structure"` - - // The attribute value. The valid values are true or false. - Value *bool `locationName:"value" type:"boolean"` -} - -// String returns the string representation -func (s AttributeBooleanValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeBooleanValue) GoString() string { - return s.String() -} - -// SetValue sets the Value field's value. -func (s *AttributeBooleanValue) SetValue(v bool) *AttributeBooleanValue { - s.Value = &v - return s -} - -// Describes a value for a resource attribute that is a String. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AttributeValue -type AttributeValue struct { - _ struct{} `type:"structure"` - - // The attribute value. Note that the value is case-sensitive. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s AttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttributeValue) GoString() string { - return s.String() -} - -// SetValue sets the Value field's value. -func (s *AttributeValue) SetValue(v string) *AttributeValue { - s.Value = &v - return s -} - -// Contains the parameters for AuthorizeSecurityGroupEgress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgressRequest -type AuthorizeSecurityGroupEgressInput struct { - _ struct{} `type:"structure"` - - // The CIDR IPv4 address range. We recommend that you specify the CIDR range - // in a set of IP permissions instead. - CidrIp *string `locationName:"cidrIp" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The start of port range for the TCP and UDP protocols, or an ICMP type number. - // We recommend that you specify the port range in a set of IP permissions instead. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The ID of the security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // A set of IP permissions. You can't specify a destination security group and - // a CIDR IP address range. - IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` - - // The IP protocol name or number. We recommend that you specify the protocol - // in a set of IP permissions instead. - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // The name of a destination security group. To authorize outbound access to - // a destination security group, we recommend that you use a set of IP permissions - // instead. - SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` - - // The AWS account number for a destination security group. To authorize outbound - // access to a destination security group, we recommend that you use a set of - // IP permissions instead. - SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` - - // The end of port range for the TCP and UDP protocols, or an ICMP type number. - // We recommend that you specify the port range in a set of IP permissions instead. - ToPort *int64 `locationName:"toPort" type:"integer"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupEgressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupEgressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeSecurityGroupEgressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeSecurityGroupEgressInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrIp sets the CidrIp field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetCidrIp(v string) *AuthorizeSecurityGroupEgressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetDryRun(v bool) *AuthorizeSecurityGroupEgressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetFromPort(v int64) *AuthorizeSecurityGroupEgressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetGroupId(v string) *AuthorizeSecurityGroupEgressInput { - s.GroupId = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetIpPermissions(v []*IpPermission) *AuthorizeSecurityGroupEgressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetIpProtocol(v string) *AuthorizeSecurityGroupEgressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetSourceSecurityGroupName(v string) *AuthorizeSecurityGroupEgressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetSourceSecurityGroupOwnerId(v string) *AuthorizeSecurityGroupEgressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetToPort(v int64) *AuthorizeSecurityGroupEgressInput { - s.ToPort = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupEgressOutput -type AuthorizeSecurityGroupEgressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupEgressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupEgressOutput) GoString() string { - return s.String() -} - -// Contains the parameters for AuthorizeSecurityGroupIngress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngressRequest -type AuthorizeSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The CIDR IPv4 address range. You can't specify this parameter when specifying - // a source security group. - CidrIp *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 - // type number. For the ICMP/ICMPv6 type number, use -1 to specify all types. - FromPort *int64 `type:"integer"` - - // The ID of the security group. Required for a nondefault VPC. - GroupId *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the security group. - GroupName *string `type:"string"` - - // A set of IP permissions. Can be used to specify multiple rules in a single - // command. - IpPermissions []*IpPermission `locationNameList:"item" type:"list"` - - // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // (VPC only) Use -1 to specify all protocols. If you specify -1, or a protocol - // number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is - // allowed, regardless of any ports you specify. For tcp, udp, and icmp, you - // must specify a port range. For protocol 58 (ICMPv6), you can optionally specify - // a port range; if you don't, traffic for all types and codes is allowed. - IpProtocol *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the source security group. You can't - // specify this parameter in combination with the following parameters: the - // CIDR IP address range, the start of the port range, the IP protocol, and - // the end of the port range. Creates rules that grant full ICMP, UDP, and TCP - // access. To create a rule with a specific IP protocol and port range, use - // a set of IP permissions instead. For EC2-VPC, the source security group must - // be in the same VPC. - SourceSecurityGroupName *string `type:"string"` - - // [EC2-Classic] The AWS account number for the source security group, if the - // source security group is in a different account. You can't specify this parameter - // in combination with the following parameters: the CIDR IP address range, - // the IP protocol, the start of the port range, and the end of the port range. - // Creates rules that grant full ICMP, UDP, and TCP access. To create a rule - // with a specific IP protocol and port range, use a set of IP permissions instead. - SourceSecurityGroupOwnerId *string `type:"string"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code - // number. For the ICMP/ICMPv6 code number, use -1 to specify all codes. - ToPort *int64 `type:"integer"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// SetCidrIp sets the CidrIp field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetCidrIp(v string) *AuthorizeSecurityGroupIngressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetDryRun(v bool) *AuthorizeSecurityGroupIngressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetFromPort(v int64) *AuthorizeSecurityGroupIngressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetGroupId(v string) *AuthorizeSecurityGroupIngressInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetGroupName(v string) *AuthorizeSecurityGroupIngressInput { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetIpPermissions(v []*IpPermission) *AuthorizeSecurityGroupIngressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetIpProtocol(v string) *AuthorizeSecurityGroupIngressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupName(v string) *AuthorizeSecurityGroupIngressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupOwnerId(v string) *AuthorizeSecurityGroupIngressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetToPort(v int64) *AuthorizeSecurityGroupIngressInput { - s.ToPort = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeSecurityGroupIngressOutput -type AuthorizeSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AuthorizeSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AuthorizeSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// Describes an Availability Zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AvailabilityZone -type AvailabilityZone struct { - _ struct{} `type:"structure"` - - // Any messages about the Availability Zone. - Messages []*AvailabilityZoneMessage `locationName:"messageSet" locationNameList:"item" type:"list"` - - // The name of the region. - RegionName *string `locationName:"regionName" type:"string"` - - // The state of the Availability Zone. - State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"` - - // The name of the Availability Zone. - ZoneName *string `locationName:"zoneName" type:"string"` -} - -// String returns the string representation -func (s AvailabilityZone) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailabilityZone) GoString() string { - return s.String() -} - -// SetMessages sets the Messages field's value. -func (s *AvailabilityZone) SetMessages(v []*AvailabilityZoneMessage) *AvailabilityZone { - s.Messages = v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *AvailabilityZone) SetRegionName(v string) *AvailabilityZone { - s.RegionName = &v - return s -} - -// SetState sets the State field's value. -func (s *AvailabilityZone) SetState(v string) *AvailabilityZone { - s.State = &v - return s -} - -// SetZoneName sets the ZoneName field's value. -func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone { - s.ZoneName = &v - return s -} - -// Describes a message about an Availability Zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AvailabilityZoneMessage -type AvailabilityZoneMessage struct { - _ struct{} `type:"structure"` - - // The message about the Availability Zone. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s AvailabilityZoneMessage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailabilityZoneMessage) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *AvailabilityZoneMessage) SetMessage(v string) *AvailabilityZoneMessage { - s.Message = &v - return s -} - -// The capacity information for instances launched onto the Dedicated Host. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AvailableCapacity -type AvailableCapacity struct { - _ struct{} `type:"structure"` - - // The total number of instances that the Dedicated Host supports. - AvailableInstanceCapacity []*InstanceCapacity `locationName:"availableInstanceCapacity" locationNameList:"item" type:"list"` - - // The number of vCPUs available on the Dedicated Host. - AvailableVCpus *int64 `locationName:"availableVCpus" type:"integer"` -} - -// String returns the string representation -func (s AvailableCapacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailableCapacity) GoString() string { - return s.String() -} - -// SetAvailableInstanceCapacity sets the AvailableInstanceCapacity field's value. -func (s *AvailableCapacity) SetAvailableInstanceCapacity(v []*InstanceCapacity) *AvailableCapacity { - s.AvailableInstanceCapacity = v - return s -} - -// SetAvailableVCpus sets the AvailableVCpus field's value. -func (s *AvailableCapacity) SetAvailableVCpus(v int64) *AvailableCapacity { - s.AvailableVCpus = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BlobAttributeValue -type BlobAttributeValue struct { - _ struct{} `type:"structure"` - - // Value is automatically base64 encoded/decoded by the SDK. - Value []byte `locationName:"value" type:"blob"` -} - -// String returns the string representation -func (s BlobAttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlobAttributeValue) GoString() string { - return s.String() -} - -// SetValue sets the Value field's value. -func (s *BlobAttributeValue) SetValue(v []byte) *BlobAttributeValue { - s.Value = v - return s -} - -// Describes a block device mapping. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BlockDeviceMapping -type BlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name exposed to the instance (for example, /dev/sdh or xvdh). - DeviceName *string `locationName:"deviceName" type:"string"` - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsBlockDevice `locationName:"ebs" type:"structure"` - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice *string `locationName:"noDevice" type:"string"` - - // The virtual device name (ephemeralN). Instance store volumes are numbered - // starting from 0. An instance type with 2 available instance store volumes - // can specify mappings for ephemeral0 and ephemeral1.The number of available - // instance store volumes depends on the instance type. After you connect to - // the instance, you must mount the volume. - // - // Constraints: For M3 instances, you must specify instance store volumes in - // the block device mapping for the instance. When you launch an M3 instance, - // we ignore any instance store volumes specified in the block device mapping - // for the AMI. - VirtualName *string `locationName:"virtualName" type:"string"` -} - -// String returns the string representation -func (s BlockDeviceMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BlockDeviceMapping) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *BlockDeviceMapping) SetDeviceName(v string) *BlockDeviceMapping { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *BlockDeviceMapping) SetEbs(v *EbsBlockDevice) *BlockDeviceMapping { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *BlockDeviceMapping) SetNoDevice(v string) *BlockDeviceMapping { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *BlockDeviceMapping) SetVirtualName(v string) *BlockDeviceMapping { - s.VirtualName = &v - return s -} - -// Contains the parameters for BundleInstance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstanceRequest -type BundleInstanceInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance to bundle. - // - // Type: String - // - // Default: None - // - // Required: Yes - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The bucket in which to store the AMI. You can specify a bucket that you already - // own or a new bucket that Amazon EC2 creates on your behalf. If you specify - // a bucket that belongs to someone else, Amazon EC2 returns an error. - // - // Storage is a required field - Storage *Storage `type:"structure" required:"true"` -} - -// String returns the string representation -func (s BundleInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BundleInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BundleInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Storage == nil { - invalidParams.Add(request.NewErrParamRequired("Storage")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *BundleInstanceInput) SetDryRun(v bool) *BundleInstanceInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *BundleInstanceInput) SetInstanceId(v string) *BundleInstanceInput { - s.InstanceId = &v - return s -} - -// SetStorage sets the Storage field's value. -func (s *BundleInstanceInput) SetStorage(v *Storage) *BundleInstanceInput { - s.Storage = v - return s -} - -// Contains the output of BundleInstance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleInstanceResult -type BundleInstanceOutput struct { - _ struct{} `type:"structure"` - - // Information about the bundle task. - BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` -} - -// String returns the string representation -func (s BundleInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleInstanceOutput) GoString() string { - return s.String() -} - -// SetBundleTask sets the BundleTask field's value. -func (s *BundleInstanceOutput) SetBundleTask(v *BundleTask) *BundleInstanceOutput { - s.BundleTask = v - return s -} - -// Describes a bundle task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleTask -type BundleTask struct { - _ struct{} `type:"structure"` - - // The ID of the bundle task. - BundleId *string `locationName:"bundleId" type:"string"` - - // If the task fails, a description of the error. - BundleTaskError *BundleTaskError `locationName:"error" type:"structure"` - - // The ID of the instance associated with this bundle task. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The level of task completion, as a percent (for example, 20%). - Progress *string `locationName:"progress" type:"string"` - - // The time this task started. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The state of the task. - State *string `locationName:"state" type:"string" enum:"BundleTaskState"` - - // The Amazon S3 storage locations. - Storage *Storage `locationName:"storage" type:"structure"` - - // The time of the most recent update for the task. - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s BundleTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleTask) GoString() string { - return s.String() -} - -// SetBundleId sets the BundleId field's value. -func (s *BundleTask) SetBundleId(v string) *BundleTask { - s.BundleId = &v - return s -} - -// SetBundleTaskError sets the BundleTaskError field's value. -func (s *BundleTask) SetBundleTaskError(v *BundleTaskError) *BundleTask { - s.BundleTaskError = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *BundleTask) SetInstanceId(v string) *BundleTask { - s.InstanceId = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *BundleTask) SetProgress(v string) *BundleTask { - s.Progress = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *BundleTask) SetStartTime(v time.Time) *BundleTask { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *BundleTask) SetState(v string) *BundleTask { - s.State = &v - return s -} - -// SetStorage sets the Storage field's value. -func (s *BundleTask) SetStorage(v *Storage) *BundleTask { - s.Storage = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *BundleTask) SetUpdateTime(v time.Time) *BundleTask { - s.UpdateTime = &v - return s -} - -// Describes an error for BundleInstance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/BundleTaskError -type BundleTaskError struct { - _ struct{} `type:"structure"` - - // The error code. - Code *string `locationName:"code" type:"string"` - - // The error message. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s BundleTaskError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BundleTaskError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *BundleTaskError) SetCode(v string) *BundleTaskError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *BundleTaskError) SetMessage(v string) *BundleTaskError { - s.Message = &v - return s -} - -// Contains the parameters for CancelBundleTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTaskRequest -type CancelBundleTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the bundle task. - // - // BundleId is a required field - BundleId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s CancelBundleTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelBundleTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelBundleTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelBundleTaskInput"} - if s.BundleId == nil { - invalidParams.Add(request.NewErrParamRequired("BundleId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBundleId sets the BundleId field's value. -func (s *CancelBundleTaskInput) SetBundleId(v string) *CancelBundleTaskInput { - s.BundleId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelBundleTaskInput) SetDryRun(v bool) *CancelBundleTaskInput { - s.DryRun = &v - return s -} - -// Contains the output of CancelBundleTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelBundleTaskResult -type CancelBundleTaskOutput struct { - _ struct{} `type:"structure"` - - // Information about the bundle task. - BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` -} - -// String returns the string representation -func (s CancelBundleTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelBundleTaskOutput) GoString() string { - return s.String() -} - -// SetBundleTask sets the BundleTask field's value. -func (s *CancelBundleTaskOutput) SetBundleTask(v *BundleTask) *CancelBundleTaskOutput { - s.BundleTask = v - return s -} - -// Contains the parameters for CancelConversionTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionRequest -type CancelConversionTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the conversion task. - // - // ConversionTaskId is a required field - ConversionTaskId *string `locationName:"conversionTaskId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The reason for canceling the conversion task. - ReasonMessage *string `locationName:"reasonMessage" type:"string"` -} - -// String returns the string representation -func (s CancelConversionTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelConversionTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelConversionTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelConversionTaskInput"} - if s.ConversionTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("ConversionTaskId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConversionTaskId sets the ConversionTaskId field's value. -func (s *CancelConversionTaskInput) SetConversionTaskId(v string) *CancelConversionTaskInput { - s.ConversionTaskId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelConversionTaskInput) SetDryRun(v bool) *CancelConversionTaskInput { - s.DryRun = &v - return s -} - -// SetReasonMessage sets the ReasonMessage field's value. -func (s *CancelConversionTaskInput) SetReasonMessage(v string) *CancelConversionTaskInput { - s.ReasonMessage = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelConversionTaskOutput -type CancelConversionTaskOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelConversionTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelConversionTaskOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CancelExportTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTaskRequest -type CancelExportTaskInput struct { - _ struct{} `type:"structure"` - - // The ID of the export task. This is the ID returned by CreateInstanceExportTask. - // - // ExportTaskId is a required field - ExportTaskId *string `locationName:"exportTaskId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelExportTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelExportTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelExportTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelExportTaskInput"} - if s.ExportTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("ExportTaskId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExportTaskId sets the ExportTaskId field's value. -func (s *CancelExportTaskInput) SetExportTaskId(v string) *CancelExportTaskInput { - s.ExportTaskId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelExportTaskOutput -type CancelExportTaskOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelExportTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelExportTaskOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CancelImportTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTaskRequest -type CancelImportTaskInput struct { - _ struct{} `type:"structure"` - - // The reason for canceling the task. - CancelReason *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the import image or import snapshot task to be canceled. - ImportTaskId *string `type:"string"` -} - -// String returns the string representation -func (s CancelImportTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelImportTaskInput) GoString() string { - return s.String() -} - -// SetCancelReason sets the CancelReason field's value. -func (s *CancelImportTaskInput) SetCancelReason(v string) *CancelImportTaskInput { - s.CancelReason = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelImportTaskInput) SetDryRun(v bool) *CancelImportTaskInput { - s.DryRun = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *CancelImportTaskInput) SetImportTaskId(v string) *CancelImportTaskInput { - s.ImportTaskId = &v - return s -} - -// Contains the output for CancelImportTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelImportTaskResult -type CancelImportTaskOutput struct { - _ struct{} `type:"structure"` - - // The ID of the task being canceled. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // The current state of the task being canceled. - PreviousState *string `locationName:"previousState" type:"string"` - - // The current state of the task being canceled. - State *string `locationName:"state" type:"string"` -} - -// String returns the string representation -func (s CancelImportTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelImportTaskOutput) GoString() string { - return s.String() -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *CancelImportTaskOutput) SetImportTaskId(v string) *CancelImportTaskOutput { - s.ImportTaskId = &v - return s -} - -// SetPreviousState sets the PreviousState field's value. -func (s *CancelImportTaskOutput) SetPreviousState(v string) *CancelImportTaskOutput { - s.PreviousState = &v - return s -} - -// SetState sets the State field's value. -func (s *CancelImportTaskOutput) SetState(v string) *CancelImportTaskOutput { - s.State = &v - return s -} - -// Contains the parameters for CancelReservedInstancesListing. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListingRequest -type CancelReservedInstancesListingInput struct { - _ struct{} `type:"structure"` - - // The ID of the Reserved Instance listing. - // - // ReservedInstancesListingId is a required field - ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelReservedInstancesListingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelReservedInstancesListingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelReservedInstancesListingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelReservedInstancesListingInput"} - if s.ReservedInstancesListingId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesListingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. -func (s *CancelReservedInstancesListingInput) SetReservedInstancesListingId(v string) *CancelReservedInstancesListingInput { - s.ReservedInstancesListingId = &v - return s -} - -// Contains the output of CancelReservedInstancesListing. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelReservedInstancesListingResult -type CancelReservedInstancesListingOutput struct { - _ struct{} `type:"structure"` - - // The Reserved Instance listing. - ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CancelReservedInstancesListingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelReservedInstancesListingOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *CancelReservedInstancesListingOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *CancelReservedInstancesListingOutput { - s.ReservedInstancesListings = v - return s -} - -// Describes a Spot fleet error. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequestsError -type CancelSpotFleetRequestsError struct { - _ struct{} `type:"structure"` - - // The error code. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true" enum:"CancelBatchErrorCode"` - - // The description for the error code. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *CancelSpotFleetRequestsError) SetCode(v string) *CancelSpotFleetRequestsError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *CancelSpotFleetRequestsError) SetMessage(v string) *CancelSpotFleetRequestsError { - s.Message = &v - return s -} - -// Describes a Spot fleet request that was not successfully canceled. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequestsErrorItem -type CancelSpotFleetRequestsErrorItem struct { - _ struct{} `type:"structure"` - - // The error. - // - // Error is a required field - Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure" required:"true"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsErrorItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsErrorItem) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *CancelSpotFleetRequestsErrorItem) SetError(v *CancelSpotFleetRequestsError) *CancelSpotFleetRequestsErrorItem { - s.Error = v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *CancelSpotFleetRequestsErrorItem) SetSpotFleetRequestId(v string) *CancelSpotFleetRequestsErrorItem { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for CancelSpotFleetRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequestsRequest -type CancelSpotFleetRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IDs of the Spot fleet requests. - // - // SpotFleetRequestIds is a required field - SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"` - - // Indicates whether to terminate instances for a Spot fleet request if it is - // canceled successfully. - // - // TerminateInstances is a required field - TerminateInstances *bool `locationName:"terminateInstances" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelSpotFleetRequestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelSpotFleetRequestsInput"} - if s.SpotFleetRequestIds == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestIds")) - } - if s.TerminateInstances == nil { - invalidParams.Add(request.NewErrParamRequired("TerminateInstances")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelSpotFleetRequestsInput) SetDryRun(v bool) *CancelSpotFleetRequestsInput { - s.DryRun = &v - return s -} - -// SetSpotFleetRequestIds sets the SpotFleetRequestIds field's value. -func (s *CancelSpotFleetRequestsInput) SetSpotFleetRequestIds(v []*string) *CancelSpotFleetRequestsInput { - s.SpotFleetRequestIds = v - return s -} - -// SetTerminateInstances sets the TerminateInstances field's value. -func (s *CancelSpotFleetRequestsInput) SetTerminateInstances(v bool) *CancelSpotFleetRequestsInput { - s.TerminateInstances = &v - return s -} - -// Contains the output of CancelSpotFleetRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequestsResponse -type CancelSpotFleetRequestsOutput struct { - _ struct{} `type:"structure"` - - // Information about the Spot fleet requests that are successfully canceled. - SuccessfulFleetRequests []*CancelSpotFleetRequestsSuccessItem `locationName:"successfulFleetRequestSet" locationNameList:"item" type:"list"` - - // Information about the Spot fleet requests that are not successfully canceled. - UnsuccessfulFleetRequests []*CancelSpotFleetRequestsErrorItem `locationName:"unsuccessfulFleetRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsOutput) GoString() string { - return s.String() -} - -// SetSuccessfulFleetRequests sets the SuccessfulFleetRequests field's value. -func (s *CancelSpotFleetRequestsOutput) SetSuccessfulFleetRequests(v []*CancelSpotFleetRequestsSuccessItem) *CancelSpotFleetRequestsOutput { - s.SuccessfulFleetRequests = v - return s -} - -// SetUnsuccessfulFleetRequests sets the UnsuccessfulFleetRequests field's value. -func (s *CancelSpotFleetRequestsOutput) SetUnsuccessfulFleetRequests(v []*CancelSpotFleetRequestsErrorItem) *CancelSpotFleetRequestsOutput { - s.UnsuccessfulFleetRequests = v - return s -} - -// Describes a Spot fleet request that was successfully canceled. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotFleetRequestsSuccessItem -type CancelSpotFleetRequestsSuccessItem struct { - _ struct{} `type:"structure"` - - // The current state of the Spot fleet request. - // - // CurrentSpotFleetRequestState is a required field - CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"` - - // The previous state of the Spot fleet request. - // - // PreviousSpotFleetRequestState is a required field - PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelSpotFleetRequestsSuccessItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotFleetRequestsSuccessItem) GoString() string { - return s.String() -} - -// SetCurrentSpotFleetRequestState sets the CurrentSpotFleetRequestState field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetCurrentSpotFleetRequestState(v string) *CancelSpotFleetRequestsSuccessItem { - s.CurrentSpotFleetRequestState = &v - return s -} - -// SetPreviousSpotFleetRequestState sets the PreviousSpotFleetRequestState field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetPreviousSpotFleetRequestState(v string) *CancelSpotFleetRequestsSuccessItem { - s.PreviousSpotFleetRequestState = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetSpotFleetRequestId(v string) *CancelSpotFleetRequestsSuccessItem { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for CancelSpotInstanceRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequestsRequest -type CancelSpotInstanceRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more Spot instance request IDs. - // - // SpotInstanceRequestIds is a required field - SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` -} - -// String returns the string representation -func (s CancelSpotInstanceRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotInstanceRequestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelSpotInstanceRequestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelSpotInstanceRequestsInput"} - if s.SpotInstanceRequestIds == nil { - invalidParams.Add(request.NewErrParamRequired("SpotInstanceRequestIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CancelSpotInstanceRequestsInput) SetDryRun(v bool) *CancelSpotInstanceRequestsInput { - s.DryRun = &v - return s -} - -// SetSpotInstanceRequestIds sets the SpotInstanceRequestIds field's value. -func (s *CancelSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*string) *CancelSpotInstanceRequestsInput { - s.SpotInstanceRequestIds = v - return s -} - -// Contains the output of CancelSpotInstanceRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelSpotInstanceRequestsResult -type CancelSpotInstanceRequestsOutput struct { - _ struct{} `type:"structure"` - - // One or more Spot instance requests. - CancelledSpotInstanceRequests []*CancelledSpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CancelSpotInstanceRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelSpotInstanceRequestsOutput) GoString() string { - return s.String() -} - -// SetCancelledSpotInstanceRequests sets the CancelledSpotInstanceRequests field's value. -func (s *CancelSpotInstanceRequestsOutput) SetCancelledSpotInstanceRequests(v []*CancelledSpotInstanceRequest) *CancelSpotInstanceRequestsOutput { - s.CancelledSpotInstanceRequests = v - return s -} - -// Describes a request to cancel a Spot instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelledSpotInstanceRequest -type CancelledSpotInstanceRequest struct { - _ struct{} `type:"structure"` - - // The ID of the Spot instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - - // The state of the Spot instance request. - State *string `locationName:"state" type:"string" enum:"CancelSpotInstanceRequestState"` -} - -// String returns the string representation -func (s CancelledSpotInstanceRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelledSpotInstanceRequest) GoString() string { - return s.String() -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *CancelledSpotInstanceRequest) SetSpotInstanceRequestId(v string) *CancelledSpotInstanceRequest { - s.SpotInstanceRequestId = &v - return s -} - -// SetState sets the State field's value. -func (s *CancelledSpotInstanceRequest) SetState(v string) *CancelledSpotInstanceRequest { - s.State = &v - return s -} - -// Describes the ClassicLink DNS support status of a VPC. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ClassicLinkDnsSupport -type ClassicLinkDnsSupport struct { - _ struct{} `type:"structure"` - - // Indicates whether ClassicLink DNS support is enabled for the VPC. - ClassicLinkDnsSupported *bool `locationName:"classicLinkDnsSupported" type:"boolean"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s ClassicLinkDnsSupport) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClassicLinkDnsSupport) GoString() string { - return s.String() -} - -// SetClassicLinkDnsSupported sets the ClassicLinkDnsSupported field's value. -func (s *ClassicLinkDnsSupport) SetClassicLinkDnsSupported(v bool) *ClassicLinkDnsSupport { - s.ClassicLinkDnsSupported = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ClassicLinkDnsSupport) SetVpcId(v string) *ClassicLinkDnsSupport { - s.VpcId = &v - return s -} - -// Describes a linked EC2-Classic instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ClassicLinkInstance -type ClassicLinkInstance struct { - _ struct{} `type:"structure"` - - // A list of security groups. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // Any tags assigned to the instance. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s ClassicLinkInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClassicLinkInstance) GoString() string { - return s.String() -} - -// SetGroups sets the Groups field's value. -func (s *ClassicLinkInstance) SetGroups(v []*GroupIdentifier) *ClassicLinkInstance { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ClassicLinkInstance) SetInstanceId(v string) *ClassicLinkInstance { - s.InstanceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ClassicLinkInstance) SetTags(v []*Tag) *ClassicLinkInstance { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ClassicLinkInstance) SetVpcId(v string) *ClassicLinkInstance { - s.VpcId = &v - return s -} - -// Describes the client-specific data. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ClientData -type ClientData struct { - _ struct{} `type:"structure"` - - // A user-defined comment about the disk upload. - Comment *string `type:"string"` - - // The time that the disk upload ends. - UploadEnd *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The size of the uploaded disk image, in GiB. - UploadSize *float64 `type:"double"` - - // The time that the disk upload starts. - UploadStart *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ClientData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ClientData) GoString() string { - return s.String() -} - -// SetComment sets the Comment field's value. -func (s *ClientData) SetComment(v string) *ClientData { - s.Comment = &v - return s -} - -// SetUploadEnd sets the UploadEnd field's value. -func (s *ClientData) SetUploadEnd(v time.Time) *ClientData { - s.UploadEnd = &v - return s -} - -// SetUploadSize sets the UploadSize field's value. -func (s *ClientData) SetUploadSize(v float64) *ClientData { - s.UploadSize = &v - return s -} - -// SetUploadStart sets the UploadStart field's value. -func (s *ClientData) SetUploadStart(v time.Time) *ClientData { - s.UploadStart = &v - return s -} - -// Contains the parameters for ConfirmProductInstance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstanceRequest -type ConfirmProductInstanceInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The product code. This must be a product code that you own. - // - // ProductCode is a required field - ProductCode *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ConfirmProductInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfirmProductInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfirmProductInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfirmProductInstanceInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.ProductCode == nil { - invalidParams.Add(request.NewErrParamRequired("ProductCode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ConfirmProductInstanceInput) SetDryRun(v bool) *ConfirmProductInstanceInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ConfirmProductInstanceInput) SetInstanceId(v string) *ConfirmProductInstanceInput { - s.InstanceId = &v - return s -} - -// SetProductCode sets the ProductCode field's value. -func (s *ConfirmProductInstanceInput) SetProductCode(v string) *ConfirmProductInstanceInput { - s.ProductCode = &v - return s -} - -// Contains the output of ConfirmProductInstance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConfirmProductInstanceResult -type ConfirmProductInstanceOutput struct { - _ struct{} `type:"structure"` - - // The AWS account ID of the instance owner. This is only present if the product - // code is attached to the instance. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The return value of the request. Returns true if the specified product code - // is owned by the requester and associated with the specified instance. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ConfirmProductInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConfirmProductInstanceOutput) GoString() string { - return s.String() -} - -// SetOwnerId sets the OwnerId field's value. -func (s *ConfirmProductInstanceOutput) SetOwnerId(v string) *ConfirmProductInstanceOutput { - s.OwnerId = &v - return s -} - -// SetReturn sets the Return field's value. -func (s *ConfirmProductInstanceOutput) SetReturn(v bool) *ConfirmProductInstanceOutput { - s.Return = &v - return s -} - -// Describes a conversion task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ConversionTask -type ConversionTask struct { - _ struct{} `type:"structure"` - - // The ID of the conversion task. - // - // ConversionTaskId is a required field - ConversionTaskId *string `locationName:"conversionTaskId" type:"string" required:"true"` - - // The time when the task expires. If the upload isn't complete before the expiration - // time, we automatically cancel the task. - ExpirationTime *string `locationName:"expirationTime" type:"string"` - - // If the task is for importing an instance, this contains information about - // the import instance task. - ImportInstance *ImportInstanceTaskDetails `locationName:"importInstance" type:"structure"` - - // If the task is for importing a volume, this contains information about the - // import volume task. - ImportVolume *ImportVolumeTaskDetails `locationName:"importVolume" type:"structure"` - - // The state of the conversion task. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"ConversionTaskState"` - - // The status message related to the conversion task. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // Any tags assigned to the task. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ConversionTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConversionTask) GoString() string { - return s.String() -} - -// SetConversionTaskId sets the ConversionTaskId field's value. -func (s *ConversionTask) SetConversionTaskId(v string) *ConversionTask { - s.ConversionTaskId = &v - return s -} - -// SetExpirationTime sets the ExpirationTime field's value. -func (s *ConversionTask) SetExpirationTime(v string) *ConversionTask { - s.ExpirationTime = &v - return s -} - -// SetImportInstance sets the ImportInstance field's value. -func (s *ConversionTask) SetImportInstance(v *ImportInstanceTaskDetails) *ConversionTask { - s.ImportInstance = v - return s -} - -// SetImportVolume sets the ImportVolume field's value. -func (s *ConversionTask) SetImportVolume(v *ImportVolumeTaskDetails) *ConversionTask { - s.ImportVolume = v - return s -} - -// SetState sets the State field's value. -func (s *ConversionTask) SetState(v string) *ConversionTask { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ConversionTask) SetStatusMessage(v string) *ConversionTask { - s.StatusMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ConversionTask) SetTags(v []*Tag) *ConversionTask { - s.Tags = v - return s -} - -// Contains the parameters for CopyImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImageRequest -type CopyImageInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `type:"string"` - - // A description for the new AMI in the destination region. - Description *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the destination snapshots of the copied image should be - // encrypted. The default CMK for EBS is used unless a non-default AWS Key Management - // Service (AWS KMS) CMK is specified with KmsKeyId. For more information, see - // Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The full ARN of the AWS Key Management Service (AWS KMS) CMK to use when - // encrypting the snapshots of an image during a copy operation. This parameter - // is only required if you want to use a non-default CMK; if this parameter - // is not specified, the default CMK for EBS is used. The ARN contains the arn:aws:kms - // namespace, followed by the region of the CMK, the AWS account ID of the CMK - // owner, the key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // The specified CMK must exist in the region that the snapshot is being copied - // to. If a KmsKeyId is specified, the Encrypted flag must also be set. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The name of the new AMI in the destination region. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The ID of the AMI to copy. - // - // SourceImageId is a required field - SourceImageId *string `type:"string" required:"true"` - - // The name of the region that contains the AMI to copy. - // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopyImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyImageInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.SourceImageId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceImageId")) - } - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CopyImageInput) SetClientToken(v string) *CopyImageInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CopyImageInput) SetDescription(v string) *CopyImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CopyImageInput) SetDryRun(v bool) *CopyImageInput { - s.DryRun = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *CopyImageInput) SetEncrypted(v bool) *CopyImageInput { - s.Encrypted = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopyImageInput) SetKmsKeyId(v string) *CopyImageInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CopyImageInput) SetName(v string) *CopyImageInput { - s.Name = &v - return s -} - -// SetSourceImageId sets the SourceImageId field's value. -func (s *CopyImageInput) SetSourceImageId(v string) *CopyImageInput { - s.SourceImageId = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyImageInput) SetSourceRegion(v string) *CopyImageInput { - s.SourceRegion = &v - return s -} - -// Contains the output of CopyImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopyImageResult -type CopyImageOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new AMI. - ImageId *string `locationName:"imageId" type:"string"` -} - -// String returns the string representation -func (s CopyImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *CopyImageOutput) SetImageId(v string) *CopyImageOutput { - s.ImageId = &v - return s -} - -// Contains the parameters for CopySnapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshotRequest -type CopySnapshotInput struct { - _ struct{} `type:"structure"` - - // A description for the EBS snapshot. - Description *string `type:"string"` - - // The destination region to use in the PresignedUrl parameter of a snapshot - // copy operation. This parameter is only valid for specifying the destination - // region in a PresignedUrl parameter, where it is required. - // - // CopySnapshot sends the snapshot copy to the regional endpoint that you send - // the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI, - // this is specified with the --region parameter or the default region in your - // AWS configuration file). - DestinationRegion *string `locationName:"destinationRegion" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the destination snapshot should be encrypted. You can encrypt - // a copy of an unencrypted snapshot using this flag, but you cannot use it - // to create an unencrypted copy from an encrypted snapshot. Your default CMK - // for EBS is used unless a non-default AWS Key Management Service (AWS KMS) - // CMK is specified with KmsKeyId. For more information, see Amazon EBS Encryption - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in - // the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The full ARN of the AWS Key Management Service (AWS KMS) CMK to use when - // creating the snapshot copy. This parameter is only required if you want to - // use a non-default CMK; if this parameter is not specified, the default CMK - // for EBS is used. The ARN contains the arn:aws:kms namespace, followed by - // the region of the CMK, the AWS account ID of the CMK owner, the key namespace, - // and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // The specified CMK must exist in the region that the snapshot is being copied - // to. If a KmsKeyId is specified, the Encrypted flag must also be set. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The pre-signed URL that facilitates copying an encrypted snapshot. This parameter - // is only required when copying an encrypted snapshot with the Amazon EC2 Query - // API; it is available as an optional parameter in all other cases. The PresignedUrl - // should use the snapshot source endpoint, the CopySnapshot action, and include - // the SourceRegion, SourceSnapshotId, and DestinationRegion parameters. The - // PresignedUrl must be signed using AWS Signature Version 4. Because EBS snapshots - // are stored in Amazon S3, the signing algorithm for this parameter uses the - // same logic that is described in Authenticating Requests by Using Query Parameters - // (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) - // in the Amazon Simple Storage Service API Reference. An invalid or improperly - // signed PresignedUrl will cause the copy operation to fail asynchronously, - // and the snapshot will move to an error state. - PresignedUrl *string `locationName:"presignedUrl" type:"string"` - - // The ID of the region that contains the snapshot to be copied. - // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` - - // The ID of the EBS snapshot to copy. - // - // SourceSnapshotId is a required field - SourceSnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CopySnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopySnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopySnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopySnapshotInput"} - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) - } - if s.SourceSnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceSnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CopySnapshotInput) SetDescription(v string) *CopySnapshotInput { - s.Description = &v - return s -} - -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *CopySnapshotInput) SetDestinationRegion(v string) *CopySnapshotInput { - s.DestinationRegion = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CopySnapshotInput) SetDryRun(v bool) *CopySnapshotInput { - s.DryRun = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *CopySnapshotInput) SetEncrypted(v bool) *CopySnapshotInput { - s.Encrypted = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopySnapshotInput) SetKmsKeyId(v string) *CopySnapshotInput { - s.KmsKeyId = &v - return s -} - -// SetPresignedUrl sets the PresignedUrl field's value. -func (s *CopySnapshotInput) SetPresignedUrl(v string) *CopySnapshotInput { - s.PresignedUrl = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopySnapshotInput) SetSourceRegion(v string) *CopySnapshotInput { - s.SourceRegion = &v - return s -} - -// SetSourceSnapshotId sets the SourceSnapshotId field's value. -func (s *CopySnapshotInput) SetSourceSnapshotId(v string) *CopySnapshotInput { - s.SourceSnapshotId = &v - return s -} - -// Contains the output of CopySnapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CopySnapshotResult -type CopySnapshotOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` -} - -// String returns the string representation -func (s CopySnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopySnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *CopySnapshotOutput) SetSnapshotId(v string) *CopySnapshotOutput { - s.SnapshotId = &v - return s -} - -// Contains the parameters for CreateCustomerGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGatewayRequest -type CreateCustomerGatewayInput struct { - _ struct{} `type:"structure"` - - // For devices that support BGP, the customer gateway's BGP ASN. - // - // Default: 65000 - // - // BgpAsn is a required field - BgpAsn *int64 `type:"integer" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The Internet-routable IP address for the customer gateway's outside interface. - // The address must be static. - // - // PublicIp is a required field - PublicIp *string `locationName:"IpAddress" type:"string" required:"true"` - - // The type of VPN connection that this customer gateway supports (ipsec.1). - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"GatewayType"` -} - -// String returns the string representation -func (s CreateCustomerGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCustomerGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCustomerGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCustomerGatewayInput"} - if s.BgpAsn == nil { - invalidParams.Add(request.NewErrParamRequired("BgpAsn")) - } - if s.PublicIp == nil { - invalidParams.Add(request.NewErrParamRequired("PublicIp")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBgpAsn sets the BgpAsn field's value. -func (s *CreateCustomerGatewayInput) SetBgpAsn(v int64) *CreateCustomerGatewayInput { - s.BgpAsn = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateCustomerGatewayInput) SetDryRun(v bool) *CreateCustomerGatewayInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *CreateCustomerGatewayInput) SetPublicIp(v string) *CreateCustomerGatewayInput { - s.PublicIp = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateCustomerGatewayInput) SetType(v string) *CreateCustomerGatewayInput { - s.Type = &v - return s -} - -// Contains the output of CreateCustomerGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCustomerGatewayResult -type CreateCustomerGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the customer gateway. - CustomerGateway *CustomerGateway `locationName:"customerGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateCustomerGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateCustomerGatewayOutput) GoString() string { - return s.String() -} - -// SetCustomerGateway sets the CustomerGateway field's value. -func (s *CreateCustomerGatewayOutput) SetCustomerGateway(v *CustomerGateway) *CreateCustomerGatewayOutput { - s.CustomerGateway = v - return s -} - -// Contains the parameters for CreateDhcpOptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptionsRequest -type CreateDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // A DHCP configuration option. - // - // DhcpConfigurations is a required field - DhcpConfigurations []*NewDhcpConfiguration `locationName:"dhcpConfiguration" locationNameList:"item" type:"list" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s CreateDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDhcpOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDhcpOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDhcpOptionsInput"} - if s.DhcpConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("DhcpConfigurations")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDhcpConfigurations sets the DhcpConfigurations field's value. -func (s *CreateDhcpOptionsInput) SetDhcpConfigurations(v []*NewDhcpConfiguration) *CreateDhcpOptionsInput { - s.DhcpConfigurations = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateDhcpOptionsInput) SetDryRun(v bool) *CreateDhcpOptionsInput { - s.DryRun = &v - return s -} - -// Contains the output of CreateDhcpOptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateDhcpOptionsResult -type CreateDhcpOptionsOutput struct { - _ struct{} `type:"structure"` - - // A set of DHCP options. - DhcpOptions *DhcpOptions `locationName:"dhcpOptions" type:"structure"` -} - -// String returns the string representation -func (s CreateDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDhcpOptionsOutput) GoString() string { - return s.String() -} - -// SetDhcpOptions sets the DhcpOptions field's value. -func (s *CreateDhcpOptionsOutput) SetDhcpOptions(v *DhcpOptions) *CreateDhcpOptionsOutput { - s.DhcpOptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGatewayRequest -type CreateEgressOnlyInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the VPC for which to create the egress-only Internet gateway. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateEgressOnlyInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEgressOnlyInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEgressOnlyInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEgressOnlyInternetGatewayInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetClientToken(v string) *CreateEgressOnlyInternetGatewayInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetDryRun(v bool) *CreateEgressOnlyInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetVpcId(v string) *CreateEgressOnlyInternetGatewayInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateEgressOnlyInternetGatewayResult -type CreateEgressOnlyInternetGatewayOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the egress-only Internet gateway. - EgressOnlyInternetGateway *EgressOnlyInternetGateway `locationName:"egressOnlyInternetGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateEgressOnlyInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateEgressOnlyInternetGatewayOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateEgressOnlyInternetGatewayOutput) SetClientToken(v string) *CreateEgressOnlyInternetGatewayOutput { - s.ClientToken = &v - return s -} - -// SetEgressOnlyInternetGateway sets the EgressOnlyInternetGateway field's value. -func (s *CreateEgressOnlyInternetGatewayOutput) SetEgressOnlyInternetGateway(v *EgressOnlyInternetGateway) *CreateEgressOnlyInternetGatewayOutput { - s.EgressOnlyInternetGateway = v - return s -} - -// Contains the parameters for CreateFlowLogs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogsRequest -type CreateFlowLogsInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs - // log group. - // - // DeliverLogsPermissionArn is a required field - DeliverLogsPermissionArn *string `type:"string" required:"true"` - - // The name of the CloudWatch log group. - // - // LogGroupName is a required field - LogGroupName *string `type:"string" required:"true"` - - // One or more subnet, network interface, or VPC IDs. - // - // Constraints: Maximum of 1000 resources - // - // ResourceIds is a required field - ResourceIds []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"` - - // The type of resource on which to create the flow log. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"FlowLogsResourceType"` - - // The type of traffic to log. - // - // TrafficType is a required field - TrafficType *string `type:"string" required:"true" enum:"TrafficType"` -} - -// String returns the string representation -func (s CreateFlowLogsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFlowLogsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFlowLogsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFlowLogsInput"} - if s.DeliverLogsPermissionArn == nil { - invalidParams.Add(request.NewErrParamRequired("DeliverLogsPermissionArn")) - } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.ResourceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIds")) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - if s.TrafficType == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateFlowLogsInput) SetClientToken(v string) *CreateFlowLogsInput { - s.ClientToken = &v - return s -} - -// SetDeliverLogsPermissionArn sets the DeliverLogsPermissionArn field's value. -func (s *CreateFlowLogsInput) SetDeliverLogsPermissionArn(v string) *CreateFlowLogsInput { - s.DeliverLogsPermissionArn = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateFlowLogsInput) SetLogGroupName(v string) *CreateFlowLogsInput { - s.LogGroupName = &v - return s -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *CreateFlowLogsInput) SetResourceIds(v []*string) *CreateFlowLogsInput { - s.ResourceIds = v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *CreateFlowLogsInput) SetResourceType(v string) *CreateFlowLogsInput { - s.ResourceType = &v - return s -} - -// SetTrafficType sets the TrafficType field's value. -func (s *CreateFlowLogsInput) SetTrafficType(v string) *CreateFlowLogsInput { - s.TrafficType = &v - return s -} - -// Contains the output of CreateFlowLogs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateFlowLogsResult -type CreateFlowLogsOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // The IDs of the flow logs. - FlowLogIds []*string `locationName:"flowLogIdSet" locationNameList:"item" type:"list"` - - // Information about the flow logs that could not be created successfully. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CreateFlowLogsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateFlowLogsOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateFlowLogsOutput) SetClientToken(v string) *CreateFlowLogsOutput { - s.ClientToken = &v - return s -} - -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *CreateFlowLogsOutput) SetFlowLogIds(v []*string) *CreateFlowLogsOutput { - s.FlowLogIds = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *CreateFlowLogsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *CreateFlowLogsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters for CreateImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImageRequest -type CreateImageInput struct { - _ struct{} `type:"structure"` - - // Information about one or more block device mappings. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // A description for the new image. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // A name for the new image. - // - // Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets - // ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), - // at-signs (@), or underscores(_) - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // By default, Amazon EC2 attempts to shut down and reboot the instance before - // creating the image. If the 'No Reboot' option is set, Amazon EC2 doesn't - // shut down the instance before creating the image. When this option is used, - // file system integrity on the created image can't be guaranteed. - NoReboot *bool `locationName:"noReboot" type:"boolean"` -} - -// String returns the string representation -func (s CreateImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateImageInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *CreateImageInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *CreateImageInput { - s.BlockDeviceMappings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateImageInput) SetDescription(v string) *CreateImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateImageInput) SetDryRun(v bool) *CreateImageInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateImageInput) SetInstanceId(v string) *CreateImageInput { - s.InstanceId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateImageInput) SetName(v string) *CreateImageInput { - s.Name = &v - return s -} - -// SetNoReboot sets the NoReboot field's value. -func (s *CreateImageInput) SetNoReboot(v bool) *CreateImageInput { - s.NoReboot = &v - return s -} - -// Contains the output of CreateImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateImageResult -type CreateImageOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new AMI. - ImageId *string `locationName:"imageId" type:"string"` -} - -// String returns the string representation -func (s CreateImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *CreateImageOutput) SetImageId(v string) *CreateImageOutput { - s.ImageId = &v - return s -} - -// Contains the parameters for CreateInstanceExportTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTaskRequest -type CreateInstanceExportTaskInput struct { - _ struct{} `type:"structure"` - - // A description for the conversion task or the resource being exported. The - // maximum length is 255 bytes. - Description *string `locationName:"description" type:"string"` - - // The format and location for an instance export task. - ExportToS3Task *ExportToS3TaskSpecification `locationName:"exportToS3" type:"structure"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The target virtualization environment. - TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` -} - -// String returns the string representation -func (s CreateInstanceExportTaskInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceExportTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInstanceExportTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInstanceExportTaskInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateInstanceExportTaskInput) SetDescription(v string) *CreateInstanceExportTaskInput { - s.Description = &v - return s -} - -// SetExportToS3Task sets the ExportToS3Task field's value. -func (s *CreateInstanceExportTaskInput) SetExportToS3Task(v *ExportToS3TaskSpecification) *CreateInstanceExportTaskInput { - s.ExportToS3Task = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateInstanceExportTaskInput) SetInstanceId(v string) *CreateInstanceExportTaskInput { - s.InstanceId = &v - return s -} - -// SetTargetEnvironment sets the TargetEnvironment field's value. -func (s *CreateInstanceExportTaskInput) SetTargetEnvironment(v string) *CreateInstanceExportTaskInput { - s.TargetEnvironment = &v - return s -} - -// Contains the output for CreateInstanceExportTask. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceExportTaskResult -type CreateInstanceExportTaskOutput struct { - _ struct{} `type:"structure"` - - // Information about the instance export task. - ExportTask *ExportTask `locationName:"exportTask" type:"structure"` -} - -// String returns the string representation -func (s CreateInstanceExportTaskOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInstanceExportTaskOutput) GoString() string { - return s.String() -} - -// SetExportTask sets the ExportTask field's value. -func (s *CreateInstanceExportTaskOutput) SetExportTask(v *ExportTask) *CreateInstanceExportTaskOutput { - s.ExportTask = v - return s -} - -// Contains the parameters for CreateInternetGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGatewayRequest -type CreateInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s CreateInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInternetGatewayInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateInternetGatewayInput) SetDryRun(v bool) *CreateInternetGatewayInput { - s.DryRun = &v - return s -} - -// Contains the output of CreateInternetGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInternetGatewayResult -type CreateInternetGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the Internet gateway. - InternetGateway *InternetGateway `locationName:"internetGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateInternetGatewayOutput) GoString() string { - return s.String() -} - -// SetInternetGateway sets the InternetGateway field's value. -func (s *CreateInternetGatewayOutput) SetInternetGateway(v *InternetGateway) *CreateInternetGatewayOutput { - s.InternetGateway = v - return s -} - -// Contains the parameters for CreateKeyPair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateKeyPairRequest -type CreateKeyPairInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A unique name for the key pair. - // - // Constraints: Up to 255 ASCII characters - // - // KeyName is a required field - KeyName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyPairInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateKeyPairInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateKeyPairInput"} - if s.KeyName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateKeyPairInput) SetDryRun(v bool) *CreateKeyPairInput { - s.DryRun = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *CreateKeyPairInput) SetKeyName(v string) *CreateKeyPairInput { - s.KeyName = &v - return s -} - -// Describes a key pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/KeyPair -type CreateKeyPairOutput struct { - _ struct{} `type:"structure"` - - // The SHA-1 digest of the DER encoded private key. - KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` - - // An unencrypted PEM encoded RSA private key. - KeyMaterial *string `locationName:"keyMaterial" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` -} - -// String returns the string representation -func (s CreateKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyPairOutput) GoString() string { - return s.String() -} - -// SetKeyFingerprint sets the KeyFingerprint field's value. -func (s *CreateKeyPairOutput) SetKeyFingerprint(v string) *CreateKeyPairOutput { - s.KeyFingerprint = &v - return s -} - -// SetKeyMaterial sets the KeyMaterial field's value. -func (s *CreateKeyPairOutput) SetKeyMaterial(v string) *CreateKeyPairOutput { - s.KeyMaterial = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *CreateKeyPairOutput) SetKeyName(v string) *CreateKeyPairOutput { - s.KeyName = &v - return s -} - -// Contains the parameters for CreateNatGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGatewayRequest -type CreateNatGatewayInput struct { - _ struct{} `type:"structure"` - - // The allocation ID of an Elastic IP address to associate with the NAT gateway. - // If the Elastic IP address is associated with another resource, you must first - // disassociate it. - // - // AllocationId is a required field - AllocationId *string `type:"string" required:"true"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraint: Maximum 64 ASCII characters. - ClientToken *string `type:"string"` - - // The subnet in which to create the NAT gateway. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateNatGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNatGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNatGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNatGatewayInput"} - if s.AllocationId == nil { - invalidParams.Add(request.NewErrParamRequired("AllocationId")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocationId sets the AllocationId field's value. -func (s *CreateNatGatewayInput) SetAllocationId(v string) *CreateNatGatewayInput { - s.AllocationId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateNatGatewayInput) SetClientToken(v string) *CreateNatGatewayInput { - s.ClientToken = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *CreateNatGatewayInput) SetSubnetId(v string) *CreateNatGatewayInput { - s.SubnetId = &v - return s -} - -// Contains the output of CreateNatGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNatGatewayResult -type CreateNatGatewayOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure the idempotency of the request. - // Only returned if a client token was provided in the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the NAT gateway. - NatGateway *NatGateway `locationName:"natGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateNatGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNatGatewayOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateNatGatewayOutput) SetClientToken(v string) *CreateNatGatewayOutput { - s.ClientToken = &v - return s -} - -// SetNatGateway sets the NatGateway field's value. -func (s *CreateNatGatewayOutput) SetNatGateway(v *NatGateway) *CreateNatGatewayOutput { - s.NatGateway = v - return s -} - -// Contains the parameters for CreateNetworkAclEntry. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntryRequest -type CreateNetworkAclEntryInput struct { - _ struct{} `type:"structure"` - - // The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether this is an egress rule (rule is applied to traffic leaving - // the subnet). - // - // Egress is a required field - Egress *bool `locationName:"egress" type:"boolean" required:"true"` - - // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying the - // ICMP protocol, or protocol 58 (ICMPv6) with an IPv6 CIDR block. - IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` - - // The IPv6 network range to allow or deny, in CIDR notation (for example 2001:db8:1234:1a00::/64). - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // The ID of the network ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - - // TCP or UDP protocols: The range of ports the rule applies to. - PortRange *PortRange `locationName:"portRange" type:"structure"` - - // The protocol. A value of -1 or all means all protocols. If you specify all, - // -1, or a protocol number other than tcp, udp, or icmp, traffic on all ports - // is allowed, regardless of any ports or ICMP types or codes you specify. If - // you specify protocol 58 (ICMPv6) and specify an IPv4 CIDR block, traffic - // for all ICMP types and codes allowed, regardless of any that you specify. - // If you specify protocol 58 (ICMPv6) and specify an IPv6 CIDR block, you must - // specify an ICMP type and code. - // - // Protocol is a required field - Protocol *string `locationName:"protocol" type:"string" required:"true"` - - // Indicates whether to allow or deny the traffic that matches the rule. - // - // RuleAction is a required field - RuleAction *string `locationName:"ruleAction" type:"string" required:"true" enum:"RuleAction"` - - // The rule number for the entry (for example, 100). ACL entries are processed - // in ascending order by rule number. - // - // Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is - // reserved for internal use. - // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` -} - -// String returns the string representation -func (s CreateNetworkAclEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkAclEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkAclEntryInput"} - if s.Egress == nil { - invalidParams.Add(request.NewErrParamRequired("Egress")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.RuleAction == nil { - invalidParams.Add(request.NewErrParamRequired("RuleAction")) - } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateNetworkAclEntryInput) SetCidrBlock(v string) *CreateNetworkAclEntryInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateNetworkAclEntryInput) SetDryRun(v bool) *CreateNetworkAclEntryInput { - s.DryRun = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *CreateNetworkAclEntryInput) SetEgress(v bool) *CreateNetworkAclEntryInput { - s.Egress = &v - return s -} - -// SetIcmpTypeCode sets the IcmpTypeCode field's value. -func (s *CreateNetworkAclEntryInput) SetIcmpTypeCode(v *IcmpTypeCode) *CreateNetworkAclEntryInput { - s.IcmpTypeCode = v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *CreateNetworkAclEntryInput) SetIpv6CidrBlock(v string) *CreateNetworkAclEntryInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *CreateNetworkAclEntryInput) SetNetworkAclId(v string) *CreateNetworkAclEntryInput { - s.NetworkAclId = &v - return s -} - -// SetPortRange sets the PortRange field's value. -func (s *CreateNetworkAclEntryInput) SetPortRange(v *PortRange) *CreateNetworkAclEntryInput { - s.PortRange = v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *CreateNetworkAclEntryInput) SetProtocol(v string) *CreateNetworkAclEntryInput { - s.Protocol = &v - return s -} - -// SetRuleAction sets the RuleAction field's value. -func (s *CreateNetworkAclEntryInput) SetRuleAction(v string) *CreateNetworkAclEntryInput { - s.RuleAction = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *CreateNetworkAclEntryInput) SetRuleNumber(v int64) *CreateNetworkAclEntryInput { - s.RuleNumber = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclEntryOutput -type CreateNetworkAclEntryOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateNetworkAclEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclEntryOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateNetworkAcl. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclRequest -type CreateNetworkAclInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateNetworkAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkAclInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateNetworkAclInput) SetDryRun(v bool) *CreateNetworkAclInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateNetworkAclInput) SetVpcId(v string) *CreateNetworkAclInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateNetworkAcl. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkAclResult -type CreateNetworkAclOutput struct { - _ struct{} `type:"structure"` - - // Information about the network ACL. - NetworkAcl *NetworkAcl `locationName:"networkAcl" type:"structure"` -} - -// String returns the string representation -func (s CreateNetworkAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkAclOutput) GoString() string { - return s.String() -} - -// SetNetworkAcl sets the NetworkAcl field's value. -func (s *CreateNetworkAclOutput) SetNetworkAcl(v *NetworkAcl) *CreateNetworkAclOutput { - s.NetworkAcl = v - return s -} - -// Contains the parameters for CreateNetworkInterface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterfaceRequest -type CreateNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // A description for the network interface. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IDs of one or more security groups. - Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // The number of IPv6 addresses to assign to a network interface. Amazon EC2 - // automatically selects the IPv6 addresses from the subnet range. You can't - // use this option if specifying specific IPv6 addresses. If your subnet has - // the AssignIpv6AddressOnCreation attribute set to true, you can specify 0 - // to override this setting. - Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` - - // One or more specific IPv6 addresses from the IPv6 CIDR block range of your - // subnet. You can't use this option if you're specifying a number of IPv6 addresses. - Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6Addresses" locationNameList:"item" type:"list"` - - // The primary private IPv4 address of the network interface. If you don't specify - // an IPv4 address, Amazon EC2 selects one for you from the subnet's IPv4 CIDR - // range. If you specify an IP address, you cannot indicate any IP addresses - // specified in privateIpAddresses as primary (only one IP address can be designated - // as primary). - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // One or more private IPv4 addresses. - PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` - - // The number of secondary private IPv4 addresses to assign to a network interface. - // When you specify a number of secondary IPv4 addresses, Amazon EC2 selects - // these IP addresses within the subnet's IPv4 CIDR range. You can't specify - // this option and specify more than one private IP address using privateIpAddresses. - // - // The number of IP addresses you can assign to a network interface varies by - // instance type. For more information, see IP Addresses Per ENI Per Instance - // Type (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) - // in the Amazon Virtual Private Cloud User Guide. - SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` - - // The ID of the subnet to associate with the network interface. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInterfaceInput"} - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - if s.PrivateIpAddresses != nil { - for i, v := range s.PrivateIpAddresses { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateNetworkInterfaceInput) SetDescription(v string) *CreateNetworkInterfaceInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateNetworkInterfaceInput) SetDryRun(v bool) *CreateNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *CreateNetworkInterfaceInput) SetGroups(v []*string) *CreateNetworkInterfaceInput { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *CreateNetworkInterfaceInput) SetIpv6AddressCount(v int64) *CreateNetworkInterfaceInput { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *CreateNetworkInterfaceInput) SetIpv6Addresses(v []*InstanceIpv6Address) *CreateNetworkInterfaceInput { - s.Ipv6Addresses = v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *CreateNetworkInterfaceInput) SetPrivateIpAddress(v string) *CreateNetworkInterfaceInput { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *CreateNetworkInterfaceInput) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *CreateNetworkInterfaceInput { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *CreateNetworkInterfaceInput) SetSecondaryPrivateIpAddressCount(v int64) *CreateNetworkInterfaceInput { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *CreateNetworkInterfaceInput) SetSubnetId(v string) *CreateNetworkInterfaceInput { - s.SubnetId = &v - return s -} - -// Contains the output of CreateNetworkInterface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateNetworkInterfaceResult -type CreateNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` - - // Information about the network interface. - NetworkInterface *NetworkInterface `locationName:"networkInterface" type:"structure"` -} - -// String returns the string representation -func (s CreateNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// SetNetworkInterface sets the NetworkInterface field's value. -func (s *CreateNetworkInterfaceOutput) SetNetworkInterface(v *NetworkInterface) *CreateNetworkInterfaceOutput { - s.NetworkInterface = v - return s -} - -// Contains the parameters for CreatePlacementGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroupRequest -type CreatePlacementGroupInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A name for the placement group. - // - // Constraints: Up to 255 ASCII characters - // - // GroupName is a required field - GroupName *string `locationName:"groupName" type:"string" required:"true"` - - // The placement strategy. - // - // Strategy is a required field - Strategy *string `locationName:"strategy" type:"string" required:"true" enum:"PlacementStrategy"` -} - -// String returns the string representation -func (s CreatePlacementGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlacementGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePlacementGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePlacementGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.Strategy == nil { - invalidParams.Add(request.NewErrParamRequired("Strategy")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreatePlacementGroupInput) SetDryRun(v bool) *CreatePlacementGroupInput { - s.DryRun = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreatePlacementGroupInput) SetGroupName(v string) *CreatePlacementGroupInput { - s.GroupName = &v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *CreatePlacementGroupInput) SetStrategy(v string) *CreatePlacementGroupInput { - s.Strategy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreatePlacementGroupOutput -type CreatePlacementGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreatePlacementGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePlacementGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateReservedInstancesListing. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListingRequest -type CreateReservedInstancesListingInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of your - // listings. This helps avoid duplicate listings. For more information, see - // Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - - // The number of instances that are a part of a Reserved Instance account to - // be listed in the Reserved Instance Marketplace. This number should be less - // than or equal to the instance count associated with the Reserved Instance - // ID specified in this call. - // - // InstanceCount is a required field - InstanceCount *int64 `locationName:"instanceCount" type:"integer" required:"true"` - - // A list specifying the price of the Standard Reserved Instance for each month - // remaining in the Reserved Instance term. - // - // PriceSchedules is a required field - PriceSchedules []*PriceScheduleSpecification `locationName:"priceSchedules" locationNameList:"item" type:"list" required:"true"` - - // The ID of the active Standard Reserved Instance. - // - // ReservedInstancesId is a required field - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateReservedInstancesListingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReservedInstancesListingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReservedInstancesListingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReservedInstancesListingInput"} - if s.ClientToken == nil { - invalidParams.Add(request.NewErrParamRequired("ClientToken")) - } - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.PriceSchedules == nil { - invalidParams.Add(request.NewErrParamRequired("PriceSchedules")) - } - if s.ReservedInstancesId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateReservedInstancesListingInput) SetClientToken(v string) *CreateReservedInstancesListingInput { - s.ClientToken = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *CreateReservedInstancesListingInput) SetInstanceCount(v int64) *CreateReservedInstancesListingInput { - s.InstanceCount = &v - return s -} - -// SetPriceSchedules sets the PriceSchedules field's value. -func (s *CreateReservedInstancesListingInput) SetPriceSchedules(v []*PriceScheduleSpecification) *CreateReservedInstancesListingInput { - s.PriceSchedules = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *CreateReservedInstancesListingInput) SetReservedInstancesId(v string) *CreateReservedInstancesListingInput { - s.ReservedInstancesId = &v - return s -} - -// Contains the output of CreateReservedInstancesListing. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateReservedInstancesListingResult -type CreateReservedInstancesListingOutput struct { - _ struct{} `type:"structure"` - - // Information about the Standard Reserved Instance listing. - ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CreateReservedInstancesListingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReservedInstancesListingOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *CreateReservedInstancesListingOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *CreateReservedInstancesListingOutput { - s.ReservedInstancesListings = v - return s -} - -// Contains the parameters for CreateRoute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteRequest -type CreateRouteInput struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR address block used for the destination match. Routing decisions - // are based on the most specific match. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR block used for the destination match. Routing decisions are - // based on the most specific match. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [IPv6 traffic only] The ID of an egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` - - // The ID of an Internet gateway or virtual private gateway attached to your - // VPC. - GatewayId *string `locationName:"gatewayId" type:"string"` - - // The ID of a NAT instance in your VPC. The operation fails if you specify - // an instance ID unless exactly one network interface is attached. - InstanceId *string `locationName:"instanceId" type:"string"` - - // [IPv4 traffic only] The ID of a NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // The ID of a network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the route table for the route. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s CreateRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRouteInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateRouteInput) SetDestinationCidrBlock(v string) *CreateRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *CreateRouteInput) SetDestinationIpv6CidrBlock(v string) *CreateRouteInput { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateRouteInput) SetDryRun(v bool) *CreateRouteInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *CreateRouteInput) SetEgressOnlyInternetGatewayId(v string) *CreateRouteInput { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// SetGatewayId sets the GatewayId field's value. -func (s *CreateRouteInput) SetGatewayId(v string) *CreateRouteInput { - s.GatewayId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateRouteInput) SetInstanceId(v string) *CreateRouteInput { - s.InstanceId = &v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *CreateRouteInput) SetNatGatewayId(v string) *CreateRouteInput { - s.NatGatewayId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *CreateRouteInput) SetNetworkInterfaceId(v string) *CreateRouteInput { - s.NetworkInterfaceId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *CreateRouteInput) SetRouteTableId(v string) *CreateRouteInput { - s.RouteTableId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *CreateRouteInput) SetVpcPeeringConnectionId(v string) *CreateRouteInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of CreateRoute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteResult -type CreateRouteOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s CreateRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *CreateRouteOutput) SetReturn(v bool) *CreateRouteOutput { - s.Return = &v - return s -} - -// Contains the parameters for CreateRouteTable. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTableRequest -type CreateRouteTableInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRouteTableInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateRouteTableInput) SetDryRun(v bool) *CreateRouteTableInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateRouteTableInput) SetVpcId(v string) *CreateRouteTableInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateRouteTable. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateRouteTableResult -type CreateRouteTableOutput struct { - _ struct{} `type:"structure"` - - // Information about the route table. - RouteTable *RouteTable `locationName:"routeTable" type:"structure"` -} - -// String returns the string representation -func (s CreateRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateRouteTableOutput) GoString() string { - return s.String() -} - -// SetRouteTable sets the RouteTable field's value. -func (s *CreateRouteTableOutput) SetRouteTable(v *RouteTable) *CreateRouteTableOutput { - s.RouteTable = v - return s -} - -// Contains the parameters for CreateSecurityGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroupRequest -type CreateSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // A description for the security group. This is informational only. - // - // Constraints: Up to 255 characters in length - // - // Constraints for EC2-Classic: ASCII characters - // - // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - // - // Description is a required field - Description *string `locationName:"GroupDescription" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The name of the security group. - // - // Constraints: Up to 255 characters in length - // - // Constraints for EC2-Classic: ASCII characters - // - // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* - // - // GroupName is a required field - GroupName *string `type:"string" required:"true"` - - // [EC2-VPC] The ID of the VPC. Required for EC2-VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s CreateSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSecurityGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSecurityGroupInput"} - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateSecurityGroupInput) SetDescription(v string) *CreateSecurityGroupInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSecurityGroupInput) SetDryRun(v bool) *CreateSecurityGroupInput { - s.DryRun = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateSecurityGroupInput) SetGroupName(v string) *CreateSecurityGroupInput { - s.GroupName = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateSecurityGroupInput) SetVpcId(v string) *CreateSecurityGroupInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateSecurityGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSecurityGroupResult -type CreateSecurityGroupOutput struct { - _ struct{} `type:"structure"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` -} - -// String returns the string representation -func (s CreateSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSecurityGroupOutput) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *CreateSecurityGroupOutput) SetGroupId(v string) *CreateSecurityGroupOutput { - s.GroupId = &v - return s -} - -// Contains the parameters for CreateSnapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshotRequest -type CreateSnapshotInput struct { - _ struct{} `type:"structure"` - - // A description for the snapshot. - Description *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the EBS volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateSnapshotInput) SetDescription(v string) *CreateSnapshotInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSnapshotInput) SetDryRun(v bool) *CreateSnapshotInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *CreateSnapshotInput) SetVolumeId(v string) *CreateSnapshotInput { - s.VolumeId = &v - return s -} - -// Contains the parameters for CreateSpotDatafeedSubscription. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscriptionRequest -type CreateSpotDatafeedSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket in which to store the Spot instance data feed. - // - // Bucket is a required field - Bucket *string `locationName:"bucket" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A prefix for the data feed file names. - Prefix *string `locationName:"prefix" type:"string"` -} - -// String returns the string representation -func (s CreateSpotDatafeedSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSpotDatafeedSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSpotDatafeedSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSpotDatafeedSubscriptionInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetBucket(v string) *CreateSpotDatafeedSubscriptionInput { - s.Bucket = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetDryRun(v bool) *CreateSpotDatafeedSubscriptionInput { - s.DryRun = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetPrefix(v string) *CreateSpotDatafeedSubscriptionInput { - s.Prefix = &v - return s -} - -// Contains the output of CreateSpotDatafeedSubscription. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSpotDatafeedSubscriptionResult -type CreateSpotDatafeedSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The Spot instance data feed subscription. - SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` -} - -// String returns the string representation -func (s CreateSpotDatafeedSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSpotDatafeedSubscriptionOutput) GoString() string { - return s.String() -} - -// SetSpotDatafeedSubscription sets the SpotDatafeedSubscription field's value. -func (s *CreateSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *SpotDatafeedSubscription) *CreateSpotDatafeedSubscriptionOutput { - s.SpotDatafeedSubscription = v - return s -} - -// Contains the parameters for CreateSubnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnetRequest -type CreateSubnetInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone for the subnet. - // - // Default: AWS selects one for you. If you create more than one subnet in your - // VPC, we may not necessarily select a different zone for each subnet. - AvailabilityZone *string `type:"string"` - - // The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. - // - // CidrBlock is a required field - CidrBlock *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IPv6 network range for the subnet, in CIDR notation. The subnet size - // must use a /64 prefix length. - Ipv6CidrBlock *string `type:"string"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateSubnetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSubnetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSubnetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSubnetInput"} - if s.CidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("CidrBlock")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateSubnetInput) SetAvailabilityZone(v string) *CreateSubnetInput { - s.AvailabilityZone = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateSubnetInput) SetCidrBlock(v string) *CreateSubnetInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSubnetInput) SetDryRun(v bool) *CreateSubnetInput { - s.DryRun = &v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *CreateSubnetInput) SetIpv6CidrBlock(v string) *CreateSubnetInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateSubnetInput) SetVpcId(v string) *CreateSubnetInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateSubnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSubnetResult -type CreateSubnetOutput struct { - _ struct{} `type:"structure"` - - // Information about the subnet. - Subnet *Subnet `locationName:"subnet" type:"structure"` -} - -// String returns the string representation -func (s CreateSubnetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateSubnetOutput) GoString() string { - return s.String() -} - -// SetSubnet sets the Subnet field's value. -func (s *CreateSubnetOutput) SetSubnet(v *Subnet) *CreateSubnetOutput { - s.Subnet = v - return s -} - -// Contains the parameters for CreateTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTagsRequest -type CreateTagsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The IDs of one or more resources to tag. For example, ami-1a2b3c4d. - // - // Resources is a required field - Resources []*string `locationName:"ResourceId" type:"list" required:"true"` - - // One or more tags. The value parameter is required, but if you don't want - // the tag to have a value, specify the parameter with no value, and we set - // the value to an empty string. - // - // Tags is a required field - Tags []*Tag `locationName:"Tag" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s CreateTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTagsInput"} - if s.Resources == nil { - invalidParams.Add(request.NewErrParamRequired("Resources")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateTagsInput) SetDryRun(v bool) *CreateTagsInput { - s.DryRun = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *CreateTagsInput) SetResources(v []*string) *CreateTagsInput { - s.Resources = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateTagsInput) SetTags(v []*Tag) *CreateTagsInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTagsOutput -type CreateTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTagsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateVolume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolumeRequest -type CreateVolumeInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which to create the volume. Use DescribeAvailabilityZones - // to list the Availability Zones that are currently available to you. - // - // AvailabilityZone is a required field - AvailabilityZone *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes - // may only be attached to instances that support Amazon EBS encryption. Volumes - // that are created from encrypted snapshots are automatically encrypted. There - // is no way to create an encrypted volume from an unencrypted snapshot or vice - // versa. If your AMI uses encrypted volumes, you can only launch it on supported - // instance types. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // Only valid for Provisioned IOPS SSD volumes. The number of I/O operations - // per second (IOPS) to provision for the volume, with a maximum ratio of 50 - // IOPS/GiB. - // - // Constraint: Range is 100 to 20000 for Provisioned IOPS SSD volumes - Iops *int64 `type:"integer"` - - // The full ARN of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use when creating the encrypted volume. This parameter is only - // required if you want to use a non-default CMK; if this parameter is not specified, - // the default CMK for EBS is used. The ARN contains the arn:aws:kms namespace, - // followed by the region of the CMK, the AWS account ID of the CMK owner, the - // key namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // If a KmsKeyId is specified, the Encrypted flag must also be set. - KmsKeyId *string `type:"string"` - - // The size of the volume, in GiBs. - // - // Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384 - // for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size - // must be equal to or larger than the snapshot size. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - Size *int64 `type:"integer"` - - // The snapshot from which to create the volume. - SnapshotId *string `type:"string"` - - // The tags to apply to the volume during creation. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned - // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard - // for Magnetic volumes. - // - // Default: standard - VolumeType *string `type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s CreateVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVolumeInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateVolumeInput) SetAvailabilityZone(v string) *CreateVolumeInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVolumeInput) SetDryRun(v bool) *CreateVolumeInput { - s.DryRun = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *CreateVolumeInput) SetEncrypted(v bool) *CreateVolumeInput { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *CreateVolumeInput) SetIops(v int64) *CreateVolumeInput { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateVolumeInput) SetKmsKeyId(v string) *CreateVolumeInput { - s.KmsKeyId = &v - return s -} - -// SetSize sets the Size field's value. -func (s *CreateVolumeInput) SetSize(v int64) *CreateVolumeInput { - s.Size = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *CreateVolumeInput) SetSnapshotId(v string) *CreateVolumeInput { - s.SnapshotId = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateVolumeInput) SetTagSpecifications(v []*TagSpecification) *CreateVolumeInput { - s.TagSpecifications = v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput { - s.VolumeType = &v - return s -} - -// Describes the user or group to be added or removed from the permissions for -// a volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolumePermission -type CreateVolumePermission struct { - _ struct{} `type:"structure"` - - // The specific group that is to be added or removed from a volume's list of - // create volume permissions. - Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - - // The specific AWS account ID that is to be added or removed from a volume's - // list of create volume permissions. - UserId *string `locationName:"userId" type:"string"` -} - -// String returns the string representation -func (s CreateVolumePermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVolumePermission) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *CreateVolumePermission) SetGroup(v string) *CreateVolumePermission { - s.Group = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *CreateVolumePermission) SetUserId(v string) *CreateVolumePermission { - s.UserId = &v - return s -} - -// Describes modifications to the permissions for a volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVolumePermissionModifications -type CreateVolumePermissionModifications struct { - _ struct{} `type:"structure"` - - // Adds a specific AWS account ID or group to a volume's list of create volume - // permissions. - Add []*CreateVolumePermission `locationNameList:"item" type:"list"` - - // Removes a specific AWS account ID or group from a volume's list of create - // volume permissions. - Remove []*CreateVolumePermission `locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s CreateVolumePermissionModifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVolumePermissionModifications) GoString() string { - return s.String() -} - -// SetAdd sets the Add field's value. -func (s *CreateVolumePermissionModifications) SetAdd(v []*CreateVolumePermission) *CreateVolumePermissionModifications { - s.Add = v - return s -} - -// SetRemove sets the Remove field's value. -func (s *CreateVolumePermissionModifications) SetRemove(v []*CreateVolumePermission) *CreateVolumePermissionModifications { - s.Remove = v - return s -} - -// Contains the parameters for CreateVpcEndpoint. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointRequest -type CreateVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // A policy to attach to the endpoint that controls access to the service. The - // policy must be in valid JSON format. If this parameter is not specified, - // we attach a default policy that allows full access to the service. - PolicyDocument *string `type:"string"` - - // One or more route table IDs. - RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` - - // The AWS service name, in the form com.amazonaws.region.service. To get a - // list of available services, use the DescribeVpcEndpointServices request. - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` - - // The ID of the VPC in which the endpoint will be used. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVpcEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointInput"} - if s.ServiceName == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceName")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointInput) SetClientToken(v string) *CreateVpcEndpointInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcEndpointInput) SetDryRun(v bool) *CreateVpcEndpointInput { - s.DryRun = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *CreateVpcEndpointInput) SetPolicyDocument(v string) *CreateVpcEndpointInput { - s.PolicyDocument = &v - return s -} - -// SetRouteTableIds sets the RouteTableIds field's value. -func (s *CreateVpcEndpointInput) SetRouteTableIds(v []*string) *CreateVpcEndpointInput { - s.RouteTableIds = v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *CreateVpcEndpointInput) SetServiceName(v string) *CreateVpcEndpointInput { - s.ServiceName = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateVpcEndpointInput) SetVpcId(v string) *CreateVpcEndpointInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateVpcEndpoint. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcEndpointResult -type CreateVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the endpoint. - VpcEndpoint *VpcEndpoint `locationName:"vpcEndpoint" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointOutput) SetClientToken(v string) *CreateVpcEndpointOutput { - s.ClientToken = &v - return s -} - -// SetVpcEndpoint sets the VpcEndpoint field's value. -func (s *CreateVpcEndpointOutput) SetVpcEndpoint(v *VpcEndpoint) *CreateVpcEndpointOutput { - s.VpcEndpoint = v - return s -} - -// Contains the parameters for CreateVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcRequest -type CreateVpcInput struct { - _ struct{} `type:"structure"` - - // Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for - // the VPC. You cannot specify the range of IP addresses, or the size of the - // CIDR block. - AmazonProvidedIpv6CidrBlock *bool `locationName:"amazonProvidedIpv6CidrBlock" type:"boolean"` - - // The IPv4 network range for the VPC, in CIDR notation. For example, 10.0.0.0/16. - // - // CidrBlock is a required field - CidrBlock *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The tenancy options for instances launched into the VPC. For default, instances - // are launched with shared tenancy by default. You can launch instances with - // any tenancy into a shared tenancy VPC. For dedicated, instances are launched - // as dedicated tenancy instances by default. You can only launch instances - // with a tenancy of dedicated or host into a dedicated tenancy VPC. - // - // Important: The host value cannot be used with this parameter. Use the default - // or dedicated values only. - // - // Default: default - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s CreateVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcInput"} - if s.CidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("CidrBlock")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmazonProvidedIpv6CidrBlock sets the AmazonProvidedIpv6CidrBlock field's value. -func (s *CreateVpcInput) SetAmazonProvidedIpv6CidrBlock(v bool) *CreateVpcInput { - s.AmazonProvidedIpv6CidrBlock = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateVpcInput) SetCidrBlock(v string) *CreateVpcInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcInput) SetDryRun(v bool) *CreateVpcInput { - s.DryRun = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *CreateVpcInput) SetInstanceTenancy(v string) *CreateVpcInput { - s.InstanceTenancy = &v - return s -} - -// Contains the output of CreateVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcResult -type CreateVpcOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC. - Vpc *Vpc `locationName:"vpc" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcOutput) GoString() string { - return s.String() -} - -// SetVpc sets the Vpc field's value. -func (s *CreateVpcOutput) SetVpc(v *Vpc) *CreateVpcOutput { - s.Vpc = v - return s -} - -// Contains the parameters for CreateVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnectionRequest -type CreateVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The AWS account ID of the owner of the peer VPC. - // - // Default: Your AWS account ID - PeerOwnerId *string `locationName:"peerOwnerId" type:"string"` - - // The ID of the VPC with which you are creating the VPC peering connection. - PeerVpcId *string `locationName:"peerVpcId" type:"string"` - - // The ID of the requester VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s CreateVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcPeeringConnectionInput) SetDryRun(v bool) *CreateVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetPeerOwnerId sets the PeerOwnerId field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerOwnerId(v string) *CreateVpcPeeringConnectionInput { - s.PeerOwnerId = &v - return s -} - -// SetPeerVpcId sets the PeerVpcId field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerVpcId(v string) *CreateVpcPeeringConnectionInput { - s.PeerVpcId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateVpcPeeringConnectionInput) SetVpcId(v string) *CreateVpcPeeringConnectionInput { - s.VpcId = &v - return s -} - -// Contains the output of CreateVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpcPeeringConnectionResult -type CreateVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connection. - VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` -} - -// String returns the string representation -func (s CreateVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. -func (s *CreateVpcPeeringConnectionOutput) SetVpcPeeringConnection(v *VpcPeeringConnection) *CreateVpcPeeringConnectionOutput { - s.VpcPeeringConnection = v - return s -} - -// Contains the parameters for CreateVpnConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRequest -type CreateVpnConnectionInput struct { - _ struct{} `type:"structure"` - - // The ID of the customer gateway. - // - // CustomerGatewayId is a required field - CustomerGatewayId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether the VPN connection requires static routes. If you are creating - // a VPN connection for a device that does not support BGP, you must specify - // true. - // - // Default: false - Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"` - - // The type of VPN connection (ipsec.1). - // - // Type is a required field - Type *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVpnConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpnConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpnConnectionInput"} - if s.CustomerGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("CustomerGatewayId")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *CreateVpnConnectionInput) SetCustomerGatewayId(v string) *CreateVpnConnectionInput { - s.CustomerGatewayId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpnConnectionInput) SetDryRun(v bool) *CreateVpnConnectionInput { - s.DryRun = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *CreateVpnConnectionInput) SetOptions(v *VpnConnectionOptionsSpecification) *CreateVpnConnectionInput { - s.Options = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateVpnConnectionInput) SetType(v string) *CreateVpnConnectionInput { - s.Type = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *CreateVpnConnectionInput) SetVpnGatewayId(v string) *CreateVpnConnectionInput { - s.VpnGatewayId = &v - return s -} - -// Contains the output of CreateVpnConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionResult -type CreateVpnConnectionOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPN connection. - VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"` -} - -// String returns the string representation -func (s CreateVpnConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionOutput) GoString() string { - return s.String() -} - -// SetVpnConnection sets the VpnConnection field's value. -func (s *CreateVpnConnectionOutput) SetVpnConnection(v *VpnConnection) *CreateVpnConnectionOutput { - s.VpnConnection = v - return s -} - -// Contains the parameters for CreateVpnConnectionRoute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRouteRequest -type CreateVpnConnectionRouteInput struct { - _ struct{} `type:"structure"` - - // The CIDR block associated with the local subnet of the customer network. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *string `type:"string" required:"true"` - - // The ID of the VPN connection. - // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateVpnConnectionRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpnConnectionRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpnConnectionRouteInput"} - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) - } - if s.VpnConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateVpnConnectionRouteInput) SetDestinationCidrBlock(v string) *CreateVpnConnectionRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *CreateVpnConnectionRouteInput) SetVpnConnectionId(v string) *CreateVpnConnectionRouteInput { - s.VpnConnectionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnConnectionRouteOutput -type CreateVpnConnectionRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateVpnConnectionRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnConnectionRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for CreateVpnGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGatewayRequest -type CreateVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone for the virtual private gateway. - AvailabilityZone *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The type of VPN connection this virtual private gateway supports. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"GatewayType"` -} - -// String returns the string representation -func (s CreateVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpnGatewayInput"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateVpnGatewayInput) SetAvailabilityZone(v string) *CreateVpnGatewayInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateVpnGatewayInput) SetDryRun(v bool) *CreateVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateVpnGatewayInput) SetType(v string) *CreateVpnGatewayInput { - s.Type = &v - return s -} - -// Contains the output of CreateVpnGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVpnGatewayResult -type CreateVpnGatewayOutput struct { - _ struct{} `type:"structure"` - - // Information about the virtual private gateway. - VpnGateway *VpnGateway `locationName:"vpnGateway" type:"structure"` -} - -// String returns the string representation -func (s CreateVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVpnGatewayOutput) GoString() string { - return s.String() -} - -// SetVpnGateway sets the VpnGateway field's value. -func (s *CreateVpnGatewayOutput) SetVpnGateway(v *VpnGateway) *CreateVpnGatewayOutput { - s.VpnGateway = v - return s -} - -// Describes a customer gateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CustomerGateway -type CustomerGateway struct { - _ struct{} `type:"structure"` - - // The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number - // (ASN). - BgpAsn *string `locationName:"bgpAsn" type:"string"` - - // The ID of the customer gateway. - CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` - - // The Internet-routable IP address of the customer gateway's outside interface. - IpAddress *string `locationName:"ipAddress" type:"string"` - - // The current state of the customer gateway (pending | available | deleting - // | deleted). - State *string `locationName:"state" type:"string"` - - // Any tags assigned to the customer gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection the customer gateway supports (ipsec.1). - Type *string `locationName:"type" type:"string"` -} - -// String returns the string representation -func (s CustomerGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CustomerGateway) GoString() string { - return s.String() -} - -// SetBgpAsn sets the BgpAsn field's value. -func (s *CustomerGateway) SetBgpAsn(v string) *CustomerGateway { - s.BgpAsn = &v - return s -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *CustomerGateway) SetCustomerGatewayId(v string) *CustomerGateway { - s.CustomerGatewayId = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *CustomerGateway) SetIpAddress(v string) *CustomerGateway { - s.IpAddress = &v - return s -} - -// SetState sets the State field's value. -func (s *CustomerGateway) SetState(v string) *CustomerGateway { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CustomerGateway) SetTags(v []*Tag) *CustomerGateway { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CustomerGateway) SetType(v string) *CustomerGateway { - s.Type = &v - return s -} - -// Contains the parameters for DeleteCustomerGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGatewayRequest -type DeleteCustomerGatewayInput struct { - _ struct{} `type:"structure"` - - // The ID of the customer gateway. - // - // CustomerGatewayId is a required field - CustomerGatewayId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DeleteCustomerGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCustomerGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCustomerGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCustomerGatewayInput"} - if s.CustomerGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("CustomerGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *DeleteCustomerGatewayInput) SetCustomerGatewayId(v string) *DeleteCustomerGatewayInput { - s.CustomerGatewayId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteCustomerGatewayInput) SetDryRun(v bool) *DeleteCustomerGatewayInput { - s.DryRun = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteCustomerGatewayOutput -type DeleteCustomerGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteCustomerGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteCustomerGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteDhcpOptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptionsRequest -type DeleteDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // The ID of the DHCP options set. - // - // DhcpOptionsId is a required field - DhcpOptionsId *string `type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DeleteDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDhcpOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDhcpOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDhcpOptionsInput"} - if s.DhcpOptionsId == nil { - invalidParams.Add(request.NewErrParamRequired("DhcpOptionsId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *DeleteDhcpOptionsInput) SetDhcpOptionsId(v string) *DeleteDhcpOptionsInput { - s.DhcpOptionsId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteDhcpOptionsInput) SetDryRun(v bool) *DeleteDhcpOptionsInput { - s.DryRun = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteDhcpOptionsOutput -type DeleteDhcpOptionsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDhcpOptionsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGatewayRequest -type DeleteEgressOnlyInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the egress-only Internet gateway. - // - // EgressOnlyInternetGatewayId is a required field - EgressOnlyInternetGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteEgressOnlyInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEgressOnlyInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEgressOnlyInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEgressOnlyInternetGatewayInput"} - if s.EgressOnlyInternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("EgressOnlyInternetGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteEgressOnlyInternetGatewayInput) SetDryRun(v bool) *DeleteEgressOnlyInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *DeleteEgressOnlyInternetGatewayInput) SetEgressOnlyInternetGatewayId(v string) *DeleteEgressOnlyInternetGatewayInput { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteEgressOnlyInternetGatewayResult -type DeleteEgressOnlyInternetGatewayOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - ReturnCode *bool `locationName:"returnCode" type:"boolean"` -} - -// String returns the string representation -func (s DeleteEgressOnlyInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEgressOnlyInternetGatewayOutput) GoString() string { - return s.String() -} - -// SetReturnCode sets the ReturnCode field's value. -func (s *DeleteEgressOnlyInternetGatewayOutput) SetReturnCode(v bool) *DeleteEgressOnlyInternetGatewayOutput { - s.ReturnCode = &v - return s -} - -// Contains the parameters for DeleteFlowLogs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogsRequest -type DeleteFlowLogsInput struct { - _ struct{} `type:"structure"` - - // One or more flow log IDs. - // - // FlowLogIds is a required field - FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteFlowLogsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFlowLogsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFlowLogsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFlowLogsInput"} - if s.FlowLogIds == nil { - invalidParams.Add(request.NewErrParamRequired("FlowLogIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *DeleteFlowLogsInput) SetFlowLogIds(v []*string) *DeleteFlowLogsInput { - s.FlowLogIds = v - return s -} - -// Contains the output of DeleteFlowLogs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteFlowLogsResult -type DeleteFlowLogsOutput struct { - _ struct{} `type:"structure"` - - // Information about the flow logs that could not be deleted successfully. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteFlowLogsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFlowLogsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteFlowLogsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteFlowLogsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters for DeleteInternetGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGatewayRequest -type DeleteInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Internet gateway. - // - // InternetGatewayId is a required field - InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInternetGatewayInput"} - if s.InternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("InternetGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteInternetGatewayInput) SetDryRun(v bool) *DeleteInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *DeleteInternetGatewayInput) SetInternetGatewayId(v string) *DeleteInternetGatewayInput { - s.InternetGatewayId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteInternetGatewayOutput -type DeleteInternetGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInternetGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteKeyPair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPairRequest -type DeleteKeyPairInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The name of the key pair. - // - // KeyName is a required field - KeyName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteKeyPairInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteKeyPairInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteKeyPairInput"} - if s.KeyName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteKeyPairInput) SetDryRun(v bool) *DeleteKeyPairInput { - s.DryRun = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *DeleteKeyPairInput) SetKeyName(v string) *DeleteKeyPairInput { - s.KeyName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteKeyPairOutput -type DeleteKeyPairOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteKeyPairOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteNatGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGatewayRequest -type DeleteNatGatewayInput struct { - _ struct{} `type:"structure"` - - // The ID of the NAT gateway. - // - // NatGatewayId is a required field - NatGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNatGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNatGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNatGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNatGatewayInput"} - if s.NatGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("NatGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *DeleteNatGatewayInput) SetNatGatewayId(v string) *DeleteNatGatewayInput { - s.NatGatewayId = &v - return s -} - -// Contains the output of DeleteNatGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNatGatewayResult -type DeleteNatGatewayOutput struct { - _ struct{} `type:"structure"` - - // The ID of the NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` -} - -// String returns the string representation -func (s DeleteNatGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNatGatewayOutput) GoString() string { - return s.String() -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *DeleteNatGatewayOutput) SetNatGatewayId(v string) *DeleteNatGatewayOutput { - s.NatGatewayId = &v - return s -} - -// Contains the parameters for DeleteNetworkAclEntry. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntryRequest -type DeleteNetworkAclEntryInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether the rule is an egress rule. - // - // Egress is a required field - Egress *bool `locationName:"egress" type:"boolean" required:"true"` - - // The ID of the network ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - - // The rule number of the entry to delete. - // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` -} - -// String returns the string representation -func (s DeleteNetworkAclEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkAclEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkAclEntryInput"} - if s.Egress == nil { - invalidParams.Add(request.NewErrParamRequired("Egress")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkAclEntryInput) SetDryRun(v bool) *DeleteNetworkAclEntryInput { - s.DryRun = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *DeleteNetworkAclEntryInput) SetEgress(v bool) *DeleteNetworkAclEntryInput { - s.Egress = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *DeleteNetworkAclEntryInput) SetNetworkAclId(v string) *DeleteNetworkAclEntryInput { - s.NetworkAclId = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *DeleteNetworkAclEntryInput) SetRuleNumber(v int64) *DeleteNetworkAclEntryInput { - s.RuleNumber = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclEntryOutput -type DeleteNetworkAclEntryOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNetworkAclEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclEntryOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteNetworkAcl. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclRequest -type DeleteNetworkAclInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNetworkAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkAclInput"} - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkAclInput) SetDryRun(v bool) *DeleteNetworkAclInput { - s.DryRun = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *DeleteNetworkAclInput) SetNetworkAclId(v string) *DeleteNetworkAclInput { - s.NetworkAclId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkAclOutput -type DeleteNetworkAclOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNetworkAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkAclOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteNetworkInterface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterfaceRequest -type DeleteNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInterfaceInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkInterfaceInput) SetDryRun(v bool) *DeleteNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DeleteNetworkInterfaceInput) SetNetworkInterfaceId(v string) *DeleteNetworkInterfaceInput { - s.NetworkInterfaceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteNetworkInterfaceOutput -type DeleteNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeletePlacementGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroupRequest -type DeletePlacementGroupInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The name of the placement group. - // - // GroupName is a required field - GroupName *string `locationName:"groupName" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePlacementGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlacementGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePlacementGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePlacementGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeletePlacementGroupInput) SetDryRun(v bool) *DeletePlacementGroupInput { - s.DryRun = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *DeletePlacementGroupInput) SetGroupName(v string) *DeletePlacementGroupInput { - s.GroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeletePlacementGroupOutput -type DeletePlacementGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePlacementGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePlacementGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteRoute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteRequest -type DeleteRouteInput struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR range for the route. The value you specify must match the CIDR - // for the route exactly. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR range for the route. The value you specify must match the CIDR - // for the route exactly. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRouteInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *DeleteRouteInput) SetDestinationCidrBlock(v string) *DeleteRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *DeleteRouteInput) SetDestinationIpv6CidrBlock(v string) *DeleteRouteInput { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteRouteInput) SetDryRun(v bool) *DeleteRouteInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *DeleteRouteInput) SetRouteTableId(v string) *DeleteRouteInput { - s.RouteTableId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteOutput -type DeleteRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteRouteTable. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTableRequest -type DeleteRouteTableInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRouteTableInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteRouteTableInput) SetDryRun(v bool) *DeleteRouteTableInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *DeleteRouteTableInput) SetRouteTableId(v string) *DeleteRouteTableInput { - s.RouteTableId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteRouteTableOutput -type DeleteRouteTableOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteRouteTableOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSecurityGroup. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroupRequest -type DeleteSecurityGroupInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the security group. Required for a nondefault VPC. - GroupId *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the security group. You can specify - // either the security group name or the security group ID. - GroupName *string `type:"string"` -} - -// String returns the string representation -func (s DeleteSecurityGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSecurityGroupInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSecurityGroupInput) SetDryRun(v bool) *DeleteSecurityGroupInput { - s.DryRun = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *DeleteSecurityGroupInput) SetGroupId(v string) *DeleteSecurityGroupInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *DeleteSecurityGroupInput) SetGroupName(v string) *DeleteSecurityGroupInput { - s.GroupName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSecurityGroupOutput -type DeleteSecurityGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSecurityGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSecurityGroupOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSnapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshotRequest -type DeleteSnapshotInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the EBS snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotInput"} - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSnapshotInput) SetDryRun(v bool) *DeleteSnapshotInput { - s.DryRun = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DeleteSnapshotInput) SetSnapshotId(v string) *DeleteSnapshotInput { - s.SnapshotId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSnapshotOutput -type DeleteSnapshotOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSnapshotOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSpotDatafeedSubscription. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscriptionRequest -type DeleteSpotDatafeedSubscriptionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DeleteSpotDatafeedSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSpotDatafeedSubscriptionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSpotDatafeedSubscriptionInput) SetDryRun(v bool) *DeleteSpotDatafeedSubscriptionInput { - s.DryRun = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSpotDatafeedSubscriptionOutput -type DeleteSpotDatafeedSubscriptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSpotDatafeedSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSpotDatafeedSubscriptionOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteSubnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnetRequest -type DeleteSubnetInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the subnet. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteSubnetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSubnetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubnetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubnetInput"} - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteSubnetInput) SetDryRun(v bool) *DeleteSubnetInput { - s.DryRun = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *DeleteSubnetInput) SetSubnetId(v string) *DeleteSubnetInput { - s.SubnetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteSubnetOutput -type DeleteSubnetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteSubnetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteSubnetOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTagsRequest -type DeleteTagsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the resource. For example, ami-1a2b3c4d. You can specify more than - // one resource ID. - // - // Resources is a required field - Resources []*string `locationName:"resourceId" type:"list" required:"true"` - - // One or more tags to delete. If you omit the value parameter, we delete the - // tag regardless of its value. If you specify this parameter with an empty - // string as the value, we delete the key only if its value is an empty string. - Tags []*Tag `locationName:"tag" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTagsInput"} - if s.Resources == nil { - invalidParams.Add(request.NewErrParamRequired("Resources")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteTagsInput) SetDryRun(v bool) *DeleteTagsInput { - s.DryRun = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *DeleteTagsInput) SetResources(v []*string) *DeleteTagsInput { - s.Resources = v - return s -} - -// SetTags sets the Tags field's value. -func (s *DeleteTagsInput) SetTags(v []*Tag) *DeleteTagsInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTagsOutput -type DeleteTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTagsOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVolume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolumeRequest -type DeleteVolumeInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVolumeInput) SetDryRun(v bool) *DeleteVolumeInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DeleteVolumeInput) SetVolumeId(v string) *DeleteVolumeInput { - s.VolumeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVolumeOutput -type DeleteVolumeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVolumeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVpcEndpoints. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointsRequest -type DeleteVpcEndpointsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more endpoint IDs. - // - // VpcEndpointIds is a required field - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DeleteVpcEndpointsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointsInput"} - if s.VpcEndpointIds == nil { - invalidParams.Add(request.NewErrParamRequired("VpcEndpointIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcEndpointsInput) SetDryRun(v bool) *DeleteVpcEndpointsInput { - s.DryRun = &v - return s -} - -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *DeleteVpcEndpointsInput) SetVpcEndpointIds(v []*string) *DeleteVpcEndpointsInput { - s.VpcEndpointIds = v - return s -} - -// Contains the output of DeleteVpcEndpoints. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcEndpointsResult -type DeleteVpcEndpointsOutput struct { - _ struct{} `type:"structure"` - - // Information about the endpoints that were not successfully deleted. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DeleteVpcEndpointsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcEndpointsOutput) GoString() string { - return s.String() -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteVpcEndpointsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters for DeleteVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcRequest -type DeleteVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcInput) SetDryRun(v bool) *DeleteVpcInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DeleteVpcInput) SetVpcId(v string) *DeleteVpcInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcOutput -type DeleteVpcOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnectionRequest -type DeleteVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC peering connection. - // - // VpcPeeringConnectionId is a required field - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcPeeringConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcPeeringConnectionInput"} - if s.VpcPeeringConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcPeeringConnectionInput) SetDryRun(v bool) *DeleteVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *DeleteVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *DeleteVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of DeleteVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpcPeeringConnectionResult -type DeleteVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DeleteVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DeleteVpcPeeringConnectionOutput) SetReturn(v bool) *DeleteVpcPeeringConnectionOutput { - s.Return = &v - return s -} - -// Contains the parameters for DeleteVpnConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRequest -type DeleteVpnConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPN connection. - // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpnConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpnConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpnConnectionInput"} - if s.VpnConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpnConnectionInput) SetDryRun(v bool) *DeleteVpnConnectionInput { - s.DryRun = &v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *DeleteVpnConnectionInput) SetVpnConnectionId(v string) *DeleteVpnConnectionInput { - s.VpnConnectionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionOutput -type DeleteVpnConnectionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpnConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVpnConnectionRoute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRouteRequest -type DeleteVpnConnectionRouteInput struct { - _ struct{} `type:"structure"` - - // The CIDR block associated with the local subnet of the customer network. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *string `type:"string" required:"true"` - - // The ID of the VPN connection. - // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpnConnectionRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpnConnectionRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpnConnectionRouteInput"} - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) - } - if s.VpnConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *DeleteVpnConnectionRouteInput) SetDestinationCidrBlock(v string) *DeleteVpnConnectionRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *DeleteVpnConnectionRouteInput) SetVpnConnectionId(v string) *DeleteVpnConnectionRouteInput { - s.VpnConnectionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnConnectionRouteOutput -type DeleteVpnConnectionRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpnConnectionRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnConnectionRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeleteVpnGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGatewayRequest -type DeleteVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpnGatewayInput"} - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpnGatewayInput) SetDryRun(v bool) *DeleteVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *DeleteVpnGatewayInput) SetVpnGatewayId(v string) *DeleteVpnGatewayInput { - s.VpnGatewayId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteVpnGatewayOutput -type DeleteVpnGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVpnGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DeregisterImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImageRequest -type DeregisterImageInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeregisterImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterImageInput"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DeregisterImageInput) SetDryRun(v bool) *DeregisterImageInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *DeregisterImageInput) SetImageId(v string) *DeregisterImageInput { - s.ImageId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterImageOutput -type DeregisterImageOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeregisterImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeregisterImageOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DescribeAccountAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributesRequest -type DescribeAccountAttributesInput struct { - _ struct{} `type:"structure"` - - // One or more account attribute names. - AttributeNames []*string `locationName:"attributeName" locationNameList:"attributeName" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DescribeAccountAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountAttributesInput) GoString() string { - return s.String() -} - -// SetAttributeNames sets the AttributeNames field's value. -func (s *DescribeAccountAttributesInput) SetAttributeNames(v []*string) *DescribeAccountAttributesInput { - s.AttributeNames = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeAccountAttributesInput) SetDryRun(v bool) *DescribeAccountAttributesInput { - s.DryRun = &v - return s -} - -// Contains the output of DescribeAccountAttributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAccountAttributesResult -type DescribeAccountAttributesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more account attributes. - AccountAttributes []*AccountAttribute `locationName:"accountAttributeSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeAccountAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAccountAttributesOutput) GoString() string { - return s.String() -} - -// SetAccountAttributes sets the AccountAttributes field's value. -func (s *DescribeAccountAttributesOutput) SetAccountAttributes(v []*AccountAttribute) *DescribeAccountAttributesOutput { - s.AccountAttributes = v - return s -} - -// Contains the parameters for DescribeAddresses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddressesRequest -type DescribeAddressesInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] One or more allocation IDs. - // - // Default: Describes all your Elastic IP addresses. - AllocationIds []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. Filter names and values are case-sensitive. - // - // * allocation-id - [EC2-VPC] The allocation ID for the address. - // - // * association-id - [EC2-VPC] The association ID for the address. - // - // * domain - Indicates whether the address is for use in EC2-Classic (standard) - // or in a VPC (vpc). - // - // * instance-id - The ID of the instance the address is associated with, - // if any. - // - // * network-interface-id - [EC2-VPC] The ID of the network interface that - // the address is associated with, if any. - // - // * network-interface-owner-id - The AWS account ID of the owner. - // - // * private-ip-address - [EC2-VPC] The private IP address associated with - // the Elastic IP address. - // - // * public-ip - The Elastic IP address. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // [EC2-Classic] One or more Elastic IP addresses. - // - // Default: Describes all your Elastic IP addresses. - PublicIps []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"` -} - -// String returns the string representation -func (s DescribeAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAddressesInput) GoString() string { - return s.String() -} - -// SetAllocationIds sets the AllocationIds field's value. -func (s *DescribeAddressesInput) SetAllocationIds(v []*string) *DescribeAddressesInput { - s.AllocationIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeAddressesInput) SetDryRun(v bool) *DescribeAddressesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeAddressesInput) SetFilters(v []*Filter) *DescribeAddressesInput { - s.Filters = v - return s -} - -// SetPublicIps sets the PublicIps field's value. -func (s *DescribeAddressesInput) SetPublicIps(v []*string) *DescribeAddressesInput { - s.PublicIps = v - return s -} - -// Contains the output of DescribeAddresses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAddressesResult -type DescribeAddressesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more Elastic IP addresses. - Addresses []*Address `locationName:"addressesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAddressesOutput) GoString() string { - return s.String() -} - -// SetAddresses sets the Addresses field's value. -func (s *DescribeAddressesOutput) SetAddresses(v []*Address) *DescribeAddressesOutput { - s.Addresses = v - return s -} - -// Contains the parameters for DescribeAvailabilityZones. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZonesRequest -type DescribeAvailabilityZonesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * message - Information about the Availability Zone. - // - // * region-name - The name of the region for the Availability Zone (for - // example, us-east-1). - // - // * state - The state of the Availability Zone (available | information - // | impaired | unavailable). - // - // * zone-name - The name of the Availability Zone (for example, us-east-1a). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The names of one or more Availability Zones. - ZoneNames []*string `locationName:"ZoneName" locationNameList:"ZoneName" type:"list"` -} - -// String returns the string representation -func (s DescribeAvailabilityZonesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailabilityZonesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeAvailabilityZonesInput) SetDryRun(v bool) *DescribeAvailabilityZonesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeAvailabilityZonesInput) SetFilters(v []*Filter) *DescribeAvailabilityZonesInput { - s.Filters = v - return s -} - -// SetZoneNames sets the ZoneNames field's value. -func (s *DescribeAvailabilityZonesInput) SetZoneNames(v []*string) *DescribeAvailabilityZonesInput { - s.ZoneNames = v - return s -} - -// Contains the output of DescribeAvailabiltyZones. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeAvailabilityZonesResult -type DescribeAvailabilityZonesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more Availability Zones. - AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeAvailabilityZonesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailabilityZonesOutput) GoString() string { - return s.String() -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DescribeAvailabilityZonesOutput) SetAvailabilityZones(v []*AvailabilityZone) *DescribeAvailabilityZonesOutput { - s.AvailabilityZones = v - return s -} - -// Contains the parameters for DescribeBundleTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasksRequest -type DescribeBundleTasksInput struct { - _ struct{} `type:"structure"` - - // One or more bundle task IDs. - // - // Default: Describes all your bundle tasks. - BundleIds []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * bundle-id - The ID of the bundle task. - // - // * error-code - If the task failed, the error code returned. - // - // * error-message - If the task failed, the error message returned. - // - // * instance-id - The ID of the instance. - // - // * progress - The level of task completion, as a percentage (for example, - // 20%). - // - // * s3-bucket - The Amazon S3 bucket to store the AMI. - // - // * s3-prefix - The beginning of the AMI name. - // - // * start-time - The time the task started (for example, 2013-09-15T17:15:20.000Z). - // - // * state - The state of the task (pending | waiting-for-shutdown | bundling - // | storing | cancelling | complete | failed). - // - // * update-time - The time of the most recent update for the task. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` -} - -// String returns the string representation -func (s DescribeBundleTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeBundleTasksInput) GoString() string { - return s.String() -} - -// SetBundleIds sets the BundleIds field's value. -func (s *DescribeBundleTasksInput) SetBundleIds(v []*string) *DescribeBundleTasksInput { - s.BundleIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeBundleTasksInput) SetDryRun(v bool) *DescribeBundleTasksInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeBundleTasksInput) SetFilters(v []*Filter) *DescribeBundleTasksInput { - s.Filters = v - return s -} - -// Contains the output of DescribeBundleTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeBundleTasksResult -type DescribeBundleTasksOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more bundle tasks. - BundleTasks []*BundleTask `locationName:"bundleInstanceTasksSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeBundleTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeBundleTasksOutput) GoString() string { - return s.String() -} - -// SetBundleTasks sets the BundleTasks field's value. -func (s *DescribeBundleTasksOutput) SetBundleTasks(v []*BundleTask) *DescribeBundleTasksOutput { - s.BundleTasks = v - return s -} - -// Contains the parameters for DescribeClassicLinkInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstancesRequest -type DescribeClassicLinkInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * group-id - The ID of a VPC security group that's associated with the - // instance. - // - // * instance-id - The ID of the instance. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC that the instance is linked to. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more instance IDs. Must be instances linked to a VPC through ClassicLink. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. You cannot specify this parameter and the instance IDs parameter - // in the same request. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeClassicLinkInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClassicLinkInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeClassicLinkInstancesInput) SetDryRun(v bool) *DescribeClassicLinkInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeClassicLinkInstancesInput) SetFilters(v []*Filter) *DescribeClassicLinkInstancesInput { - s.Filters = v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeClassicLinkInstancesInput) SetInstanceIds(v []*string) *DescribeClassicLinkInstancesInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeClassicLinkInstancesInput) SetMaxResults(v int64) *DescribeClassicLinkInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeClassicLinkInstancesInput) SetNextToken(v string) *DescribeClassicLinkInstancesInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeClassicLinkInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClassicLinkInstancesResult -type DescribeClassicLinkInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more linked EC2-Classic instances. - Instances []*ClassicLinkInstance `locationName:"instancesSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeClassicLinkInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeClassicLinkInstancesOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *DescribeClassicLinkInstancesOutput) SetInstances(v []*ClassicLinkInstance) *DescribeClassicLinkInstancesOutput { - s.Instances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeClassicLinkInstancesOutput) SetNextToken(v string) *DescribeClassicLinkInstancesOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeConversionTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeConversionTasksRequest -type DescribeConversionTasksInput struct { - _ struct{} `type:"structure"` - - // One or more conversion task IDs. - ConversionTaskIds []*string `locationName:"conversionTaskId" locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DescribeConversionTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConversionTasksInput) GoString() string { - return s.String() -} - -// SetConversionTaskIds sets the ConversionTaskIds field's value. -func (s *DescribeConversionTasksInput) SetConversionTaskIds(v []*string) *DescribeConversionTasksInput { - s.ConversionTaskIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeConversionTasksInput) SetDryRun(v bool) *DescribeConversionTasksInput { - s.DryRun = &v - return s -} - -// Contains the output for DescribeConversionTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeConversionTasksResult -type DescribeConversionTasksOutput struct { - _ struct{} `type:"structure"` - - // Information about the conversion tasks. - ConversionTasks []*ConversionTask `locationName:"conversionTasks" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeConversionTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeConversionTasksOutput) GoString() string { - return s.String() -} - -// SetConversionTasks sets the ConversionTasks field's value. -func (s *DescribeConversionTasksOutput) SetConversionTasks(v []*ConversionTask) *DescribeConversionTasksOutput { - s.ConversionTasks = v - return s -} - -// Contains the parameters for DescribeCustomerGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCustomerGatewaysRequest -type DescribeCustomerGatewaysInput struct { - _ struct{} `type:"structure"` - - // One or more customer gateway IDs. - // - // Default: Describes all your customer gateways. - CustomerGatewayIds []*string `locationName:"CustomerGatewayId" locationNameList:"CustomerGatewayId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * bgp-asn - The customer gateway's Border Gateway Protocol (BGP) Autonomous - // System Number (ASN). - // - // * customer-gateway-id - The ID of the customer gateway. - // - // * ip-address - The IP address of the customer gateway's Internet-routable - // external interface. - // - // * state - The state of the customer gateway (pending | available | deleting - // | deleted). - // - // * type - The type of customer gateway. Currently, the only supported type - // is ipsec.1. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` -} - -// String returns the string representation -func (s DescribeCustomerGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCustomerGatewaysInput) GoString() string { - return s.String() -} - -// SetCustomerGatewayIds sets the CustomerGatewayIds field's value. -func (s *DescribeCustomerGatewaysInput) SetCustomerGatewayIds(v []*string) *DescribeCustomerGatewaysInput { - s.CustomerGatewayIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeCustomerGatewaysInput) SetDryRun(v bool) *DescribeCustomerGatewaysInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeCustomerGatewaysInput) SetFilters(v []*Filter) *DescribeCustomerGatewaysInput { - s.Filters = v - return s -} - -// Contains the output of DescribeCustomerGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCustomerGatewaysResult -type DescribeCustomerGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more customer gateways. - CustomerGateways []*CustomerGateway `locationName:"customerGatewaySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeCustomerGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCustomerGatewaysOutput) GoString() string { - return s.String() -} - -// SetCustomerGateways sets the CustomerGateways field's value. -func (s *DescribeCustomerGatewaysOutput) SetCustomerGateways(v []*CustomerGateway) *DescribeCustomerGatewaysOutput { - s.CustomerGateways = v - return s -} - -// Contains the parameters for DescribeDhcpOptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeDhcpOptionsRequest -type DescribeDhcpOptionsInput struct { - _ struct{} `type:"structure"` - - // The IDs of one or more DHCP options sets. - // - // Default: Describes all your DHCP options sets. - DhcpOptionsIds []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * dhcp-options-id - The ID of a set of DHCP options. - // - // * key - The key for one of the options (for example, domain-name). - // - // * value - The value for one of the options. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` -} - -// String returns the string representation -func (s DescribeDhcpOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDhcpOptionsInput) GoString() string { - return s.String() -} - -// SetDhcpOptionsIds sets the DhcpOptionsIds field's value. -func (s *DescribeDhcpOptionsInput) SetDhcpOptionsIds(v []*string) *DescribeDhcpOptionsInput { - s.DhcpOptionsIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeDhcpOptionsInput) SetDryRun(v bool) *DescribeDhcpOptionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeDhcpOptionsInput) SetFilters(v []*Filter) *DescribeDhcpOptionsInput { - s.Filters = v - return s -} - -// Contains the output of DescribeDhcpOptions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeDhcpOptionsResult -type DescribeDhcpOptionsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more DHCP options sets. - DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeDhcpOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDhcpOptionsOutput) GoString() string { - return s.String() -} - -// SetDhcpOptions sets the DhcpOptions field's value. -func (s *DescribeDhcpOptionsOutput) SetDhcpOptions(v []*DhcpOptions) *DescribeDhcpOptionsOutput { - s.DhcpOptions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeEgressOnlyInternetGatewaysRequest -type DescribeEgressOnlyInternetGatewaysInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more egress-only Internet gateway IDs. - EgressOnlyInternetGatewayIds []*string `locationName:"EgressOnlyInternetGatewayId" locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000; if MaxResults is given - // a value larger than 1000, only 1000 results are returned. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeEgressOnlyInternetGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEgressOnlyInternetGatewaysInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetDryRun(v bool) *DescribeEgressOnlyInternetGatewaysInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayIds sets the EgressOnlyInternetGatewayIds field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetEgressOnlyInternetGatewayIds(v []*string) *DescribeEgressOnlyInternetGatewaysInput { - s.EgressOnlyInternetGatewayIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetMaxResults(v int64) *DescribeEgressOnlyInternetGatewaysInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeEgressOnlyInternetGatewaysResult -type DescribeEgressOnlyInternetGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about the egress-only Internet gateways. - EgressOnlyInternetGateways []*EgressOnlyInternetGateway `locationName:"egressOnlyInternetGatewaySet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeEgressOnlyInternetGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeEgressOnlyInternetGatewaysOutput) GoString() string { - return s.String() -} - -// SetEgressOnlyInternetGateways sets the EgressOnlyInternetGateways field's value. -func (s *DescribeEgressOnlyInternetGatewaysOutput) SetEgressOnlyInternetGateways(v []*EgressOnlyInternetGateway) *DescribeEgressOnlyInternetGatewaysOutput { - s.EgressOnlyInternetGateways = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeEgressOnlyInternetGatewaysOutput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeExportTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeExportTasksRequest -type DescribeExportTasksInput struct { - _ struct{} `type:"structure"` - - // One or more export task IDs. - ExportTaskIds []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` -} - -// String returns the string representation -func (s DescribeExportTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeExportTasksInput) GoString() string { - return s.String() -} - -// SetExportTaskIds sets the ExportTaskIds field's value. -func (s *DescribeExportTasksInput) SetExportTaskIds(v []*string) *DescribeExportTasksInput { - s.ExportTaskIds = v - return s -} - -// Contains the output for DescribeExportTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeExportTasksResult -type DescribeExportTasksOutput struct { - _ struct{} `type:"structure"` - - // Information about the export tasks. - ExportTasks []*ExportTask `locationName:"exportTaskSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeExportTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeExportTasksOutput) GoString() string { - return s.String() -} - -// SetExportTasks sets the ExportTasks field's value. -func (s *DescribeExportTasksOutput) SetExportTasks(v []*ExportTask) *DescribeExportTasksOutput { - s.ExportTasks = v - return s -} - -// Contains the parameters for DescribeFlowLogs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogsRequest -type DescribeFlowLogsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * deliver-log-status - The status of the logs delivery (SUCCESS | FAILED). - // - // * flow-log-id - The ID of the flow log. - // - // * log-group-name - The name of the log group. - // - // * resource-id - The ID of the VPC, subnet, or network interface. - // - // * traffic-type - The type of traffic (ACCEPT | REJECT | ALL) - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // One or more flow log IDs. - FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000; if MaxResults is given - // a value larger than 1000, only 1000 results are returned. You cannot specify - // this parameter and the flow log IDs parameter in the same request. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeFlowLogsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFlowLogsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeFlowLogsInput) SetFilter(v []*Filter) *DescribeFlowLogsInput { - s.Filter = v - return s -} - -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *DescribeFlowLogsInput) SetFlowLogIds(v []*string) *DescribeFlowLogsInput { - s.FlowLogIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFlowLogsInput) SetMaxResults(v int64) *DescribeFlowLogsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFlowLogsInput) SetNextToken(v string) *DescribeFlowLogsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeFlowLogs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFlowLogsResult -type DescribeFlowLogsOutput struct { - _ struct{} `type:"structure"` - - // Information about the flow logs. - FlowLogs []*FlowLog `locationName:"flowLogSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeFlowLogsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFlowLogsOutput) GoString() string { - return s.String() -} - -// SetFlowLogs sets the FlowLogs field's value. -func (s *DescribeFlowLogsOutput) SetFlowLogs(v []*FlowLog) *DescribeFlowLogsOutput { - s.FlowLogs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFlowLogsOutput) SetNextToken(v string) *DescribeFlowLogsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationOfferingsRequest -type DescribeHostReservationOfferingsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * instance-family - The instance family of the offering (e.g., m4). - // - // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // This is the maximum duration of the reservation you'd like to purchase, specified - // in seconds. Reservations are available in one-year and three-year terms. - // The number of seconds specified must be the number of seconds in a year (365x24x60x60) - // times one of the supported durations (1 or 3). For example, specify 94608000 - // for three years. - MaxDuration *int64 `type:"integer"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500; if maxResults is given - // a larger value than 500, you will receive an error. - MaxResults *int64 `type:"integer"` - - // This is the minimum duration of the reservation you'd like to purchase, specified - // in seconds. Reservations are available in one-year and three-year terms. - // The number of seconds specified must be the number of seconds in a year (365x24x60x60) - // times one of the supported durations (1 or 3). For example, specify 31536000 - // for one year. - MinDuration *int64 `type:"integer"` - - // The token to use to retrieve the next page of results. - NextToken *string `type:"string"` - - // The ID of the reservation offering. - OfferingId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeHostReservationOfferingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationOfferingsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeHostReservationOfferingsInput) SetFilter(v []*Filter) *DescribeHostReservationOfferingsInput { - s.Filter = v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *DescribeHostReservationOfferingsInput) SetMaxDuration(v int64) *DescribeHostReservationOfferingsInput { - s.MaxDuration = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostReservationOfferingsInput) SetMaxResults(v int64) *DescribeHostReservationOfferingsInput { - s.MaxResults = &v - return s -} - -// SetMinDuration sets the MinDuration field's value. -func (s *DescribeHostReservationOfferingsInput) SetMinDuration(v int64) *DescribeHostReservationOfferingsInput { - s.MinDuration = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationOfferingsInput) SetNextToken(v string) *DescribeHostReservationOfferingsInput { - s.NextToken = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *DescribeHostReservationOfferingsInput) SetOfferingId(v string) *DescribeHostReservationOfferingsInput { - s.OfferingId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationOfferingsResult -type DescribeHostReservationOfferingsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the offerings. - OfferingSet []*HostOffering `locationName:"offeringSet" type:"list"` -} - -// String returns the string representation -func (s DescribeHostReservationOfferingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationOfferingsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationOfferingsOutput) SetNextToken(v string) *DescribeHostReservationOfferingsOutput { - s.NextToken = &v - return s -} - -// SetOfferingSet sets the OfferingSet field's value. -func (s *DescribeHostReservationOfferingsOutput) SetOfferingSet(v []*HostOffering) *DescribeHostReservationOfferingsOutput { - s.OfferingSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationsRequest -type DescribeHostReservationsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * instance-family - The instance family (e.g., m4). - // - // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). - // - // * state - The state of the reservation (payment-pending | payment-failed - // | active | retired). - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // One or more host reservation IDs. - HostReservationIdSet []*string `locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500; if maxResults is given - // a larger value than 500, you will receive an error. - MaxResults *int64 `type:"integer"` - - // The token to use to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeHostReservationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeHostReservationsInput) SetFilter(v []*Filter) *DescribeHostReservationsInput { - s.Filter = v - return s -} - -// SetHostReservationIdSet sets the HostReservationIdSet field's value. -func (s *DescribeHostReservationsInput) SetHostReservationIdSet(v []*string) *DescribeHostReservationsInput { - s.HostReservationIdSet = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostReservationsInput) SetMaxResults(v int64) *DescribeHostReservationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationsInput) SetNextToken(v string) *DescribeHostReservationsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostReservationsResult -type DescribeHostReservationsOutput struct { - _ struct{} `type:"structure"` - - // Details about the reservation's configuration. - HostReservationSet []*HostReservation `locationName:"hostReservationSet" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeHostReservationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostReservationsOutput) GoString() string { - return s.String() -} - -// SetHostReservationSet sets the HostReservationSet field's value. -func (s *DescribeHostReservationsOutput) SetHostReservationSet(v []*HostReservation) *DescribeHostReservationsOutput { - s.HostReservationSet = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationsOutput) SetNextToken(v string) *DescribeHostReservationsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostsRequest -type DescribeHostsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * instance-type - The instance type size that the Dedicated Host is configured - // to support. - // - // * auto-placement - Whether auto-placement is enabled or disabled (on | - // off). - // - // * host-reservation-id - The ID of the reservation assigned to this host. - // - // * client-token - The idempotency token you provided when you launched - // the instance - // - // * state- The allocation state of the Dedicated Host (available | under-assessment - // | permanent-failure | released | released-permanent-failure). - // - // * availability-zone - The Availability Zone of the host. - Filter []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` - - // The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches. - HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // nextToken value. This value can be between 5 and 500; if maxResults is given - // a larger value than 500, you will receive an error. You cannot specify this - // parameter and the host IDs parameter in the same request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostsInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeHostsInput) SetFilter(v []*Filter) *DescribeHostsInput { - s.Filter = v - return s -} - -// SetHostIds sets the HostIds field's value. -func (s *DescribeHostsInput) SetHostIds(v []*string) *DescribeHostsInput { - s.HostIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostsInput) SetMaxResults(v int64) *DescribeHostsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostsInput) SetNextToken(v string) *DescribeHostsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeHostsResult -type DescribeHostsOutput struct { - _ struct{} `type:"structure"` - - // Information about the Dedicated Hosts. - Hosts []*Host `locationName:"hostSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeHostsOutput) GoString() string { - return s.String() -} - -// SetHosts sets the Hosts field's value. -func (s *DescribeHostsOutput) SetHosts(v []*Host) *DescribeHostsOutput { - s.Hosts = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostsOutput) SetNextToken(v string) *DescribeHostsOutput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociationsRequest -type DescribeIamInstanceProfileAssociationsInput struct { - _ struct{} `type:"structure"` - - // One or more IAM instance profile associations. - AssociationIds []*string `locationName:"AssociationId" locationNameList:"AssociationId" type:"list"` - - // One or more filters. - // - // * instance-id - The ID of the instance. - // - // * state - The state of the association (associating | associated | disassociating - // | disassociated). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int64 `min:"5" type:"integer"` - - // The token to request the next page of results. - NextToken *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeIamInstanceProfileAssociationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIamInstanceProfileAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeIamInstanceProfileAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeIamInstanceProfileAssociationsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationIds sets the AssociationIds field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetAssociationIds(v []*string) *DescribeIamInstanceProfileAssociationsInput { - s.AssociationIds = v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetFilters(v []*Filter) *DescribeIamInstanceProfileAssociationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetMaxResults(v int64) *DescribeIamInstanceProfileAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsInput { - s.NextToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociationsResult -type DescribeIamInstanceProfileAssociationsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more IAM instance profile associations. - IamInstanceProfileAssociations []*IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociationSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` -} - -// String returns the string representation -func (s DescribeIamInstanceProfileAssociationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIamInstanceProfileAssociationsOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociations sets the IamInstanceProfileAssociations field's value. -func (s *DescribeIamInstanceProfileAssociationsOutput) SetIamInstanceProfileAssociations(v []*IamInstanceProfileAssociation) *DescribeIamInstanceProfileAssociationsOutput { - s.IamInstanceProfileAssociations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeIamInstanceProfileAssociationsOutput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeIdFormat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormatRequest -type DescribeIdFormatInput struct { - _ struct{} `type:"structure"` - - // The type of resource: instance | reservation | snapshot | volume - Resource *string `type:"string"` -} - -// String returns the string representation -func (s DescribeIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdFormatInput) GoString() string { - return s.String() -} - -// SetResource sets the Resource field's value. -func (s *DescribeIdFormatInput) SetResource(v string) *DescribeIdFormatInput { - s.Resource = &v - return s -} - -// Contains the output of DescribeIdFormat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormatResult -type DescribeIdFormatOutput struct { - _ struct{} `type:"structure"` - - // Information about the ID format for the resource. - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdFormatOutput) GoString() string { - return s.String() -} - -// SetStatuses sets the Statuses field's value. -func (s *DescribeIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdFormatOutput { - s.Statuses = v - return s -} - -// Contains the parameters for DescribeIdentityIdFormat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdentityIdFormatRequest -type DescribeIdentityIdFormatInput struct { - _ struct{} `type:"structure"` - - // The ARN of the principal, which can be an IAM role, IAM user, or the root - // user. - // - // PrincipalArn is a required field - PrincipalArn *string `locationName:"principalArn" type:"string" required:"true"` - - // The type of resource: instance | reservation | snapshot | volume - Resource *string `locationName:"resource" type:"string"` -} - -// String returns the string representation -func (s DescribeIdentityIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdentityIdFormatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeIdentityIdFormatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeIdentityIdFormatInput"} - if s.PrincipalArn == nil { - invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrincipalArn sets the PrincipalArn field's value. -func (s *DescribeIdentityIdFormatInput) SetPrincipalArn(v string) *DescribeIdentityIdFormatInput { - s.PrincipalArn = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *DescribeIdentityIdFormatInput) SetResource(v string) *DescribeIdentityIdFormatInput { - s.Resource = &v - return s -} - -// Contains the output of DescribeIdentityIdFormat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdentityIdFormatResult -type DescribeIdentityIdFormatOutput struct { - _ struct{} `type:"structure"` - - // Information about the ID format for the resources. - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeIdentityIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeIdentityIdFormatOutput) GoString() string { - return s.String() -} - -// SetStatuses sets the Statuses field's value. -func (s *DescribeIdentityIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdentityIdFormatOutput { - s.Statuses = v - return s -} - -// Contains the parameters for DescribeImageAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImageAttributeRequest -type DescribeImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The AMI attribute. - // - // Note: Depending on your account privileges, the blockDeviceMapping attribute - // may return a Client.AuthFailure error. If this happens, use DescribeImages - // to get information about the block device mapping for the AMI. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"ImageAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeImageAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeImageAttributeInput) SetAttribute(v string) *DescribeImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImageAttributeInput) SetDryRun(v bool) *DescribeImageAttributeInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *DescribeImageAttributeInput) SetImageId(v string) *DescribeImageAttributeInput { - s.ImageId = &v - return s -} - -// Describes an image attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImageAttribute -type DescribeImageAttributeOutput struct { - _ struct{} `type:"structure"` - - // One or more block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // A description for the AMI. - Description *AttributeValue `locationName:"description" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The kernel ID. - KernelId *AttributeValue `locationName:"kernel" type:"structure"` - - // One or more launch permissions. - LaunchPermissions []*LaunchPermission `locationName:"launchPermission" locationNameList:"item" type:"list"` - - // One or more product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The RAM disk ID. - RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` - - // Indicates whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` -} - -// String returns the string representation -func (s DescribeImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImageAttributeOutput) GoString() string { - return s.String() -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *DescribeImageAttributeOutput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *DescribeImageAttributeOutput { - s.BlockDeviceMappings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeImageAttributeOutput) SetDescription(v *AttributeValue) *DescribeImageAttributeOutput { - s.Description = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *DescribeImageAttributeOutput) SetImageId(v string) *DescribeImageAttributeOutput { - s.ImageId = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *DescribeImageAttributeOutput) SetKernelId(v *AttributeValue) *DescribeImageAttributeOutput { - s.KernelId = v - return s -} - -// SetLaunchPermissions sets the LaunchPermissions field's value. -func (s *DescribeImageAttributeOutput) SetLaunchPermissions(v []*LaunchPermission) *DescribeImageAttributeOutput { - s.LaunchPermissions = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeImageAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeImageAttributeOutput { - s.ProductCodes = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *DescribeImageAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeImageAttributeOutput { - s.RamdiskId = v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *DescribeImageAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeImageAttributeOutput { - s.SriovNetSupport = v - return s -} - -// Contains the parameters for DescribeImages. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImagesRequest -type DescribeImagesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Scopes the images by users with explicit launch permissions. Specify an AWS - // account ID, self (the sender of the request), or all (public AMIs). - ExecutableUsers []*string `locationName:"ExecutableBy" locationNameList:"ExecutableBy" type:"list"` - - // One or more filters. - // - // * architecture - The image architecture (i386 | x86_64). - // - // * block-device-mapping.delete-on-termination - A Boolean value that indicates - // whether the Amazon EBS volume is deleted on instance termination. - // - // * block-device-mapping.device-name - The device name for the EBS volume - // (for example, /dev/sdh). - // - // * block-device-mapping.snapshot-id - The ID of the snapshot used for the - // EBS volume. - // - // * block-device-mapping.volume-size - The volume size of the EBS volume, - // in GiB. - // - // * block-device-mapping.volume-type - The volume type of the EBS volume - // (gp2 | io1 | st1 | sc1 | standard). - // - // * description - The description of the image (provided during image creation). - // - // * ena-support - A Boolean that indicates whether enhanced networking with - // ENA is enabled. - // - // * hypervisor - The hypervisor type (ovm | xen). - // - // * image-id - The ID of the image. - // - // * image-type - The image type (machine | kernel | ramdisk). - // - // * is-public - A Boolean that indicates whether the image is public. - // - // * kernel-id - The kernel ID. - // - // * manifest-location - The location of the image manifest. - // - // * name - The name of the AMI (provided during image creation). - // - // * owner-alias - String value from an Amazon-maintained list (amazon | - // aws-marketplace | microsoft) of snapshot owners. Not to be confused with - // the user-configured AWS account alias, which is set from the IAM console. - // - // * owner-id - The AWS account ID of the image owner. - // - // * platform - The platform. To only list Windows-based AMIs, use windows. - // - // * product-code - The product code. - // - // * product-code.type - The type of the product code (devpay | marketplace). - // - // * ramdisk-id - The RAM disk ID. - // - // * root-device-name - The name of the root device volume (for example, - // /dev/sda1). - // - // * root-device-type - The type of the root device volume (ebs | instance-store). - // - // * state - The state of the image (available | pending | failed). - // - // * state-reason-code - The reason code for the state change. - // - // * state-reason-message - The message for the state change. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * virtualization-type - The virtualization type (paravirtual | hvm). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more image IDs. - // - // Default: Describes all images available to you. - ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` - - // Filters the images by the owner. Specify an AWS account ID, self (owner is - // the sender of the request), or an AWS owner alias (valid values are amazon - // | aws-marketplace | microsoft). Omitting this option returns all images for - // which you have launch permissions, regardless of ownership. - Owners []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` -} - -// String returns the string representation -func (s DescribeImagesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImagesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImagesInput) SetDryRun(v bool) *DescribeImagesInput { - s.DryRun = &v - return s -} - -// SetExecutableUsers sets the ExecutableUsers field's value. -func (s *DescribeImagesInput) SetExecutableUsers(v []*string) *DescribeImagesInput { - s.ExecutableUsers = v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeImagesInput) SetFilters(v []*Filter) *DescribeImagesInput { - s.Filters = v - return s -} - -// SetImageIds sets the ImageIds field's value. -func (s *DescribeImagesInput) SetImageIds(v []*string) *DescribeImagesInput { - s.ImageIds = v - return s -} - -// SetOwners sets the Owners field's value. -func (s *DescribeImagesInput) SetOwners(v []*string) *DescribeImagesInput { - s.Owners = v - return s -} - -// Contains the output of DescribeImages. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImagesResult -type DescribeImagesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more images. - Images []*Image `locationName:"imagesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeImagesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImagesOutput) GoString() string { - return s.String() -} - -// SetImages sets the Images field's value. -func (s *DescribeImagesOutput) SetImages(v []*Image) *DescribeImagesOutput { - s.Images = v - return s -} - -// Contains the parameters for DescribeImportImageTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportImageTasksRequest -type DescribeImportImageTasksInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Filter tasks using the task-state filter and one of the following values: - // active, completed, deleting, deleted. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // A list of import image task IDs. - ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // A token that indicates the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeImportImageTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportImageTasksInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImportImageTasksInput) SetDryRun(v bool) *DescribeImportImageTasksInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeImportImageTasksInput) SetFilters(v []*Filter) *DescribeImportImageTasksInput { - s.Filters = v - return s -} - -// SetImportTaskIds sets the ImportTaskIds field's value. -func (s *DescribeImportImageTasksInput) SetImportTaskIds(v []*string) *DescribeImportImageTasksInput { - s.ImportTaskIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeImportImageTasksInput) SetMaxResults(v int64) *DescribeImportImageTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportImageTasksInput) SetNextToken(v string) *DescribeImportImageTasksInput { - s.NextToken = &v - return s -} - -// Contains the output for DescribeImportImageTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportImageTasksResult -type DescribeImportImageTasksOutput struct { - _ struct{} `type:"structure"` - - // A list of zero or more import image tasks that are currently active or were - // completed or canceled in the previous 7 days. - ImportImageTasks []*ImportImageTask `locationName:"importImageTaskSet" locationNameList:"item" type:"list"` - - // The token to use to get the next page of results. This value is null when - // there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeImportImageTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportImageTasksOutput) GoString() string { - return s.String() -} - -// SetImportImageTasks sets the ImportImageTasks field's value. -func (s *DescribeImportImageTasksOutput) SetImportImageTasks(v []*ImportImageTask) *DescribeImportImageTasksOutput { - s.ImportImageTasks = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportImageTasksOutput) SetNextToken(v string) *DescribeImportImageTasksOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeImportSnapshotTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportSnapshotTasksRequest -type DescribeImportSnapshotTasksInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // A list of import snapshot task IDs. - ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // A token that indicates the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeImportSnapshotTasksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportSnapshotTasksInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeImportSnapshotTasksInput) SetDryRun(v bool) *DescribeImportSnapshotTasksInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeImportSnapshotTasksInput) SetFilters(v []*Filter) *DescribeImportSnapshotTasksInput { - s.Filters = v - return s -} - -// SetImportTaskIds sets the ImportTaskIds field's value. -func (s *DescribeImportSnapshotTasksInput) SetImportTaskIds(v []*string) *DescribeImportSnapshotTasksInput { - s.ImportTaskIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeImportSnapshotTasksInput) SetMaxResults(v int64) *DescribeImportSnapshotTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportSnapshotTasksInput) SetNextToken(v string) *DescribeImportSnapshotTasksInput { - s.NextToken = &v - return s -} - -// Contains the output for DescribeImportSnapshotTasks. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeImportSnapshotTasksResult -type DescribeImportSnapshotTasksOutput struct { - _ struct{} `type:"structure"` - - // A list of zero or more import snapshot tasks that are currently active or - // were completed or canceled in the previous 7 days. - ImportSnapshotTasks []*ImportSnapshotTask `locationName:"importSnapshotTaskSet" locationNameList:"item" type:"list"` - - // The token to use to get the next page of results. This value is null when - // there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeImportSnapshotTasksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImportSnapshotTasksOutput) GoString() string { - return s.String() -} - -// SetImportSnapshotTasks sets the ImportSnapshotTasks field's value. -func (s *DescribeImportSnapshotTasksOutput) SetImportSnapshotTasks(v []*ImportSnapshotTask) *DescribeImportSnapshotTasksOutput { - s.ImportSnapshotTasks = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImportSnapshotTasksOutput) SetNextToken(v string) *DescribeImportSnapshotTasksOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeInstanceAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceAttributeRequest -type DescribeInstanceAttributeInput struct { - _ struct{} `type:"structure"` - - // The instance attribute. - // - // Note: The enaSupport attribute is not supported at this time. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"InstanceAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeInstanceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstanceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeInstanceAttributeInput) SetAttribute(v string) *DescribeInstanceAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceAttributeInput) SetDryRun(v bool) *DescribeInstanceAttributeInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceAttributeInput) SetInstanceId(v string) *DescribeInstanceAttributeInput { - s.InstanceId = &v - return s -} - -// Describes an instance attribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceAttribute -type DescribeInstanceAttributeOutput struct { - _ struct{} `type:"structure"` - - // The block device mapping of the instance. - BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // If the value is true, you can't terminate the instance through the Amazon - // EC2 console, CLI, or API; otherwise, you can. - DisableApiTermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` - - // Indicates whether the instance is optimized for EBS I/O. - EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` - - // Indicates whether enhanced networking with ENA is enabled. - EnaSupport *AttributeBooleanValue `locationName:"enaSupport" type:"structure"` - - // The security groups associated with the instance. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *AttributeValue `locationName:"instanceInitiatedShutdownBehavior" type:"structure"` - - // The instance type. - InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` - - // The kernel ID. - KernelId *AttributeValue `locationName:"kernel" type:"structure"` - - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The RAM disk ID. - RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` - - // The name of the root device (for example, /dev/sda1 or /dev/xvda). - RootDeviceName *AttributeValue `locationName:"rootDeviceName" type:"structure"` - - // Indicates whether source/destination checking is enabled. A value of true - // means checking is enabled, and false means checking is disabled. This value - // must be false for a NAT instance to perform NAT. - SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` - - // Indicates whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - - // The user data. - UserData *AttributeValue `locationName:"userData" type:"structure"` -} - -// String returns the string representation -func (s DescribeInstanceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceAttributeOutput) GoString() string { - return s.String() -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *DescribeInstanceAttributeOutput) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *DescribeInstanceAttributeOutput { - s.BlockDeviceMappings = v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *DescribeInstanceAttributeOutput) SetDisableApiTermination(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.DisableApiTermination = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *DescribeInstanceAttributeOutput) SetEbsOptimized(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.EbsOptimized = v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *DescribeInstanceAttributeOutput) SetEnaSupport(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.EnaSupport = v - return s -} - -// SetGroups sets the Groups field's value. -func (s *DescribeInstanceAttributeOutput) SetGroups(v []*GroupIdentifier) *DescribeInstanceAttributeOutput { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceId(v string) *DescribeInstanceAttributeOutput { - s.InstanceId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceInitiatedShutdownBehavior(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.InstanceInitiatedShutdownBehavior = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceType(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.InstanceType = v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *DescribeInstanceAttributeOutput) SetKernelId(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.KernelId = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeInstanceAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeInstanceAttributeOutput { - s.ProductCodes = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *DescribeInstanceAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.RamdiskId = v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *DescribeInstanceAttributeOutput) SetRootDeviceName(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.RootDeviceName = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *DescribeInstanceAttributeOutput) SetSourceDestCheck(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.SourceDestCheck = v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *DescribeInstanceAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.SriovNetSupport = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *DescribeInstanceAttributeOutput) SetUserData(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.UserData = v - return s -} - -// Contains the parameters for DescribeInstanceStatus. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceStatusRequest -type DescribeInstanceStatusInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone of the instance. - // - // * event.code - The code for the scheduled event (instance-reboot | system-reboot - // | system-maintenance | instance-retirement | instance-stop). - // - // * event.description - A description of the event. - // - // * event.not-after - The latest end time for the scheduled event (for example, - // 2014-09-15T17:15:20.000Z). - // - // * event.not-before - The earliest start time for the scheduled event (for - // example, 2014-09-15T17:15:20.000Z). - // - // * instance-state-code - The code for the instance state, as a 16-bit unsigned - // integer. The high byte is an opaque internal value and should be ignored. - // The low byte is set based on the state represented. The valid values are - // 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), - // and 80 (stopped). - // - // * instance-state-name - The state of the instance (pending | running | - // shutting-down | terminated | stopping | stopped). - // - // * instance-status.reachability - Filters on instance status where the - // name is reachability (passed | failed | initializing | insufficient-data). - // - // * instance-status.status - The status of the instance (ok | impaired | - // initializing | insufficient-data | not-applicable). - // - // * system-status.reachability - Filters on system status where the name - // is reachability (passed | failed | initializing | insufficient-data). - // - // * system-status.status - The system status of the instance (ok | impaired - // | initializing | insufficient-data | not-applicable). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // When true, includes the health status for all instances. When false, includes - // the health status for running instances only. - // - // Default: false - IncludeAllInstances *bool `locationName:"includeAllInstances" type:"boolean"` - - // One or more instance IDs. - // - // Default: Describes all your instances. - // - // Constraints: Maximum 100 explicitly specified instance IDs. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. You cannot specify this parameter and the - // instance IDs parameter in the same call. - MaxResults *int64 `type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceStatusInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceStatusInput) SetDryRun(v bool) *DescribeInstanceStatusInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstanceStatusInput) SetFilters(v []*Filter) *DescribeInstanceStatusInput { - s.Filters = v - return s -} - -// SetIncludeAllInstances sets the IncludeAllInstances field's value. -func (s *DescribeInstanceStatusInput) SetIncludeAllInstances(v bool) *DescribeInstanceStatusInput { - s.IncludeAllInstances = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstanceStatusInput) SetInstanceIds(v []*string) *DescribeInstanceStatusInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceStatusInput) SetMaxResults(v int64) *DescribeInstanceStatusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceStatusInput) SetNextToken(v string) *DescribeInstanceStatusInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeInstanceStatus. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceStatusResult -type DescribeInstanceStatusOutput struct { - _ struct{} `type:"structure"` - - // One or more instance status descriptions. - InstanceStatuses []*InstanceStatus `locationName:"instanceStatusSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceStatusOutput) GoString() string { - return s.String() -} - -// SetInstanceStatuses sets the InstanceStatuses field's value. -func (s *DescribeInstanceStatusOutput) SetInstanceStatuses(v []*InstanceStatus) *DescribeInstanceStatusOutput { - s.InstanceStatuses = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceStatusOutput) SetNextToken(v string) *DescribeInstanceStatusOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstancesRequest -type DescribeInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * affinity - The affinity setting for an instance running on a Dedicated - // Host (default | host). - // - // * architecture - The instance architecture (i386 | x86_64). - // - // * association.public-ip - The address of the Elastic IP address (IPv4) - // bound to the network interface. - // - // * association.ip-owner-id - The owner of the Elastic IP address (IPv4) - // associated with the network interface. - // - // * association.allocation-id - The allocation ID returned when you allocated - // the Elastic IP address (IPv4) for your network interface. - // - // * association.association-id - The association ID returned when the network - // interface was associated with an IPv4 address. - // - // * availability-zone - The Availability Zone of the instance. - // - // * block-device-mapping.attach-time - The attach time for an EBS volume - // mapped to the instance, for example, 2010-09-15T17:15:20.000Z. - // - // * block-device-mapping.delete-on-termination - A Boolean that indicates - // whether the EBS volume is deleted on instance termination. - // - // * block-device-mapping.device-name - The device name for the EBS volume - // (for example, /dev/sdh or xvdh). - // - // * block-device-mapping.status - The status for the EBS volume (attaching - // | attached | detaching | detached). - // - // * block-device-mapping.volume-id - The volume ID of the EBS volume. - // - // * client-token - The idempotency token you provided when you launched - // the instance. - // - // * dns-name - The public DNS name of the instance. - // - // * group-id - The ID of the security group for the instance. EC2-Classic - // only. - // - // * group-name - The name of the security group for the instance. EC2-Classic - // only. - // - // * host-id - The ID of the Dedicated Host on which the instance is running, - // if applicable. - // - // * hypervisor - The hypervisor type of the instance (ovm | xen). - // - // * iam-instance-profile.arn - The instance profile associated with the - // instance. Specified as an ARN. - // - // * image-id - The ID of the image used to launch the instance. - // - // * instance-id - The ID of the instance. - // - // * instance-lifecycle - Indicates whether this is a Spot Instance or a - // Scheduled Instance (spot | scheduled). - // - // * instance-state-code - The state of the instance, as a 16-bit unsigned - // integer. The high byte is an opaque internal value and should be ignored. - // The low byte is set based on the state represented. The valid values are: - // 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), - // and 80 (stopped). - // - // * instance-state-name - The state of the instance (pending | running | - // shutting-down | terminated | stopping | stopped). - // - // * instance-type - The type of instance (for example, t2.micro). - // - // * instance.group-id - The ID of the security group for the instance. - // - // * instance.group-name - The name of the security group for the instance. - // - // - // * ip-address - The public IPv4 address of the instance. - // - // * kernel-id - The kernel ID. - // - // * key-name - The name of the key pair used when the instance was launched. - // - // * launch-index - When launching multiple instances, this is the index - // for the instance in the launch group (for example, 0, 1, 2, and so on). - // - // - // * launch-time - The time when the instance was launched. - // - // * monitoring-state - Indicates whether detailed monitoring is enabled - // (disabled | enabled). - // - // * network-interface.addresses.private-ip-address - The private IPv4 address - // associated with the network interface. - // - // * network-interface.addresses.primary - Specifies whether the IPv4 address - // of the network interface is the primary private IPv4 address. - // - // * network-interface.addresses.association.public-ip - The ID of the association - // of an Elastic IP address (IPv4) with a network interface. - // - // * network-interface.addresses.association.ip-owner-id - The owner ID of - // the private IPv4 address associated with the network interface. - // - // * network-interface.attachment.attachment-id - The ID of the interface - // attachment. - // - // * network-interface.attachment.instance-id - The ID of the instance to - // which the network interface is attached. - // - // * network-interface.attachment.instance-owner-id - The owner ID of the - // instance to which the network interface is attached. - // - // * network-interface.attachment.device-index - The device index to which - // the network interface is attached. - // - // * network-interface.attachment.status - The status of the attachment (attaching - // | attached | detaching | detached). - // - // * network-interface.attachment.attach-time - The time that the network - // interface was attached to an instance. - // - // * network-interface.attachment.delete-on-termination - Specifies whether - // the attachment is deleted when an instance is terminated. - // - // * network-interface.availability-zone - The Availability Zone for the - // network interface. - // - // * network-interface.description - The description of the network interface. - // - // * network-interface.group-id - The ID of a security group associated with - // the network interface. - // - // * network-interface.group-name - The name of a security group associated - // with the network interface. - // - // * network-interface.ipv6-addresses.ipv6-address - The IPv6 address associated - // with the network interface. - // - // * network-interface.mac-address - The MAC address of the network interface. - // - // * network-interface.network-interface-id - The ID of the network interface. - // - // * network-interface.owner-id - The ID of the owner of the network interface. - // - // * network-interface.private-dns-name - The private DNS name of the network - // interface. - // - // * network-interface.requester-id - The requester ID for the network interface. - // - // * network-interface.requester-managed - Indicates whether the network - // interface is being managed by AWS. - // - // * network-interface.status - The status of the network interface (available) - // | in-use). - // - // * network-interface.source-dest-check - Whether the network interface - // performs source/destination checking. A value of true means checking is - // enabled, and false means checking is disabled. The value must be false - // for the network interface to perform network address translation (NAT) - // in your VPC. - // - // * network-interface.subnet-id - The ID of the subnet for the network interface. - // - // * network-interface.vpc-id - The ID of the VPC for the network interface. - // - // * owner-id - The AWS account ID of the instance owner. - // - // * placement-group-name - The name of the placement group for the instance. - // - // * platform - The platform. Use windows if you have Windows instances; - // otherwise, leave blank. - // - // * private-dns-name - The private IPv4 DNS name of the instance. - // - // * private-ip-address - The private IPv4 address of the instance. - // - // * product-code - The product code associated with the AMI used to launch - // the instance. - // - // * product-code.type - The type of product code (devpay | marketplace). - // - // * ramdisk-id - The RAM disk ID. - // - // * reason - The reason for the current state of the instance (for example, - // shows "User Initiated [date]" when you stop or terminate the instance). - // Similar to the state-reason-code filter. - // - // * requester-id - The ID of the entity that launched the instance on your - // behalf (for example, AWS Management Console, Auto Scaling, and so on). - // - // * reservation-id - The ID of the instance's reservation. A reservation - // ID is created any time you launch an instance. A reservation ID has a - // one-to-one relationship with an instance launch request, but can be associated - // with more than one instance if you launch multiple instances using the - // same launch request. For example, if you launch one instance, you'll get - // one reservation ID. If you launch ten instances using the same launch - // request, you'll also get one reservation ID. - // - // * root-device-name - The name of the root device for the instance (for - // example, /dev/sda1 or /dev/xvda). - // - // * root-device-type - The type of root device that the instance uses (ebs - // | instance-store). - // - // * source-dest-check - Indicates whether the instance performs source/destination - // checking. A value of true means that checking is enabled, and false means - // checking is disabled. The value must be false for the instance to perform - // network address translation (NAT) in your VPC. - // - // * spot-instance-request-id - The ID of the Spot instance request. - // - // * state-reason-code - The reason code for the state change. - // - // * state-reason-message - A message that describes the state change. - // - // * subnet-id - The ID of the subnet for the instance. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * tenancy - The tenancy of an instance (dedicated | default | host). - // - // * virtualization-type - The virtualization type of the instance (paravirtual - // | hvm). - // - // * vpc-id - The ID of the VPC that the instance is running in. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more instance IDs. - // - // Default: Describes all your instances. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 1000. You cannot specify this parameter and the - // instance IDs parameter or tag filters in the same call. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to request the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstancesInput) SetDryRun(v bool) *DescribeInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInstancesInput) SetFilters(v []*Filter) *DescribeInstancesInput { - s.Filters = v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstancesInput) SetInstanceIds(v []*string) *DescribeInstancesInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancesInput) SetMaxResults(v int64) *DescribeInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesInput) SetNextToken(v string) *DescribeInstancesInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstancesResult -type DescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Zero or more reservations. - Reservations []*Reservation `locationName:"reservationSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesOutput) SetNextToken(v string) *DescribeInstancesOutput { - s.NextToken = &v - return s -} - -// SetReservations sets the Reservations field's value. -func (s *DescribeInstancesOutput) SetReservations(v []*Reservation) *DescribeInstancesOutput { - s.Reservations = v - return s -} - -// Contains the parameters for DescribeInternetGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInternetGatewaysRequest -type DescribeInternetGatewaysInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * attachment.state - The current state of the attachment between the gateway - // and the VPC (available). Present only if a VPC is attached. - // - // * attachment.vpc-id - The ID of an attached VPC. - // - // * internet-gateway-id - The ID of the Internet gateway. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more Internet gateway IDs. - // - // Default: Describes all your Internet gateways. - InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeInternetGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInternetGatewaysInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeInternetGatewaysInput) SetDryRun(v bool) *DescribeInternetGatewaysInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeInternetGatewaysInput) SetFilters(v []*Filter) *DescribeInternetGatewaysInput { - s.Filters = v - return s -} - -// SetInternetGatewayIds sets the InternetGatewayIds field's value. -func (s *DescribeInternetGatewaysInput) SetInternetGatewayIds(v []*string) *DescribeInternetGatewaysInput { - s.InternetGatewayIds = v - return s -} - -// Contains the output of DescribeInternetGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInternetGatewaysResult -type DescribeInternetGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more Internet gateways. - InternetGateways []*InternetGateway `locationName:"internetGatewaySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeInternetGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInternetGatewaysOutput) GoString() string { - return s.String() -} - -// SetInternetGateways sets the InternetGateways field's value. -func (s *DescribeInternetGatewaysOutput) SetInternetGateways(v []*InternetGateway) *DescribeInternetGatewaysOutput { - s.InternetGateways = v - return s -} - -// Contains the parameters for DescribeKeyPairs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeKeyPairsRequest -type DescribeKeyPairsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * fingerprint - The fingerprint of the key pair. - // - // * key-name - The name of the key pair. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more key pair names. - // - // Default: Describes all your key pairs. - KeyNames []*string `locationName:"KeyName" locationNameList:"KeyName" type:"list"` -} - -// String returns the string representation -func (s DescribeKeyPairsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyPairsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeKeyPairsInput) SetDryRun(v bool) *DescribeKeyPairsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeKeyPairsInput) SetFilters(v []*Filter) *DescribeKeyPairsInput { - s.Filters = v - return s -} - -// SetKeyNames sets the KeyNames field's value. -func (s *DescribeKeyPairsInput) SetKeyNames(v []*string) *DescribeKeyPairsInput { - s.KeyNames = v - return s -} - -// Contains the output of DescribeKeyPairs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeKeyPairsResult -type DescribeKeyPairsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more key pairs. - KeyPairs []*KeyPairInfo `locationName:"keySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeKeyPairsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyPairsOutput) GoString() string { - return s.String() -} - -// SetKeyPairs sets the KeyPairs field's value. -func (s *DescribeKeyPairsOutput) SetKeyPairs(v []*KeyPairInfo) *DescribeKeyPairsOutput { - s.KeyPairs = v - return s -} - -// Contains the parameters for DescribeMovingAddresses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddressesRequest -type DescribeMovingAddressesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * moving-status - The status of the Elastic IP address (MovingToVpc | - // RestoringToClassic). - Filters []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value outside of this range, an error is returned. - // - // Default: If no value is provided, the default is 1000. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to use to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // One or more Elastic IP addresses. - PublicIps []*string `locationName:"publicIp" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeMovingAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMovingAddressesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeMovingAddressesInput) SetDryRun(v bool) *DescribeMovingAddressesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeMovingAddressesInput) SetFilters(v []*Filter) *DescribeMovingAddressesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeMovingAddressesInput) SetMaxResults(v int64) *DescribeMovingAddressesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMovingAddressesInput) SetNextToken(v string) *DescribeMovingAddressesInput { - s.NextToken = &v - return s -} - -// SetPublicIps sets the PublicIps field's value. -func (s *DescribeMovingAddressesInput) SetPublicIps(v []*string) *DescribeMovingAddressesInput { - s.PublicIps = v - return s -} - -// Contains the output of DescribeMovingAddresses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddressesResult -type DescribeMovingAddressesOutput struct { - _ struct{} `type:"structure"` - - // The status for each Elastic IP address. - MovingAddressStatuses []*MovingAddressStatus `locationName:"movingAddressStatusSet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeMovingAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeMovingAddressesOutput) GoString() string { - return s.String() -} - -// SetMovingAddressStatuses sets the MovingAddressStatuses field's value. -func (s *DescribeMovingAddressesOutput) SetMovingAddressStatuses(v []*MovingAddressStatus) *DescribeMovingAddressesOutput { - s.MovingAddressStatuses = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeMovingAddressesOutput) SetNextToken(v string) *DescribeMovingAddressesOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeNatGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGatewaysRequest -type DescribeNatGatewaysInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * nat-gateway-id - The ID of the NAT gateway. - // - // * state - The state of the NAT gateway (pending | failed | available | - // deleting | deleted). - // - // * subnet-id - The ID of the subnet in which the NAT gateway resides. - // - // * vpc-id - The ID of the VPC in which the NAT gateway resides. - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. - MaxResults *int64 `type:"integer"` - - // One or more NAT gateway IDs. - NatGatewayIds []*string `locationName:"NatGatewayId" locationNameList:"item" type:"list"` - - // The token to retrieve the next page of results. - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeNatGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNatGatewaysInput) GoString() string { - return s.String() -} - -// SetFilter sets the Filter field's value. -func (s *DescribeNatGatewaysInput) SetFilter(v []*Filter) *DescribeNatGatewaysInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeNatGatewaysInput) SetMaxResults(v int64) *DescribeNatGatewaysInput { - s.MaxResults = &v - return s -} - -// SetNatGatewayIds sets the NatGatewayIds field's value. -func (s *DescribeNatGatewaysInput) SetNatGatewayIds(v []*string) *DescribeNatGatewaysInput { - s.NatGatewayIds = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNatGatewaysInput) SetNextToken(v string) *DescribeNatGatewaysInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeNatGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGatewaysResult -type DescribeNatGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about the NAT gateways. - NatGateways []*NatGateway `locationName:"natGatewaySet" locationNameList:"item" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeNatGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNatGatewaysOutput) GoString() string { - return s.String() -} - -// SetNatGateways sets the NatGateways field's value. -func (s *DescribeNatGatewaysOutput) SetNatGateways(v []*NatGateway) *DescribeNatGatewaysOutput { - s.NatGateways = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeNatGatewaysOutput) SetNextToken(v string) *DescribeNatGatewaysOutput { - s.NextToken = &v - return s -} - -// Contains the parameters for DescribeNetworkAcls. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAclsRequest -type DescribeNetworkAclsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * association.association-id - The ID of an association ID for the ACL. - // - // * association.network-acl-id - The ID of the network ACL involved in the - // association. - // - // * association.subnet-id - The ID of the subnet involved in the association. - // - // * default - Indicates whether the ACL is the default network ACL for the - // VPC. - // - // * entry.cidr - The IPv4 CIDR range specified in the entry. - // - // * entry.egress - Indicates whether the entry applies to egress traffic. - // - // * entry.icmp.code - The ICMP code specified in the entry, if any. - // - // * entry.icmp.type - The ICMP type specified in the entry, if any. - // - // * entry.ipv6-cidr - The IPv6 CIDR range specified in the entry. - // - // * entry.port-range.from - The start of the port range specified in the - // entry. - // - // * entry.port-range.to - The end of the port range specified in the entry. - // - // - // * entry.protocol - The protocol specified in the entry (tcp | udp | icmp - // or a protocol number). - // - // * entry.rule-action - Allows or denies the matching traffic (allow | deny). - // - // * entry.rule-number - The number of an entry (in other words, rule) in - // the ACL's set of entries. - // - // * network-acl-id - The ID of the network ACL. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the network ACL. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more network ACL IDs. - // - // Default: Describes all your network ACLs. - NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkAclsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkAclsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeNetworkAclsInput) SetDryRun(v bool) *DescribeNetworkAclsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeNetworkAclsInput) SetFilters(v []*Filter) *DescribeNetworkAclsInput { - s.Filters = v - return s -} - -// SetNetworkAclIds sets the NetworkAclIds field's value. -func (s *DescribeNetworkAclsInput) SetNetworkAclIds(v []*string) *DescribeNetworkAclsInput { - s.NetworkAclIds = v - return s -} - -// Contains the output of DescribeNetworkAcls. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAclsResult -type DescribeNetworkAclsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more network ACLs. - NetworkAcls []*NetworkAcl `locationName:"networkAclSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkAclsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkAclsOutput) GoString() string { - return s.String() -} - -// SetNetworkAcls sets the NetworkAcls field's value. -func (s *DescribeNetworkAclsOutput) SetNetworkAcls(v []*NetworkAcl) *DescribeNetworkAclsOutput { - s.NetworkAcls = v - return s -} - -// Contains the parameters for DescribeNetworkInterfaceAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttributeRequest -type DescribeNetworkInterfaceAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute of the network interface. - Attribute *string `locationName:"attribute" type:"string" enum:"NetworkInterfaceAttribute"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeNetworkInterfaceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfaceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeNetworkInterfaceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkInterfaceAttributeInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeNetworkInterfaceAttributeInput) SetAttribute(v string) *DescribeNetworkInterfaceAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeNetworkInterfaceAttributeInput) SetDryRun(v bool) *DescribeNetworkInterfaceAttributeInput { - s.DryRun = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DescribeNetworkInterfaceAttributeInput) SetNetworkInterfaceId(v string) *DescribeNetworkInterfaceAttributeInput { - s.NetworkInterfaceId = &v - return s -} - -// Contains the output of DescribeNetworkInterfaceAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttributeResult -type DescribeNetworkInterfaceAttributeOutput struct { - _ struct{} `type:"structure"` - - // The attachment (if any) of the network interface. - Attachment *NetworkInterfaceAttachment `locationName:"attachment" type:"structure"` - - // The description of the network interface. - Description *AttributeValue `locationName:"description" type:"structure"` - - // The security groups associated with the network interface. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // Indicates whether source/destination checking is enabled. - SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` -} - -// String returns the string representation -func (s DescribeNetworkInterfaceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfaceAttributeOutput) GoString() string { - return s.String() -} - -// SetAttachment sets the Attachment field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetAttachment(v *NetworkInterfaceAttachment) *DescribeNetworkInterfaceAttributeOutput { - s.Attachment = v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetDescription(v *AttributeValue) *DescribeNetworkInterfaceAttributeOutput { - s.Description = v - return s -} - -// SetGroups sets the Groups field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetGroups(v []*GroupIdentifier) *DescribeNetworkInterfaceAttributeOutput { - s.Groups = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetNetworkInterfaceId(v string) *DescribeNetworkInterfaceAttributeOutput { - s.NetworkInterfaceId = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *DescribeNetworkInterfaceAttributeOutput) SetSourceDestCheck(v *AttributeBooleanValue) *DescribeNetworkInterfaceAttributeOutput { - s.SourceDestCheck = v - return s -} - -// Contains the parameters for DescribeNetworkInterfaces. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacesRequest -type DescribeNetworkInterfacesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * addresses.private-ip-address - The private IPv4 addresses associated - // with the network interface. - // - // * addresses.primary - Whether the private IPv4 address is the primary - // IP address associated with the network interface. - // - // * addresses.association.public-ip - The association ID returned when the - // network interface was associated with the Elastic IP address (IPv4). - // - // * addresses.association.owner-id - The owner ID of the addresses associated - // with the network interface. - // - // * association.association-id - The association ID returned when the network - // interface was associated with an IPv4 address. - // - // * association.allocation-id - The allocation ID returned when you allocated - // the Elastic IP address (IPv4) for your network interface. - // - // * association.ip-owner-id - The owner of the Elastic IP address (IPv4) - // associated with the network interface. - // - // * association.public-ip - The address of the Elastic IP address (IPv4) - // bound to the network interface. - // - // * association.public-dns-name - The public DNS name for the network interface - // (IPv4). - // - // * attachment.attachment-id - The ID of the interface attachment. - // - // * attachment.attach.time - The time that the network interface was attached - // to an instance. - // - // * attachment.delete-on-termination - Indicates whether the attachment - // is deleted when an instance is terminated. - // - // * attachment.device-index - The device index to which the network interface - // is attached. - // - // * attachment.instance-id - The ID of the instance to which the network - // interface is attached. - // - // * attachment.instance-owner-id - The owner ID of the instance to which - // the network interface is attached. - // - // * attachment.nat-gateway-id - The ID of the NAT gateway to which the network - // interface is attached. - // - // * attachment.status - The status of the attachment (attaching | attached - // | detaching | detached). - // - // * availability-zone - The Availability Zone of the network interface. - // - // * description - The description of the network interface. - // - // * group-id - The ID of a security group associated with the network interface. - // - // * group-name - The name of a security group associated with the network - // interface. - // - // * ipv6-addresses.ipv6-address - An IPv6 address associated with the network - // interface. - // - // * mac-address - The MAC address of the network interface. - // - // * network-interface-id - The ID of the network interface. - // - // * owner-id - The AWS account ID of the network interface owner. - // - // * private-ip-address - The private IPv4 address or addresses of the network - // interface. - // - // * private-dns-name - The private DNS name of the network interface (IPv4). - // - // * requester-id - The ID of the entity that launched the instance on your - // behalf (for example, AWS Management Console, Auto Scaling, and so on). - // - // * requester-managed - Indicates whether the network interface is being - // managed by an AWS service (for example, AWS Management Console, Auto Scaling, - // and so on). - // - // * source-desk-check - Indicates whether the network interface performs - // source/destination checking. A value of true means checking is enabled, - // and false means checking is disabled. The value must be false for the - // network interface to perform network address translation (NAT) in your - // VPC. - // - // * status - The status of the network interface. If the network interface - // is not attached to an instance, the status is available; if a network - // interface is attached to an instance the status is in-use. - // - // * subnet-id - The ID of the subnet for the network interface. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the network interface. - Filters []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"` - - // One or more network interface IDs. - // - // Default: Describes all your network interfaces. - NetworkInterfaceIds []*string `locationName:"NetworkInterfaceId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkInterfacesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfacesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeNetworkInterfacesInput) SetDryRun(v bool) *DescribeNetworkInterfacesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeNetworkInterfacesInput) SetFilters(v []*Filter) *DescribeNetworkInterfacesInput { - s.Filters = v - return s -} - -// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. -func (s *DescribeNetworkInterfacesInput) SetNetworkInterfaceIds(v []*string) *DescribeNetworkInterfacesInput { - s.NetworkInterfaceIds = v - return s -} - -// Contains the output of DescribeNetworkInterfaces. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacesResult -type DescribeNetworkInterfacesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more network interfaces. - NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeNetworkInterfacesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNetworkInterfacesOutput) GoString() string { - return s.String() -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *DescribeNetworkInterfacesOutput) SetNetworkInterfaces(v []*NetworkInterface) *DescribeNetworkInterfacesOutput { - s.NetworkInterfaces = v - return s -} - -// Contains the parameters for DescribePlacementGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroupsRequest -type DescribePlacementGroupsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * group-name - The name of the placement group. - // - // * state - The state of the placement group (pending | available | deleting - // | deleted). - // - // * strategy - The strategy of the placement group (cluster). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more placement group names. - // - // Default: Describes all your placement groups, or only those otherwise specified. - GroupNames []*string `locationName:"groupName" type:"list"` -} - -// String returns the string representation -func (s DescribePlacementGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePlacementGroupsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribePlacementGroupsInput) SetDryRun(v bool) *DescribePlacementGroupsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribePlacementGroupsInput) SetFilters(v []*Filter) *DescribePlacementGroupsInput { - s.Filters = v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *DescribePlacementGroupsInput) SetGroupNames(v []*string) *DescribePlacementGroupsInput { - s.GroupNames = v - return s -} - -// Contains the output of DescribePlacementGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroupsResult -type DescribePlacementGroupsOutput struct { - _ struct{} `type:"structure"` - - // One or more placement groups. - PlacementGroups []*PlacementGroup `locationName:"placementGroupSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePlacementGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePlacementGroupsOutput) GoString() string { - return s.String() -} - -// SetPlacementGroups sets the PlacementGroups field's value. -func (s *DescribePlacementGroupsOutput) SetPlacementGroups(v []*PlacementGroup) *DescribePlacementGroupsOutput { - s.PlacementGroups = v - return s -} - -// Contains the parameters for DescribePrefixLists. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixListsRequest -type DescribePrefixListsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * prefix-list-id: The ID of a prefix list. - // - // * prefix-list-name: The name of a prefix list. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. - MaxResults *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `type:"string"` - - // One or more prefix list IDs. - PrefixListIds []*string `locationName:"PrefixListId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePrefixListsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePrefixListsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribePrefixListsInput) SetDryRun(v bool) *DescribePrefixListsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribePrefixListsInput) SetFilters(v []*Filter) *DescribePrefixListsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribePrefixListsInput) SetMaxResults(v int64) *DescribePrefixListsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePrefixListsInput) SetNextToken(v string) *DescribePrefixListsInput { - s.NextToken = &v - return s -} - -// SetPrefixListIds sets the PrefixListIds field's value. -func (s *DescribePrefixListsInput) SetPrefixListIds(v []*string) *DescribePrefixListsInput { - s.PrefixListIds = v - return s -} - -// Contains the output of DescribePrefixLists. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixListsResult -type DescribePrefixListsOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // All available prefix lists. - PrefixLists []*PrefixList `locationName:"prefixListSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribePrefixListsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribePrefixListsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribePrefixListsOutput) SetNextToken(v string) *DescribePrefixListsOutput { - s.NextToken = &v - return s -} - -// SetPrefixLists sets the PrefixLists field's value. -func (s *DescribePrefixListsOutput) SetPrefixLists(v []*PrefixList) *DescribePrefixListsOutput { - s.PrefixLists = v - return s -} - -// Contains the parameters for DescribeRegions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegionsRequest -type DescribeRegionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * endpoint - The endpoint of the region (for example, ec2.us-east-1.amazonaws.com). - // - // * region-name - The name of the region (for example, us-east-1). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The names of one or more regions. - RegionNames []*string `locationName:"RegionName" locationNameList:"RegionName" type:"list"` -} - -// String returns the string representation -func (s DescribeRegionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRegionsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeRegionsInput) SetDryRun(v bool) *DescribeRegionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeRegionsInput) SetFilters(v []*Filter) *DescribeRegionsInput { - s.Filters = v - return s -} - -// SetRegionNames sets the RegionNames field's value. -func (s *DescribeRegionsInput) SetRegionNames(v []*string) *DescribeRegionsInput { - s.RegionNames = v - return s -} - -// Contains the output of DescribeRegions. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegionsResult -type DescribeRegionsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more regions. - Regions []*Region `locationName:"regionInfo" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeRegionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRegionsOutput) GoString() string { - return s.String() -} - -// SetRegions sets the Regions field's value. -func (s *DescribeRegionsOutput) SetRegions(v []*Region) *DescribeRegionsOutput { - s.Regions = v - return s -} - -// Contains the parameters for DescribeReservedInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesRequest -type DescribeReservedInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone where the Reserved Instance - // can be used. - // - // * duration - The duration of the Reserved Instance (one year or three - // years), in seconds (31536000 | 94608000). - // - // * end - The time when the Reserved Instance expires (for example, 2015-08-07T11:54:42.000Z). - // - // * fixed-price - The purchase price of the Reserved Instance (for example, - // 9800.0). - // - // * instance-type - The instance type that is covered by the reservation. - // - // * scope - The scope of the Reserved Instance (Region or Availability Zone). - // - // * product-description - The Reserved Instance product platform description. - // Instances that include (Amazon VPC) in the product platform description - // will only be displayed to EC2-Classic account holders and are for use - // with Amazon VPC (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | SUSE - // Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise Linux - // (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL Server - // Standard | Windows with SQL Server Standard (Amazon VPC) | Windows with - // SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows with - // SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon VPC)). - // - // * reserved-instances-id - The ID of the Reserved Instance. - // - // * start - The time at which the Reserved Instance purchase request was - // placed (for example, 2014-08-07T11:54:42.000Z). - // - // * state - The state of the Reserved Instance (payment-pending | active - // | payment-failed | retired). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * usage-price - The usage price of the Reserved Instance, per hour (for - // example, 0.84). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // Describes whether the Reserved Instance is Standard or Convertible. - OfferingClass *string `type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. If you are using tools that predate - // the 2011-11-01 API version, you only have access to the Medium Utilization - // Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // One or more Reserved Instance IDs. - // - // Default: Describes all your Reserved Instances, or only those otherwise specified. - ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeReservedInstancesInput) SetDryRun(v bool) *DescribeReservedInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesInput) SetFilters(v []*Filter) *DescribeReservedInstancesInput { - s.Filters = v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *DescribeReservedInstancesInput) SetOfferingClass(v string) *DescribeReservedInstancesInput { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedInstancesInput) SetOfferingType(v string) *DescribeReservedInstancesInput { - s.OfferingType = &v - return s -} - -// SetReservedInstancesIds sets the ReservedInstancesIds field's value. -func (s *DescribeReservedInstancesInput) SetReservedInstancesIds(v []*string) *DescribeReservedInstancesInput { - s.ReservedInstancesIds = v - return s -} - -// Contains the parameters for DescribeReservedInstancesListings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListingsRequest -type DescribeReservedInstancesListingsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * reserved-instances-id - The ID of the Reserved Instances. - // - // * reserved-instances-listing-id - The ID of the Reserved Instances listing. - // - // * status - The status of the Reserved Instance listing (pending | active - // | cancelled | closed). - // - // * status-message - The reason for the status. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more Reserved Instance IDs. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // One or more Reserved Instance listing IDs. - ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` -} - -// String returns the string representation -func (s DescribeReservedInstancesListingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesListingsInput) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesListingsInput) SetFilters(v []*Filter) *DescribeReservedInstancesListingsInput { - s.Filters = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *DescribeReservedInstancesListingsInput) SetReservedInstancesId(v string) *DescribeReservedInstancesListingsInput { - s.ReservedInstancesId = &v - return s -} - -// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. -func (s *DescribeReservedInstancesListingsInput) SetReservedInstancesListingId(v string) *DescribeReservedInstancesListingsInput { - s.ReservedInstancesListingId = &v - return s -} - -// Contains the output of DescribeReservedInstancesListings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListingsResult -type DescribeReservedInstancesListingsOutput struct { - _ struct{} `type:"structure"` - - // Information about the Reserved Instance listing. - ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesListingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesListingsOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *DescribeReservedInstancesListingsOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *DescribeReservedInstancesListingsOutput { - s.ReservedInstancesListings = v - return s -} - -// Contains the parameters for DescribeReservedInstancesModifications. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModificationsRequest -type DescribeReservedInstancesModificationsInput struct { - _ struct{} `type:"structure"` - - // One or more filters. - // - // * client-token - The idempotency token for the modification request. - // - // * create-date - The time when the modification request was created. - // - // * effective-date - The time when the modification becomes effective. - // - // * modification-result.reserved-instances-id - The ID for the Reserved - // Instances created as part of the modification request. This ID is only - // available when the status of the modification is fulfilled. - // - // * modification-result.target-configuration.availability-zone - The Availability - // Zone for the new Reserved Instances. - // - // * modification-result.target-configuration.instance-count - The number - // of new Reserved Instances. - // - // * modification-result.target-configuration.instance-type - The instance - // type of the new Reserved Instances. - // - // * modification-result.target-configuration.platform - The network platform - // of the new Reserved Instances (EC2-Classic | EC2-VPC). - // - // * reserved-instances-id - The ID of the Reserved Instances modified. - // - // * reserved-instances-modification-id - The ID of the modification request. - // - // * status - The status of the Reserved Instances modification request (processing - // | fulfilled | failed). - // - // * status-message - The reason for the status. - // - // * update-date - The time when the modification request was last updated. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // IDs for the submitted modification request. - ReservedInstancesModificationIds []*string `locationName:"ReservedInstancesModificationId" locationNameList:"ReservedInstancesModificationId" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesModificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesModificationsInput) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesModificationsInput) SetFilters(v []*Filter) *DescribeReservedInstancesModificationsInput { - s.Filters = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesModificationsInput) SetNextToken(v string) *DescribeReservedInstancesModificationsInput { - s.NextToken = &v - return s -} - -// SetReservedInstancesModificationIds sets the ReservedInstancesModificationIds field's value. -func (s *DescribeReservedInstancesModificationsInput) SetReservedInstancesModificationIds(v []*string) *DescribeReservedInstancesModificationsInput { - s.ReservedInstancesModificationIds = v - return s -} - -// Contains the output of DescribeReservedInstancesModifications. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModificationsResult -type DescribeReservedInstancesModificationsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The Reserved Instance modification information. - ReservedInstancesModifications []*ReservedInstancesModification `locationName:"reservedInstancesModificationsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesModificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesModificationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesModificationsOutput) SetNextToken(v string) *DescribeReservedInstancesModificationsOutput { - s.NextToken = &v - return s -} - -// SetReservedInstancesModifications sets the ReservedInstancesModifications field's value. -func (s *DescribeReservedInstancesModificationsOutput) SetReservedInstancesModifications(v []*ReservedInstancesModification) *DescribeReservedInstancesModificationsOutput { - s.ReservedInstancesModifications = v - return s -} - -// Contains the parameters for DescribeReservedInstancesOfferings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferingsRequest -type DescribeReservedInstancesOfferingsInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone where the Reserved Instance - // can be used. - // - // * duration - The duration of the Reserved Instance (for example, one year - // or three years), in seconds (31536000 | 94608000). - // - // * fixed-price - The purchase price of the Reserved Instance (for example, - // 9800.0). - // - // * instance-type - The instance type that is covered by the reservation. - // - // * marketplace - Set to true to show only Reserved Instance Marketplace - // offerings. When this filter is not used, which is the default behavior, - // all offerings from both AWS and the Reserved Instance Marketplace are - // listed. - // - // * product-description - The Reserved Instance product platform description. - // Instances that include (Amazon VPC) in the product platform description - // will only be displayed to EC2-Classic account holders and are for use - // with Amazon VPC. (Linux/UNIX | Linux/UNIX (Amazon VPC) | SUSE Linux | - // SUSE Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise - // Linux (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL - // Server Standard | Windows with SQL Server Standard (Amazon VPC) | Windows - // with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows - // with SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon - // VPC)) - // - // * reserved-instances-offering-id - The Reserved Instances offering ID. - // - // * scope - The scope of the Reserved Instance (Availability Zone or Region). - // - // * usage-price - The usage price of the Reserved Instance, per hour (for - // example, 0.84). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // Include Reserved Instance Marketplace offerings in the response. - IncludeMarketplace *bool `type:"boolean"` - - // The tenancy of the instances covered by the reservation. A Reserved Instance - // with a tenancy of dedicated is applied to instances that run in a VPC on - // single-tenant hardware (i.e., Dedicated Instances). - // - // Default: default - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // The instance type that the reservation will cover (for example, m1.small). - // For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. - InstanceType *string `type:"string" enum:"InstanceType"` - - // The maximum duration (in seconds) to filter when searching for offerings. - // - // Default: 94608000 (3 years) - MaxDuration *int64 `type:"long"` - - // The maximum number of instances to filter when searching for offerings. - // - // Default: 20 - MaxInstanceCount *int64 `type:"integer"` - - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. The maximum is 100. - // - // Default: 100 - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The minimum duration (in seconds) to filter when searching for offerings. - // - // Default: 2592000 (1 month) - MinDuration *int64 `type:"long"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The offering class of the Reserved Instance. Can be standard or convertible. - OfferingClass *string `type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. If you are using tools that predate - // the 2011-11-01 API version, you only have access to the Medium Utilization - // Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // The Reserved Instance product platform description. Instances that include - // (Amazon VPC) in the description are for use with Amazon VPC. - ProductDescription *string `type:"string" enum:"RIProductDescription"` - - // One or more Reserved Instances offering IDs. - ReservedInstancesOfferingIds []*string `locationName:"ReservedInstancesOfferingId" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesOfferingsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesOfferingsInput) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetAvailabilityZone(v string) *DescribeReservedInstancesOfferingsInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetDryRun(v bool) *DescribeReservedInstancesOfferingsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetFilters(v []*Filter) *DescribeReservedInstancesOfferingsInput { - s.Filters = v - return s -} - -// SetIncludeMarketplace sets the IncludeMarketplace field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetIncludeMarketplace(v bool) *DescribeReservedInstancesOfferingsInput { - s.IncludeMarketplace = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetInstanceTenancy(v string) *DescribeReservedInstancesOfferingsInput { - s.InstanceTenancy = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetInstanceType(v string) *DescribeReservedInstancesOfferingsInput { - s.InstanceType = &v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMaxDuration(v int64) *DescribeReservedInstancesOfferingsInput { - s.MaxDuration = &v - return s -} - -// SetMaxInstanceCount sets the MaxInstanceCount field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMaxInstanceCount(v int64) *DescribeReservedInstancesOfferingsInput { - s.MaxInstanceCount = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMaxResults(v int64) *DescribeReservedInstancesOfferingsInput { - s.MaxResults = &v - return s -} - -// SetMinDuration sets the MinDuration field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetMinDuration(v int64) *DescribeReservedInstancesOfferingsInput { - s.MinDuration = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetNextToken(v string) *DescribeReservedInstancesOfferingsInput { - s.NextToken = &v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetOfferingClass(v string) *DescribeReservedInstancesOfferingsInput { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetOfferingType(v string) *DescribeReservedInstancesOfferingsInput { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetProductDescription(v string) *DescribeReservedInstancesOfferingsInput { - s.ProductDescription = &v - return s -} - -// SetReservedInstancesOfferingIds sets the ReservedInstancesOfferingIds field's value. -func (s *DescribeReservedInstancesOfferingsInput) SetReservedInstancesOfferingIds(v []*string) *DescribeReservedInstancesOfferingsInput { - s.ReservedInstancesOfferingIds = v - return s -} - -// Contains the output of DescribeReservedInstancesOfferings. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferingsResult -type DescribeReservedInstancesOfferingsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of Reserved Instances offerings. - ReservedInstancesOfferings []*ReservedInstancesOffering `locationName:"reservedInstancesOfferingsSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesOfferingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesOfferingsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeReservedInstancesOfferingsOutput) SetNextToken(v string) *DescribeReservedInstancesOfferingsOutput { - s.NextToken = &v - return s -} - -// SetReservedInstancesOfferings sets the ReservedInstancesOfferings field's value. -func (s *DescribeReservedInstancesOfferingsOutput) SetReservedInstancesOfferings(v []*ReservedInstancesOffering) *DescribeReservedInstancesOfferingsOutput { - s.ReservedInstancesOfferings = v - return s -} - -// Contains the output for DescribeReservedInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesResult -type DescribeReservedInstancesOutput struct { - _ struct{} `type:"structure"` - - // A list of Reserved Instances. - ReservedInstances []*ReservedInstances `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeReservedInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeReservedInstancesOutput) GoString() string { - return s.String() -} - -// SetReservedInstances sets the ReservedInstances field's value. -func (s *DescribeReservedInstancesOutput) SetReservedInstances(v []*ReservedInstances) *DescribeReservedInstancesOutput { - s.ReservedInstances = v - return s -} - -// Contains the parameters for DescribeRouteTables. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTablesRequest -type DescribeRouteTablesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * association.route-table-association-id - The ID of an association ID - // for the route table. - // - // * association.route-table-id - The ID of the route table involved in the - // association. - // - // * association.subnet-id - The ID of the subnet involved in the association. - // - // * association.main - Indicates whether the route table is the main route - // table for the VPC (true | false). - // - // * route-table-id - The ID of the route table. - // - // * route.destination-cidr-block - The IPv4 CIDR range specified in a route - // in the table. - // - // * route.destination-ipv6-cidr-block - The IPv6 CIDR range specified in - // a route in the route table. - // - // * route.destination-prefix-list-id - The ID (prefix) of the AWS service - // specified in a route in the table. - // - // * route.egress-only-internet-gateway-id - The ID of an egress-only Internet - // gateway specified in a route in the route table. - // - // * route.gateway-id - The ID of a gateway specified in a route in the table. - // - // * route.instance-id - The ID of an instance specified in a route in the - // table. - // - // * route.nat-gateway-id - The ID of a NAT gateway. - // - // * route.origin - Describes how the route was created. CreateRouteTable - // indicates that the route was automatically created when the route table - // was created; CreateRoute indicates that the route was manually added to - // the route table; EnableVgwRoutePropagation indicates that the route was - // propagated by route propagation. - // - // * route.state - The state of a route in the route table (active | blackhole). - // The blackhole state indicates that the route's target isn't available - // (for example, the specified gateway isn't attached to the VPC, the specified - // NAT instance has been terminated, and so on). - // - // * route.vpc-peering-connection-id - The ID of a VPC peering connection - // specified in a route in the table. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the route table. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more route table IDs. - // - // Default: Describes all your route tables. - RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeRouteTablesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRouteTablesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeRouteTablesInput) SetDryRun(v bool) *DescribeRouteTablesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeRouteTablesInput) SetFilters(v []*Filter) *DescribeRouteTablesInput { - s.Filters = v - return s -} - -// SetRouteTableIds sets the RouteTableIds field's value. -func (s *DescribeRouteTablesInput) SetRouteTableIds(v []*string) *DescribeRouteTablesInput { - s.RouteTableIds = v - return s -} - -// Contains the output of DescribeRouteTables. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTablesResult -type DescribeRouteTablesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more route tables. - RouteTables []*RouteTable `locationName:"routeTableSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeRouteTablesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeRouteTablesOutput) GoString() string { - return s.String() -} - -// SetRouteTables sets the RouteTables field's value. -func (s *DescribeRouteTablesOutput) SetRouteTables(v []*RouteTable) *DescribeRouteTablesOutput { - s.RouteTables = v - return s -} - -// Contains the parameters for DescribeScheduledInstanceAvailability. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailabilityRequest -type DescribeScheduledInstanceAvailabilityInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone (for example, us-west-2a). - // - // * instance-type - The instance type (for example, c4.large). - // - // * network-platform - The network platform (EC2-Classic or EC2-VPC). - // - // * platform - The platform (Linux/UNIX or Windows). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The time period for the first schedule to start. - // - // FirstSlotStartTimeRange is a required field - FirstSlotStartTimeRange *SlotDateTimeRangeRequest `type:"structure" required:"true"` - - // The maximum number of results to return in a single call. This value can - // be between 5 and 300. The default value is 300. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The maximum available duration, in hours. This value must be greater than - // MinSlotDurationInHours and less than 1,720. - MaxSlotDurationInHours *int64 `type:"integer"` - - // The minimum available duration, in hours. The minimum required duration is - // 1,200 hours per year. For example, the minimum daily schedule is 4 hours, - // the minimum weekly schedule is 24 hours, and the minimum monthly schedule - // is 100 hours. - MinSlotDurationInHours *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // The schedule recurrence. - // - // Recurrence is a required field - Recurrence *ScheduledInstanceRecurrenceRequest `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DescribeScheduledInstanceAvailabilityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstanceAvailabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScheduledInstanceAvailabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScheduledInstanceAvailabilityInput"} - if s.FirstSlotStartTimeRange == nil { - invalidParams.Add(request.NewErrParamRequired("FirstSlotStartTimeRange")) - } - if s.Recurrence == nil { - invalidParams.Add(request.NewErrParamRequired("Recurrence")) - } - if s.FirstSlotStartTimeRange != nil { - if err := s.FirstSlotStartTimeRange.Validate(); err != nil { - invalidParams.AddNested("FirstSlotStartTimeRange", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetDryRun(v bool) *DescribeScheduledInstanceAvailabilityInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetFilters(v []*Filter) *DescribeScheduledInstanceAvailabilityInput { - s.Filters = v - return s -} - -// SetFirstSlotStartTimeRange sets the FirstSlotStartTimeRange field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetFirstSlotStartTimeRange(v *SlotDateTimeRangeRequest) *DescribeScheduledInstanceAvailabilityInput { - s.FirstSlotStartTimeRange = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetMaxResults(v int64) *DescribeScheduledInstanceAvailabilityInput { - s.MaxResults = &v - return s -} - -// SetMaxSlotDurationInHours sets the MaxSlotDurationInHours field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetMaxSlotDurationInHours(v int64) *DescribeScheduledInstanceAvailabilityInput { - s.MaxSlotDurationInHours = &v - return s -} - -// SetMinSlotDurationInHours sets the MinSlotDurationInHours field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetMinSlotDurationInHours(v int64) *DescribeScheduledInstanceAvailabilityInput { - s.MinSlotDurationInHours = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetNextToken(v string) *DescribeScheduledInstanceAvailabilityInput { - s.NextToken = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *DescribeScheduledInstanceAvailabilityInput) SetRecurrence(v *ScheduledInstanceRecurrenceRequest) *DescribeScheduledInstanceAvailabilityInput { - s.Recurrence = v - return s -} - -// Contains the output of DescribeScheduledInstanceAvailability. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailabilityResult -type DescribeScheduledInstanceAvailabilityOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the available Scheduled Instances. - ScheduledInstanceAvailabilitySet []*ScheduledInstanceAvailability `locationName:"scheduledInstanceAvailabilitySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeScheduledInstanceAvailabilityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstanceAvailabilityOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstanceAvailabilityOutput) SetNextToken(v string) *DescribeScheduledInstanceAvailabilityOutput { - s.NextToken = &v - return s -} - -// SetScheduledInstanceAvailabilitySet sets the ScheduledInstanceAvailabilitySet field's value. -func (s *DescribeScheduledInstanceAvailabilityOutput) SetScheduledInstanceAvailabilitySet(v []*ScheduledInstanceAvailability) *DescribeScheduledInstanceAvailabilityOutput { - s.ScheduledInstanceAvailabilitySet = v - return s -} - -// Contains the parameters for DescribeScheduledInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstancesRequest -type DescribeScheduledInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * availability-zone - The Availability Zone (for example, us-west-2a). - // - // * instance-type - The instance type (for example, c4.large). - // - // * network-platform - The network platform (EC2-Classic or EC2-VPC). - // - // * platform - The platform (Linux/UNIX or Windows). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. This value can - // be between 5 and 300. The default value is 100. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `type:"integer"` - - // The token for the next set of results. - NextToken *string `type:"string"` - - // One or more Scheduled Instance IDs. - ScheduledInstanceIds []*string `locationName:"ScheduledInstanceId" locationNameList:"ScheduledInstanceId" type:"list"` - - // The time period for the first schedule to start. - SlotStartTimeRange *SlotStartTimeRangeRequest `type:"structure"` -} - -// String returns the string representation -func (s DescribeScheduledInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstancesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeScheduledInstancesInput) SetDryRun(v bool) *DescribeScheduledInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeScheduledInstancesInput) SetFilters(v []*Filter) *DescribeScheduledInstancesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScheduledInstancesInput) SetMaxResults(v int64) *DescribeScheduledInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstancesInput) SetNextToken(v string) *DescribeScheduledInstancesInput { - s.NextToken = &v - return s -} - -// SetScheduledInstanceIds sets the ScheduledInstanceIds field's value. -func (s *DescribeScheduledInstancesInput) SetScheduledInstanceIds(v []*string) *DescribeScheduledInstancesInput { - s.ScheduledInstanceIds = v - return s -} - -// SetSlotStartTimeRange sets the SlotStartTimeRange field's value. -func (s *DescribeScheduledInstancesInput) SetSlotStartTimeRange(v *SlotStartTimeRangeRequest) *DescribeScheduledInstancesInput { - s.SlotStartTimeRange = v - return s -} - -// Contains the output of DescribeScheduledInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstancesResult -type DescribeScheduledInstancesOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the Scheduled Instances. - ScheduledInstanceSet []*ScheduledInstance `locationName:"scheduledInstanceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeScheduledInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScheduledInstancesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduledInstancesOutput) SetNextToken(v string) *DescribeScheduledInstancesOutput { - s.NextToken = &v - return s -} - -// SetScheduledInstanceSet sets the ScheduledInstanceSet field's value. -func (s *DescribeScheduledInstancesOutput) SetScheduledInstanceSet(v []*ScheduledInstance) *DescribeScheduledInstancesOutput { - s.ScheduledInstanceSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferencesRequest -type DescribeSecurityGroupReferencesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more security group IDs in your account. - // - // GroupId is a required field - GroupId []*string `locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeSecurityGroupReferencesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupReferencesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSecurityGroupReferencesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSecurityGroupReferencesInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSecurityGroupReferencesInput) SetDryRun(v bool) *DescribeSecurityGroupReferencesInput { - s.DryRun = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *DescribeSecurityGroupReferencesInput) SetGroupId(v []*string) *DescribeSecurityGroupReferencesInput { - s.GroupId = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferencesResult -type DescribeSecurityGroupReferencesOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPCs with the referencing security groups. - SecurityGroupReferenceSet []*SecurityGroupReference `locationName:"securityGroupReferenceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSecurityGroupReferencesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupReferencesOutput) GoString() string { - return s.String() -} - -// SetSecurityGroupReferenceSet sets the SecurityGroupReferenceSet field's value. -func (s *DescribeSecurityGroupReferencesOutput) SetSecurityGroupReferenceSet(v []*SecurityGroupReference) *DescribeSecurityGroupReferencesOutput { - s.SecurityGroupReferenceSet = v - return s -} - -// Contains the parameters for DescribeSecurityGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupsRequest -type DescribeSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. If using multiple filters for rules, the results include - // security groups for which any combination of rules - not necessarily a single - // rule - match all filters. - // - // * description - The description of the security group. - // - // * egress.ip-permission.prefix-list-id - The ID (prefix) of the AWS service - // to which the security group allows access. - // - // * group-id - The ID of the security group. - // - // * group-name - The name of the security group. - // - // * ip-permission.cidr - An IPv4 CIDR range that has been granted permission - // in a security group rule. - // - // * ip-permission.from-port - The start of port range for the TCP and UDP - // protocols, or an ICMP type number. - // - // * ip-permission.group-id - The ID of a security group that has been granted - // permission. - // - // * ip-permission.group-name - The name of a security group that has been - // granted permission. - // - // * ip-permission.ipv6-cidr - An IPv6 CIDR range that has been granted permission - // in a security group rule. - // - // * ip-permission.protocol - The IP protocol for the permission (tcp | udp - // | icmp or a protocol number). - // - // * ip-permission.to-port - The end of port range for the TCP and UDP protocols, - // or an ICMP code. - // - // * ip-permission.user-id - The ID of an AWS account that has been granted - // permission. - // - // * owner-id - The AWS account ID of the owner of the security group. - // - // * tag-key - The key of a tag assigned to the security group. - // - // * tag-value - The value of a tag assigned to the security group. - // - // * vpc-id - The ID of the VPC specified when the security group was created. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more security group IDs. Required for security groups in a nondefault - // VPC. - // - // Default: Describes all your security groups. - GroupIds []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` - - // [EC2-Classic and default VPC only] One or more security group names. You - // can specify either the security group name or the security group ID. For - // security groups in a nondefault VPC, use the group-name filter to describe - // security groups by name. - // - // Default: Describes all your security groups. - GroupNames []*string `locationName:"GroupName" locationNameList:"GroupName" type:"list"` -} - -// String returns the string representation -func (s DescribeSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSecurityGroupsInput) SetDryRun(v bool) *DescribeSecurityGroupsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSecurityGroupsInput) SetFilters(v []*Filter) *DescribeSecurityGroupsInput { - s.Filters = v - return s -} - -// SetGroupIds sets the GroupIds field's value. -func (s *DescribeSecurityGroupsInput) SetGroupIds(v []*string) *DescribeSecurityGroupsInput { - s.GroupIds = v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *DescribeSecurityGroupsInput) SetGroupNames(v []*string) *DescribeSecurityGroupsInput { - s.GroupNames = v - return s -} - -// Contains the output of DescribeSecurityGroups. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupsResult -type DescribeSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more security groups. - SecurityGroups []*SecurityGroup `locationName:"securityGroupInfo" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *DescribeSecurityGroupsOutput) SetSecurityGroups(v []*SecurityGroup) *DescribeSecurityGroupsOutput { - s.SecurityGroups = v - return s -} - -// Contains the parameters for DescribeSnapshotAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttributeRequest -type DescribeSnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The snapshot attribute you would like to view. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"SnapshotAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the EBS snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeSnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSnapshotAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeSnapshotAttributeInput) SetAttribute(v string) *DescribeSnapshotAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSnapshotAttributeInput) SetDryRun(v bool) *DescribeSnapshotAttributeInput { - s.DryRun = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DescribeSnapshotAttributeInput) SetSnapshotId(v string) *DescribeSnapshotAttributeInput { - s.SnapshotId = &v - return s -} - -// Contains the output of DescribeSnapshotAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttributeResult -type DescribeSnapshotAttributeOutput struct { - _ struct{} `type:"structure"` - - // A list of permissions for creating volumes from the snapshot. - CreateVolumePermissions []*CreateVolumePermission `locationName:"createVolumePermission" locationNameList:"item" type:"list"` - - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The ID of the EBS snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` -} - -// String returns the string representation -func (s DescribeSnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotAttributeOutput) GoString() string { - return s.String() -} - -// SetCreateVolumePermissions sets the CreateVolumePermissions field's value. -func (s *DescribeSnapshotAttributeOutput) SetCreateVolumePermissions(v []*CreateVolumePermission) *DescribeSnapshotAttributeOutput { - s.CreateVolumePermissions = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeSnapshotAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeSnapshotAttributeOutput { - s.ProductCodes = v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *DescribeSnapshotAttributeOutput) SetSnapshotId(v string) *DescribeSnapshotAttributeOutput { - s.SnapshotId = &v - return s -} - -// Contains the parameters for DescribeSnapshots. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotsRequest -type DescribeSnapshotsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * description - A description of the snapshot. - // - // * owner-alias - Value from an Amazon-maintained list (amazon | aws-marketplace - // | microsoft) of snapshot owners. Not to be confused with the user-configured - // AWS account alias, which is set from the IAM consolew. - // - // * owner-id - The ID of the AWS account that owns the snapshot. - // - // * progress - The progress of the snapshot, as a percentage (for example, - // 80%). - // - // * snapshot-id - The snapshot ID. - // - // * start-time - The time stamp when the snapshot was initiated. - // - // * status - The status of the snapshot (pending | completed | error). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * volume-id - The ID of the volume the snapshot is for. - // - // * volume-size - The size of the volume, in GiB. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of snapshot results returned by DescribeSnapshots in paginated - // output. When this parameter is used, DescribeSnapshots only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another DescribeSnapshots - // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. If this parameter is not used, then DescribeSnapshots returns - // all results. You cannot specify this parameter and the snapshot IDs parameter - // in the same request. - MaxResults *int64 `type:"integer"` - - // The NextToken value returned from a previous paginated DescribeSnapshots - // request where MaxResults was used and the results exceeded the value of that - // parameter. Pagination continues from the end of the previous results that - // returned the NextToken value. This value is null when there are no more results - // to return. - NextToken *string `type:"string"` - - // Returns the snapshots owned by the specified owner. Multiple owners can be - // specified. - OwnerIds []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` - - // One or more AWS accounts IDs that can create volumes from the snapshot. - RestorableByUserIds []*string `locationName:"RestorableBy" type:"list"` - - // One or more snapshot IDs. - // - // Default: Describes snapshots for which you have launch permissions. - SnapshotIds []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"` -} - -// String returns the string representation -func (s DescribeSnapshotsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSnapshotsInput) SetDryRun(v bool) *DescribeSnapshotsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSnapshotsInput) SetFilters(v []*Filter) *DescribeSnapshotsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSnapshotsInput) SetMaxResults(v int64) *DescribeSnapshotsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSnapshotsInput) SetNextToken(v string) *DescribeSnapshotsInput { - s.NextToken = &v - return s -} - -// SetOwnerIds sets the OwnerIds field's value. -func (s *DescribeSnapshotsInput) SetOwnerIds(v []*string) *DescribeSnapshotsInput { - s.OwnerIds = v - return s -} - -// SetRestorableByUserIds sets the RestorableByUserIds field's value. -func (s *DescribeSnapshotsInput) SetRestorableByUserIds(v []*string) *DescribeSnapshotsInput { - s.RestorableByUserIds = v - return s -} - -// SetSnapshotIds sets the SnapshotIds field's value. -func (s *DescribeSnapshotsInput) SetSnapshotIds(v []*string) *DescribeSnapshotsInput { - s.SnapshotIds = v - return s -} - -// Contains the output of DescribeSnapshots. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotsResult -type DescribeSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // The NextToken value to include in a future DescribeSnapshots request. When - // the results of a DescribeSnapshots request exceed MaxResults, this value - // can be used to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the snapshots. - Snapshots []*Snapshot `locationName:"snapshotSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSnapshotsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSnapshotsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSnapshotsOutput) SetNextToken(v string) *DescribeSnapshotsOutput { - s.NextToken = &v - return s -} - -// SetSnapshots sets the Snapshots field's value. -func (s *DescribeSnapshotsOutput) SetSnapshots(v []*Snapshot) *DescribeSnapshotsOutput { - s.Snapshots = v - return s -} - -// Contains the parameters for DescribeSpotDatafeedSubscription. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscriptionRequest -type DescribeSpotDatafeedSubscriptionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DescribeSpotDatafeedSubscriptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotDatafeedSubscriptionInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotDatafeedSubscriptionInput) SetDryRun(v bool) *DescribeSpotDatafeedSubscriptionInput { - s.DryRun = &v - return s -} - -// Contains the output of DescribeSpotDatafeedSubscription. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscriptionResult -type DescribeSpotDatafeedSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The Spot instance data feed subscription. - SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` -} - -// String returns the string representation -func (s DescribeSpotDatafeedSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotDatafeedSubscriptionOutput) GoString() string { - return s.String() -} - -// SetSpotDatafeedSubscription sets the SpotDatafeedSubscription field's value. -func (s *DescribeSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *SpotDatafeedSubscription) *DescribeSpotDatafeedSubscriptionOutput { - s.SpotDatafeedSubscription = v - return s -} - -// Contains the parameters for DescribeSpotFleetInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstancesRequest -type DescribeSpotFleetInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSpotFleetInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSpotFleetInstancesInput"} - if s.SpotFleetRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotFleetInstancesInput) SetDryRun(v bool) *DescribeSpotFleetInstancesInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotFleetInstancesInput) SetMaxResults(v int64) *DescribeSpotFleetInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetInstancesInput) SetNextToken(v string) *DescribeSpotFleetInstancesInput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetInstancesInput) SetSpotFleetRequestId(v string) *DescribeSpotFleetInstancesInput { - s.SpotFleetRequestId = &v - return s -} - -// Contains the output of DescribeSpotFleetInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstancesResponse -type DescribeSpotFleetInstancesOutput struct { - _ struct{} `type:"structure"` - - // The running instances. Note that this list is refreshed periodically and - // might be out of date. - // - // ActiveInstances is a required field - ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list" required:"true"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetInstancesOutput) GoString() string { - return s.String() -} - -// SetActiveInstances sets the ActiveInstances field's value. -func (s *DescribeSpotFleetInstancesOutput) SetActiveInstances(v []*ActiveInstance) *DescribeSpotFleetInstancesOutput { - s.ActiveInstances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetInstancesOutput) SetNextToken(v string) *DescribeSpotFleetInstancesOutput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetInstancesOutput) SetSpotFleetRequestId(v string) *DescribeSpotFleetInstancesOutput { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for DescribeSpotFleetRequestHistory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistoryRequest -type DescribeSpotFleetRequestHistoryInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The type of events to describe. By default, all events are described. - EventType *string `locationName:"eventType" type:"string" enum:"EventType"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSpotFleetRequestHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSpotFleetRequestHistoryInput"} - if s.SpotFleetRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId")) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetDryRun(v bool) *DescribeSpotFleetRequestHistoryInput { - s.DryRun = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetEventType(v string) *DescribeSpotFleetRequestHistoryInput { - s.EventType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetMaxResults(v int64) *DescribeSpotFleetRequestHistoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetNextToken(v string) *DescribeSpotFleetRequestHistoryInput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetSpotFleetRequestId(v string) *DescribeSpotFleetRequestHistoryInput { - s.SpotFleetRequestId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeSpotFleetRequestHistoryInput) SetStartTime(v time.Time) *DescribeSpotFleetRequestHistoryInput { - s.StartTime = &v - return s -} - -// Contains the output of DescribeSpotFleetRequestHistory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistoryResponse -type DescribeSpotFleetRequestHistoryOutput struct { - _ struct{} `type:"structure"` - - // Information about the events in the history of the Spot fleet request. - // - // HistoryRecords is a required field - HistoryRecords []*HistoryRecord `locationName:"historyRecordSet" locationNameList:"item" type:"list" required:"true"` - - // The last date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // All records up to this time were retrieved. - // - // If nextToken indicates that there are more results, this value is not present. - // - // LastEvaluatedTime is a required field - LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestHistoryOutput) GoString() string { - return s.String() -} - -// SetHistoryRecords sets the HistoryRecords field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetHistoryRecords(v []*HistoryRecord) *DescribeSpotFleetRequestHistoryOutput { - s.HistoryRecords = v - return s -} - -// SetLastEvaluatedTime sets the LastEvaluatedTime field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetLastEvaluatedTime(v time.Time) *DescribeSpotFleetRequestHistoryOutput { - s.LastEvaluatedTime = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetNextToken(v string) *DescribeSpotFleetRequestHistoryOutput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetSpotFleetRequestId(v string) *DescribeSpotFleetRequestHistoryOutput { - s.SpotFleetRequestId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeSpotFleetRequestHistoryOutput) SetStartTime(v time.Time) *DescribeSpotFleetRequestHistoryOutput { - s.StartTime = &v - return s -} - -// Contains the parameters for DescribeSpotFleetRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestsRequest -type DescribeSpotFleetRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The IDs of the Spot fleet requests. - SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotFleetRequestsInput) SetDryRun(v bool) *DescribeSpotFleetRequestsInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotFleetRequestsInput) SetMaxResults(v int64) *DescribeSpotFleetRequestsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestsInput) SetNextToken(v string) *DescribeSpotFleetRequestsInput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestIds sets the SpotFleetRequestIds field's value. -func (s *DescribeSpotFleetRequestsInput) SetSpotFleetRequestIds(v []*string) *DescribeSpotFleetRequestsInput { - s.SpotFleetRequestIds = v - return s -} - -// Contains the output of DescribeSpotFleetRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestsResponse -type DescribeSpotFleetRequestsOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the configuration of your Spot fleet. - // - // SpotFleetRequestConfigs is a required field - SpotFleetRequestConfigs []*SpotFleetRequestConfig `locationName:"spotFleetRequestConfigSet" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s DescribeSpotFleetRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotFleetRequestsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotFleetRequestsOutput) SetNextToken(v string) *DescribeSpotFleetRequestsOutput { - s.NextToken = &v - return s -} - -// SetSpotFleetRequestConfigs sets the SpotFleetRequestConfigs field's value. -func (s *DescribeSpotFleetRequestsOutput) SetSpotFleetRequestConfigs(v []*SpotFleetRequestConfig) *DescribeSpotFleetRequestsOutput { - s.SpotFleetRequestConfigs = v - return s -} - -// Contains the parameters for DescribeSpotInstanceRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequestsRequest -type DescribeSpotInstanceRequestsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availability-zone-group - The Availability Zone group. - // - // * create-time - The time stamp when the Spot instance request was created. - // - // * fault-code - The fault code related to the request. - // - // * fault-message - The fault message related to the request. - // - // * instance-id - The ID of the instance that fulfilled the request. - // - // * launch-group - The Spot instance launch group. - // - // * launch.block-device-mapping.delete-on-termination - Indicates whether - // the Amazon EBS volume is deleted on instance termination. - // - // * launch.block-device-mapping.device-name - The device name for the Amazon - // EBS volume (for example, /dev/sdh). - // - // * launch.block-device-mapping.snapshot-id - The ID of the snapshot used - // for the Amazon EBS volume. - // - // * launch.block-device-mapping.volume-size - The size of the Amazon EBS - // volume, in GiB. - // - // * launch.block-device-mapping.volume-type - The type of the Amazon EBS - // volume: gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, st1 - // for Throughput Optimized HDD, sc1for Cold HDD, or standard for Magnetic. - // - // * launch.group-id - The security group for the instance. - // - // * launch.image-id - The ID of the AMI. - // - // * launch.instance-type - The type of instance (for example, m3.medium). - // - // * launch.kernel-id - The kernel ID. - // - // * launch.key-name - The name of the key pair the instance launched with. - // - // * launch.monitoring-enabled - Whether monitoring is enabled for the Spot - // instance. - // - // * launch.ramdisk-id - The RAM disk ID. - // - // * network-interface.network-interface-id - The ID of the network interface. - // - // * network-interface.device-index - The index of the device for the network - // interface attachment on the instance. - // - // * network-interface.subnet-id - The ID of the subnet for the instance. - // - // * network-interface.description - A description of the network interface. - // - // * network-interface.private-ip-address - The primary private IP address - // of the network interface. - // - // * network-interface.delete-on-termination - Indicates whether the network - // interface is deleted when the instance is terminated. - // - // * network-interface.group-id - The ID of the security group associated - // with the network interface. - // - // * network-interface.group-name - The name of the security group associated - // with the network interface. - // - // * network-interface.addresses.primary - Indicates whether the IP address - // is the primary private IP address. - // - // * product-description - The product description associated with the instance - // (Linux/UNIX | Windows). - // - // * spot-instance-request-id - The Spot instance request ID. - // - // * spot-price - The maximum hourly price for any Spot instance launched - // to fulfill the request. - // - // * state - The state of the Spot instance request (open | active | closed - // | cancelled | failed). Spot bid status information can help you track - // your Amazon EC2 Spot instance requests. For more information, see Spot - // Bid Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // * status-code - The short code describing the most recent evaluation of - // your Spot instance request. - // - // * status-message - The message explaining the status of the Spot instance - // request. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * type - The type of Spot instance request (one-time | persistent). - // - // * launched-availability-zone - The Availability Zone in which the bid - // is launched. - // - // * valid-from - The start date of the request. - // - // * valid-until - The end date of the request. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more Spot instance request IDs. - SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotInstanceRequestsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotInstanceRequestsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotInstanceRequestsInput) SetDryRun(v bool) *DescribeSpotInstanceRequestsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSpotInstanceRequestsInput) SetFilters(v []*Filter) *DescribeSpotInstanceRequestsInput { - s.Filters = v - return s -} - -// SetSpotInstanceRequestIds sets the SpotInstanceRequestIds field's value. -func (s *DescribeSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*string) *DescribeSpotInstanceRequestsInput { - s.SpotInstanceRequestIds = v - return s -} - -// Contains the output of DescribeSpotInstanceRequests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequestsResult -type DescribeSpotInstanceRequestsOutput struct { - _ struct{} `type:"structure"` - - // One or more Spot instance requests. - SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotInstanceRequestsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotInstanceRequestsOutput) GoString() string { - return s.String() -} - -// SetSpotInstanceRequests sets the SpotInstanceRequests field's value. -func (s *DescribeSpotInstanceRequestsOutput) SetSpotInstanceRequests(v []*SpotInstanceRequest) *DescribeSpotInstanceRequestsOutput { - s.SpotInstanceRequests = v - return s -} - -// Contains the parameters for DescribeSpotPriceHistory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistoryRequest -type DescribeSpotPriceHistoryInput struct { - _ struct{} `type:"structure"` - - // Filters the results by the specified Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The date and time, up to the current date, from which to stop retrieving - // the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // One or more filters. - // - // * availability-zone - The Availability Zone for which prices should be - // returned. - // - // * instance-type - The type of instance (for example, m3.medium). - // - // * product-description - The product description for the Spot price (Linux/UNIX - // | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | SUSE Linux (Amazon - // VPC) | Windows (Amazon VPC)). - // - // * spot-price - The Spot price. The value must match exactly (or use wildcards; - // greater than or less than comparison is not supported). - // - // * timestamp - The timestamp of the Spot price history, in UTC format (for - // example, YYYY-MM-DDTHH:MM:SSZ). You can use wildcards (* and ?). Greater - // than or less than comparison is not supported. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // Filters the results by the specified instance types. Note that T2 and HS1 - // instance types are not supported. - InstanceTypes []*string `locationName:"InstanceType" type:"list"` - - // The maximum number of results to return in a single call. Specify a value - // between 1 and 1000. The default value is 1000. To retrieve the remaining - // results, make another call with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // Filters the results by the specified basic product descriptions. - ProductDescriptions []*string `locationName:"ProductDescription" type:"list"` - - // The date and time, up to the past 90 days, from which to start retrieving - // the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s DescribeSpotPriceHistoryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotPriceHistoryInput) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *DescribeSpotPriceHistoryInput) SetAvailabilityZone(v string) *DescribeSpotPriceHistoryInput { - s.AvailabilityZone = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSpotPriceHistoryInput) SetDryRun(v bool) *DescribeSpotPriceHistoryInput { - s.DryRun = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeSpotPriceHistoryInput) SetEndTime(v time.Time) *DescribeSpotPriceHistoryInput { - s.EndTime = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSpotPriceHistoryInput) SetFilters(v []*Filter) *DescribeSpotPriceHistoryInput { - s.Filters = v - return s -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *DescribeSpotPriceHistoryInput) SetInstanceTypes(v []*string) *DescribeSpotPriceHistoryInput { - s.InstanceTypes = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSpotPriceHistoryInput) SetMaxResults(v int64) *DescribeSpotPriceHistoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotPriceHistoryInput) SetNextToken(v string) *DescribeSpotPriceHistoryInput { - s.NextToken = &v - return s -} - -// SetProductDescriptions sets the ProductDescriptions field's value. -func (s *DescribeSpotPriceHistoryInput) SetProductDescriptions(v []*string) *DescribeSpotPriceHistoryInput { - s.ProductDescriptions = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeSpotPriceHistoryInput) SetStartTime(v time.Time) *DescribeSpotPriceHistoryInput { - s.StartTime = &v - return s -} - -// Contains the output of DescribeSpotPriceHistory. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistoryResult -type DescribeSpotPriceHistoryOutput struct { - _ struct{} `type:"structure"` - - // The token required to retrieve the next set of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // The historical Spot prices. - SpotPriceHistory []*SpotPrice `locationName:"spotPriceHistorySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSpotPriceHistoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSpotPriceHistoryOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSpotPriceHistoryOutput) SetNextToken(v string) *DescribeSpotPriceHistoryOutput { - s.NextToken = &v - return s -} - -// SetSpotPriceHistory sets the SpotPriceHistory field's value. -func (s *DescribeSpotPriceHistoryOutput) SetSpotPriceHistory(v []*SpotPrice) *DescribeSpotPriceHistoryOutput { - s.SpotPriceHistory = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroupsRequest -type DescribeStaleSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `min:"5" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `min:"1" type:"string"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStaleSecurityGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStaleSecurityGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStaleSecurityGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStaleSecurityGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeStaleSecurityGroupsInput) SetDryRun(v bool) *DescribeStaleSecurityGroupsInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeStaleSecurityGroupsInput) SetMaxResults(v int64) *DescribeStaleSecurityGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStaleSecurityGroupsInput) SetNextToken(v string) *DescribeStaleSecurityGroupsInput { - s.NextToken = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DescribeStaleSecurityGroupsInput) SetVpcId(v string) *DescribeStaleSecurityGroupsInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroupsResult -type DescribeStaleSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the stale security groups. - StaleSecurityGroupSet []*StaleSecurityGroup `locationName:"staleSecurityGroupSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeStaleSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStaleSecurityGroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeStaleSecurityGroupsOutput) SetNextToken(v string) *DescribeStaleSecurityGroupsOutput { - s.NextToken = &v - return s -} - -// SetStaleSecurityGroupSet sets the StaleSecurityGroupSet field's value. -func (s *DescribeStaleSecurityGroupsOutput) SetStaleSecurityGroupSet(v []*StaleSecurityGroup) *DescribeStaleSecurityGroupsOutput { - s.StaleSecurityGroupSet = v - return s -} - -// Contains the parameters for DescribeSubnets. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnetsRequest -type DescribeSubnetsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * availabilityZone - The Availability Zone for the subnet. You can also - // use availability-zone as the filter name. - // - // * available-ip-address-count - The number of IPv4 addresses in the subnet - // that are available. - // - // * cidrBlock - The IPv4 CIDR block of the subnet. The CIDR block you specify - // must exactly match the subnet's CIDR block for information to be returned - // for the subnet. You can also use cidr or cidr-block as the filter names. - // - // * defaultForAz - Indicates whether this is the default subnet for the - // Availability Zone. You can also use default-for-az as the filter name. - // - // * ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated - // with the subnet. - // - // * ipv6-cidr-block-association.association-id - An association ID for an - // IPv6 CIDR block associated with the subnet. - // - // * ipv6-cidr-block-association.state - The state of an IPv6 CIDR block - // associated with the subnet. - // - // * state - The state of the subnet (pending | available). - // - // * subnet-id - The ID of the subnet. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC for the subnet. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more subnet IDs. - // - // Default: Describes all your subnets. - SubnetIds []*string `locationName:"SubnetId" locationNameList:"SubnetId" type:"list"` -} - -// String returns the string representation -func (s DescribeSubnetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSubnetsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeSubnetsInput) SetDryRun(v bool) *DescribeSubnetsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeSubnetsInput) SetFilters(v []*Filter) *DescribeSubnetsInput { - s.Filters = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *DescribeSubnetsInput) SetSubnetIds(v []*string) *DescribeSubnetsInput { - s.SubnetIds = v - return s -} - -// Contains the output of DescribeSubnets. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnetsResult -type DescribeSubnetsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more subnets. - Subnets []*Subnet `locationName:"subnetSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeSubnetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSubnetsOutput) GoString() string { - return s.String() -} - -// SetSubnets sets the Subnets field's value. -func (s *DescribeSubnetsOutput) SetSubnets(v []*Subnet) *DescribeSubnetsOutput { - s.Subnets = v - return s -} - -// Contains the parameters for DescribeTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTagsRequest -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * key - The tag key. - // - // * resource-id - The resource ID. - // - // * resource-type - The resource type (customer-gateway | dhcp-options | - // image | instance | internet-gateway | network-acl | network-interface - // | reserved-instances | route-table | security-group | snapshot | spot-instances-request - // | subnet | volume | vpc | vpn-connection | vpn-gateway). - // - // * value - The tag value. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return in a single call. This value can - // be between 5 and 1000. To retrieve the remaining results, make another call - // with the returned NextToken value. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTagsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeTagsInput) SetDryRun(v bool) *DescribeTagsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeTagsInput) SetFilters(v []*Filter) *DescribeTagsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeTagsInput) SetMaxResults(v int64) *DescribeTagsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTagsInput) SetNextToken(v string) *DescribeTagsInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeTags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTagsResult -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return.. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of tags. - Tags []*TagDescription `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTagsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTagsOutput) SetNextToken(v string) *DescribeTagsOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DescribeTagsOutput) SetTags(v []*TagDescription) *DescribeTagsOutput { - s.Tags = v - return s -} - -// Contains the parameters for DescribeVolumeAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttributeRequest -type DescribeVolumeAttributeInput struct { - _ struct{} `type:"structure"` - - // The instance attribute. - Attribute *string `type:"string" enum:"VolumeAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeVolumeAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVolumeAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVolumeAttributeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeVolumeAttributeInput) SetAttribute(v string) *DescribeVolumeAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumeAttributeInput) SetDryRun(v bool) *DescribeVolumeAttributeInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DescribeVolumeAttributeInput) SetVolumeId(v string) *DescribeVolumeAttributeInput { - s.VolumeId = &v - return s -} - -// Contains the output of DescribeVolumeAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttributeResult -type DescribeVolumeAttributeOutput struct { - _ struct{} `type:"structure"` - - // The state of autoEnableIO attribute. - AutoEnableIO *AttributeBooleanValue `locationName:"autoEnableIO" type:"structure"` - - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // The ID of the volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s DescribeVolumeAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeAttributeOutput) GoString() string { - return s.String() -} - -// SetAutoEnableIO sets the AutoEnableIO field's value. -func (s *DescribeVolumeAttributeOutput) SetAutoEnableIO(v *AttributeBooleanValue) *DescribeVolumeAttributeOutput { - s.AutoEnableIO = v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeVolumeAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeVolumeAttributeOutput { - s.ProductCodes = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DescribeVolumeAttributeOutput) SetVolumeId(v string) *DescribeVolumeAttributeOutput { - s.VolumeId = &v - return s -} - -// Contains the parameters for DescribeVolumeStatus. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatusRequest -type DescribeVolumeStatusInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * action.code - The action code for the event (for example, enable-volume-io). - // - // * action.description - A description of the action. - // - // * action.event-id - The event ID associated with the action. - // - // * availability-zone - The Availability Zone of the instance. - // - // * event.description - A description of the event. - // - // * event.event-id - The event ID. - // - // * event.event-type - The event type (for io-enabled: passed | failed; - // for io-performance: io-performance:degraded | io-performance:severely-degraded - // | io-performance:stalled). - // - // * event.not-after - The latest end time for the event. - // - // * event.not-before - The earliest start time for the event. - // - // * volume-status.details-name - The cause for volume-status.status (io-enabled - // | io-performance). - // - // * volume-status.details-status - The status of volume-status.details-name - // (for io-enabled: passed | failed; for io-performance: normal | degraded - // | severely-degraded | stalled). - // - // * volume-status.status - The status of the volume (ok | impaired | warning - // | insufficient-data). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of volume results returned by DescribeVolumeStatus in - // paginated output. When this parameter is used, the request only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another request with - // the returned NextToken value. This value can be between 5 and 1000; if MaxResults - // is given a value larger than 1000, only 1000 results are returned. If this - // parameter is not used, then DescribeVolumeStatus returns all results. You - // cannot specify this parameter and the volume IDs parameter in the same request. - MaxResults *int64 `type:"integer"` - - // The NextToken value to include in a future DescribeVolumeStatus request. - // When the results of the request exceed MaxResults, this value can be used - // to retrieve the next page of results. This value is null when there are no - // more results to return. - NextToken *string `type:"string"` - - // One or more volume IDs. - // - // Default: Describes all your volumes. - VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumeStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeStatusInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumeStatusInput) SetDryRun(v bool) *DescribeVolumeStatusInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVolumeStatusInput) SetFilters(v []*Filter) *DescribeVolumeStatusInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVolumeStatusInput) SetMaxResults(v int64) *DescribeVolumeStatusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumeStatusInput) SetNextToken(v string) *DescribeVolumeStatusInput { - s.NextToken = &v - return s -} - -// SetVolumeIds sets the VolumeIds field's value. -func (s *DescribeVolumeStatusInput) SetVolumeIds(v []*string) *DescribeVolumeStatusInput { - s.VolumeIds = v - return s -} - -// Contains the output of DescribeVolumeStatus. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatusResult -type DescribeVolumeStatusOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of volumes. - VolumeStatuses []*VolumeStatusItem `locationName:"volumeStatusSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumeStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumeStatusOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumeStatusOutput) SetNextToken(v string) *DescribeVolumeStatusOutput { - s.NextToken = &v - return s -} - -// SetVolumeStatuses sets the VolumeStatuses field's value. -func (s *DescribeVolumeStatusOutput) SetVolumeStatuses(v []*VolumeStatusItem) *DescribeVolumeStatusOutput { - s.VolumeStatuses = v - return s -} - -// Contains the parameters for DescribeVolumes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesRequest -type DescribeVolumesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * attachment.attach-time - The time stamp when the attachment initiated. - // - // * attachment.delete-on-termination - Whether the volume is deleted on - // instance termination. - // - // * attachment.device - The device name that is exposed to the instance - // (for example, /dev/sda1). - // - // * attachment.instance-id - The ID of the instance the volume is attached - // to. - // - // * attachment.status - The attachment state (attaching | attached | detaching - // | detached). - // - // * availability-zone - The Availability Zone in which the volume was created. - // - // * create-time - The time stamp when the volume was created. - // - // * encrypted - The encryption status of the volume. - // - // * size - The size of the volume, in GiB. - // - // * snapshot-id - The snapshot from which the volume was created. - // - // * status - The status of the volume (creating | available | in-use | deleting - // | deleted | error). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * volume-id - The volume ID. - // - // * volume-type - The Amazon EBS volume type. This can be gp2 for General - // Purpose SSD, io1 for Provisioned IOPS SSD, st1 for Throughput Optimized - // HDD, sc1 for Cold HDD, or standard for Magnetic volumes. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of volume results returned by DescribeVolumes in paginated - // output. When this parameter is used, DescribeVolumes only returns MaxResults - // results in a single page along with a NextToken response element. The remaining - // results of the initial request can be seen by sending another DescribeVolumes - // request with the returned NextToken value. This value can be between 5 and - // 500; if MaxResults is given a value larger than 500, only 500 results are - // returned. If this parameter is not used, then DescribeVolumes returns all - // results. You cannot specify this parameter and the volume IDs parameter in - // the same request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The NextToken value returned from a previous paginated DescribeVolumes request - // where MaxResults was used and the results exceeded the value of that parameter. - // Pagination continues from the end of the previous results that returned the - // NextToken value. This value is null when there are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // One or more volume IDs. - VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumesInput) SetDryRun(v bool) *DescribeVolumesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVolumesInput) SetFilters(v []*Filter) *DescribeVolumesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVolumesInput) SetMaxResults(v int64) *DescribeVolumesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesInput) SetNextToken(v string) *DescribeVolumesInput { - s.NextToken = &v - return s -} - -// SetVolumeIds sets the VolumeIds field's value. -func (s *DescribeVolumesInput) SetVolumeIds(v []*string) *DescribeVolumesInput { - s.VolumeIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModificationsRequest -type DescribeVolumesModificationsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. Supported filters: volume-id, modification-state, target-size, - // target-iops, target-volume-type, original-size, original-iops, original-volume-type, - // start-time. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results (up to a limit of 500) to be returned in a - // paginated request. - MaxResults *int64 `type:"integer"` - - // The nextToken value returned by a previous paginated request. - NextToken *string `type:"string"` - - // One or more volume IDs for which in-progress modifications will be described. - VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesModificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesModificationsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVolumesModificationsInput) SetDryRun(v bool) *DescribeVolumesModificationsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVolumesModificationsInput) SetFilters(v []*Filter) *DescribeVolumesModificationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVolumesModificationsInput) SetMaxResults(v int64) *DescribeVolumesModificationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesModificationsInput) SetNextToken(v string) *DescribeVolumesModificationsInput { - s.NextToken = &v - return s -} - -// SetVolumeIds sets the VolumeIds field's value. -func (s *DescribeVolumesModificationsInput) SetVolumeIds(v []*string) *DescribeVolumesModificationsInput { - s.VolumeIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModificationsResult -type DescribeVolumesModificationsOutput struct { - _ struct{} `type:"structure"` - - // Token for pagination, null if there are no more results - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of returned VolumeModification objects. - VolumesModifications []*VolumeModification `locationName:"volumeModificationSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesModificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesModificationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesModificationsOutput) SetNextToken(v string) *DescribeVolumesModificationsOutput { - s.NextToken = &v - return s -} - -// SetVolumesModifications sets the VolumesModifications field's value. -func (s *DescribeVolumesModificationsOutput) SetVolumesModifications(v []*VolumeModification) *DescribeVolumesModificationsOutput { - s.VolumesModifications = v - return s -} - -// Contains the output of DescribeVolumes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesResult -type DescribeVolumesOutput struct { - _ struct{} `type:"structure"` - - // The NextToken value to include in a future DescribeVolumes request. When - // the results of a DescribeVolumes request exceed MaxResults, this value can - // be used to retrieve the next page of results. This value is null when there - // are no more results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the volumes. - Volumes []*Volume `locationName:"volumeSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVolumesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVolumesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVolumesOutput) SetNextToken(v string) *DescribeVolumesOutput { - s.NextToken = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *DescribeVolumesOutput) SetVolumes(v []*Volume) *DescribeVolumesOutput { - s.Volumes = v - return s -} - -// Contains the parameters for DescribeVpcAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttributeRequest -type DescribeVpcAttributeInput struct { - _ struct{} `type:"structure"` - - // The VPC attribute. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"VpcAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeVpcAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVpcAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVpcAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *DescribeVpcAttributeInput) SetAttribute(v string) *DescribeVpcAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcAttributeInput) SetDryRun(v bool) *DescribeVpcAttributeInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DescribeVpcAttributeInput) SetVpcId(v string) *DescribeVpcAttributeInput { - s.VpcId = &v - return s -} - -// Contains the output of DescribeVpcAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttributeResult -type DescribeVpcAttributeOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // this attribute is true, instances in the VPC get DNS hostnames; otherwise, - // they do not. - EnableDnsHostnames *AttributeBooleanValue `locationName:"enableDnsHostnames" type:"structure"` - - // Indicates whether DNS resolution is enabled for the VPC. If this attribute - // is true, the Amazon DNS server resolves DNS hostnames for your instances - // to their corresponding IP addresses; otherwise, it does not. - EnableDnsSupport *AttributeBooleanValue `locationName:"enableDnsSupport" type:"structure"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s DescribeVpcAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcAttributeOutput) GoString() string { - return s.String() -} - -// SetEnableDnsHostnames sets the EnableDnsHostnames field's value. -func (s *DescribeVpcAttributeOutput) SetEnableDnsHostnames(v *AttributeBooleanValue) *DescribeVpcAttributeOutput { - s.EnableDnsHostnames = v - return s -} - -// SetEnableDnsSupport sets the EnableDnsSupport field's value. -func (s *DescribeVpcAttributeOutput) SetEnableDnsSupport(v *AttributeBooleanValue) *DescribeVpcAttributeOutput { - s.EnableDnsSupport = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DescribeVpcAttributeOutput) SetVpcId(v string) *DescribeVpcAttributeOutput { - s.VpcId = &v - return s -} - -// Contains the parameters for DescribeVpcClassicLinkDnsSupport. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupportRequest -type DescribeVpcClassicLinkDnsSupportInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // One or more VPC IDs. - VpcIds []*string `locationNameList:"VpcId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkDnsSupportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkDnsSupportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeVpcClassicLinkDnsSupportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeVpcClassicLinkDnsSupportInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcClassicLinkDnsSupportInput) SetMaxResults(v int64) *DescribeVpcClassicLinkDnsSupportInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcClassicLinkDnsSupportInput) SetNextToken(v string) *DescribeVpcClassicLinkDnsSupportInput { - s.NextToken = &v - return s -} - -// SetVpcIds sets the VpcIds field's value. -func (s *DescribeVpcClassicLinkDnsSupportInput) SetVpcIds(v []*string) *DescribeVpcClassicLinkDnsSupportInput { - s.VpcIds = v - return s -} - -// Contains the output of DescribeVpcClassicLinkDnsSupport. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupportResult -type DescribeVpcClassicLinkDnsSupportOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Information about the ClassicLink DNS support status of the VPCs. - Vpcs []*ClassicLinkDnsSupport `locationName:"vpcs" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkDnsSupportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkDnsSupportOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcClassicLinkDnsSupportOutput) SetNextToken(v string) *DescribeVpcClassicLinkDnsSupportOutput { - s.NextToken = &v - return s -} - -// SetVpcs sets the Vpcs field's value. -func (s *DescribeVpcClassicLinkDnsSupportOutput) SetVpcs(v []*ClassicLinkDnsSupport) *DescribeVpcClassicLinkDnsSupportOutput { - s.Vpcs = v - return s -} - -// Contains the parameters for DescribeVpcClassicLink. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkRequest -type DescribeVpcClassicLinkInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * is-classic-link-enabled - Whether the VPC is enabled for ClassicLink - // (true | false). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPCs for which you want to describe the ClassicLink status. - VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcClassicLinkInput) SetDryRun(v bool) *DescribeVpcClassicLinkInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcClassicLinkInput) SetFilters(v []*Filter) *DescribeVpcClassicLinkInput { - s.Filters = v - return s -} - -// SetVpcIds sets the VpcIds field's value. -func (s *DescribeVpcClassicLinkInput) SetVpcIds(v []*string) *DescribeVpcClassicLinkInput { - s.VpcIds = v - return s -} - -// Contains the output of DescribeVpcClassicLink. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkResult -type DescribeVpcClassicLinkOutput struct { - _ struct{} `type:"structure"` - - // The ClassicLink status of one or more VPCs. - Vpcs []*VpcClassicLink `locationName:"vpcSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcClassicLinkOutput) GoString() string { - return s.String() -} - -// SetVpcs sets the Vpcs field's value. -func (s *DescribeVpcClassicLinkOutput) SetVpcs(v []*VpcClassicLink) *DescribeVpcClassicLinkOutput { - s.Vpcs = v - return s -} - -// Contains the parameters for DescribeVpcEndpointServices. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicesRequest -type DescribeVpcEndpointServicesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServicesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServicesInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointServicesInput) SetDryRun(v bool) *DescribeVpcEndpointServicesInput { - s.DryRun = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointServicesInput) SetMaxResults(v int64) *DescribeVpcEndpointServicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServicesInput) SetNextToken(v string) *DescribeVpcEndpointServicesInput { - s.NextToken = &v - return s -} - -// Contains the output of DescribeVpcEndpointServices. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicesResult -type DescribeVpcEndpointServicesOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of supported AWS services. - ServiceNames []*string `locationName:"serviceNameSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointServicesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointServicesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointServicesOutput) SetNextToken(v string) *DescribeVpcEndpointServicesOutput { - s.NextToken = &v - return s -} - -// SetServiceNames sets the ServiceNames field's value. -func (s *DescribeVpcEndpointServicesOutput) SetServiceNames(v []*string) *DescribeVpcEndpointServicesOutput { - s.ServiceNames = v - return s -} - -// Contains the parameters for DescribeVpcEndpoints. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointsRequest -type DescribeVpcEndpointsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more filters. - // - // * service-name: The name of the AWS service. - // - // * vpc-id: The ID of the VPC in which the endpoint resides. - // - // * vpc-endpoint-id: The ID of the endpoint. - // - // * vpc-endpoint-state: The state of the endpoint. (pending | available - // | deleting | deleted) - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `type:"integer"` - - // The token for the next set of items to return. (You received this token from - // a prior call.) - NextToken *string `type:"string"` - - // One or more endpoint IDs. - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcEndpointsInput) SetDryRun(v bool) *DescribeVpcEndpointsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcEndpointsInput) SetFilters(v []*Filter) *DescribeVpcEndpointsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeVpcEndpointsInput) SetMaxResults(v int64) *DescribeVpcEndpointsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointsInput) SetNextToken(v string) *DescribeVpcEndpointsInput { - s.NextToken = &v - return s -} - -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *DescribeVpcEndpointsInput) SetVpcEndpointIds(v []*string) *DescribeVpcEndpointsInput { - s.VpcEndpointIds = v - return s -} - -// Contains the output of DescribeVpcEndpoints. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointsResult -type DescribeVpcEndpointsOutput struct { - _ struct{} `type:"structure"` - - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the endpoints. - VpcEndpoints []*VpcEndpoint `locationName:"vpcEndpointSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcEndpointsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcEndpointsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeVpcEndpointsOutput) SetNextToken(v string) *DescribeVpcEndpointsOutput { - s.NextToken = &v - return s -} - -// SetVpcEndpoints sets the VpcEndpoints field's value. -func (s *DescribeVpcEndpointsOutput) SetVpcEndpoints(v []*VpcEndpoint) *DescribeVpcEndpointsOutput { - s.VpcEndpoints = v - return s -} - -// Contains the parameters for DescribeVpcPeeringConnections. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnectionsRequest -type DescribeVpcPeeringConnectionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * accepter-vpc-info.cidr-block - The IPv4 CIDR block of the peer VPC. - // - // * accepter-vpc-info.owner-id - The AWS account ID of the owner of the - // peer VPC. - // - // * accepter-vpc-info.vpc-id - The ID of the peer VPC. - // - // * expiration-time - The expiration date and time for the VPC peering connection. - // - // * requester-vpc-info.cidr-block - The IPv4 CIDR block of the requester's - // VPC. - // - // * requester-vpc-info.owner-id - The AWS account ID of the owner of the - // requester VPC. - // - // * requester-vpc-info.vpc-id - The ID of the requester VPC. - // - // * status-code - The status of the VPC peering connection (pending-acceptance - // | failed | expired | provisioning | active | deleted | rejected). - // - // * status-message - A message that provides more information about the - // status of the VPC peering connection, if applicable. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-peering-connection-id - The ID of the VPC peering connection. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPC peering connection IDs. - // - // Default: Describes all your VPC peering connections. - VpcPeeringConnectionIds []*string `locationName:"VpcPeeringConnectionId" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcPeeringConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcPeeringConnectionsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcPeeringConnectionsInput) SetDryRun(v bool) *DescribeVpcPeeringConnectionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcPeeringConnectionsInput) SetFilters(v []*Filter) *DescribeVpcPeeringConnectionsInput { - s.Filters = v - return s -} - -// SetVpcPeeringConnectionIds sets the VpcPeeringConnectionIds field's value. -func (s *DescribeVpcPeeringConnectionsInput) SetVpcPeeringConnectionIds(v []*string) *DescribeVpcPeeringConnectionsInput { - s.VpcPeeringConnectionIds = v - return s -} - -// Contains the output of DescribeVpcPeeringConnections. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnectionsResult -type DescribeVpcPeeringConnectionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connections. - VpcPeeringConnections []*VpcPeeringConnection `locationName:"vpcPeeringConnectionSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcPeeringConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcPeeringConnectionsOutput) GoString() string { - return s.String() -} - -// SetVpcPeeringConnections sets the VpcPeeringConnections field's value. -func (s *DescribeVpcPeeringConnectionsOutput) SetVpcPeeringConnections(v []*VpcPeeringConnection) *DescribeVpcPeeringConnectionsOutput { - s.VpcPeeringConnections = v - return s -} - -// Contains the parameters for DescribeVpcs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcsRequest -type DescribeVpcsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * cidr - The IPv4 CIDR block of the VPC. The CIDR block you specify must - // exactly match the VPC's CIDR block for information to be returned for - // the VPC. Must contain the slash followed by one or two digits (for example, - // /28). - // - // * dhcp-options-id - The ID of a set of DHCP options. - // - // * ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated - // with the VPC. - // - // * ipv6-cidr-block-association.association-id - The association ID for - // an IPv6 CIDR block associated with the VPC. - // - // * ipv6-cidr-block-association.state - The state of an IPv6 CIDR block - // associated with the VPC. - // - // * isDefault - Indicates whether the VPC is the default VPC. - // - // * state - The state of the VPC (pending | available). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * vpc-id - The ID of the VPC. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPC IDs. - // - // Default: Describes all your VPCs. - VpcIds []*string `locationName:"VpcId" locationNameList:"VpcId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpcsInput) SetDryRun(v bool) *DescribeVpcsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpcsInput) SetFilters(v []*Filter) *DescribeVpcsInput { - s.Filters = v - return s -} - -// SetVpcIds sets the VpcIds field's value. -func (s *DescribeVpcsInput) SetVpcIds(v []*string) *DescribeVpcsInput { - s.VpcIds = v - return s -} - -// Contains the output of DescribeVpcs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcsResult -type DescribeVpcsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more VPCs. - Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpcsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpcsOutput) GoString() string { - return s.String() -} - -// SetVpcs sets the Vpcs field's value. -func (s *DescribeVpcsOutput) SetVpcs(v []*Vpc) *DescribeVpcsOutput { - s.Vpcs = v - return s -} - -// Contains the parameters for DescribeVpnConnections. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnectionsRequest -type DescribeVpnConnectionsInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * customer-gateway-configuration - The configuration information for the - // customer gateway. - // - // * customer-gateway-id - The ID of a customer gateway associated with the - // VPN connection. - // - // * state - The state of the VPN connection (pending | available | deleting - // | deleted). - // - // * option.static-routes-only - Indicates whether the connection has static - // routes only. Used for devices that do not support Border Gateway Protocol - // (BGP). - // - // * route.destination-cidr-block - The destination CIDR block. This corresponds - // to the subnet used in a customer data center. - // - // * bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP - // device. - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * type - The type of VPN connection. Currently the only supported type - // is ipsec.1. - // - // * vpn-connection-id - The ID of the VPN connection. - // - // * vpn-gateway-id - The ID of a virtual private gateway associated with - // the VPN connection. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more VPN connection IDs. - // - // Default: Describes your VPN connections. - VpnConnectionIds []*string `locationName:"VpnConnectionId" locationNameList:"VpnConnectionId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnConnectionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnConnectionsInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpnConnectionsInput) SetDryRun(v bool) *DescribeVpnConnectionsInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpnConnectionsInput) SetFilters(v []*Filter) *DescribeVpnConnectionsInput { - s.Filters = v - return s -} - -// SetVpnConnectionIds sets the VpnConnectionIds field's value. -func (s *DescribeVpnConnectionsInput) SetVpnConnectionIds(v []*string) *DescribeVpnConnectionsInput { - s.VpnConnectionIds = v - return s -} - -// Contains the output of DescribeVpnConnections. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnectionsResult -type DescribeVpnConnectionsOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more VPN connections. - VpnConnections []*VpnConnection `locationName:"vpnConnectionSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnConnectionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnConnectionsOutput) GoString() string { - return s.String() -} - -// SetVpnConnections sets the VpnConnections field's value. -func (s *DescribeVpnConnectionsOutput) SetVpnConnections(v []*VpnConnection) *DescribeVpnConnectionsOutput { - s.VpnConnections = v - return s -} - -// Contains the parameters for DescribeVpnGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGatewaysRequest -type DescribeVpnGatewaysInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more filters. - // - // * attachment.state - The current state of the attachment between the gateway - // and the VPC (attaching | attached | detaching | detached). - // - // * attachment.vpc-id - The ID of an attached VPC. - // - // * availability-zone - The Availability Zone for the virtual private gateway - // (if applicable). - // - // * state - The state of the virtual private gateway (pending | available - // | deleting | deleted). - // - // * tag:key=value - The key/value combination of a tag assigned to the resource. - // Specify the key of the tag in the filter name and the value of the tag - // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose - // for the filter name and X for the filter value. - // - // * tag-key - The key of a tag assigned to the resource. This filter is - // independent of the tag-value filter. For example, if you use both the - // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources - // assigned both the tag key Purpose (regardless of what the tag's value - // is), and the tag value X (regardless of what the tag's key is). If you - // want to list only resources where Purpose is X, see the tag:key=value - // filter. - // - // * tag-value - The value of a tag assigned to the resource. This filter - // is independent of the tag-key filter. - // - // * type - The type of virtual private gateway. Currently the only supported - // type is ipsec.1. - // - // * vpn-gateway-id - The ID of the virtual private gateway. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // One or more virtual private gateway IDs. - // - // Default: Describes all your virtual private gateways. - VpnGatewayIds []*string `locationName:"VpnGatewayId" locationNameList:"VpnGatewayId" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnGatewaysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnGatewaysInput) GoString() string { - return s.String() -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeVpnGatewaysInput) SetDryRun(v bool) *DescribeVpnGatewaysInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeVpnGatewaysInput) SetFilters(v []*Filter) *DescribeVpnGatewaysInput { - s.Filters = v - return s -} - -// SetVpnGatewayIds sets the VpnGatewayIds field's value. -func (s *DescribeVpnGatewaysInput) SetVpnGatewayIds(v []*string) *DescribeVpnGatewaysInput { - s.VpnGatewayIds = v - return s -} - -// Contains the output of DescribeVpnGateways. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGatewaysResult -type DescribeVpnGatewaysOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more virtual private gateways. - VpnGateways []*VpnGateway `locationName:"vpnGatewaySet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DescribeVpnGatewaysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeVpnGatewaysOutput) GoString() string { - return s.String() -} - -// SetVpnGateways sets the VpnGateways field's value. -func (s *DescribeVpnGatewaysOutput) SetVpnGateways(v []*VpnGateway) *DescribeVpnGatewaysOutput { - s.VpnGateways = v - return s -} - -// Contains the parameters for DetachClassicLinkVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpcRequest -type DetachClassicLinkVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance to unlink from the VPC. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The ID of the VPC to which the instance is linked. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachClassicLinkVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachClassicLinkVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachClassicLinkVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachClassicLinkVpcInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachClassicLinkVpcInput) SetDryRun(v bool) *DetachClassicLinkVpcInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DetachClassicLinkVpcInput) SetInstanceId(v string) *DetachClassicLinkVpcInput { - s.InstanceId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DetachClassicLinkVpcInput) SetVpcId(v string) *DetachClassicLinkVpcInput { - s.VpcId = &v - return s -} - -// Contains the output of DetachClassicLinkVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpcResult -type DetachClassicLinkVpcOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DetachClassicLinkVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachClassicLinkVpcOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DetachClassicLinkVpcOutput) SetReturn(v bool) *DetachClassicLinkVpcOutput { - s.Return = &v - return s -} - -// Contains the parameters for DetachInternetGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGatewayRequest -type DetachInternetGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Internet gateway. - // - // InternetGatewayId is a required field - InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachInternetGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInternetGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachInternetGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachInternetGatewayInput"} - if s.InternetGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("InternetGatewayId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachInternetGatewayInput) SetDryRun(v bool) *DetachInternetGatewayInput { - s.DryRun = &v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *DetachInternetGatewayInput) SetInternetGatewayId(v string) *DetachInternetGatewayInput { - s.InternetGatewayId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DetachInternetGatewayInput) SetVpcId(v string) *DetachInternetGatewayInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGatewayOutput -type DetachInternetGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachInternetGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInternetGatewayOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DetachNetworkInterface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterfaceRequest -type DetachNetworkInterfaceInput struct { - _ struct{} `type:"structure"` - - // The ID of the attachment. - // - // AttachmentId is a required field - AttachmentId *string `locationName:"attachmentId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether to force a detachment. - Force *bool `locationName:"force" type:"boolean"` -} - -// String returns the string representation -func (s DetachNetworkInterfaceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachNetworkInterfaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachNetworkInterfaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachNetworkInterfaceInput"} - if s.AttachmentId == nil { - invalidParams.Add(request.NewErrParamRequired("AttachmentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *DetachNetworkInterfaceInput) SetAttachmentId(v string) *DetachNetworkInterfaceInput { - s.AttachmentId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachNetworkInterfaceInput) SetDryRun(v bool) *DetachNetworkInterfaceInput { - s.DryRun = &v - return s -} - -// SetForce sets the Force field's value. -func (s *DetachNetworkInterfaceInput) SetForce(v bool) *DetachNetworkInterfaceInput { - s.Force = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterfaceOutput -type DetachNetworkInterfaceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachNetworkInterfaceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachNetworkInterfaceOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DetachVolume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolumeRequest -type DetachVolumeInput struct { - _ struct{} `type:"structure"` - - // The device name. - Device *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Forces detachment if the previous detachment attempt did not occur cleanly - // (for example, logging into an instance, unmounting the volume, and detaching - // normally). This option can lead to data loss or a corrupted file system. - // Use this option only as a last resort to detach a volume from a failed instance. - // The instance won't have an opportunity to flush file system caches or file - // system metadata. If you use this option, you must perform file system check - // and repair procedures. - Force *bool `type:"boolean"` - - // The ID of the instance. - InstanceId *string `type:"string"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDevice sets the Device field's value. -func (s *DetachVolumeInput) SetDevice(v string) *DetachVolumeInput { - s.Device = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachVolumeInput) SetDryRun(v bool) *DetachVolumeInput { - s.DryRun = &v - return s -} - -// SetForce sets the Force field's value. -func (s *DetachVolumeInput) SetForce(v bool) *DetachVolumeInput { - s.Force = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DetachVolumeInput) SetInstanceId(v string) *DetachVolumeInput { - s.InstanceId = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *DetachVolumeInput) SetVolumeId(v string) *DetachVolumeInput { - s.VolumeId = &v - return s -} - -// Contains the parameters for DetachVpnGateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGatewayRequest -type DetachVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. - // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DetachVpnGatewayInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVpnGatewayInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachVpnGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachVpnGatewayInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - if s.VpnGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DetachVpnGatewayInput) SetDryRun(v bool) *DetachVpnGatewayInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DetachVpnGatewayInput) SetVpcId(v string) *DetachVpnGatewayInput { - s.VpcId = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *DetachVpnGatewayInput) SetVpnGatewayId(v string) *DetachVpnGatewayInput { - s.VpnGatewayId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGatewayOutput -type DetachVpnGatewayOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DetachVpnGatewayOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachVpnGatewayOutput) GoString() string { - return s.String() -} - -// Describes a DHCP configuration option. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DhcpConfiguration -type DhcpConfiguration struct { - _ struct{} `type:"structure"` - - // The name of a DHCP option. - Key *string `locationName:"key" type:"string"` - - // One or more values for the DHCP option. - Values []*AttributeValue `locationName:"valueSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DhcpConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DhcpConfiguration) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *DhcpConfiguration) SetKey(v string) *DhcpConfiguration { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *DhcpConfiguration) SetValues(v []*AttributeValue) *DhcpConfiguration { - s.Values = v - return s -} - -// Describes a set of DHCP options. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DhcpOptions -type DhcpOptions struct { - _ struct{} `type:"structure"` - - // One or more DHCP options in the set. - DhcpConfigurations []*DhcpConfiguration `locationName:"dhcpConfigurationSet" locationNameList:"item" type:"list"` - - // The ID of the set of DHCP options. - DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` - - // Any tags assigned to the DHCP options set. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s DhcpOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DhcpOptions) GoString() string { - return s.String() -} - -// SetDhcpConfigurations sets the DhcpConfigurations field's value. -func (s *DhcpOptions) SetDhcpConfigurations(v []*DhcpConfiguration) *DhcpOptions { - s.DhcpConfigurations = v - return s -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *DhcpOptions) SetDhcpOptionsId(v string) *DhcpOptions { - s.DhcpOptionsId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DhcpOptions) SetTags(v []*Tag) *DhcpOptions { - s.Tags = v - return s -} - -// Contains the parameters for DisableVgwRoutePropagation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagationRequest -type DisableVgwRoutePropagationInput struct { - _ struct{} `type:"structure"` - - // The ID of the virtual private gateway. - // - // GatewayId is a required field - GatewayId *string `type:"string" required:"true"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableVgwRoutePropagationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVgwRoutePropagationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableVgwRoutePropagationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableVgwRoutePropagationInput"} - if s.GatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("GatewayId")) - } - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGatewayId sets the GatewayId field's value. -func (s *DisableVgwRoutePropagationInput) SetGatewayId(v string) *DisableVgwRoutePropagationInput { - s.GatewayId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *DisableVgwRoutePropagationInput) SetRouteTableId(v string) *DisableVgwRoutePropagationInput { - s.RouteTableId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagationOutput -type DisableVgwRoutePropagationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisableVgwRoutePropagationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVgwRoutePropagationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for DisableVpcClassicLinkDnsSupport. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupportRequest -type DisableVpcClassicLinkDnsSupportInput struct { - _ struct{} `type:"structure"` - - // The ID of the VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkDnsSupportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkDnsSupportInput) GoString() string { - return s.String() -} - -// SetVpcId sets the VpcId field's value. -func (s *DisableVpcClassicLinkDnsSupportInput) SetVpcId(v string) *DisableVpcClassicLinkDnsSupportInput { - s.VpcId = &v - return s -} - -// Contains the output of DisableVpcClassicLinkDnsSupport. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupportResult -type DisableVpcClassicLinkDnsSupportOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkDnsSupportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkDnsSupportOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DisableVpcClassicLinkDnsSupportOutput) SetReturn(v bool) *DisableVpcClassicLinkDnsSupportOutput { - s.Return = &v - return s -} - -// Contains the parameters for DisableVpcClassicLink. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkRequest -type DisableVpcClassicLinkInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableVpcClassicLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableVpcClassicLinkInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DisableVpcClassicLinkInput) SetDryRun(v bool) *DisableVpcClassicLinkInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DisableVpcClassicLinkInput) SetVpcId(v string) *DisableVpcClassicLinkInput { - s.VpcId = &v - return s -} - -// Contains the output of DisableVpcClassicLink. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkResult -type DisableVpcClassicLinkOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s DisableVpcClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableVpcClassicLinkOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *DisableVpcClassicLinkOutput) SetReturn(v bool) *DisableVpcClassicLinkOutput { - s.Return = &v - return s -} - -// Contains the parameters for DisassociateAddress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddressRequest -type DisassociateAddressInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The association ID. Required for EC2-VPC. - AssociationId *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIp *string `type:"string"` -} - -// String returns the string representation -func (s DisassociateAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateAddressInput) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateAddressInput) SetAssociationId(v string) *DisassociateAddressInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DisassociateAddressInput) SetDryRun(v bool) *DisassociateAddressInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *DisassociateAddressInput) SetPublicIp(v string) *DisassociateAddressInput { - s.PublicIp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddressOutput -type DisassociateAddressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisassociateAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateAddressOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfileRequest -type DisassociateIamInstanceProfileInput struct { - _ struct{} `type:"structure"` - - // The ID of the IAM instance profile association. - // - // AssociationId is a required field - AssociationId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DisassociateIamInstanceProfileInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateIamInstanceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateIamInstanceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateIamInstanceProfileInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateIamInstanceProfileInput) SetAssociationId(v string) *DisassociateIamInstanceProfileInput { - s.AssociationId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfileResult -type DisassociateIamInstanceProfileOutput struct { - _ struct{} `type:"structure"` - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` -} - -// String returns the string representation -func (s DisassociateIamInstanceProfileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateIamInstanceProfileOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. -func (s *DisassociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *DisassociateIamInstanceProfileOutput { - s.IamInstanceProfileAssociation = v - return s -} - -// Contains the parameters for DisassociateRouteTable. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTableRequest -type DisassociateRouteTableInput struct { - _ struct{} `type:"structure"` - - // The association ID representing the current association between the route - // table and subnet. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` -} - -// String returns the string representation -func (s DisassociateRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateRouteTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateRouteTableInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateRouteTableInput) SetAssociationId(v string) *DisassociateRouteTableInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *DisassociateRouteTableInput) SetDryRun(v bool) *DisassociateRouteTableInput { - s.DryRun = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTableOutput -type DisassociateRouteTableOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DisassociateRouteTableOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateRouteTableOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlockRequest -type DisassociateSubnetCidrBlockInput struct { - _ struct{} `type:"structure"` - - // The association ID for the CIDR block. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisassociateSubnetCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateSubnetCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateSubnetCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateSubnetCidrBlockInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateSubnetCidrBlockInput) SetAssociationId(v string) *DisassociateSubnetCidrBlockInput { - s.AssociationId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlockResult -type DisassociateSubnetCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *SubnetIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s DisassociateSubnetCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateSubnetCidrBlockOutput) GoString() string { - return s.String() -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *DisassociateSubnetCidrBlockOutput) SetIpv6CidrBlockAssociation(v *SubnetIpv6CidrBlockAssociation) *DisassociateSubnetCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *DisassociateSubnetCidrBlockOutput) SetSubnetId(v string) *DisassociateSubnetCidrBlockOutput { - s.SubnetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlockRequest -type DisassociateVpcCidrBlockInput struct { - _ struct{} `type:"structure"` - - // The association ID for the CIDR block. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisassociateVpcCidrBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateVpcCidrBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateVpcCidrBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateVpcCidrBlockInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *DisassociateVpcCidrBlockInput) SetAssociationId(v string) *DisassociateVpcCidrBlockInput { - s.AssociationId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlockResult -type DisassociateVpcCidrBlockOutput struct { - _ struct{} `type:"structure"` - - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *VpcIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s DisassociateVpcCidrBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateVpcCidrBlockOutput) GoString() string { - return s.String() -} - -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *DisassociateVpcCidrBlockOutput) SetIpv6CidrBlockAssociation(v *VpcIpv6CidrBlockAssociation) *DisassociateVpcCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DisassociateVpcCidrBlockOutput) SetVpcId(v string) *DisassociateVpcCidrBlockOutput { - s.VpcId = &v - return s -} - -// Describes a disk image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DiskImage -type DiskImage struct { - _ struct{} `type:"structure"` - - // A description of the disk image. - Description *string `type:"string"` - - // Information about the disk image. - Image *DiskImageDetail `type:"structure"` - - // Information about the volume. - Volume *VolumeDetail `type:"structure"` -} - -// String returns the string representation -func (s DiskImage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DiskImage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DiskImage"} - if s.Image != nil { - if err := s.Image.Validate(); err != nil { - invalidParams.AddNested("Image", err.(request.ErrInvalidParams)) - } - } - if s.Volume != nil { - if err := s.Volume.Validate(); err != nil { - invalidParams.AddNested("Volume", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *DiskImage) SetDescription(v string) *DiskImage { - s.Description = &v - return s -} - -// SetImage sets the Image field's value. -func (s *DiskImage) SetImage(v *DiskImageDetail) *DiskImage { - s.Image = v - return s -} - -// SetVolume sets the Volume field's value. -func (s *DiskImage) SetVolume(v *VolumeDetail) *DiskImage { - s.Volume = v - return s -} - -// Describes a disk image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DiskImageDescription -type DiskImageDescription struct { - _ struct{} `type:"structure"` - - // The checksum computed for the disk image. - Checksum *string `locationName:"checksum" type:"string"` - - // The disk image format. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"DiskImageFormat"` - - // A presigned URL for the import manifest stored in Amazon S3. For information - // about creating a presigned URL for an Amazon S3 object, read the "Query String - // Request Authentication Alternative" section of the Authenticating REST Requests - // (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) - // topic in the Amazon Simple Storage Service Developer Guide. - // - // For information about the import manifest referenced by this API action, - // see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). - // - // ImportManifestUrl is a required field - ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"` - - // The size of the disk image, in GiB. - // - // Size is a required field - Size *int64 `locationName:"size" type:"long" required:"true"` -} - -// String returns the string representation -func (s DiskImageDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImageDescription) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *DiskImageDescription) SetChecksum(v string) *DiskImageDescription { - s.Checksum = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *DiskImageDescription) SetFormat(v string) *DiskImageDescription { - s.Format = &v - return s -} - -// SetImportManifestUrl sets the ImportManifestUrl field's value. -func (s *DiskImageDescription) SetImportManifestUrl(v string) *DiskImageDescription { - s.ImportManifestUrl = &v - return s -} - -// SetSize sets the Size field's value. -func (s *DiskImageDescription) SetSize(v int64) *DiskImageDescription { - s.Size = &v - return s -} - -// Describes a disk image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DiskImageDetail -type DiskImageDetail struct { - _ struct{} `type:"structure"` - - // The size of the disk image, in GiB. - // - // Bytes is a required field - Bytes *int64 `locationName:"bytes" type:"long" required:"true"` - - // The disk image format. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"DiskImageFormat"` - - // A presigned URL for the import manifest stored in Amazon S3 and presented - // here as an Amazon S3 presigned URL. For information about creating a presigned - // URL for an Amazon S3 object, read the "Query String Request Authentication - // Alternative" section of the Authenticating REST Requests (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) - // topic in the Amazon Simple Storage Service Developer Guide. - // - // For information about the import manifest referenced by this API action, - // see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). - // - // ImportManifestUrl is a required field - ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"` -} - -// String returns the string representation -func (s DiskImageDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImageDetail) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DiskImageDetail) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DiskImageDetail"} - if s.Bytes == nil { - invalidParams.Add(request.NewErrParamRequired("Bytes")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.ImportManifestUrl == nil { - invalidParams.Add(request.NewErrParamRequired("ImportManifestUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBytes sets the Bytes field's value. -func (s *DiskImageDetail) SetBytes(v int64) *DiskImageDetail { - s.Bytes = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *DiskImageDetail) SetFormat(v string) *DiskImageDetail { - s.Format = &v - return s -} - -// SetImportManifestUrl sets the ImportManifestUrl field's value. -func (s *DiskImageDetail) SetImportManifestUrl(v string) *DiskImageDetail { - s.ImportManifestUrl = &v - return s -} - -// Describes a disk image volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DiskImageVolumeDescription -type DiskImageVolumeDescription struct { - _ struct{} `type:"structure"` - - // The volume identifier. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The size of the volume, in GiB. - Size *int64 `locationName:"size" type:"long"` -} - -// String returns the string representation -func (s DiskImageVolumeDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DiskImageVolumeDescription) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *DiskImageVolumeDescription) SetId(v string) *DiskImageVolumeDescription { - s.Id = &v - return s -} - -// SetSize sets the Size field's value. -func (s *DiskImageVolumeDescription) SetSize(v int64) *DiskImageVolumeDescription { - s.Size = &v - return s -} - -// Describes a block device for an EBS volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsBlockDevice -type EbsBlockDevice struct { - _ struct{} `type:"structure"` - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes - // may only be attached to instances that support Amazon EBS encryption. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1, this represents the number of IOPS that are provisioned for the - // volume. For gp2, this represents the baseline performance of the volume and - // the rate at which the volume accumulates I/O credits for bursting. For more - // information about General Purpose SSD baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops *int64 `locationName:"iops" type:"integer"` - - // The ID of the snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // The size of the volume, in GiB. - // - // Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned - // IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for - // Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify - // a snapshot, the volume size must be equal to or larger than the snapshot - // size. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - VolumeSize *int64 `locationName:"volumeSize" type:"integer"` - - // The volume type: gp2, io1, st1, sc1, or standard. - // - // Default: standard - VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s EbsBlockDevice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsBlockDevice) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *EbsBlockDevice) SetDeleteOnTermination(v bool) *EbsBlockDevice { - s.DeleteOnTermination = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *EbsBlockDevice) SetEncrypted(v bool) *EbsBlockDevice { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *EbsBlockDevice) SetIops(v int64) *EbsBlockDevice { - s.Iops = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *EbsBlockDevice) SetSnapshotId(v string) *EbsBlockDevice { - s.SnapshotId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *EbsBlockDevice) SetVolumeSize(v int64) *EbsBlockDevice { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *EbsBlockDevice) SetVolumeType(v string) *EbsBlockDevice { - s.VolumeType = &v - return s -} - -// Describes a parameter used to set up an EBS volume in a block device mapping. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsInstanceBlockDevice -type EbsInstanceBlockDevice struct { - _ struct{} `type:"structure"` - - // The time stamp when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The attachment state. - Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` - - // The ID of the EBS volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s EbsInstanceBlockDevice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsInstanceBlockDevice) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *EbsInstanceBlockDevice) SetAttachTime(v time.Time) *EbsInstanceBlockDevice { - s.AttachTime = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *EbsInstanceBlockDevice) SetDeleteOnTermination(v bool) *EbsInstanceBlockDevice { - s.DeleteOnTermination = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EbsInstanceBlockDevice) SetStatus(v string) *EbsInstanceBlockDevice { - s.Status = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *EbsInstanceBlockDevice) SetVolumeId(v string) *EbsInstanceBlockDevice { - s.VolumeId = &v - return s -} - -// Describes information used to set up an EBS volume specified in a block device -// mapping. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsInstanceBlockDeviceSpecification -type EbsInstanceBlockDeviceSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The ID of the EBS volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s EbsInstanceBlockDeviceSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EbsInstanceBlockDeviceSpecification) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *EbsInstanceBlockDeviceSpecification) SetDeleteOnTermination(v bool) *EbsInstanceBlockDeviceSpecification { - s.DeleteOnTermination = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *EbsInstanceBlockDeviceSpecification) SetVolumeId(v string) *EbsInstanceBlockDeviceSpecification { - s.VolumeId = &v - return s -} - -// Describes an egress-only Internet gateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EgressOnlyInternetGateway -type EgressOnlyInternetGateway struct { - _ struct{} `type:"structure"` - - // Information about the attachment of the egress-only Internet gateway. - Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` - - // The ID of the egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` -} - -// String returns the string representation -func (s EgressOnlyInternetGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EgressOnlyInternetGateway) GoString() string { - return s.String() -} - -// SetAttachments sets the Attachments field's value. -func (s *EgressOnlyInternetGateway) SetAttachments(v []*InternetGatewayAttachment) *EgressOnlyInternetGateway { - s.Attachments = v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *EgressOnlyInternetGateway) SetEgressOnlyInternetGatewayId(v string) *EgressOnlyInternetGateway { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// Contains the parameters for EnableVgwRoutePropagation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagationRequest -type EnableVgwRoutePropagationInput struct { - _ struct{} `type:"structure"` - - // The ID of the virtual private gateway. - // - // GatewayId is a required field - GatewayId *string `type:"string" required:"true"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableVgwRoutePropagationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVgwRoutePropagationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableVgwRoutePropagationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableVgwRoutePropagationInput"} - if s.GatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("GatewayId")) - } - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGatewayId sets the GatewayId field's value. -func (s *EnableVgwRoutePropagationInput) SetGatewayId(v string) *EnableVgwRoutePropagationInput { - s.GatewayId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *EnableVgwRoutePropagationInput) SetRouteTableId(v string) *EnableVgwRoutePropagationInput { - s.RouteTableId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagationOutput -type EnableVgwRoutePropagationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableVgwRoutePropagationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVgwRoutePropagationOutput) GoString() string { - return s.String() -} - -// Contains the parameters for EnableVolumeIO. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIORequest -type EnableVolumeIOInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `locationName:"volumeId" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableVolumeIOInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVolumeIOInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableVolumeIOInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableVolumeIOInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *EnableVolumeIOInput) SetDryRun(v bool) *EnableVolumeIOInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *EnableVolumeIOInput) SetVolumeId(v string) *EnableVolumeIOInput { - s.VolumeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIOOutput -type EnableVolumeIOOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s EnableVolumeIOOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVolumeIOOutput) GoString() string { - return s.String() -} - -// Contains the parameters for EnableVpcClassicLinkDnsSupport. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupportRequest -type EnableVpcClassicLinkDnsSupportInput struct { - _ struct{} `type:"structure"` - - // The ID of the VPC. - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkDnsSupportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkDnsSupportInput) GoString() string { - return s.String() -} - -// SetVpcId sets the VpcId field's value. -func (s *EnableVpcClassicLinkDnsSupportInput) SetVpcId(v string) *EnableVpcClassicLinkDnsSupportInput { - s.VpcId = &v - return s -} - -// Contains the output of EnableVpcClassicLinkDnsSupport. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupportResult -type EnableVpcClassicLinkDnsSupportOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkDnsSupportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkDnsSupportOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *EnableVpcClassicLinkDnsSupportOutput) SetReturn(v bool) *EnableVpcClassicLinkDnsSupportOutput { - s.Return = &v - return s -} - -// Contains the parameters for EnableVpcClassicLink. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkRequest -type EnableVpcClassicLinkInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableVpcClassicLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableVpcClassicLinkInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *EnableVpcClassicLinkInput) SetDryRun(v bool) *EnableVpcClassicLinkInput { - s.DryRun = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *EnableVpcClassicLinkInput) SetVpcId(v string) *EnableVpcClassicLinkInput { - s.VpcId = &v - return s -} - -// Contains the output of EnableVpcClassicLink. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkResult -type EnableVpcClassicLinkOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s EnableVpcClassicLinkOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableVpcClassicLinkOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *EnableVpcClassicLinkOutput) SetReturn(v bool) *EnableVpcClassicLinkOutput { - s.Return = &v - return s -} - -// Describes a Spot fleet event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EventInformation -type EventInformation struct { - _ struct{} `type:"structure"` - - // The description of the event. - EventDescription *string `locationName:"eventDescription" type:"string"` - - // The event. - // - // The following are the error events. - // - // * iamFleetRoleInvalid - The Spot fleet did not have the required permissions - // either to launch or terminate an instance. - // - // * launchSpecTemporarilyBlacklisted - The configuration is not valid and - // several attempts to launch instances have failed. For more information, - // see the description of the event. - // - // * spotFleetRequestConfigurationInvalid - The configuration is not valid. - // For more information, see the description of the event. - // - // * spotInstanceCountLimitExceeded - You've reached the limit on the number - // of Spot instances that you can launch. - // - // The following are the fleetRequestChange events. - // - // * active - The Spot fleet has been validated and Amazon EC2 is attempting - // to maintain the target number of running Spot instances. - // - // * cancelled - The Spot fleet is canceled and has no running Spot instances. - // The Spot fleet will be deleted two days after its instances were terminated. - // - // * cancelled_running - The Spot fleet is canceled and will not launch additional - // Spot instances, but its existing Spot instances continue to run until - // they are interrupted or terminated. - // - // * cancelled_terminating - The Spot fleet is canceled and its Spot instances - // are terminating. - // - // * expired - The Spot fleet request has expired. A subsequent event indicates - // that the instances were terminated, if the request was created with TerminateInstancesWithExpiration - // set. - // - // * modify_in_progress - A request to modify the Spot fleet request was - // accepted and is in progress. - // - // * modify_successful - The Spot fleet request was modified. - // - // * price_update - The bid price for a launch configuration was adjusted - // because it was too high. This change is permanent. - // - // * submitted - The Spot fleet request is being evaluated and Amazon EC2 - // is preparing to launch the target number of Spot instances. - // - // The following are the instanceChange events. - // - // * launched - A bid was fulfilled and a new instance was launched. - // - // * terminated - An instance was terminated by the user. - EventSubType *string `locationName:"eventSubType" type:"string"` - - // The ID of the instance. This information is available only for instanceChange - // events. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s EventInformation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EventInformation) GoString() string { - return s.String() -} - -// SetEventDescription sets the EventDescription field's value. -func (s *EventInformation) SetEventDescription(v string) *EventInformation { - s.EventDescription = &v - return s -} - -// SetEventSubType sets the EventSubType field's value. -func (s *EventInformation) SetEventSubType(v string) *EventInformation { - s.EventSubType = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *EventInformation) SetInstanceId(v string) *EventInformation { - s.InstanceId = &v - return s -} - -// Describes an instance export task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportTask -type ExportTask struct { - _ struct{} `type:"structure"` - - // A description of the resource being exported. - Description *string `locationName:"description" type:"string"` - - // The ID of the export task. - ExportTaskId *string `locationName:"exportTaskId" type:"string"` - - // Information about the export task. - ExportToS3Task *ExportToS3Task `locationName:"exportToS3" type:"structure"` - - // Information about the instance to export. - InstanceExportDetails *InstanceExportDetails `locationName:"instanceExport" type:"structure"` - - // The state of the export task. - State *string `locationName:"state" type:"string" enum:"ExportTaskState"` - - // The status message related to the export task. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s ExportTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportTask) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ExportTask) SetDescription(v string) *ExportTask { - s.Description = &v - return s -} - -// SetExportTaskId sets the ExportTaskId field's value. -func (s *ExportTask) SetExportTaskId(v string) *ExportTask { - s.ExportTaskId = &v - return s -} - -// SetExportToS3Task sets the ExportToS3Task field's value. -func (s *ExportTask) SetExportToS3Task(v *ExportToS3Task) *ExportTask { - s.ExportToS3Task = v - return s -} - -// SetInstanceExportDetails sets the InstanceExportDetails field's value. -func (s *ExportTask) SetInstanceExportDetails(v *InstanceExportDetails) *ExportTask { - s.InstanceExportDetails = v - return s -} - -// SetState sets the State field's value. -func (s *ExportTask) SetState(v string) *ExportTask { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ExportTask) SetStatusMessage(v string) *ExportTask { - s.StatusMessage = &v - return s -} - -// Describes the format and location for an instance export task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportToS3Task -type ExportToS3Task struct { - _ struct{} `type:"structure"` - - // The container format used to combine disk images with metadata (such as OVF). - // If absent, only the disk image is exported. - ContainerFormat *string `locationName:"containerFormat" type:"string" enum:"ContainerFormat"` - - // The format for the exported image. - DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` - - // The S3 bucket for the destination image. The destination bucket must exist - // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. - S3Bucket *string `locationName:"s3Bucket" type:"string"` - - // The encryption key for your S3 bucket. - S3Key *string `locationName:"s3Key" type:"string"` -} - -// String returns the string representation -func (s ExportToS3Task) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportToS3Task) GoString() string { - return s.String() -} - -// SetContainerFormat sets the ContainerFormat field's value. -func (s *ExportToS3Task) SetContainerFormat(v string) *ExportToS3Task { - s.ContainerFormat = &v - return s -} - -// SetDiskImageFormat sets the DiskImageFormat field's value. -func (s *ExportToS3Task) SetDiskImageFormat(v string) *ExportToS3Task { - s.DiskImageFormat = &v - return s -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *ExportToS3Task) SetS3Bucket(v string) *ExportToS3Task { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *ExportToS3Task) SetS3Key(v string) *ExportToS3Task { - s.S3Key = &v - return s -} - -// Describes an instance export task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportToS3TaskSpecification -type ExportToS3TaskSpecification struct { - _ struct{} `type:"structure"` - - // The container format used to combine disk images with metadata (such as OVF). - // If absent, only the disk image is exported. - ContainerFormat *string `locationName:"containerFormat" type:"string" enum:"ContainerFormat"` - - // The format for the exported image. - DiskImageFormat *string `locationName:"diskImageFormat" type:"string" enum:"DiskImageFormat"` - - // The S3 bucket for the destination image. The destination bucket must exist - // and grant WRITE and READ_ACP permissions to the AWS account vm-import-export@amazon.com. - S3Bucket *string `locationName:"s3Bucket" type:"string"` - - // The image is written to a single object in the S3 bucket at the S3 key s3prefix - // + exportTaskId + '.' + diskImageFormat. - S3Prefix *string `locationName:"s3Prefix" type:"string"` -} - -// String returns the string representation -func (s ExportToS3TaskSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportToS3TaskSpecification) GoString() string { - return s.String() -} - -// SetContainerFormat sets the ContainerFormat field's value. -func (s *ExportToS3TaskSpecification) SetContainerFormat(v string) *ExportToS3TaskSpecification { - s.ContainerFormat = &v - return s -} - -// SetDiskImageFormat sets the DiskImageFormat field's value. -func (s *ExportToS3TaskSpecification) SetDiskImageFormat(v string) *ExportToS3TaskSpecification { - s.DiskImageFormat = &v - return s -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *ExportToS3TaskSpecification) SetS3Bucket(v string) *ExportToS3TaskSpecification { - s.S3Bucket = &v - return s -} - -// SetS3Prefix sets the S3Prefix field's value. -func (s *ExportToS3TaskSpecification) SetS3Prefix(v string) *ExportToS3TaskSpecification { - s.S3Prefix = &v - return s -} - -// A filter name and value pair that is used to return a more specific list -// of results. Filters can be used to match a set of resources by various criteria, -// such as tags, attributes, or IDs. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Filter -type Filter struct { - _ struct{} `type:"structure"` - - // The name of the filter. Filter names are case-sensitive. - Name *string `type:"string"` - - // One or more filter values. Filter values are case-sensitive. - Values []*string `locationName:"Value" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s Filter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Filter) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Filter) SetName(v string) *Filter { - s.Name = &v - return s -} - -// SetValues sets the Values field's value. -func (s *Filter) SetValues(v []*string) *Filter { - s.Values = v - return s -} - -// Describes a flow log. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/FlowLog -type FlowLog struct { - _ struct{} `type:"structure"` - - // The date and time the flow log was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // Information about the error that occurred. Rate limited indicates that CloudWatch - // logs throttling has been applied for one or more network interfaces, or that - // you've reached the limit on the number of CloudWatch Logs log groups that - // you can create. Access error indicates that the IAM role associated with - // the flow log does not have sufficient permissions to publish to CloudWatch - // Logs. Unknown error indicates an internal error. - DeliverLogsErrorMessage *string `locationName:"deliverLogsErrorMessage" type:"string"` - - // The ARN of the IAM role that posts logs to CloudWatch Logs. - DeliverLogsPermissionArn *string `locationName:"deliverLogsPermissionArn" type:"string"` - - // The status of the logs delivery (SUCCESS | FAILED). - DeliverLogsStatus *string `locationName:"deliverLogsStatus" type:"string"` - - // The flow log ID. - FlowLogId *string `locationName:"flowLogId" type:"string"` - - // The status of the flow log (ACTIVE). - FlowLogStatus *string `locationName:"flowLogStatus" type:"string"` - - // The name of the flow log group. - LogGroupName *string `locationName:"logGroupName" type:"string"` - - // The ID of the resource on which the flow log was created. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of traffic captured for the flow log. - TrafficType *string `locationName:"trafficType" type:"string" enum:"TrafficType"` -} - -// String returns the string representation -func (s FlowLog) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FlowLog) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *FlowLog) SetCreationTime(v time.Time) *FlowLog { - s.CreationTime = &v - return s -} - -// SetDeliverLogsErrorMessage sets the DeliverLogsErrorMessage field's value. -func (s *FlowLog) SetDeliverLogsErrorMessage(v string) *FlowLog { - s.DeliverLogsErrorMessage = &v - return s -} - -// SetDeliverLogsPermissionArn sets the DeliverLogsPermissionArn field's value. -func (s *FlowLog) SetDeliverLogsPermissionArn(v string) *FlowLog { - s.DeliverLogsPermissionArn = &v - return s -} - -// SetDeliverLogsStatus sets the DeliverLogsStatus field's value. -func (s *FlowLog) SetDeliverLogsStatus(v string) *FlowLog { - s.DeliverLogsStatus = &v - return s -} - -// SetFlowLogId sets the FlowLogId field's value. -func (s *FlowLog) SetFlowLogId(v string) *FlowLog { - s.FlowLogId = &v - return s -} - -// SetFlowLogStatus sets the FlowLogStatus field's value. -func (s *FlowLog) SetFlowLogStatus(v string) *FlowLog { - s.FlowLogStatus = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *FlowLog) SetLogGroupName(v string) *FlowLog { - s.LogGroupName = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *FlowLog) SetResourceId(v string) *FlowLog { - s.ResourceId = &v - return s -} - -// SetTrafficType sets the TrafficType field's value. -func (s *FlowLog) SetTrafficType(v string) *FlowLog { - s.TrafficType = &v - return s -} - -// Contains the parameters for GetConsoleOutput. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutputRequest -type GetConsoleOutputInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetConsoleOutputInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleOutputInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConsoleOutputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConsoleOutputInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetConsoleOutputInput) SetDryRun(v bool) *GetConsoleOutputInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleOutputInput) SetInstanceId(v string) *GetConsoleOutputInput { - s.InstanceId = &v - return s -} - -// Contains the output of GetConsoleOutput. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutputResult -type GetConsoleOutputOutput struct { - _ struct{} `type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The console output, Base64-encoded. If using a command line tool, the tool - // decodes the output for you. - Output *string `locationName:"output" type:"string"` - - // The time the output was last updated. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s GetConsoleOutputOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleOutputOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleOutputOutput) SetInstanceId(v string) *GetConsoleOutputOutput { - s.InstanceId = &v - return s -} - -// SetOutput sets the Output field's value. -func (s *GetConsoleOutputOutput) SetOutput(v string) *GetConsoleOutputOutput { - s.Output = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *GetConsoleOutputOutput) SetTimestamp(v time.Time) *GetConsoleOutputOutput { - s.Timestamp = &v - return s -} - -// Contains the parameters for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshotRequest -type GetConsoleScreenshotInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // When set to true, acts as keystroke input and wakes up an instance that's - // in standby or "sleep" mode. - WakeUp *bool `type:"boolean"` -} - -// String returns the string representation -func (s GetConsoleScreenshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleScreenshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConsoleScreenshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConsoleScreenshotInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetConsoleScreenshotInput) SetDryRun(v bool) *GetConsoleScreenshotInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleScreenshotInput) SetInstanceId(v string) *GetConsoleScreenshotInput { - s.InstanceId = &v - return s -} - -// SetWakeUp sets the WakeUp field's value. -func (s *GetConsoleScreenshotInput) SetWakeUp(v bool) *GetConsoleScreenshotInput { - s.WakeUp = &v - return s -} - -// Contains the output of the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshotResult -type GetConsoleScreenshotOutput struct { - _ struct{} `type:"structure"` - - // The data that comprises the image. - ImageData *string `locationName:"imageData" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` -} - -// String returns the string representation -func (s GetConsoleScreenshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetConsoleScreenshotOutput) GoString() string { - return s.String() -} - -// SetImageData sets the ImageData field's value. -func (s *GetConsoleScreenshotOutput) SetImageData(v string) *GetConsoleScreenshotOutput { - s.ImageData = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetConsoleScreenshotOutput) SetInstanceId(v string) *GetConsoleScreenshotOutput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreviewRequest -type GetHostReservationPurchasePreviewInput struct { - _ struct{} `type:"structure"` - - // The ID/s of the Dedicated Host/s that the reservation will be associated - // with. - // - // HostIdSet is a required field - HostIdSet []*string `locationNameList:"item" type:"list" required:"true"` - - // The offering ID of the reservation. - // - // OfferingId is a required field - OfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetHostReservationPurchasePreviewInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostReservationPurchasePreviewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHostReservationPurchasePreviewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHostReservationPurchasePreviewInput"} - if s.HostIdSet == nil { - invalidParams.Add(request.NewErrParamRequired("HostIdSet")) - } - if s.OfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("OfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *GetHostReservationPurchasePreviewInput) SetHostIdSet(v []*string) *GetHostReservationPurchasePreviewInput { - s.HostIdSet = v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *GetHostReservationPurchasePreviewInput) SetOfferingId(v string) *GetHostReservationPurchasePreviewInput { - s.OfferingId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreviewResult -type GetHostReservationPurchasePreviewOutput struct { - _ struct{} `type:"structure"` - - // The currency in which the totalUpfrontPrice and totalHourlyPrice amounts - // are specified. At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The purchase information of the Dedicated Host Reservation and the Dedicated - // Hosts associated with it. - Purchase []*Purchase `locationName:"purchase" type:"list"` - - // The potential total hourly price of the reservation per hour. - TotalHourlyPrice *string `locationName:"totalHourlyPrice" type:"string"` - - // The potential total upfront price. This is billed immediately. - TotalUpfrontPrice *string `locationName:"totalUpfrontPrice" type:"string"` -} - -// String returns the string representation -func (s GetHostReservationPurchasePreviewOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostReservationPurchasePreviewOutput) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetCurrencyCode(v string) *GetHostReservationPurchasePreviewOutput { - s.CurrencyCode = &v - return s -} - -// SetPurchase sets the Purchase field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetPurchase(v []*Purchase) *GetHostReservationPurchasePreviewOutput { - s.Purchase = v - return s -} - -// SetTotalHourlyPrice sets the TotalHourlyPrice field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetTotalHourlyPrice(v string) *GetHostReservationPurchasePreviewOutput { - s.TotalHourlyPrice = &v - return s -} - -// SetTotalUpfrontPrice sets the TotalUpfrontPrice field's value. -func (s *GetHostReservationPurchasePreviewOutput) SetTotalUpfrontPrice(v string) *GetHostReservationPurchasePreviewOutput { - s.TotalUpfrontPrice = &v - return s -} - -// Contains the parameters for GetPasswordData. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordDataRequest -type GetPasswordDataInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the Windows instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPasswordDataInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPasswordDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPasswordDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPasswordDataInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetPasswordDataInput) SetDryRun(v bool) *GetPasswordDataInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetPasswordDataInput) SetInstanceId(v string) *GetPasswordDataInput { - s.InstanceId = &v - return s -} - -// Contains the output of GetPasswordData. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordDataResult -type GetPasswordDataOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Windows instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The password of the instance. - PasswordData *string `locationName:"passwordData" type:"string"` - - // The time the data was last updated. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s GetPasswordDataOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPasswordDataOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *GetPasswordDataOutput) SetInstanceId(v string) *GetPasswordDataOutput { - s.InstanceId = &v - return s -} - -// SetPasswordData sets the PasswordData field's value. -func (s *GetPasswordDataOutput) SetPasswordData(v string) *GetPasswordDataOutput { - s.PasswordData = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *GetPasswordDataOutput) SetTimestamp(v time.Time) *GetPasswordDataOutput { - s.Timestamp = &v - return s -} - -// Contains the parameters for GetReservedInstanceExchangeQuote. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuoteRequest -type GetReservedInstancesExchangeQuoteInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The IDs of the Convertible Reserved Instances to exchange. - // - // ReservedInstanceIds is a required field - ReservedInstanceIds []*string `locationName:"ReservedInstanceId" locationNameList:"ReservedInstanceId" type:"list" required:"true"` - - // The configuration requirements of the Convertible Reserved Instances to exchange - // for your current Convertible Reserved Instances. - TargetConfigurations []*TargetConfigurationRequest `locationName:"TargetConfiguration" locationNameList:"TargetConfigurationRequest" type:"list"` -} - -// String returns the string representation -func (s GetReservedInstancesExchangeQuoteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetReservedInstancesExchangeQuoteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReservedInstancesExchangeQuoteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReservedInstancesExchangeQuoteInput"} - if s.ReservedInstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstanceIds")) - } - if s.TargetConfigurations != nil { - for i, v := range s.TargetConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *GetReservedInstancesExchangeQuoteInput) SetDryRun(v bool) *GetReservedInstancesExchangeQuoteInput { - s.DryRun = &v - return s -} - -// SetReservedInstanceIds sets the ReservedInstanceIds field's value. -func (s *GetReservedInstancesExchangeQuoteInput) SetReservedInstanceIds(v []*string) *GetReservedInstancesExchangeQuoteInput { - s.ReservedInstanceIds = v - return s -} - -// SetTargetConfigurations sets the TargetConfigurations field's value. -func (s *GetReservedInstancesExchangeQuoteInput) SetTargetConfigurations(v []*TargetConfigurationRequest) *GetReservedInstancesExchangeQuoteInput { - s.TargetConfigurations = v - return s -} - -// Contains the output of GetReservedInstancesExchangeQuote. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuoteResult -type GetReservedInstancesExchangeQuoteOutput struct { - _ struct{} `type:"structure"` - - // The currency of the transaction. - CurrencyCode *string `locationName:"currencyCode" type:"string"` - - // If true, the exchange is valid. If false, the exchange cannot be completed. - IsValidExchange *bool `locationName:"isValidExchange" type:"boolean"` - - // The new end date of the reservation term. - OutputReservedInstancesWillExpireAt *time.Time `locationName:"outputReservedInstancesWillExpireAt" type:"timestamp" timestampFormat:"iso8601"` - - // The total true upfront charge for the exchange. - PaymentDue *string `locationName:"paymentDue" type:"string"` - - // The cost associated with the Reserved Instance. - ReservedInstanceValueRollup *ReservationValue `locationName:"reservedInstanceValueRollup" type:"structure"` - - // The configuration of your Convertible Reserved Instances. - ReservedInstanceValueSet []*ReservedInstanceReservationValue `locationName:"reservedInstanceValueSet" locationNameList:"item" type:"list"` - - // The cost associated with the Reserved Instance. - TargetConfigurationValueRollup *ReservationValue `locationName:"targetConfigurationValueRollup" type:"structure"` - - // The values of the target Convertible Reserved Instances. - TargetConfigurationValueSet []*TargetReservationValue `locationName:"targetConfigurationValueSet" locationNameList:"item" type:"list"` - - // Describes the reason why the exchange cannot be completed. - ValidationFailureReason *string `locationName:"validationFailureReason" type:"string"` -} - -// String returns the string representation -func (s GetReservedInstancesExchangeQuoteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetReservedInstancesExchangeQuoteOutput) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetCurrencyCode(v string) *GetReservedInstancesExchangeQuoteOutput { - s.CurrencyCode = &v - return s -} - -// SetIsValidExchange sets the IsValidExchange field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetIsValidExchange(v bool) *GetReservedInstancesExchangeQuoteOutput { - s.IsValidExchange = &v - return s -} - -// SetOutputReservedInstancesWillExpireAt sets the OutputReservedInstancesWillExpireAt field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetOutputReservedInstancesWillExpireAt(v time.Time) *GetReservedInstancesExchangeQuoteOutput { - s.OutputReservedInstancesWillExpireAt = &v - return s -} - -// SetPaymentDue sets the PaymentDue field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetPaymentDue(v string) *GetReservedInstancesExchangeQuoteOutput { - s.PaymentDue = &v - return s -} - -// SetReservedInstanceValueRollup sets the ReservedInstanceValueRollup field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetReservedInstanceValueRollup(v *ReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.ReservedInstanceValueRollup = v - return s -} - -// SetReservedInstanceValueSet sets the ReservedInstanceValueSet field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetReservedInstanceValueSet(v []*ReservedInstanceReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.ReservedInstanceValueSet = v - return s -} - -// SetTargetConfigurationValueRollup sets the TargetConfigurationValueRollup field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetTargetConfigurationValueRollup(v *ReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.TargetConfigurationValueRollup = v - return s -} - -// SetTargetConfigurationValueSet sets the TargetConfigurationValueSet field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetTargetConfigurationValueSet(v []*TargetReservationValue) *GetReservedInstancesExchangeQuoteOutput { - s.TargetConfigurationValueSet = v - return s -} - -// SetValidationFailureReason sets the ValidationFailureReason field's value. -func (s *GetReservedInstancesExchangeQuoteOutput) SetValidationFailureReason(v string) *GetReservedInstancesExchangeQuoteOutput { - s.ValidationFailureReason = &v - return s -} - -// Describes a security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GroupIdentifier -type GroupIdentifier struct { - _ struct{} `type:"structure"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` - - // The name of the security group. - GroupName *string `locationName:"groupName" type:"string"` -} - -// String returns the string representation -func (s GroupIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GroupIdentifier) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *GroupIdentifier) SetGroupId(v string) *GroupIdentifier { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier { - s.GroupName = &v - return s -} - -// Describes an event in the history of the Spot fleet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/HistoryRecord -type HistoryRecord struct { - _ struct{} `type:"structure"` - - // Information about the event. - // - // EventInformation is a required field - EventInformation *EventInformation `locationName:"eventInformation" type:"structure" required:"true"` - - // The event type. - // - // * error - Indicates an error with the Spot fleet request. - // - // * fleetRequestChange - Indicates a change in the status or configuration - // of the Spot fleet request. - // - // * instanceChange - Indicates that an instance was launched or terminated. - // - // EventType is a required field - EventType *string `locationName:"eventType" type:"string" required:"true" enum:"EventType"` - - // The date and time of the event, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // Timestamp is a required field - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s HistoryRecord) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HistoryRecord) GoString() string { - return s.String() -} - -// SetEventInformation sets the EventInformation field's value. -func (s *HistoryRecord) SetEventInformation(v *EventInformation) *HistoryRecord { - s.EventInformation = v - return s -} - -// SetEventType sets the EventType field's value. -func (s *HistoryRecord) SetEventType(v string) *HistoryRecord { - s.EventType = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *HistoryRecord) SetTimestamp(v time.Time) *HistoryRecord { - s.Timestamp = &v - return s -} - -// Describes the properties of the Dedicated Host. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Host -type Host struct { - _ struct{} `type:"structure"` - - // Whether auto-placement is on or off. - AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` - - // The Availability Zone of the Dedicated Host. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of new instances that can be launched onto the Dedicated Host. - AvailableCapacity *AvailableCapacity `locationName:"availableCapacity" type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `locationName:"clientToken" type:"string"` - - // The ID of the Dedicated Host. - HostId *string `locationName:"hostId" type:"string"` - - // The hardware specifications of the Dedicated Host. - HostProperties *HostProperties `locationName:"hostProperties" type:"structure"` - - // The reservation ID of the Dedicated Host. This returns a null response if - // the Dedicated Host doesn't have an associated reservation. - HostReservationId *string `locationName:"hostReservationId" type:"string"` - - // The IDs and instance type that are currently running on the Dedicated Host. - Instances []*HostInstance `locationName:"instances" locationNameList:"item" type:"list"` - - // The Dedicated Host's state. - State *string `locationName:"state" type:"string" enum:"AllocationState"` -} - -// String returns the string representation -func (s Host) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Host) GoString() string { - return s.String() -} - -// SetAutoPlacement sets the AutoPlacement field's value. -func (s *Host) SetAutoPlacement(v string) *Host { - s.AutoPlacement = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Host) SetAvailabilityZone(v string) *Host { - s.AvailabilityZone = &v - return s -} - -// SetAvailableCapacity sets the AvailableCapacity field's value. -func (s *Host) SetAvailableCapacity(v *AvailableCapacity) *Host { - s.AvailableCapacity = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *Host) SetClientToken(v string) *Host { - s.ClientToken = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *Host) SetHostId(v string) *Host { - s.HostId = &v - return s -} - -// SetHostProperties sets the HostProperties field's value. -func (s *Host) SetHostProperties(v *HostProperties) *Host { - s.HostProperties = v - return s -} - -// SetHostReservationId sets the HostReservationId field's value. -func (s *Host) SetHostReservationId(v string) *Host { - s.HostReservationId = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *Host) SetInstances(v []*HostInstance) *Host { - s.Instances = v - return s -} - -// SetState sets the State field's value. -func (s *Host) SetState(v string) *Host { - s.State = &v - return s -} - -// Describes an instance running on a Dedicated Host. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/HostInstance -type HostInstance struct { - _ struct{} `type:"structure"` - - // the IDs of instances that are running on the Dedicated Host. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance type size (for example, m3.medium) of the running instance. - InstanceType *string `locationName:"instanceType" type:"string"` -} - -// String returns the string representation -func (s HostInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostInstance) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *HostInstance) SetInstanceId(v string) *HostInstance { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *HostInstance) SetInstanceType(v string) *HostInstance { - s.InstanceType = &v - return s -} - -// Details about the Dedicated Host Reservation offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/HostOffering -type HostOffering struct { - _ struct{} `type:"structure"` - - // The currency of the offering. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the offering (in seconds). - Duration *int64 `locationName:"duration" type:"integer"` - - // The hourly price of the offering. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance family of the offering. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The ID of the offering. - OfferingId *string `locationName:"offeringId" type:"string"` - - // The available payment option. - PaymentOption *string `locationName:"paymentOption" type:"string" enum:"PaymentOption"` - - // The upfront price of the offering. Does not apply to No Upfront offerings. - UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` -} - -// String returns the string representation -func (s HostOffering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostOffering) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *HostOffering) SetCurrencyCode(v string) *HostOffering { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *HostOffering) SetDuration(v int64) *HostOffering { - s.Duration = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *HostOffering) SetHourlyPrice(v string) *HostOffering { - s.HourlyPrice = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *HostOffering) SetInstanceFamily(v string) *HostOffering { - s.InstanceFamily = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *HostOffering) SetOfferingId(v string) *HostOffering { - s.OfferingId = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *HostOffering) SetPaymentOption(v string) *HostOffering { - s.PaymentOption = &v - return s -} - -// SetUpfrontPrice sets the UpfrontPrice field's value. -func (s *HostOffering) SetUpfrontPrice(v string) *HostOffering { - s.UpfrontPrice = &v - return s -} - -// Describes properties of a Dedicated Host. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/HostProperties -type HostProperties struct { - _ struct{} `type:"structure"` - - // The number of cores on the Dedicated Host. - Cores *int64 `locationName:"cores" type:"integer"` - - // The instance type size that the Dedicated Host supports (for example, m3.medium). - InstanceType *string `locationName:"instanceType" type:"string"` - - // The number of sockets on the Dedicated Host. - Sockets *int64 `locationName:"sockets" type:"integer"` - - // The number of vCPUs on the Dedicated Host. - TotalVCpus *int64 `locationName:"totalVCpus" type:"integer"` -} - -// String returns the string representation -func (s HostProperties) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostProperties) GoString() string { - return s.String() -} - -// SetCores sets the Cores field's value. -func (s *HostProperties) SetCores(v int64) *HostProperties { - s.Cores = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *HostProperties) SetInstanceType(v string) *HostProperties { - s.InstanceType = &v - return s -} - -// SetSockets sets the Sockets field's value. -func (s *HostProperties) SetSockets(v int64) *HostProperties { - s.Sockets = &v - return s -} - -// SetTotalVCpus sets the TotalVCpus field's value. -func (s *HostProperties) SetTotalVCpus(v int64) *HostProperties { - s.TotalVCpus = &v - return s -} - -// Details about the Dedicated Host Reservation and associated Dedicated Hosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/HostReservation -type HostReservation struct { - _ struct{} `type:"structure"` - - // The number of Dedicated Hosts the reservation is associated with. - Count *int64 `locationName:"count" type:"integer"` - - // The currency in which the upfrontPrice and hourlyPrice amounts are specified. - // At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The length of the reservation's term, specified in seconds. Can be 31536000 - // (1 year) | 94608000 (3 years). - Duration *int64 `locationName:"duration" type:"integer"` - - // The date and time that the reservation ends. - End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"iso8601"` - - // The IDs of the Dedicated Hosts associated with the reservation. - HostIdSet []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` - - // The ID of the reservation that specifies the associated Dedicated Hosts. - HostReservationId *string `locationName:"hostReservationId" type:"string"` - - // The hourly price of the reservation. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance family of the Dedicated Host Reservation. The instance family - // on the Dedicated Host must be the same in order for it to benefit from the - // reservation. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The ID of the reservation. This remains the same regardless of which Dedicated - // Hosts are associated with it. - OfferingId *string `locationName:"offeringId" type:"string"` - - // The payment option selected for this reservation. - PaymentOption *string `locationName:"paymentOption" type:"string" enum:"PaymentOption"` - - // The date and time that the reservation started. - Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"` - - // The state of the reservation. - State *string `locationName:"state" type:"string" enum:"ReservationState"` - - // The upfront price of the reservation. - UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` -} - -// String returns the string representation -func (s HostReservation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostReservation) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *HostReservation) SetCount(v int64) *HostReservation { - s.Count = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *HostReservation) SetCurrencyCode(v string) *HostReservation { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *HostReservation) SetDuration(v int64) *HostReservation { - s.Duration = &v - return s -} - -// SetEnd sets the End field's value. -func (s *HostReservation) SetEnd(v time.Time) *HostReservation { - s.End = &v - return s -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *HostReservation) SetHostIdSet(v []*string) *HostReservation { - s.HostIdSet = v - return s -} - -// SetHostReservationId sets the HostReservationId field's value. -func (s *HostReservation) SetHostReservationId(v string) *HostReservation { - s.HostReservationId = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *HostReservation) SetHourlyPrice(v string) *HostReservation { - s.HourlyPrice = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *HostReservation) SetInstanceFamily(v string) *HostReservation { - s.InstanceFamily = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *HostReservation) SetOfferingId(v string) *HostReservation { - s.OfferingId = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *HostReservation) SetPaymentOption(v string) *HostReservation { - s.PaymentOption = &v - return s -} - -// SetStart sets the Start field's value. -func (s *HostReservation) SetStart(v time.Time) *HostReservation { - s.Start = &v - return s -} - -// SetState sets the State field's value. -func (s *HostReservation) SetState(v string) *HostReservation { - s.State = &v - return s -} - -// SetUpfrontPrice sets the UpfrontPrice field's value. -func (s *HostReservation) SetUpfrontPrice(v string) *HostReservation { - s.UpfrontPrice = &v - return s -} - -// Describes an IAM instance profile. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IamInstanceProfile -type IamInstanceProfile struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the instance profile. - Id *string `locationName:"id" type:"string"` -} - -// String returns the string representation -func (s IamInstanceProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IamInstanceProfile) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *IamInstanceProfile) SetArn(v string) *IamInstanceProfile { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *IamInstanceProfile) SetId(v string) *IamInstanceProfile { - s.Id = &v - return s -} - -// Describes an association between an IAM instance profile and an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IamInstanceProfileAssociation -type IamInstanceProfileAssociation struct { - _ struct{} `type:"structure"` - - // The ID of the association. - AssociationId *string `locationName:"associationId" type:"string"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The state of the association. - State *string `locationName:"state" type:"string" enum:"IamInstanceProfileAssociationState"` - - // The time the IAM instance profile was associated with the instance. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s IamInstanceProfileAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IamInstanceProfileAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *IamInstanceProfileAssociation) SetAssociationId(v string) *IamInstanceProfileAssociation { - s.AssociationId = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *IamInstanceProfileAssociation) SetIamInstanceProfile(v *IamInstanceProfile) *IamInstanceProfileAssociation { - s.IamInstanceProfile = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *IamInstanceProfileAssociation) SetInstanceId(v string) *IamInstanceProfileAssociation { - s.InstanceId = &v - return s -} - -// SetState sets the State field's value. -func (s *IamInstanceProfileAssociation) SetState(v string) *IamInstanceProfileAssociation { - s.State = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *IamInstanceProfileAssociation) SetTimestamp(v time.Time) *IamInstanceProfileAssociation { - s.Timestamp = &v - return s -} - -// Describes an IAM instance profile. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IamInstanceProfileSpecification -type IamInstanceProfileSpecification struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the instance profile. - Arn *string `locationName:"arn" type:"string"` - - // The name of the instance profile. - Name *string `locationName:"name" type:"string"` -} - -// String returns the string representation -func (s IamInstanceProfileSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IamInstanceProfileSpecification) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *IamInstanceProfileSpecification) SetArn(v string) *IamInstanceProfileSpecification { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *IamInstanceProfileSpecification) SetName(v string) *IamInstanceProfileSpecification { - s.Name = &v - return s -} - -// Describes the ICMP type and code. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IcmpTypeCode -type IcmpTypeCode struct { - _ struct{} `type:"structure"` - - // The ICMP code. A value of -1 means all codes for the specified ICMP type. - Code *int64 `locationName:"code" type:"integer"` - - // The ICMP type. A value of -1 means all types. - Type *int64 `locationName:"type" type:"integer"` -} - -// String returns the string representation -func (s IcmpTypeCode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IcmpTypeCode) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *IcmpTypeCode) SetCode(v int64) *IcmpTypeCode { - s.Code = &v - return s -} - -// SetType sets the Type field's value. -func (s *IcmpTypeCode) SetType(v int64) *IcmpTypeCode { - s.Type = &v - return s -} - -// Describes the ID format for a resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IdFormat -type IdFormat struct { - _ struct{} `type:"structure"` - - // The date in UTC at which you are permanently switched over to using longer - // IDs. If a deadline is not yet available for this resource type, this field - // is not returned. - Deadline *time.Time `locationName:"deadline" type:"timestamp" timestampFormat:"iso8601"` - - // The type of resource. - Resource *string `locationName:"resource" type:"string"` - - // Indicates whether longer IDs (17-character IDs) are enabled for the resource. - UseLongIds *bool `locationName:"useLongIds" type:"boolean"` -} - -// String returns the string representation -func (s IdFormat) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IdFormat) GoString() string { - return s.String() -} - -// SetDeadline sets the Deadline field's value. -func (s *IdFormat) SetDeadline(v time.Time) *IdFormat { - s.Deadline = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *IdFormat) SetResource(v string) *IdFormat { - s.Resource = &v - return s -} - -// SetUseLongIds sets the UseLongIds field's value. -func (s *IdFormat) SetUseLongIds(v bool) *IdFormat { - s.UseLongIds = &v - return s -} - -// Describes an image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Image -type Image struct { - _ struct{} `type:"structure"` - - // The architecture of the image. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // Any block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // The date and time the image was created. - CreationDate *string `locationName:"creationDate" type:"string"` - - // The description of the AMI that was provided during image creation. - Description *string `locationName:"description" type:"string"` - - // Specifies whether enhanced networking with ENA is enabled. - EnaSupport *bool `locationName:"enaSupport" type:"boolean"` - - // The hypervisor type of the image. - Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The location of the AMI. - ImageLocation *string `locationName:"imageLocation" type:"string"` - - // The AWS account alias (for example, amazon, self) or the AWS account ID of - // the AMI owner. - ImageOwnerAlias *string `locationName:"imageOwnerAlias" type:"string"` - - // The type of image. - ImageType *string `locationName:"imageType" type:"string" enum:"ImageTypeValues"` - - // The kernel associated with the image, if any. Only applicable for machine - // images. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the AMI that was provided during image creation. - Name *string `locationName:"name" type:"string"` - - // The AWS account ID of the image owner. - OwnerId *string `locationName:"imageOwnerId" type:"string"` - - // The value is Windows for Windows AMIs; otherwise blank. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` - - // Any product codes associated with the AMI. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // Indicates whether the image has public launch permissions. The value is true - // if this image has public launch permissions or false if it has only implicit - // and explicit launch permissions. - Public *bool `locationName:"isPublic" type:"boolean"` - - // The RAM disk associated with the image, if any. Only applicable for machine - // images. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // The device name of the root device (for example, /dev/sda1 or /dev/xvda). - RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - - // The type of root device used by the AMI. The AMI can use an EBS volume or - // an instance store volume. - RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` - - // Specifies whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` - - // The current state of the AMI. If the state is available, the image is successfully - // registered and can be used to launch an instance. - State *string `locationName:"imageState" type:"string" enum:"ImageState"` - - // The reason for the state change. - StateReason *StateReason `locationName:"stateReason" type:"structure"` - - // Any tags assigned to the image. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of virtualization of the AMI. - VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` -} - -// String returns the string representation -func (s Image) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Image) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *Image) SetArchitecture(v string) *Image { - s.Architecture = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *Image) SetBlockDeviceMappings(v []*BlockDeviceMapping) *Image { - s.BlockDeviceMappings = v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *Image) SetCreationDate(v string) *Image { - s.CreationDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Image) SetDescription(v string) *Image { - s.Description = &v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *Image) SetEnaSupport(v bool) *Image { - s.EnaSupport = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *Image) SetHypervisor(v string) *Image { - s.Hypervisor = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *Image) SetImageId(v string) *Image { - s.ImageId = &v - return s -} - -// SetImageLocation sets the ImageLocation field's value. -func (s *Image) SetImageLocation(v string) *Image { - s.ImageLocation = &v - return s -} - -// SetImageOwnerAlias sets the ImageOwnerAlias field's value. -func (s *Image) SetImageOwnerAlias(v string) *Image { - s.ImageOwnerAlias = &v - return s -} - -// SetImageType sets the ImageType field's value. -func (s *Image) SetImageType(v string) *Image { - s.ImageType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *Image) SetKernelId(v string) *Image { - s.KernelId = &v - return s -} - -// SetName sets the Name field's value. -func (s *Image) SetName(v string) *Image { - s.Name = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *Image) SetOwnerId(v string) *Image { - s.OwnerId = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Image) SetPlatform(v string) *Image { - s.Platform = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *Image) SetProductCodes(v []*ProductCode) *Image { - s.ProductCodes = v - return s -} - -// SetPublic sets the Public field's value. -func (s *Image) SetPublic(v bool) *Image { - s.Public = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *Image) SetRamdiskId(v string) *Image { - s.RamdiskId = &v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *Image) SetRootDeviceName(v string) *Image { - s.RootDeviceName = &v - return s -} - -// SetRootDeviceType sets the RootDeviceType field's value. -func (s *Image) SetRootDeviceType(v string) *Image { - s.RootDeviceType = &v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *Image) SetSriovNetSupport(v string) *Image { - s.SriovNetSupport = &v - return s -} - -// SetState sets the State field's value. -func (s *Image) SetState(v string) *Image { - s.State = &v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *Image) SetStateReason(v *StateReason) *Image { - s.StateReason = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Image) SetTags(v []*Tag) *Image { - s.Tags = v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *Image) SetVirtualizationType(v string) *Image { - s.VirtualizationType = &v - return s -} - -// Describes the disk container object for an import image task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImageDiskContainer -type ImageDiskContainer struct { - _ struct{} `type:"structure"` - - // The description of the disk image. - Description *string `type:"string"` - - // The block device mapping for the disk. - DeviceName *string `type:"string"` - - // The format of the disk image being imported. - // - // Valid values: RAW | VHD | VMDK | OVA - Format *string `type:"string"` - - // The ID of the EBS snapshot to be used for importing the snapshot. - SnapshotId *string `type:"string"` - - // The URL to the Amazon S3-based disk image being imported. The URL can either - // be a https URL (https://..) or an Amazon S3 URL (s3://..) - Url *string `type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucket `type:"structure"` -} - -// String returns the string representation -func (s ImageDiskContainer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImageDiskContainer) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImageDiskContainer) SetDescription(v string) *ImageDiskContainer { - s.Description = &v - return s -} - -// SetDeviceName sets the DeviceName field's value. -func (s *ImageDiskContainer) SetDeviceName(v string) *ImageDiskContainer { - s.DeviceName = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *ImageDiskContainer) SetFormat(v string) *ImageDiskContainer { - s.Format = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ImageDiskContainer) SetSnapshotId(v string) *ImageDiskContainer { - s.SnapshotId = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *ImageDiskContainer) SetUrl(v string) *ImageDiskContainer { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *ImageDiskContainer) SetUserBucket(v *UserBucket) *ImageDiskContainer { - s.UserBucket = v - return s -} - -// Contains the parameters for ImportImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImageRequest -type ImportImageInput struct { - _ struct{} `type:"structure"` - - // The architecture of the virtual machine. - // - // Valid values: i386 | x86_64 - Architecture *string `type:"string"` - - // The client-specific data. - ClientData *ClientData `type:"structure"` - - // The token to enable idempotency for VM import requests. - ClientToken *string `type:"string"` - - // A description string for the import image task. - Description *string `type:"string"` - - // Information about the disk containers. - DiskContainers []*ImageDiskContainer `locationName:"DiskContainer" locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The target hypervisor platform. - // - // Valid values: xen - Hypervisor *string `type:"string"` - - // The license type to be used for the Amazon Machine Image (AMI) after importing. - // - // Note: You may only use BYOL if you have existing licenses with rights to - // use these licenses in a third party cloud like AWS. For more information, - // see Prerequisites (http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#prerequisites-image) - // in the VM Import/Export User Guide. - // - // Valid values: AWS | BYOL - LicenseType *string `type:"string"` - - // The operating system of the virtual machine. - // - // Valid values: Windows | Linux - Platform *string `type:"string"` - - // The name of the role to use when not using the default role, 'vmimport'. - RoleName *string `type:"string"` -} - -// String returns the string representation -func (s ImportImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageInput) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportImageInput) SetArchitecture(v string) *ImportImageInput { - s.Architecture = &v - return s -} - -// SetClientData sets the ClientData field's value. -func (s *ImportImageInput) SetClientData(v *ClientData) *ImportImageInput { - s.ClientData = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ImportImageInput) SetClientToken(v string) *ImportImageInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportImageInput) SetDescription(v string) *ImportImageInput { - s.Description = &v - return s -} - -// SetDiskContainers sets the DiskContainers field's value. -func (s *ImportImageInput) SetDiskContainers(v []*ImageDiskContainer) *ImportImageInput { - s.DiskContainers = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportImageInput) SetDryRun(v bool) *ImportImageInput { - s.DryRun = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *ImportImageInput) SetHypervisor(v string) *ImportImageInput { - s.Hypervisor = &v - return s -} - -// SetLicenseType sets the LicenseType field's value. -func (s *ImportImageInput) SetLicenseType(v string) *ImportImageInput { - s.LicenseType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportImageInput) SetPlatform(v string) *ImportImageInput { - s.Platform = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *ImportImageInput) SetRoleName(v string) *ImportImageInput { - s.RoleName = &v - return s -} - -// Contains the output for ImportImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImageResult -type ImportImageOutput struct { - _ struct{} `type:"structure"` - - // The architecture of the virtual machine. - Architecture *string `locationName:"architecture" type:"string"` - - // A description of the import task. - Description *string `locationName:"description" type:"string"` - - // The target hypervisor of the import task. - Hypervisor *string `locationName:"hypervisor" type:"string"` - - // The ID of the Amazon Machine Image (AMI) created by the import task. - ImageId *string `locationName:"imageId" type:"string"` - - // The task ID of the import image task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // The license type of the virtual machine. - LicenseType *string `locationName:"licenseType" type:"string"` - - // The operating system of the virtual machine. - Platform *string `locationName:"platform" type:"string"` - - // The progress of the task. - Progress *string `locationName:"progress" type:"string"` - - // Information about the snapshots. - SnapshotDetails []*SnapshotDetail `locationName:"snapshotDetailSet" locationNameList:"item" type:"list"` - - // A brief status of the task. - Status *string `locationName:"status" type:"string"` - - // A detailed status message of the import task. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s ImportImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageOutput) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportImageOutput) SetArchitecture(v string) *ImportImageOutput { - s.Architecture = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportImageOutput) SetDescription(v string) *ImportImageOutput { - s.Description = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *ImportImageOutput) SetHypervisor(v string) *ImportImageOutput { - s.Hypervisor = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ImportImageOutput) SetImageId(v string) *ImportImageOutput { - s.ImageId = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportImageOutput) SetImportTaskId(v string) *ImportImageOutput { - s.ImportTaskId = &v - return s -} - -// SetLicenseType sets the LicenseType field's value. -func (s *ImportImageOutput) SetLicenseType(v string) *ImportImageOutput { - s.LicenseType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportImageOutput) SetPlatform(v string) *ImportImageOutput { - s.Platform = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *ImportImageOutput) SetProgress(v string) *ImportImageOutput { - s.Progress = &v - return s -} - -// SetSnapshotDetails sets the SnapshotDetails field's value. -func (s *ImportImageOutput) SetSnapshotDetails(v []*SnapshotDetail) *ImportImageOutput { - s.SnapshotDetails = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportImageOutput) SetStatus(v string) *ImportImageOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportImageOutput) SetStatusMessage(v string) *ImportImageOutput { - s.StatusMessage = &v - return s -} - -// Describes an import image task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImageTask -type ImportImageTask struct { - _ struct{} `type:"structure"` - - // The architecture of the virtual machine. - // - // Valid values: i386 | x86_64 - Architecture *string `locationName:"architecture" type:"string"` - - // A description of the import task. - Description *string `locationName:"description" type:"string"` - - // The target hypervisor for the import task. - // - // Valid values: xen - Hypervisor *string `locationName:"hypervisor" type:"string"` - - // The ID of the Amazon Machine Image (AMI) of the imported virtual machine. - ImageId *string `locationName:"imageId" type:"string"` - - // The ID of the import image task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // The license type of the virtual machine. - LicenseType *string `locationName:"licenseType" type:"string"` - - // The description string for the import image task. - Platform *string `locationName:"platform" type:"string"` - - // The percentage of progress of the import image task. - Progress *string `locationName:"progress" type:"string"` - - // Information about the snapshots. - SnapshotDetails []*SnapshotDetail `locationName:"snapshotDetailSet" locationNameList:"item" type:"list"` - - // A brief status for the import image task. - Status *string `locationName:"status" type:"string"` - - // A descriptive status message for the import image task. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s ImportImageTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageTask) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportImageTask) SetArchitecture(v string) *ImportImageTask { - s.Architecture = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportImageTask) SetDescription(v string) *ImportImageTask { - s.Description = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *ImportImageTask) SetHypervisor(v string) *ImportImageTask { - s.Hypervisor = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ImportImageTask) SetImageId(v string) *ImportImageTask { - s.ImageId = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportImageTask) SetImportTaskId(v string) *ImportImageTask { - s.ImportTaskId = &v - return s -} - -// SetLicenseType sets the LicenseType field's value. -func (s *ImportImageTask) SetLicenseType(v string) *ImportImageTask { - s.LicenseType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportImageTask) SetPlatform(v string) *ImportImageTask { - s.Platform = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *ImportImageTask) SetProgress(v string) *ImportImageTask { - s.Progress = &v - return s -} - -// SetSnapshotDetails sets the SnapshotDetails field's value. -func (s *ImportImageTask) SetSnapshotDetails(v []*SnapshotDetail) *ImportImageTask { - s.SnapshotDetails = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportImageTask) SetStatus(v string) *ImportImageTask { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportImageTask) SetStatusMessage(v string) *ImportImageTask { - s.StatusMessage = &v - return s -} - -// Contains the parameters for ImportInstance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstanceRequest -type ImportInstanceInput struct { - _ struct{} `type:"structure"` - - // A description for the instance being imported. - Description *string `locationName:"description" type:"string"` - - // The disk image. - DiskImages []*DiskImage `locationName:"diskImage" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The launch specification. - LaunchSpecification *ImportInstanceLaunchSpecification `locationName:"launchSpecification" type:"structure"` - - // The instance operating system. - // - // Platform is a required field - Platform *string `locationName:"platform" type:"string" required:"true" enum:"PlatformValues"` -} - -// String returns the string representation -func (s ImportInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportInstanceInput"} - if s.Platform == nil { - invalidParams.Add(request.NewErrParamRequired("Platform")) - } - if s.DiskImages != nil { - for i, v := range s.DiskImages { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DiskImages", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *ImportInstanceInput) SetDescription(v string) *ImportInstanceInput { - s.Description = &v - return s -} - -// SetDiskImages sets the DiskImages field's value. -func (s *ImportInstanceInput) SetDiskImages(v []*DiskImage) *ImportInstanceInput { - s.DiskImages = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportInstanceInput) SetDryRun(v bool) *ImportInstanceInput { - s.DryRun = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *ImportInstanceInput) SetLaunchSpecification(v *ImportInstanceLaunchSpecification) *ImportInstanceInput { - s.LaunchSpecification = v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportInstanceInput) SetPlatform(v string) *ImportInstanceInput { - s.Platform = &v - return s -} - -// Describes the launch specification for VM import. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstanceLaunchSpecification -type ImportInstanceLaunchSpecification struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `locationName:"additionalInfo" type:"string"` - - // The architecture of the instance. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // One or more security group IDs. - GroupIds []*string `locationName:"GroupId" locationNameList:"SecurityGroupId" type:"list"` - - // One or more security group names. - GroupNames []*string `locationName:"GroupName" locationNameList:"SecurityGroup" type:"list"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"` - - // The instance type. For more information about the instance types that you - // can import, see Instance Types (http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#vmimport-instance-types) - // in the VM Import/Export User Guide. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // Indicates whether monitoring is enabled. - Monitoring *bool `locationName:"monitoring" type:"boolean"` - - // The placement information for the instance. - Placement *Placement `locationName:"placement" type:"structure"` - - // [EC2-VPC] An available IP address from the IP address range of the subnet. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // [EC2-VPC] The ID of the subnet in which to launch the instance. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The user data to make available to the instance. If you are using an AWS - // SDK or command line tool, Base64-encoding is performed for you, and you can - // load the text from a file. Otherwise, you must provide Base64-encoded text. - UserData *UserData `locationName:"userData" type:"structure"` -} - -// String returns the string representation -func (s ImportInstanceLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceLaunchSpecification) GoString() string { - return s.String() -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *ImportInstanceLaunchSpecification) SetAdditionalInfo(v string) *ImportInstanceLaunchSpecification { - s.AdditionalInfo = &v - return s -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportInstanceLaunchSpecification) SetArchitecture(v string) *ImportInstanceLaunchSpecification { - s.Architecture = &v - return s -} - -// SetGroupIds sets the GroupIds field's value. -func (s *ImportInstanceLaunchSpecification) SetGroupIds(v []*string) *ImportInstanceLaunchSpecification { - s.GroupIds = v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *ImportInstanceLaunchSpecification) SetGroupNames(v []*string) *ImportInstanceLaunchSpecification { - s.GroupNames = v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *ImportInstanceLaunchSpecification) SetInstanceInitiatedShutdownBehavior(v string) *ImportInstanceLaunchSpecification { - s.InstanceInitiatedShutdownBehavior = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ImportInstanceLaunchSpecification) SetInstanceType(v string) *ImportInstanceLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *ImportInstanceLaunchSpecification) SetMonitoring(v bool) *ImportInstanceLaunchSpecification { - s.Monitoring = &v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *ImportInstanceLaunchSpecification) SetPlacement(v *Placement) *ImportInstanceLaunchSpecification { - s.Placement = v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *ImportInstanceLaunchSpecification) SetPrivateIpAddress(v string) *ImportInstanceLaunchSpecification { - s.PrivateIpAddress = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ImportInstanceLaunchSpecification) SetSubnetId(v string) *ImportInstanceLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ImportInstanceLaunchSpecification) SetUserData(v *UserData) *ImportInstanceLaunchSpecification { - s.UserData = v - return s -} - -// Contains the output for ImportInstance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstanceResult -type ImportInstanceOutput struct { - _ struct{} `type:"structure"` - - // Information about the conversion task. - ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` -} - -// String returns the string representation -func (s ImportInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceOutput) GoString() string { - return s.String() -} - -// SetConversionTask sets the ConversionTask field's value. -func (s *ImportInstanceOutput) SetConversionTask(v *ConversionTask) *ImportInstanceOutput { - s.ConversionTask = v - return s -} - -// Describes an import instance task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstanceTaskDetails -type ImportInstanceTaskDetails struct { - _ struct{} `type:"structure"` - - // A description of the task. - Description *string `locationName:"description" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance operating system. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` - - // One or more volumes. - // - // Volumes is a required field - Volumes []*ImportInstanceVolumeDetailItem `locationName:"volumes" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ImportInstanceTaskDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceTaskDetails) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportInstanceTaskDetails) SetDescription(v string) *ImportInstanceTaskDetails { - s.Description = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ImportInstanceTaskDetails) SetInstanceId(v string) *ImportInstanceTaskDetails { - s.InstanceId = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportInstanceTaskDetails) SetPlatform(v string) *ImportInstanceTaskDetails { - s.Platform = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *ImportInstanceTaskDetails) SetVolumes(v []*ImportInstanceVolumeDetailItem) *ImportInstanceTaskDetails { - s.Volumes = v - return s -} - -// Describes an import volume task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstanceVolumeDetailItem -type ImportInstanceVolumeDetailItem struct { - _ struct{} `type:"structure"` - - // The Availability Zone where the resulting instance will reside. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // The number of bytes converted so far. - // - // BytesConverted is a required field - BytesConverted *int64 `locationName:"bytesConverted" type:"long" required:"true"` - - // A description of the task. - Description *string `locationName:"description" type:"string"` - - // The image. - // - // Image is a required field - Image *DiskImageDescription `locationName:"image" type:"structure" required:"true"` - - // The status of the import of this particular disk image. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true"` - - // The status information or errors related to the disk image. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The volume. - // - // Volume is a required field - Volume *DiskImageVolumeDescription `locationName:"volume" type:"structure" required:"true"` -} - -// String returns the string representation -func (s ImportInstanceVolumeDetailItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportInstanceVolumeDetailItem) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ImportInstanceVolumeDetailItem) SetAvailabilityZone(v string) *ImportInstanceVolumeDetailItem { - s.AvailabilityZone = &v - return s -} - -// SetBytesConverted sets the BytesConverted field's value. -func (s *ImportInstanceVolumeDetailItem) SetBytesConverted(v int64) *ImportInstanceVolumeDetailItem { - s.BytesConverted = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportInstanceVolumeDetailItem) SetDescription(v string) *ImportInstanceVolumeDetailItem { - s.Description = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ImportInstanceVolumeDetailItem) SetImage(v *DiskImageDescription) *ImportInstanceVolumeDetailItem { - s.Image = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportInstanceVolumeDetailItem) SetStatus(v string) *ImportInstanceVolumeDetailItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportInstanceVolumeDetailItem) SetStatusMessage(v string) *ImportInstanceVolumeDetailItem { - s.StatusMessage = &v - return s -} - -// SetVolume sets the Volume field's value. -func (s *ImportInstanceVolumeDetailItem) SetVolume(v *DiskImageVolumeDescription) *ImportInstanceVolumeDetailItem { - s.Volume = v - return s -} - -// Contains the parameters for ImportKeyPair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPairRequest -type ImportKeyPairInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // A unique name for the key pair. - // - // KeyName is a required field - KeyName *string `locationName:"keyName" type:"string" required:"true"` - - // The public key. For API calls, the text must be base64-encoded. For command - // line tools, base64 encoding is performed for you. - // - // PublicKeyMaterial is automatically base64 encoded/decoded by the SDK. - // - // PublicKeyMaterial is a required field - PublicKeyMaterial []byte `locationName:"publicKeyMaterial" type:"blob" required:"true"` -} - -// String returns the string representation -func (s ImportKeyPairInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyPairInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportKeyPairInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportKeyPairInput"} - if s.KeyName == nil { - invalidParams.Add(request.NewErrParamRequired("KeyName")) - } - if s.PublicKeyMaterial == nil { - invalidParams.Add(request.NewErrParamRequired("PublicKeyMaterial")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportKeyPairInput) SetDryRun(v bool) *ImportKeyPairInput { - s.DryRun = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *ImportKeyPairInput) SetKeyName(v string) *ImportKeyPairInput { - s.KeyName = &v - return s -} - -// SetPublicKeyMaterial sets the PublicKeyMaterial field's value. -func (s *ImportKeyPairInput) SetPublicKeyMaterial(v []byte) *ImportKeyPairInput { - s.PublicKeyMaterial = v - return s -} - -// Contains the output of ImportKeyPair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPairResult -type ImportKeyPairOutput struct { - _ struct{} `type:"structure"` - - // The MD5 public key fingerprint as specified in section 4 of RFC 4716. - KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` - - // The key pair name you provided. - KeyName *string `locationName:"keyName" type:"string"` -} - -// String returns the string representation -func (s ImportKeyPairOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyPairOutput) GoString() string { - return s.String() -} - -// SetKeyFingerprint sets the KeyFingerprint field's value. -func (s *ImportKeyPairOutput) SetKeyFingerprint(v string) *ImportKeyPairOutput { - s.KeyFingerprint = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *ImportKeyPairOutput) SetKeyName(v string) *ImportKeyPairOutput { - s.KeyName = &v - return s -} - -// Contains the parameters for ImportSnapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshotRequest -type ImportSnapshotInput struct { - _ struct{} `type:"structure"` - - // The client-specific data. - ClientData *ClientData `type:"structure"` - - // Token to enable idempotency for VM import requests. - ClientToken *string `type:"string"` - - // The description string for the import snapshot task. - Description *string `type:"string"` - - // Information about the disk container. - DiskContainer *SnapshotDiskContainer `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The name of the role to use when not using the default role, 'vmimport'. - RoleName *string `type:"string"` -} - -// String returns the string representation -func (s ImportSnapshotInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportSnapshotInput) GoString() string { - return s.String() -} - -// SetClientData sets the ClientData field's value. -func (s *ImportSnapshotInput) SetClientData(v *ClientData) *ImportSnapshotInput { - s.ClientData = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ImportSnapshotInput) SetClientToken(v string) *ImportSnapshotInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportSnapshotInput) SetDescription(v string) *ImportSnapshotInput { - s.Description = &v - return s -} - -// SetDiskContainer sets the DiskContainer field's value. -func (s *ImportSnapshotInput) SetDiskContainer(v *SnapshotDiskContainer) *ImportSnapshotInput { - s.DiskContainer = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportSnapshotInput) SetDryRun(v bool) *ImportSnapshotInput { - s.DryRun = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *ImportSnapshotInput) SetRoleName(v string) *ImportSnapshotInput { - s.RoleName = &v - return s -} - -// Contains the output for ImportSnapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshotResult -type ImportSnapshotOutput struct { - _ struct{} `type:"structure"` - - // A description of the import snapshot task. - Description *string `locationName:"description" type:"string"` - - // The ID of the import snapshot task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // Information about the import snapshot task. - SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` -} - -// String returns the string representation -func (s ImportSnapshotOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportSnapshotOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportSnapshotOutput) SetDescription(v string) *ImportSnapshotOutput { - s.Description = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportSnapshotOutput) SetImportTaskId(v string) *ImportSnapshotOutput { - s.ImportTaskId = &v - return s -} - -// SetSnapshotTaskDetail sets the SnapshotTaskDetail field's value. -func (s *ImportSnapshotOutput) SetSnapshotTaskDetail(v *SnapshotTaskDetail) *ImportSnapshotOutput { - s.SnapshotTaskDetail = v - return s -} - -// Describes an import snapshot task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshotTask -type ImportSnapshotTask struct { - _ struct{} `type:"structure"` - - // A description of the import snapshot task. - Description *string `locationName:"description" type:"string"` - - // The ID of the import snapshot task. - ImportTaskId *string `locationName:"importTaskId" type:"string"` - - // Describes an import snapshot task. - SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` -} - -// String returns the string representation -func (s ImportSnapshotTask) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportSnapshotTask) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportSnapshotTask) SetDescription(v string) *ImportSnapshotTask { - s.Description = &v - return s -} - -// SetImportTaskId sets the ImportTaskId field's value. -func (s *ImportSnapshotTask) SetImportTaskId(v string) *ImportSnapshotTask { - s.ImportTaskId = &v - return s -} - -// SetSnapshotTaskDetail sets the SnapshotTaskDetail field's value. -func (s *ImportSnapshotTask) SetSnapshotTaskDetail(v *SnapshotTaskDetail) *ImportSnapshotTask { - s.SnapshotTaskDetail = v - return s -} - -// Contains the parameters for ImportVolume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolumeRequest -type ImportVolumeInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone for the resulting EBS volume. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // A description of the volume. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The disk image. - // - // Image is a required field - Image *DiskImageDetail `locationName:"image" type:"structure" required:"true"` - - // The volume size. - // - // Volume is a required field - Volume *VolumeDetail `locationName:"volume" type:"structure" required:"true"` -} - -// String returns the string representation -func (s ImportVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportVolumeInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) - } - if s.Image == nil { - invalidParams.Add(request.NewErrParamRequired("Image")) - } - if s.Volume == nil { - invalidParams.Add(request.NewErrParamRequired("Volume")) - } - if s.Image != nil { - if err := s.Image.Validate(); err != nil { - invalidParams.AddNested("Image", err.(request.ErrInvalidParams)) - } - } - if s.Volume != nil { - if err := s.Volume.Validate(); err != nil { - invalidParams.AddNested("Volume", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ImportVolumeInput) SetAvailabilityZone(v string) *ImportVolumeInput { - s.AvailabilityZone = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportVolumeInput) SetDescription(v string) *ImportVolumeInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ImportVolumeInput) SetDryRun(v bool) *ImportVolumeInput { - s.DryRun = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ImportVolumeInput) SetImage(v *DiskImageDetail) *ImportVolumeInput { - s.Image = v - return s -} - -// SetVolume sets the Volume field's value. -func (s *ImportVolumeInput) SetVolume(v *VolumeDetail) *ImportVolumeInput { - s.Volume = v - return s -} - -// Contains the output for ImportVolume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolumeResult -type ImportVolumeOutput struct { - _ struct{} `type:"structure"` - - // Information about the conversion task. - ConversionTask *ConversionTask `locationName:"conversionTask" type:"structure"` -} - -// String returns the string representation -func (s ImportVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportVolumeOutput) GoString() string { - return s.String() -} - -// SetConversionTask sets the ConversionTask field's value. -func (s *ImportVolumeOutput) SetConversionTask(v *ConversionTask) *ImportVolumeOutput { - s.ConversionTask = v - return s -} - -// Describes an import volume task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolumeTaskDetails -type ImportVolumeTaskDetails struct { - _ struct{} `type:"structure"` - - // The Availability Zone where the resulting volume will reside. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` - - // The number of bytes converted so far. - // - // BytesConverted is a required field - BytesConverted *int64 `locationName:"bytesConverted" type:"long" required:"true"` - - // The description you provided when starting the import volume task. - Description *string `locationName:"description" type:"string"` - - // The image. - // - // Image is a required field - Image *DiskImageDescription `locationName:"image" type:"structure" required:"true"` - - // The volume. - // - // Volume is a required field - Volume *DiskImageVolumeDescription `locationName:"volume" type:"structure" required:"true"` -} - -// String returns the string representation -func (s ImportVolumeTaskDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportVolumeTaskDetails) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ImportVolumeTaskDetails) SetAvailabilityZone(v string) *ImportVolumeTaskDetails { - s.AvailabilityZone = &v - return s -} - -// SetBytesConverted sets the BytesConverted field's value. -func (s *ImportVolumeTaskDetails) SetBytesConverted(v int64) *ImportVolumeTaskDetails { - s.BytesConverted = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportVolumeTaskDetails) SetDescription(v string) *ImportVolumeTaskDetails { - s.Description = &v - return s -} - -// SetImage sets the Image field's value. -func (s *ImportVolumeTaskDetails) SetImage(v *DiskImageDescription) *ImportVolumeTaskDetails { - s.Image = v - return s -} - -// SetVolume sets the Volume field's value. -func (s *ImportVolumeTaskDetails) SetVolume(v *DiskImageVolumeDescription) *ImportVolumeTaskDetails { - s.Volume = v - return s -} - -// Describes an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Instance -type Instance struct { - _ struct{} `type:"structure"` - - // The AMI launch index, which can be used to find this instance in the launch - // group. - AmiLaunchIndex *int64 `locationName:"amiLaunchIndex" type:"integer"` - - // The architecture of the image. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // Any block device mapping entries for the instance. - BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // The idempotency token you provided when you launched the instance, if applicable. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // Specifies whether enhanced networking with ENA is enabled. - EnaSupport *bool `locationName:"enaSupport" type:"boolean"` - - // The hypervisor type of the instance. - Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"` - - // The IAM instance profile associated with the instance, if applicable. - IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI used to launch the instance. - ImageId *string `locationName:"imageId" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // Indicates whether this is a Spot instance or a Scheduled Instance. - InstanceLifecycle *string `locationName:"instanceLifecycle" type:"string" enum:"InstanceLifecycleType"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The kernel associated with this instance, if applicable. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair, if this instance was launched with an associated - // key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // The time the instance was launched. - LaunchTime *time.Time `locationName:"launchTime" type:"timestamp" timestampFormat:"iso8601"` - - // The monitoring for the instance. - Monitoring *Monitoring `locationName:"monitoring" type:"structure"` - - // [EC2-VPC] One or more network interfaces for the instance. - NetworkInterfaces []*InstanceNetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - - // The location where the instance launched, if applicable. - Placement *Placement `locationName:"placement" type:"structure"` - - // The value is Windows for Windows instances; otherwise blank. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` - - // (IPv4 only) The private DNS hostname name assigned to the instance. This - // DNS hostname can only be used inside the Amazon EC2 network. This name is - // not available until the instance enters the running state. - // - // [EC2-VPC] The Amazon-provided DNS server will resolve Amazon-provided private - // DNS hostnames if you've enabled DNS resolution and DNS hostnames in your - // VPC. If you are not using the Amazon-provided DNS server in your VPC, your - // custom domain name servers must resolve the hostname as appropriate. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The private IPv4 address assigned to the instance. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The product codes attached to this instance, if applicable. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` - - // (IPv4 only) The public DNS name assigned to the instance. This name is not - // available until the instance enters the running state. For EC2-VPC, this - // name is only available if you've enabled DNS hostnames for your VPC. - PublicDnsName *string `locationName:"dnsName" type:"string"` - - // The public IPv4 address assigned to the instance, if applicable. - PublicIpAddress *string `locationName:"ipAddress" type:"string"` - - // The RAM disk associated with this instance, if applicable. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // The root device name (for example, /dev/sda1 or /dev/xvda). - RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - - // The root device type used by the AMI. The AMI can use an EBS volume or an - // instance store volume. - RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"` - - // One or more security groups for the instance. - SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // Specifies whether to enable an instance launched in a VPC to perform NAT. - // This controls whether source/destination checking is enabled on the instance. - // A value of true means checking is enabled, and false means checking is disabled. - // The value must be false for the instance to perform NAT. For more information, - // see NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) - // in the Amazon Virtual Private Cloud User Guide. - SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` - - // If the request is a Spot instance request, the ID of the request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - - // Specifies whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` - - // The current state of the instance. - State *InstanceState `locationName:"instanceState" type:"structure"` - - // The reason for the most recent state transition. - StateReason *StateReason `locationName:"stateReason" type:"structure"` - - // The reason for the most recent state transition. This might be an empty string. - StateTransitionReason *string `locationName:"reason" type:"string"` - - // [EC2-VPC] The ID of the subnet in which the instance is running. - SubnetId *string `locationName:"subnetId" type:"string"` - - // Any tags assigned to the instance. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The virtualization type of the instance. - VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` - - // [EC2-VPC] The ID of the VPC in which the instance is running. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s Instance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Instance) GoString() string { - return s.String() -} - -// SetAmiLaunchIndex sets the AmiLaunchIndex field's value. -func (s *Instance) SetAmiLaunchIndex(v int64) *Instance { - s.AmiLaunchIndex = &v - return s -} - -// SetArchitecture sets the Architecture field's value. -func (s *Instance) SetArchitecture(v string) *Instance { - s.Architecture = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *Instance) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *Instance { - s.BlockDeviceMappings = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *Instance) SetClientToken(v string) *Instance { - s.ClientToken = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *Instance) SetEbsOptimized(v bool) *Instance { - s.EbsOptimized = &v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *Instance) SetEnaSupport(v bool) *Instance { - s.EnaSupport = &v - return s -} - -// SetHypervisor sets the Hypervisor field's value. -func (s *Instance) SetHypervisor(v string) *Instance { - s.Hypervisor = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *Instance) SetIamInstanceProfile(v *IamInstanceProfile) *Instance { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *Instance) SetImageId(v string) *Instance { - s.ImageId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Instance) SetInstanceId(v string) *Instance { - s.InstanceId = &v - return s -} - -// SetInstanceLifecycle sets the InstanceLifecycle field's value. -func (s *Instance) SetInstanceLifecycle(v string) *Instance { - s.InstanceLifecycle = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *Instance) SetInstanceType(v string) *Instance { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *Instance) SetKernelId(v string) *Instance { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *Instance) SetKeyName(v string) *Instance { - s.KeyName = &v - return s -} - -// SetLaunchTime sets the LaunchTime field's value. -func (s *Instance) SetLaunchTime(v time.Time) *Instance { - s.LaunchTime = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *Instance) SetMonitoring(v *Monitoring) *Instance { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *Instance) SetNetworkInterfaces(v []*InstanceNetworkInterface) *Instance { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *Instance) SetPlacement(v *Placement) *Instance { - s.Placement = v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Instance) SetPlatform(v string) *Instance { - s.Platform = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *Instance) SetPrivateDnsName(v string) *Instance { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *Instance) SetPrivateIpAddress(v string) *Instance { - s.PrivateIpAddress = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *Instance) SetProductCodes(v []*ProductCode) *Instance { - s.ProductCodes = v - return s -} - -// SetPublicDnsName sets the PublicDnsName field's value. -func (s *Instance) SetPublicDnsName(v string) *Instance { - s.PublicDnsName = &v - return s -} - -// SetPublicIpAddress sets the PublicIpAddress field's value. -func (s *Instance) SetPublicIpAddress(v string) *Instance { - s.PublicIpAddress = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *Instance) SetRamdiskId(v string) *Instance { - s.RamdiskId = &v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *Instance) SetRootDeviceName(v string) *Instance { - s.RootDeviceName = &v - return s -} - -// SetRootDeviceType sets the RootDeviceType field's value. -func (s *Instance) SetRootDeviceType(v string) *Instance { - s.RootDeviceType = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *Instance) SetSecurityGroups(v []*GroupIdentifier) *Instance { - s.SecurityGroups = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *Instance) SetSourceDestCheck(v bool) *Instance { - s.SourceDestCheck = &v - return s -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *Instance) SetSpotInstanceRequestId(v string) *Instance { - s.SpotInstanceRequestId = &v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *Instance) SetSriovNetSupport(v string) *Instance { - s.SriovNetSupport = &v - return s -} - -// SetState sets the State field's value. -func (s *Instance) SetState(v *InstanceState) *Instance { - s.State = v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *Instance) SetStateReason(v *StateReason) *Instance { - s.StateReason = v - return s -} - -// SetStateTransitionReason sets the StateTransitionReason field's value. -func (s *Instance) SetStateTransitionReason(v string) *Instance { - s.StateTransitionReason = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *Instance) SetSubnetId(v string) *Instance { - s.SubnetId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Instance) SetTags(v []*Tag) *Instance { - s.Tags = v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *Instance) SetVirtualizationType(v string) *Instance { - s.VirtualizationType = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Instance) SetVpcId(v string) *Instance { - s.VpcId = &v - return s -} - -// Describes a block device mapping. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceBlockDeviceMapping -type InstanceBlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name exposed to the instance (for example, /dev/sdh or xvdh). - DeviceName *string `locationName:"deviceName" type:"string"` - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsInstanceBlockDevice `locationName:"ebs" type:"structure"` -} - -// String returns the string representation -func (s InstanceBlockDeviceMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceBlockDeviceMapping) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *InstanceBlockDeviceMapping) SetDeviceName(v string) *InstanceBlockDeviceMapping { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *InstanceBlockDeviceMapping) SetEbs(v *EbsInstanceBlockDevice) *InstanceBlockDeviceMapping { - s.Ebs = v - return s -} - -// Describes a block device mapping entry. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceBlockDeviceMappingSpecification -type InstanceBlockDeviceMappingSpecification struct { - _ struct{} `type:"structure"` - - // The device name exposed to the instance (for example, /dev/sdh or xvdh). - DeviceName *string `locationName:"deviceName" type:"string"` - - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` - - // suppress the specified device included in the block device mapping. - NoDevice *string `locationName:"noDevice" type:"string"` - - // The virtual device name. - VirtualName *string `locationName:"virtualName" type:"string"` -} - -// String returns the string representation -func (s InstanceBlockDeviceMappingSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceBlockDeviceMappingSpecification) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetDeviceName(v string) *InstanceBlockDeviceMappingSpecification { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetEbs(v *EbsInstanceBlockDeviceSpecification) *InstanceBlockDeviceMappingSpecification { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetNoDevice(v string) *InstanceBlockDeviceMappingSpecification { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *InstanceBlockDeviceMappingSpecification) SetVirtualName(v string) *InstanceBlockDeviceMappingSpecification { - s.VirtualName = &v - return s -} - -// Information about the instance type that the Dedicated Host supports. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceCapacity -type InstanceCapacity struct { - _ struct{} `type:"structure"` - - // The number of instances that can still be launched onto the Dedicated Host. - AvailableCapacity *int64 `locationName:"availableCapacity" type:"integer"` - - // The instance type size supported by the Dedicated Host. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The total number of instances that can be launched onto the Dedicated Host. - TotalCapacity *int64 `locationName:"totalCapacity" type:"integer"` -} - -// String returns the string representation -func (s InstanceCapacity) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceCapacity) GoString() string { - return s.String() -} - -// SetAvailableCapacity sets the AvailableCapacity field's value. -func (s *InstanceCapacity) SetAvailableCapacity(v int64) *InstanceCapacity { - s.AvailableCapacity = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceCapacity) SetInstanceType(v string) *InstanceCapacity { - s.InstanceType = &v - return s -} - -// SetTotalCapacity sets the TotalCapacity field's value. -func (s *InstanceCapacity) SetTotalCapacity(v int64) *InstanceCapacity { - s.TotalCapacity = &v - return s -} - -// Describes a Reserved Instance listing state. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceCount -type InstanceCount struct { - _ struct{} `type:"structure"` - - // The number of listed Reserved Instances in the state specified by the state. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The states of the listed Reserved Instances. - State *string `locationName:"state" type:"string" enum:"ListingState"` -} - -// String returns the string representation -func (s InstanceCount) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceCount) GoString() string { - return s.String() -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *InstanceCount) SetInstanceCount(v int64) *InstanceCount { - s.InstanceCount = &v - return s -} - -// SetState sets the State field's value. -func (s *InstanceCount) SetState(v string) *InstanceCount { - s.State = &v - return s -} - -// Describes an instance to export. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceExportDetails -type InstanceExportDetails struct { - _ struct{} `type:"structure"` - - // The ID of the resource being exported. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The target virtualization environment. - TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` -} - -// String returns the string representation -func (s InstanceExportDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceExportDetails) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceExportDetails) SetInstanceId(v string) *InstanceExportDetails { - s.InstanceId = &v - return s -} - -// SetTargetEnvironment sets the TargetEnvironment field's value. -func (s *InstanceExportDetails) SetTargetEnvironment(v string) *InstanceExportDetails { - s.TargetEnvironment = &v - return s -} - -// Describes an IPv6 address. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceIpv6Address -type InstanceIpv6Address struct { - _ struct{} `type:"structure"` - - // The IPv6 address. - Ipv6Address *string `locationName:"ipv6Address" type:"string"` -} - -// String returns the string representation -func (s InstanceIpv6Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceIpv6Address) GoString() string { - return s.String() -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *InstanceIpv6Address) SetIpv6Address(v string) *InstanceIpv6Address { - s.Ipv6Address = &v - return s -} - -// Describes the monitoring of an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceMonitoring -type InstanceMonitoring struct { - _ struct{} `type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The monitoring for the instance. - Monitoring *Monitoring `locationName:"monitoring" type:"structure"` -} - -// String returns the string representation -func (s InstanceMonitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceMonitoring) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceMonitoring) SetInstanceId(v string) *InstanceMonitoring { - s.InstanceId = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *InstanceMonitoring) SetMonitoring(v *Monitoring) *InstanceMonitoring { - s.Monitoring = v - return s -} - -// Describes a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceNetworkInterface -type InstanceNetworkInterface struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IPv4 associated with the network - // interface. - Association *InstanceNetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // The network interface attachment. - Attachment *InstanceNetworkInterfaceAttachment `locationName:"attachment" type:"structure"` - - // The description. - Description *string `locationName:"description" type:"string"` - - // One or more security groups. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // One or more IPv6 addresses associated with the network interface. - Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6AddressesSet" locationNameList:"item" type:"list"` - - // The MAC address. - MacAddress *string `locationName:"macAddress" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the AWS account that created the network interface. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The private DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // One or more private IPv4 addresses associated with the network interface. - PrivateIpAddresses []*InstancePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` - - // Indicates whether to validate network traffic to or from this network interface. - SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` - - // The status of the network interface. - Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s InstanceNetworkInterface) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterface) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *InstanceNetworkInterface) SetAssociation(v *InstanceNetworkInterfaceAssociation) *InstanceNetworkInterface { - s.Association = v - return s -} - -// SetAttachment sets the Attachment field's value. -func (s *InstanceNetworkInterface) SetAttachment(v *InstanceNetworkInterfaceAttachment) *InstanceNetworkInterface { - s.Attachment = v - return s -} - -// SetDescription sets the Description field's value. -func (s *InstanceNetworkInterface) SetDescription(v string) *InstanceNetworkInterface { - s.Description = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *InstanceNetworkInterface) SetGroups(v []*GroupIdentifier) *InstanceNetworkInterface { - s.Groups = v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *InstanceNetworkInterface) SetIpv6Addresses(v []*InstanceIpv6Address) *InstanceNetworkInterface { - s.Ipv6Addresses = v - return s -} - -// SetMacAddress sets the MacAddress field's value. -func (s *InstanceNetworkInterface) SetMacAddress(v string) *InstanceNetworkInterface { - s.MacAddress = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *InstanceNetworkInterface) SetNetworkInterfaceId(v string) *InstanceNetworkInterface { - s.NetworkInterfaceId = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *InstanceNetworkInterface) SetOwnerId(v string) *InstanceNetworkInterface { - s.OwnerId = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *InstanceNetworkInterface) SetPrivateDnsName(v string) *InstanceNetworkInterface { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *InstanceNetworkInterface) SetPrivateIpAddress(v string) *InstanceNetworkInterface { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *InstanceNetworkInterface) SetPrivateIpAddresses(v []*InstancePrivateIpAddress) *InstanceNetworkInterface { - s.PrivateIpAddresses = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *InstanceNetworkInterface) SetSourceDestCheck(v bool) *InstanceNetworkInterface { - s.SourceDestCheck = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceNetworkInterface) SetStatus(v string) *InstanceNetworkInterface { - s.Status = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *InstanceNetworkInterface) SetSubnetId(v string) *InstanceNetworkInterface { - s.SubnetId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *InstanceNetworkInterface) SetVpcId(v string) *InstanceNetworkInterface { - s.VpcId = &v - return s -} - -// Describes association information for an Elastic IP address (IPv4). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceNetworkInterfaceAssociation -type InstanceNetworkInterfaceAssociation struct { - _ struct{} `type:"structure"` - - // The ID of the owner of the Elastic IP address. - IpOwnerId *string `locationName:"ipOwnerId" type:"string"` - - // The public DNS name. - PublicDnsName *string `locationName:"publicDnsName" type:"string"` - - // The public IP address or Elastic IP address bound to the network interface. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s InstanceNetworkInterfaceAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterfaceAssociation) GoString() string { - return s.String() -} - -// SetIpOwnerId sets the IpOwnerId field's value. -func (s *InstanceNetworkInterfaceAssociation) SetIpOwnerId(v string) *InstanceNetworkInterfaceAssociation { - s.IpOwnerId = &v - return s -} - -// SetPublicDnsName sets the PublicDnsName field's value. -func (s *InstanceNetworkInterfaceAssociation) SetPublicDnsName(v string) *InstanceNetworkInterfaceAssociation { - s.PublicDnsName = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *InstanceNetworkInterfaceAssociation) SetPublicIp(v string) *InstanceNetworkInterfaceAssociation { - s.PublicIp = &v - return s -} - -// Describes a network interface attachment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceNetworkInterfaceAttachment -type InstanceNetworkInterfaceAttachment struct { - _ struct{} `type:"structure"` - - // The time stamp when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The index of the device on the instance for the network interface attachment. - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` - - // The attachment state. - Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` -} - -// String returns the string representation -func (s InstanceNetworkInterfaceAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterfaceAttachment) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *InstanceNetworkInterfaceAttachment) SetAttachTime(v time.Time) *InstanceNetworkInterfaceAttachment { - s.AttachTime = &v - return s -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *InstanceNetworkInterfaceAttachment) SetAttachmentId(v string) *InstanceNetworkInterfaceAttachment { - s.AttachmentId = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *InstanceNetworkInterfaceAttachment) SetDeleteOnTermination(v bool) *InstanceNetworkInterfaceAttachment { - s.DeleteOnTermination = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *InstanceNetworkInterfaceAttachment) SetDeviceIndex(v int64) *InstanceNetworkInterfaceAttachment { - s.DeviceIndex = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceNetworkInterfaceAttachment) SetStatus(v string) *InstanceNetworkInterfaceAttachment { - s.Status = &v - return s -} - -// Describes a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceNetworkInterfaceSpecification -type InstanceNetworkInterfaceSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether to assign a public IPv4 address to an instance you launch - // in a VPC. The public IP address can only be assigned to a network interface - // for eth0, and can only be assigned to a new network interface, not an existing - // one. You cannot specify more than one network interface in the request. If - // launching into a default subnet, the default value is true. - AssociatePublicIpAddress *bool `locationName:"associatePublicIpAddress" type:"boolean"` - - // If set to true, the interface is deleted when the instance is terminated. - // You can specify true only if creating a new network interface when launching - // an instance. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The description of the network interface. Applies only if creating a network - // interface when launching an instance. - Description *string `locationName:"description" type:"string"` - - // The index of the device on the instance for the network interface attachment. - // If you are specifying a network interface in a RunInstances request, you - // must provide the device index. - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` - - // The IDs of the security groups for the network interface. Applies only if - // creating a network interface when launching an instance. - Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // A number of IPv6 addresses to assign to the network interface. Amazon EC2 - // chooses the IPv6 addresses from the range of the subnet. You cannot specify - // this option and the option to assign specific IPv6 addresses in the same - // request. You can specify this option if you've specified a minimum number - // of instances to launch. - Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"` - - // One or more IPv6 addresses to assign to the network interface. You cannot - // specify this option and the option to assign a number of IPv6 addresses in - // the same request. You cannot specify this option if you've specified a minimum - // number of instances to launch. - Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6AddressesSet" queryName:"Ipv6Addresses" locationNameList:"item" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The private IPv4 address of the network interface. Applies only if creating - // a network interface when launching an instance. You cannot specify this option - // if you're launching more than one instance in a RunInstances request. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // One or more private IPv4 addresses to assign to the network interface. Only - // one private IPv4 address can be designated as primary. You cannot specify - // this option if you're launching more than one instance in a RunInstances - // request. - PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddressesSet" queryName:"PrivateIpAddresses" locationNameList:"item" type:"list"` - - // The number of secondary private IPv4 addresses. You can't specify this option - // and specify more than one private IP address using the private IP addresses - // option. You cannot specify this option if you're launching more than one - // instance in a RunInstances request. - SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"` - - // The ID of the subnet associated with the network string. Applies only if - // creating a network interface when launching an instance. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s InstanceNetworkInterfaceSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceNetworkInterfaceSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceNetworkInterfaceSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceNetworkInterfaceSpecification"} - if s.PrivateIpAddresses != nil { - for i, v := range s.PrivateIpAddresses { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *InstanceNetworkInterfaceSpecification) SetAssociatePublicIpAddress(v bool) *InstanceNetworkInterfaceSpecification { - s.AssociatePublicIpAddress = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *InstanceNetworkInterfaceSpecification) SetDeleteOnTermination(v bool) *InstanceNetworkInterfaceSpecification { - s.DeleteOnTermination = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *InstanceNetworkInterfaceSpecification) SetDescription(v string) *InstanceNetworkInterfaceSpecification { - s.Description = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *InstanceNetworkInterfaceSpecification) SetDeviceIndex(v int64) *InstanceNetworkInterfaceSpecification { - s.DeviceIndex = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *InstanceNetworkInterfaceSpecification) SetGroups(v []*string) *InstanceNetworkInterfaceSpecification { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *InstanceNetworkInterfaceSpecification) SetIpv6AddressCount(v int64) *InstanceNetworkInterfaceSpecification { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *InstanceNetworkInterfaceSpecification) SetIpv6Addresses(v []*InstanceIpv6Address) *InstanceNetworkInterfaceSpecification { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *InstanceNetworkInterfaceSpecification) SetNetworkInterfaceId(v string) *InstanceNetworkInterfaceSpecification { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *InstanceNetworkInterfaceSpecification) SetPrivateIpAddress(v string) *InstanceNetworkInterfaceSpecification { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *InstanceNetworkInterfaceSpecification) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *InstanceNetworkInterfaceSpecification { - s.PrivateIpAddresses = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *InstanceNetworkInterfaceSpecification) SetSecondaryPrivateIpAddressCount(v int64) *InstanceNetworkInterfaceSpecification { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *InstanceNetworkInterfaceSpecification) SetSubnetId(v string) *InstanceNetworkInterfaceSpecification { - s.SubnetId = &v - return s -} - -// Describes a private IPv4 address. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstancePrivateIpAddress -type InstancePrivateIpAddress struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IP address for the network interface. - Association *InstanceNetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // Indicates whether this IPv4 address is the primary private IP address of - // the network interface. - Primary *bool `locationName:"primary" type:"boolean"` - - // The private IPv4 DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The private IPv4 address of the network interface. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` -} - -// String returns the string representation -func (s InstancePrivateIpAddress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstancePrivateIpAddress) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *InstancePrivateIpAddress) SetAssociation(v *InstanceNetworkInterfaceAssociation) *InstancePrivateIpAddress { - s.Association = v - return s -} - -// SetPrimary sets the Primary field's value. -func (s *InstancePrivateIpAddress) SetPrimary(v bool) *InstancePrivateIpAddress { - s.Primary = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *InstancePrivateIpAddress) SetPrivateDnsName(v string) *InstancePrivateIpAddress { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *InstancePrivateIpAddress) SetPrivateIpAddress(v string) *InstancePrivateIpAddress { - s.PrivateIpAddress = &v - return s -} - -// Describes the current state of an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceState -type InstanceState struct { - _ struct{} `type:"structure"` - - // The low byte represents the state. The high byte is an opaque internal value - // and should be ignored. - // - // * 0 : pending - // - // * 16 : running - // - // * 32 : shutting-down - // - // * 48 : terminated - // - // * 64 : stopping - // - // * 80 : stopped - Code *int64 `locationName:"code" type:"integer"` - - // The current state of the instance. - Name *string `locationName:"name" type:"string" enum:"InstanceStateName"` -} - -// String returns the string representation -func (s InstanceState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceState) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceState) SetCode(v int64) *InstanceState { - s.Code = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceState) SetName(v string) *InstanceState { - s.Name = &v - return s -} - -// Describes an instance state change. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceStateChange -type InstanceStateChange struct { - _ struct{} `type:"structure"` - - // The current state of the instance. - CurrentState *InstanceState `locationName:"currentState" type:"structure"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The previous state of the instance. - PreviousState *InstanceState `locationName:"previousState" type:"structure"` -} - -// String returns the string representation -func (s InstanceStateChange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStateChange) GoString() string { - return s.String() -} - -// SetCurrentState sets the CurrentState field's value. -func (s *InstanceStateChange) SetCurrentState(v *InstanceState) *InstanceStateChange { - s.CurrentState = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceStateChange) SetInstanceId(v string) *InstanceStateChange { - s.InstanceId = &v - return s -} - -// SetPreviousState sets the PreviousState field's value. -func (s *InstanceStateChange) SetPreviousState(v *InstanceState) *InstanceStateChange { - s.PreviousState = v - return s -} - -// Describes the status of an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceStatus -type InstanceStatus struct { - _ struct{} `type:"structure"` - - // The Availability Zone of the instance. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // Any scheduled events associated with the instance. - Events []*InstanceStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The intended state of the instance. DescribeInstanceStatus requires that - // an instance be in the running state. - InstanceState *InstanceState `locationName:"instanceState" type:"structure"` - - // Reports impaired functionality that stems from issues internal to the instance, - // such as impaired reachability. - InstanceStatus *InstanceStatusSummary `locationName:"instanceStatus" type:"structure"` - - // Reports impaired functionality that stems from issues related to the systems - // that support an instance, such as hardware failures and network connectivity - // problems. - SystemStatus *InstanceStatusSummary `locationName:"systemStatus" type:"structure"` -} - -// String returns the string representation -func (s InstanceStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatus) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *InstanceStatus) SetAvailabilityZone(v string) *InstanceStatus { - s.AvailabilityZone = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *InstanceStatus) SetEvents(v []*InstanceStatusEvent) *InstanceStatus { - s.Events = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceStatus) SetInstanceId(v string) *InstanceStatus { - s.InstanceId = &v - return s -} - -// SetInstanceState sets the InstanceState field's value. -func (s *InstanceStatus) SetInstanceState(v *InstanceState) *InstanceStatus { - s.InstanceState = v - return s -} - -// SetInstanceStatus sets the InstanceStatus field's value. -func (s *InstanceStatus) SetInstanceStatus(v *InstanceStatusSummary) *InstanceStatus { - s.InstanceStatus = v - return s -} - -// SetSystemStatus sets the SystemStatus field's value. -func (s *InstanceStatus) SetSystemStatus(v *InstanceStatusSummary) *InstanceStatus { - s.SystemStatus = v - return s -} - -// Describes the instance status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceStatusDetails -type InstanceStatusDetails struct { - _ struct{} `type:"structure"` - - // The time when a status check failed. For an instance that was launched and - // impaired, this is the time when the instance was launched. - ImpairedSince *time.Time `locationName:"impairedSince" type:"timestamp" timestampFormat:"iso8601"` - - // The type of instance status. - Name *string `locationName:"name" type:"string" enum:"StatusName"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"StatusType"` -} - -// String returns the string representation -func (s InstanceStatusDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatusDetails) GoString() string { - return s.String() -} - -// SetImpairedSince sets the ImpairedSince field's value. -func (s *InstanceStatusDetails) SetImpairedSince(v time.Time) *InstanceStatusDetails { - s.ImpairedSince = &v - return s -} - -// SetName sets the Name field's value. -func (s *InstanceStatusDetails) SetName(v string) *InstanceStatusDetails { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceStatusDetails) SetStatus(v string) *InstanceStatusDetails { - s.Status = &v - return s -} - -// Describes a scheduled event for an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceStatusEvent -type InstanceStatusEvent struct { - _ struct{} `type:"structure"` - - // The event code. - Code *string `locationName:"code" type:"string" enum:"EventCode"` - - // A description of the event. - // - // After a scheduled event is completed, it can still be described for up to - // a week. If the event has been completed, this description starts with the - // following text: [Completed]. - Description *string `locationName:"description" type:"string"` - - // The latest scheduled end time for the event. - NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The earliest scheduled start time for the event. - NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s InstanceStatusEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatusEvent) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceStatusEvent) SetCode(v string) *InstanceStatusEvent { - s.Code = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *InstanceStatusEvent) SetDescription(v string) *InstanceStatusEvent { - s.Description = &v - return s -} - -// SetNotAfter sets the NotAfter field's value. -func (s *InstanceStatusEvent) SetNotAfter(v time.Time) *InstanceStatusEvent { - s.NotAfter = &v - return s -} - -// SetNotBefore sets the NotBefore field's value. -func (s *InstanceStatusEvent) SetNotBefore(v time.Time) *InstanceStatusEvent { - s.NotBefore = &v - return s -} - -// Describes the status of an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InstanceStatusSummary -type InstanceStatusSummary struct { - _ struct{} `type:"structure"` - - // The system instance health or application instance health. - Details []*InstanceStatusDetails `locationName:"details" locationNameList:"item" type:"list"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"SummaryStatus"` -} - -// String returns the string representation -func (s InstanceStatusSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceStatusSummary) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *InstanceStatusSummary) SetDetails(v []*InstanceStatusDetails) *InstanceStatusSummary { - s.Details = v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceStatusSummary) SetStatus(v string) *InstanceStatusSummary { - s.Status = &v - return s -} - -// Describes an Internet gateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InternetGateway -type InternetGateway struct { - _ struct{} `type:"structure"` - - // Any VPCs attached to the Internet gateway. - Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` - - // The ID of the Internet gateway. - InternetGatewayId *string `locationName:"internetGatewayId" type:"string"` - - // Any tags assigned to the Internet gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s InternetGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InternetGateway) GoString() string { - return s.String() -} - -// SetAttachments sets the Attachments field's value. -func (s *InternetGateway) SetAttachments(v []*InternetGatewayAttachment) *InternetGateway { - s.Attachments = v - return s -} - -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *InternetGateway) SetInternetGatewayId(v string) *InternetGateway { - s.InternetGatewayId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *InternetGateway) SetTags(v []*Tag) *InternetGateway { - s.Tags = v - return s -} - -// Describes the attachment of a VPC to an Internet gateway or an egress-only -// Internet gateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/InternetGatewayAttachment -type InternetGatewayAttachment struct { - _ struct{} `type:"structure"` - - // The current state of the attachment. - State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s InternetGatewayAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InternetGatewayAttachment) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *InternetGatewayAttachment) SetState(v string) *InternetGatewayAttachment { - s.State = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *InternetGatewayAttachment) SetVpcId(v string) *InternetGatewayAttachment { - s.VpcId = &v - return s -} - -// Describes a security group rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IpPermission -type IpPermission struct { - _ struct{} `type:"structure"` - - // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 - // type number. A value of -1 indicates all ICMP/ICMPv6 types. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // - // [EC2-VPC only] Use -1 to specify all protocols. When authorizing security - // group rules, specifying -1 or a protocol number other than tcp, udp, icmp, - // or 58 (ICMPv6) allows traffic on all ports, regardless of any port range - // you specify. For tcp, udp, and icmp, you must specify a port range. For 58 - // (ICMPv6), you can optionally specify a port range; if you don't, traffic - // for all types and codes is allowed when authorizing rules. - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // One or more IPv4 ranges. - IpRanges []*IpRange `locationName:"ipRanges" locationNameList:"item" type:"list"` - - // [EC2-VPC only] One or more IPv6 ranges. - Ipv6Ranges []*Ipv6Range `locationName:"ipv6Ranges" locationNameList:"item" type:"list"` - - // (Valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress and DescribeSecurityGroups - // only) One or more prefix list IDs for an AWS service. In an AuthorizeSecurityGroupEgress - // request, this is the AWS service that you want to access through a VPC endpoint - // from instances associated with the security group. - PrefixListIds []*PrefixListId `locationName:"prefixListIds" locationNameList:"item" type:"list"` - - // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code. - // A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type. - ToPort *int64 `locationName:"toPort" type:"integer"` - - // One or more security group and AWS account ID pairs. - UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s IpPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IpPermission) GoString() string { - return s.String() -} - -// SetFromPort sets the FromPort field's value. -func (s *IpPermission) SetFromPort(v int64) *IpPermission { - s.FromPort = &v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *IpPermission) SetIpProtocol(v string) *IpPermission { - s.IpProtocol = &v - return s -} - -// SetIpRanges sets the IpRanges field's value. -func (s *IpPermission) SetIpRanges(v []*IpRange) *IpPermission { - s.IpRanges = v - return s -} - -// SetIpv6Ranges sets the Ipv6Ranges field's value. -func (s *IpPermission) SetIpv6Ranges(v []*Ipv6Range) *IpPermission { - s.Ipv6Ranges = v - return s -} - -// SetPrefixListIds sets the PrefixListIds field's value. -func (s *IpPermission) SetPrefixListIds(v []*PrefixListId) *IpPermission { - s.PrefixListIds = v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *IpPermission) SetToPort(v int64) *IpPermission { - s.ToPort = &v - return s -} - -// SetUserIdGroupPairs sets the UserIdGroupPairs field's value. -func (s *IpPermission) SetUserIdGroupPairs(v []*UserIdGroupPair) *IpPermission { - s.UserIdGroupPairs = v - return s -} - -// Describes an IPv4 range. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IpRange -type IpRange struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR range. You can either specify a CIDR range or a source security - // group, not both. To specify a single IPv4 address, use the /32 prefix. - CidrIp *string `locationName:"cidrIp" type:"string"` -} - -// String returns the string representation -func (s IpRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IpRange) GoString() string { - return s.String() -} - -// SetCidrIp sets the CidrIp field's value. -func (s *IpRange) SetCidrIp(v string) *IpRange { - s.CidrIp = &v - return s -} - -// Describes an IPv6 CIDR block. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Ipv6CidrBlock -type Ipv6CidrBlock struct { - _ struct{} `type:"structure"` - - // The IPv6 CIDR block. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` -} - -// String returns the string representation -func (s Ipv6CidrBlock) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ipv6CidrBlock) GoString() string { - return s.String() -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *Ipv6CidrBlock) SetIpv6CidrBlock(v string) *Ipv6CidrBlock { - s.Ipv6CidrBlock = &v - return s -} - -// [EC2-VPC only] Describes an IPv6 range. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Ipv6Range -type Ipv6Range struct { - _ struct{} `type:"structure"` - - // The IPv6 CIDR range. You can either specify a CIDR range or a source security - // group, not both. To specify a single IPv6 address, use the /128 prefix. - CidrIpv6 *string `locationName:"cidrIpv6" type:"string"` -} - -// String returns the string representation -func (s Ipv6Range) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Ipv6Range) GoString() string { - return s.String() -} - -// SetCidrIpv6 sets the CidrIpv6 field's value. -func (s *Ipv6Range) SetCidrIpv6(v string) *Ipv6Range { - s.CidrIpv6 = &v - return s -} - -// Describes a key pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/KeyPairInfo -type KeyPairInfo struct { - _ struct{} `type:"structure"` - - // If you used CreateKeyPair to create the key pair, this is the SHA-1 digest - // of the DER encoded private key. If you used ImportKeyPair to provide AWS - // the public key, this is the MD5 public key fingerprint as specified in section - // 4 of RFC4716. - KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` -} - -// String returns the string representation -func (s KeyPairInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyPairInfo) GoString() string { - return s.String() -} - -// SetKeyFingerprint sets the KeyFingerprint field's value. -func (s *KeyPairInfo) SetKeyFingerprint(v string) *KeyPairInfo { - s.KeyFingerprint = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *KeyPairInfo) SetKeyName(v string) *KeyPairInfo { - s.KeyName = &v - return s -} - -// Describes a launch permission. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/LaunchPermission -type LaunchPermission struct { - _ struct{} `type:"structure"` - - // The name of the group. - Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - - // The AWS account ID. - UserId *string `locationName:"userId" type:"string"` -} - -// String returns the string representation -func (s LaunchPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchPermission) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *LaunchPermission) SetGroup(v string) *LaunchPermission { - s.Group = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *LaunchPermission) SetUserId(v string) *LaunchPermission { - s.UserId = &v - return s -} - -// Describes a launch permission modification. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/LaunchPermissionModifications -type LaunchPermissionModifications struct { - _ struct{} `type:"structure"` - - // The AWS account ID to add to the list of launch permissions for the AMI. - Add []*LaunchPermission `locationNameList:"item" type:"list"` - - // The AWS account ID to remove from the list of launch permissions for the - // AMI. - Remove []*LaunchPermission `locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s LaunchPermissionModifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchPermissionModifications) GoString() string { - return s.String() -} - -// SetAdd sets the Add field's value. -func (s *LaunchPermissionModifications) SetAdd(v []*LaunchPermission) *LaunchPermissionModifications { - s.Add = v - return s -} - -// SetRemove sets the Remove field's value. -func (s *LaunchPermissionModifications) SetRemove(v []*LaunchPermission) *LaunchPermissionModifications { - s.Remove = v - return s -} - -// Describes the launch specification for an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/LaunchSpecification -type LaunchSpecification struct { - _ struct{} `type:"structure"` - - // Deprecated. - AddressingType *string `locationName:"addressingType" type:"string"` - - // One or more block device mapping entries. - // - // Although you can specify encrypted EBS volumes in this block device mapping - // for your Spot Instances, these volumes are not encrypted. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // Describes the monitoring of an instance. - Monitoring *RunInstancesMonitoringEnabled `locationName:"monitoring" type:"structure"` - - // One or more network interfaces. If you specify a network interface, you must - // specify subnet IDs and security group IDs using the network interface. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - - // The placement information for the instance. - Placement *SpotPlacement `locationName:"placement" type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // One or more security groups. When requesting instances in a VPC, you must - // specify the IDs of the security groups. When requesting instances in EC2-Classic, - // you can specify the names or the IDs of the security groups. - SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The ID of the subnet in which to launch the instance. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The user data to make available to the instances. If you are using an AWS - // SDK or command line tool, Base64-encoding is performed for you, and you can - // load the text from a file. Otherwise, you must provide Base64-encoded text. - UserData *string `locationName:"userData" type:"string"` -} - -// String returns the string representation -func (s LaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LaunchSpecification) GoString() string { - return s.String() -} - -// SetAddressingType sets the AddressingType field's value. -func (s *LaunchSpecification) SetAddressingType(v string) *LaunchSpecification { - s.AddressingType = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *LaunchSpecification) SetBlockDeviceMappings(v []*BlockDeviceMapping) *LaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *LaunchSpecification) SetEbsOptimized(v bool) *LaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *LaunchSpecification) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *LaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *LaunchSpecification) SetImageId(v string) *LaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *LaunchSpecification) SetInstanceType(v string) *LaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *LaunchSpecification) SetKernelId(v string) *LaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *LaunchSpecification) SetKeyName(v string) *LaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *LaunchSpecification) SetMonitoring(v *RunInstancesMonitoringEnabled) *LaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *LaunchSpecification) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *LaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *LaunchSpecification) SetPlacement(v *SpotPlacement) *LaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *LaunchSpecification) SetRamdiskId(v string) *LaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *LaunchSpecification) SetSecurityGroups(v []*GroupIdentifier) *LaunchSpecification { - s.SecurityGroups = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *LaunchSpecification) SetSubnetId(v string) *LaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *LaunchSpecification) SetUserData(v string) *LaunchSpecification { - s.UserData = &v - return s -} - -// Contains the parameters for ModifyHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHostsRequest -type ModifyHostsInput struct { - _ struct{} `type:"structure"` - - // Specify whether to enable or disable auto-placement. - // - // AutoPlacement is a required field - AutoPlacement *string `locationName:"autoPlacement" type:"string" required:"true" enum:"AutoPlacement"` - - // The host IDs of the Dedicated Hosts you want to modify. - // - // HostIds is a required field - HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyHostsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyHostsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyHostsInput"} - if s.AutoPlacement == nil { - invalidParams.Add(request.NewErrParamRequired("AutoPlacement")) - } - if s.HostIds == nil { - invalidParams.Add(request.NewErrParamRequired("HostIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoPlacement sets the AutoPlacement field's value. -func (s *ModifyHostsInput) SetAutoPlacement(v string) *ModifyHostsInput { - s.AutoPlacement = &v - return s -} - -// SetHostIds sets the HostIds field's value. -func (s *ModifyHostsInput) SetHostIds(v []*string) *ModifyHostsInput { - s.HostIds = v - return s -} - -// Contains the output of ModifyHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHostsResult -type ModifyHostsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the Dedicated Hosts that were successfully modified. - Successful []*string `locationName:"successful" locationNameList:"item" type:"list"` - - // The IDs of the Dedicated Hosts that could not be modified. Check whether - // the setting you requested can be used. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ModifyHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyHostsOutput) GoString() string { - return s.String() -} - -// SetSuccessful sets the Successful field's value. -func (s *ModifyHostsOutput) SetSuccessful(v []*string) *ModifyHostsOutput { - s.Successful = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *ModifyHostsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *ModifyHostsOutput { - s.Unsuccessful = v - return s -} - -// Contains the parameters of ModifyIdFormat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormatRequest -type ModifyIdFormatInput struct { - _ struct{} `type:"structure"` - - // The type of resource: instance | reservation | snapshot | volume - // - // Resource is a required field - Resource *string `type:"string" required:"true"` - - // Indicate whether the resource should use longer IDs (17-character IDs). - // - // UseLongIds is a required field - UseLongIds *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s ModifyIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdFormatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyIdFormatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyIdFormatInput"} - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.UseLongIds == nil { - invalidParams.Add(request.NewErrParamRequired("UseLongIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResource sets the Resource field's value. -func (s *ModifyIdFormatInput) SetResource(v string) *ModifyIdFormatInput { - s.Resource = &v - return s -} - -// SetUseLongIds sets the UseLongIds field's value. -func (s *ModifyIdFormatInput) SetUseLongIds(v bool) *ModifyIdFormatInput { - s.UseLongIds = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormatOutput -type ModifyIdFormatOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdFormatOutput) GoString() string { - return s.String() -} - -// Contains the parameters of ModifyIdentityIdFormat. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormatRequest -type ModifyIdentityIdFormatInput struct { - _ struct{} `type:"structure"` - - // The ARN of the principal, which can be an IAM user, IAM role, or the root - // user. Specify all to modify the ID format for all IAM users, IAM roles, and - // the root user of the account. - // - // PrincipalArn is a required field - PrincipalArn *string `locationName:"principalArn" type:"string" required:"true"` - - // The type of resource: instance | reservation | snapshot | volume - // - // Resource is a required field - Resource *string `locationName:"resource" type:"string" required:"true"` - - // Indicates whether the resource should use longer IDs (17-character IDs) - // - // UseLongIds is a required field - UseLongIds *bool `locationName:"useLongIds" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s ModifyIdentityIdFormatInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdentityIdFormatInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyIdentityIdFormatInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyIdentityIdFormatInput"} - if s.PrincipalArn == nil { - invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) - } - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.UseLongIds == nil { - invalidParams.Add(request.NewErrParamRequired("UseLongIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrincipalArn sets the PrincipalArn field's value. -func (s *ModifyIdentityIdFormatInput) SetPrincipalArn(v string) *ModifyIdentityIdFormatInput { - s.PrincipalArn = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *ModifyIdentityIdFormatInput) SetResource(v string) *ModifyIdentityIdFormatInput { - s.Resource = &v - return s -} - -// SetUseLongIds sets the UseLongIds field's value. -func (s *ModifyIdentityIdFormatInput) SetUseLongIds(v bool) *ModifyIdentityIdFormatInput { - s.UseLongIds = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormatOutput -type ModifyIdentityIdFormatOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyIdentityIdFormatOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyIdentityIdFormatOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyImageAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttributeRequest -type ModifyImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute to modify. - Attribute *string `type:"string"` - - // A description for the AMI. - Description *AttributeValue `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` - - // A launch permission modification. - LaunchPermission *LaunchPermissionModifications `type:"structure"` - - // The operation type. - OperationType *string `type:"string" enum:"OperationType"` - - // One or more product codes. After you add a product code to an AMI, it can't - // be removed. This is only valid when modifying the productCodes attribute. - ProductCodes []*string `locationName:"ProductCode" locationNameList:"ProductCode" type:"list"` - - // One or more user groups. This is only valid when modifying the launchPermission - // attribute. - UserGroups []*string `locationName:"UserGroup" locationNameList:"UserGroup" type:"list"` - - // One or more AWS account IDs. This is only valid when modifying the launchPermission - // attribute. - UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` - - // The value of the attribute being modified. This is only valid when modifying - // the description attribute. - Value *string `type:"string"` -} - -// String returns the string representation -func (s ModifyImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyImageAttributeInput"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ModifyImageAttributeInput) SetAttribute(v string) *ModifyImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyImageAttributeInput) SetDescription(v *AttributeValue) *ModifyImageAttributeInput { - s.Description = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyImageAttributeInput) SetDryRun(v bool) *ModifyImageAttributeInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ModifyImageAttributeInput) SetImageId(v string) *ModifyImageAttributeInput { - s.ImageId = &v - return s -} - -// SetLaunchPermission sets the LaunchPermission field's value. -func (s *ModifyImageAttributeInput) SetLaunchPermission(v *LaunchPermissionModifications) *ModifyImageAttributeInput { - s.LaunchPermission = v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *ModifyImageAttributeInput) SetOperationType(v string) *ModifyImageAttributeInput { - s.OperationType = &v - return s -} - -// SetProductCodes sets the ProductCodes field's value. -func (s *ModifyImageAttributeInput) SetProductCodes(v []*string) *ModifyImageAttributeInput { - s.ProductCodes = v - return s -} - -// SetUserGroups sets the UserGroups field's value. -func (s *ModifyImageAttributeInput) SetUserGroups(v []*string) *ModifyImageAttributeInput { - s.UserGroups = v - return s -} - -// SetUserIds sets the UserIds field's value. -func (s *ModifyImageAttributeInput) SetUserIds(v []*string) *ModifyImageAttributeInput { - s.UserIds = v - return s -} - -// SetValue sets the Value field's value. -func (s *ModifyImageAttributeInput) SetValue(v string) *ModifyImageAttributeInput { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttributeOutput -type ModifyImageAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyInstanceAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttributeRequest -type ModifyInstanceAttributeInput struct { - _ struct{} `type:"structure"` - - // The name of the attribute. - Attribute *string `locationName:"attribute" type:"string" enum:"InstanceAttributeName"` - - // Modifies the DeleteOnTermination attribute for volumes that are currently - // attached. The volume must be owned by the caller. If no value is specified - // for DeleteOnTermination, the default is true and the volume is deleted when - // the instance is terminated. - // - // To add instance store volumes to an Amazon EBS-backed instance, you must - // add them when you launch the instance. For more information, see Updating - // the Block Device Mapping when Launching an Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM) - // in the Amazon Elastic Compute Cloud User Guide. - BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // If the value is true, you can't terminate the instance using the Amazon EC2 - // console, CLI, or API; otherwise, you can. You cannot use this paramater for - // Spot Instances. - DisableApiTermination *AttributeBooleanValue `locationName:"disableApiTermination" type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Specifies whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` - - // Set to true to enable enhanced networking with ENA for the instance. - // - // This option is supported only for HVM instances. Specifying this option with - // a PV instance can make it unreachable. - EnaSupport *AttributeBooleanValue `locationName:"enaSupport" type:"structure"` - - // [EC2-VPC] Changes the security groups of the instance. You must specify at - // least one security group, even if it's just the default security group for - // the VPC. You must specify the security group ID, not the security group name. - Groups []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // Specifies whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - InstanceInitiatedShutdownBehavior *AttributeValue `locationName:"instanceInitiatedShutdownBehavior" type:"structure"` - - // Changes the instance type to the specified value. For more information, see - // Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). - // If the instance type is not valid, the error returned is InvalidInstanceAttributeValue. - InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` - - // Changes the instance's kernel to the specified value. We recommend that you - // use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html). - Kernel *AttributeValue `locationName:"kernel" type:"structure"` - - // Changes the instance's RAM disk to the specified value. We recommend that - // you use PV-GRUB instead of kernels and RAM disks. For more information, see - // PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html). - Ramdisk *AttributeValue `locationName:"ramdisk" type:"structure"` - - // Specifies whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means checking is disabled. This - // value must be false for a NAT instance to perform NAT. - SourceDestCheck *AttributeBooleanValue `type:"structure"` - - // Set to simple to enable enhanced networking with the Intel 82599 Virtual - // Function interface for the instance. - // - // There is no way to disable enhanced networking with the Intel 82599 Virtual - // Function interface at this time. - // - // This option is supported only for HVM instances. Specifying this option with - // a PV instance can make it unreachable. - SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` - - // Changes the instance's user data to the specified value. If you are using - // an AWS SDK or command line tool, Base64-encoding is performed for you, and - // you can load the text from a file. Otherwise, you must provide Base64-encoded - // text. - UserData *BlobAttributeValue `locationName:"userData" type:"structure"` - - // A new value for the attribute. Use only with the kernel, ramdisk, userData, - // disableApiTermination, or instanceInitiatedShutdownBehavior attribute. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyInstanceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceAttributeInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ModifyInstanceAttributeInput) SetAttribute(v string) *ModifyInstanceAttributeInput { - s.Attribute = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *ModifyInstanceAttributeInput) SetBlockDeviceMappings(v []*InstanceBlockDeviceMappingSpecification) *ModifyInstanceAttributeInput { - s.BlockDeviceMappings = v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *ModifyInstanceAttributeInput) SetDisableApiTermination(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.DisableApiTermination = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyInstanceAttributeInput) SetDryRun(v bool) *ModifyInstanceAttributeInput { - s.DryRun = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *ModifyInstanceAttributeInput) SetEbsOptimized(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.EbsOptimized = v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *ModifyInstanceAttributeInput) SetEnaSupport(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.EnaSupport = v - return s -} - -// SetGroups sets the Groups field's value. -func (s *ModifyInstanceAttributeInput) SetGroups(v []*string) *ModifyInstanceAttributeInput { - s.Groups = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceId(v string) *ModifyInstanceAttributeInput { - s.InstanceId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceInitiatedShutdownBehavior(v *AttributeValue) *ModifyInstanceAttributeInput { - s.InstanceInitiatedShutdownBehavior = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceType(v *AttributeValue) *ModifyInstanceAttributeInput { - s.InstanceType = v - return s -} - -// SetKernel sets the Kernel field's value. -func (s *ModifyInstanceAttributeInput) SetKernel(v *AttributeValue) *ModifyInstanceAttributeInput { - s.Kernel = v - return s -} - -// SetRamdisk sets the Ramdisk field's value. -func (s *ModifyInstanceAttributeInput) SetRamdisk(v *AttributeValue) *ModifyInstanceAttributeInput { - s.Ramdisk = v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *ModifyInstanceAttributeInput) SetSourceDestCheck(v *AttributeBooleanValue) *ModifyInstanceAttributeInput { - s.SourceDestCheck = v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *ModifyInstanceAttributeInput) SetSriovNetSupport(v *AttributeValue) *ModifyInstanceAttributeInput { - s.SriovNetSupport = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ModifyInstanceAttributeInput) SetUserData(v *BlobAttributeValue) *ModifyInstanceAttributeInput { - s.UserData = v - return s -} - -// SetValue sets the Value field's value. -func (s *ModifyInstanceAttributeInput) SetValue(v string) *ModifyInstanceAttributeInput { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttributeOutput -type ModifyInstanceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyInstanceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyInstancePlacement. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacementRequest -type ModifyInstancePlacementInput struct { - _ struct{} `type:"structure"` - - // The new affinity setting for the instance. - Affinity *string `locationName:"affinity" type:"string" enum:"Affinity"` - - // The ID of the Dedicated Host that the instance will have affinity with. - HostId *string `locationName:"hostId" type:"string"` - - // The ID of the instance that you are modifying. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - - // The tenancy of the instance that you are modifying. - Tenancy *string `locationName:"tenancy" type:"string" enum:"HostTenancy"` -} - -// String returns the string representation -func (s ModifyInstancePlacementInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstancePlacementInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyInstancePlacementInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyInstancePlacementInput"} - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAffinity sets the Affinity field's value. -func (s *ModifyInstancePlacementInput) SetAffinity(v string) *ModifyInstancePlacementInput { - s.Affinity = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *ModifyInstancePlacementInput) SetHostId(v string) *ModifyInstancePlacementInput { - s.HostId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstancePlacementInput) SetInstanceId(v string) *ModifyInstancePlacementInput { - s.InstanceId = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *ModifyInstancePlacementInput) SetTenancy(v string) *ModifyInstancePlacementInput { - s.Tenancy = &v - return s -} - -// Contains the output of ModifyInstancePlacement. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacementResult -type ModifyInstancePlacementOutput struct { - _ struct{} `type:"structure"` - - // Is true if the request succeeds, and an error otherwise. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyInstancePlacementOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstancePlacementOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifyInstancePlacementOutput) SetReturn(v bool) *ModifyInstancePlacementOutput { - s.Return = &v - return s -} - -// Contains the parameters for ModifyNetworkInterfaceAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttributeRequest -type ModifyNetworkInterfaceAttributeInput struct { - _ struct{} `type:"structure"` - - // Information about the interface attachment. If modifying the 'delete on termination' - // attribute, you must specify the ID of the interface attachment. - Attachment *NetworkInterfaceAttachmentChanges `locationName:"attachment" type:"structure"` - - // A description for the network interface. - Description *AttributeValue `locationName:"description" type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Changes the security groups for the network interface. The new set of groups - // you specify replaces the current set. You must specify at least one group, - // even if it's just the default security group in the VPC. You must specify - // the ID of the security group, not the name. - Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // Indicates whether source/destination checking is enabled. A value of true - // means checking is enabled, and false means checking is disabled. This value - // must be false for a NAT instance to perform NAT. For more information, see - // NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) - // in the Amazon Virtual Private Cloud User Guide. - SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` -} - -// String returns the string representation -func (s ModifyNetworkInterfaceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyNetworkInterfaceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyNetworkInterfaceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyNetworkInterfaceAttributeInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachment sets the Attachment field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetAttachment(v *NetworkInterfaceAttachmentChanges) *ModifyNetworkInterfaceAttributeInput { - s.Attachment = v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetDescription(v *AttributeValue) *ModifyNetworkInterfaceAttributeInput { - s.Description = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetDryRun(v bool) *ModifyNetworkInterfaceAttributeInput { - s.DryRun = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetGroups(v []*string) *ModifyNetworkInterfaceAttributeInput { - s.Groups = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetNetworkInterfaceId(v string) *ModifyNetworkInterfaceAttributeInput { - s.NetworkInterfaceId = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *ModifyNetworkInterfaceAttributeInput) SetSourceDestCheck(v *AttributeBooleanValue) *ModifyNetworkInterfaceAttributeInput { - s.SourceDestCheck = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttributeOutput -type ModifyNetworkInterfaceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyNetworkInterfaceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyNetworkInterfaceAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyReservedInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstancesRequest -type ModifyReservedInstancesInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive token you provide to ensure idempotency of your - // modification request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // The IDs of the Reserved Instances to modify. - // - // ReservedInstancesIds is a required field - ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"ReservedInstancesId" type:"list" required:"true"` - - // The configuration settings for the Reserved Instances to modify. - // - // TargetConfigurations is a required field - TargetConfigurations []*ReservedInstancesConfiguration `locationName:"ReservedInstancesConfigurationSetItemType" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ModifyReservedInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReservedInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyReservedInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyReservedInstancesInput"} - if s.ReservedInstancesIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesIds")) - } - if s.TargetConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("TargetConfigurations")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *ModifyReservedInstancesInput) SetClientToken(v string) *ModifyReservedInstancesInput { - s.ClientToken = &v - return s -} - -// SetReservedInstancesIds sets the ReservedInstancesIds field's value. -func (s *ModifyReservedInstancesInput) SetReservedInstancesIds(v []*string) *ModifyReservedInstancesInput { - s.ReservedInstancesIds = v - return s -} - -// SetTargetConfigurations sets the TargetConfigurations field's value. -func (s *ModifyReservedInstancesInput) SetTargetConfigurations(v []*ReservedInstancesConfiguration) *ModifyReservedInstancesInput { - s.TargetConfigurations = v - return s -} - -// Contains the output of ModifyReservedInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstancesResult -type ModifyReservedInstancesOutput struct { - _ struct{} `type:"structure"` - - // The ID for the modification. - ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` -} - -// String returns the string representation -func (s ModifyReservedInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyReservedInstancesOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesModificationId sets the ReservedInstancesModificationId field's value. -func (s *ModifyReservedInstancesOutput) SetReservedInstancesModificationId(v string) *ModifyReservedInstancesOutput { - s.ReservedInstancesModificationId = &v - return s -} - -// Contains the parameters for ModifySnapshotAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttributeRequest -type ModifySnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The snapshot attribute to modify. - // - // Only volume creation permissions may be modified at the customer level. - Attribute *string `type:"string" enum:"SnapshotAttributeName"` - - // A JSON representation of the snapshot attribute modification. - CreateVolumePermission *CreateVolumePermissionModifications `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The group to modify for the snapshot. - GroupNames []*string `locationName:"UserGroup" locationNameList:"GroupName" type:"list"` - - // The type of operation to perform to the attribute. - OperationType *string `type:"string" enum:"OperationType"` - - // The ID of the snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` - - // The account ID to modify for the snapshot. - UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"` -} - -// String returns the string representation -func (s ModifySnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifySnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifySnapshotAttributeInput"} - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ModifySnapshotAttributeInput) SetAttribute(v string) *ModifySnapshotAttributeInput { - s.Attribute = &v - return s -} - -// SetCreateVolumePermission sets the CreateVolumePermission field's value. -func (s *ModifySnapshotAttributeInput) SetCreateVolumePermission(v *CreateVolumePermissionModifications) *ModifySnapshotAttributeInput { - s.CreateVolumePermission = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifySnapshotAttributeInput) SetDryRun(v bool) *ModifySnapshotAttributeInput { - s.DryRun = &v - return s -} - -// SetGroupNames sets the GroupNames field's value. -func (s *ModifySnapshotAttributeInput) SetGroupNames(v []*string) *ModifySnapshotAttributeInput { - s.GroupNames = v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *ModifySnapshotAttributeInput) SetOperationType(v string) *ModifySnapshotAttributeInput { - s.OperationType = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ModifySnapshotAttributeInput) SetSnapshotId(v string) *ModifySnapshotAttributeInput { - s.SnapshotId = &v - return s -} - -// SetUserIds sets the UserIds field's value. -func (s *ModifySnapshotAttributeInput) SetUserIds(v []*string) *ModifySnapshotAttributeInput { - s.UserIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttributeOutput -type ModifySnapshotAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifySnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySnapshotAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifySpotFleetRequest. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequestRequest -type ModifySpotFleetRequestInput struct { - _ struct{} `type:"structure"` - - // Indicates whether running Spot instances should be terminated if the target - // capacity of the Spot fleet request is decreased below the current size of - // the Spot fleet. - ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The size of the fleet. - TargetCapacity *int64 `locationName:"targetCapacity" type:"integer"` -} - -// String returns the string representation -func (s ModifySpotFleetRequestInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySpotFleetRequestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifySpotFleetRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifySpotFleetRequestInput"} - if s.SpotFleetRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *ModifySpotFleetRequestInput) SetExcessCapacityTerminationPolicy(v string) *ModifySpotFleetRequestInput { - s.ExcessCapacityTerminationPolicy = &v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *ModifySpotFleetRequestInput) SetSpotFleetRequestId(v string) *ModifySpotFleetRequestInput { - s.SpotFleetRequestId = &v - return s -} - -// SetTargetCapacity sets the TargetCapacity field's value. -func (s *ModifySpotFleetRequestInput) SetTargetCapacity(v int64) *ModifySpotFleetRequestInput { - s.TargetCapacity = &v - return s -} - -// Contains the output of ModifySpotFleetRequest. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequestResponse -type ModifySpotFleetRequestOutput struct { - _ struct{} `type:"structure"` - - // Is true if the request succeeds, and an error otherwise. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifySpotFleetRequestOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySpotFleetRequestOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifySpotFleetRequestOutput) SetReturn(v bool) *ModifySpotFleetRequestOutput { - s.Return = &v - return s -} - -// Contains the parameters for ModifySubnetAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttributeRequest -type ModifySubnetAttributeInput struct { - _ struct{} `type:"structure"` - - // Specify true to indicate that network interfaces created in the specified - // subnet should be assigned an IPv6 address. This includes a network interface - // that's created when launching an instance into the subnet (the instance therefore - // receives an IPv6 address). - // - // If you enable the IPv6 addressing feature for your subnet, your network interface - // or instance only receives an IPv6 address if it's created using version 2016-11-15 - // or later of the Amazon EC2 API. - AssignIpv6AddressOnCreation *AttributeBooleanValue `type:"structure"` - - // Specify true to indicate that network interfaces created in the specified - // subnet should be assigned a public IPv4 address. This includes a network - // interface that's created when launching an instance into the subnet (the - // instance therefore receives a public IPv4 address). - MapPublicIpOnLaunch *AttributeBooleanValue `type:"structure"` - - // The ID of the subnet. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifySubnetAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySubnetAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifySubnetAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifySubnetAttributeInput"} - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssignIpv6AddressOnCreation sets the AssignIpv6AddressOnCreation field's value. -func (s *ModifySubnetAttributeInput) SetAssignIpv6AddressOnCreation(v *AttributeBooleanValue) *ModifySubnetAttributeInput { - s.AssignIpv6AddressOnCreation = v - return s -} - -// SetMapPublicIpOnLaunch sets the MapPublicIpOnLaunch field's value. -func (s *ModifySubnetAttributeInput) SetMapPublicIpOnLaunch(v *AttributeBooleanValue) *ModifySubnetAttributeInput { - s.MapPublicIpOnLaunch = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ModifySubnetAttributeInput) SetSubnetId(v string) *ModifySubnetAttributeInput { - s.SubnetId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttributeOutput -type ModifySubnetAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifySubnetAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifySubnetAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyVolumeAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttributeRequest -type ModifyVolumeAttributeInput struct { - _ struct{} `type:"structure"` - - // Indicates whether the volume should be auto-enabled for I/O operations. - AutoEnableIO *AttributeBooleanValue `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the volume. - // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVolumeAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVolumeAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVolumeAttributeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoEnableIO sets the AutoEnableIO field's value. -func (s *ModifyVolumeAttributeInput) SetAutoEnableIO(v *AttributeBooleanValue) *ModifyVolumeAttributeInput { - s.AutoEnableIO = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVolumeAttributeInput) SetDryRun(v bool) *ModifyVolumeAttributeInput { - s.DryRun = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *ModifyVolumeAttributeInput) SetVolumeId(v string) *ModifyVolumeAttributeInput { - s.VolumeId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttributeOutput -type ModifyVolumeAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyVolumeAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeAttributeOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeRequest -type ModifyVolumeInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // Target IOPS rate of the volume to be modified. - // - // Only valid for Provisioned IOPS SSD (io1) volumes. For more information about - // io1 IOPS configuration, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops). - // - // Default: If no IOPS value is specified, the existing value is retained. - Iops *int64 `type:"integer"` - - // Target size in GiB of the volume to be modified. Target volume size must - // be greater than or equal to than the existing size of the volume. For information - // about available EBS volume sizes, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html - // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html). - // - // Default: If no size is specified, the existing size is retained. - Size *int64 `type:"integer"` - - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` - - // Target EBS volume type of the volume to be modified - // - // The API does not support modifications for volume type standard. You also - // cannot change the type of a volume to standard. - // - // Default: If no type is specified, the existing type is retained. - VolumeType *string `type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s ModifyVolumeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVolumeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVolumeInput"} - if s.VolumeId == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVolumeInput) SetDryRun(v bool) *ModifyVolumeInput { - s.DryRun = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *ModifyVolumeInput) SetIops(v int64) *ModifyVolumeInput { - s.Iops = &v - return s -} - -// SetSize sets the Size field's value. -func (s *ModifyVolumeInput) SetSize(v int64) *ModifyVolumeInput { - s.Size = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *ModifyVolumeInput) SetVolumeId(v string) *ModifyVolumeInput { - s.VolumeId = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *ModifyVolumeInput) SetVolumeType(v string) *ModifyVolumeInput { - s.VolumeType = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeResult -type ModifyVolumeOutput struct { - _ struct{} `type:"structure"` - - // A VolumeModification object. - VolumeModification *VolumeModification `locationName:"volumeModification" type:"structure"` -} - -// String returns the string representation -func (s ModifyVolumeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVolumeOutput) GoString() string { - return s.String() -} - -// SetVolumeModification sets the VolumeModification field's value. -func (s *ModifyVolumeOutput) SetVolumeModification(v *VolumeModification) *ModifyVolumeOutput { - s.VolumeModification = v - return s -} - -// Contains the parameters for ModifyVpcAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttributeRequest -type ModifyVpcAttributeInput struct { - _ struct{} `type:"structure"` - - // Indicates whether the instances launched in the VPC get DNS hostnames. If - // enabled, instances in the VPC get DNS hostnames; otherwise, they do not. - // - // You cannot modify the DNS resolution and DNS hostnames attributes in the - // same request. Use separate requests for each attribute. You can only enable - // DNS hostnames if you've enabled DNS support. - EnableDnsHostnames *AttributeBooleanValue `type:"structure"` - - // Indicates whether the DNS resolution is supported for the VPC. If enabled, - // queries to the Amazon provided DNS server at the 169.254.169.253 IP address, - // or the reserved IP address at the base of the VPC network range "plus two" - // will succeed. If disabled, the Amazon provided DNS service in the VPC that - // resolves public DNS hostnames to IP addresses is not enabled. - // - // You cannot modify the DNS resolution and DNS hostnames attributes in the - // same request. Use separate requests for each attribute. - EnableDnsSupport *AttributeBooleanValue `type:"structure"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcAttributeInput"} - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnableDnsHostnames sets the EnableDnsHostnames field's value. -func (s *ModifyVpcAttributeInput) SetEnableDnsHostnames(v *AttributeBooleanValue) *ModifyVpcAttributeInput { - s.EnableDnsHostnames = v - return s -} - -// SetEnableDnsSupport sets the EnableDnsSupport field's value. -func (s *ModifyVpcAttributeInput) SetEnableDnsSupport(v *AttributeBooleanValue) *ModifyVpcAttributeInput { - s.EnableDnsSupport = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ModifyVpcAttributeInput) SetVpcId(v string) *ModifyVpcAttributeInput { - s.VpcId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttributeOutput -type ModifyVpcAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ModifyVpcAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ModifyVpcEndpoint. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointRequest -type ModifyVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // One or more route tables IDs to associate with the endpoint. - AddRouteTableIds []*string `locationName:"AddRouteTableId" locationNameList:"item" type:"list"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // A policy document to attach to the endpoint. The policy must be in valid - // JSON format. - PolicyDocument *string `type:"string"` - - // One or more route table IDs to disassociate from the endpoint. - RemoveRouteTableIds []*string `locationName:"RemoveRouteTableId" locationNameList:"item" type:"list"` - - // Specify true to reset the policy document to the default policy. The default - // policy allows access to the service. - ResetPolicy *bool `type:"boolean"` - - // The ID of the endpoint. - // - // VpcEndpointId is a required field - VpcEndpointId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcEndpointInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcEndpointInput"} - if s.VpcEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcEndpointId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddRouteTableIds sets the AddRouteTableIds field's value. -func (s *ModifyVpcEndpointInput) SetAddRouteTableIds(v []*string) *ModifyVpcEndpointInput { - s.AddRouteTableIds = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcEndpointInput) SetDryRun(v bool) *ModifyVpcEndpointInput { - s.DryRun = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *ModifyVpcEndpointInput) SetPolicyDocument(v string) *ModifyVpcEndpointInput { - s.PolicyDocument = &v - return s -} - -// SetRemoveRouteTableIds sets the RemoveRouteTableIds field's value. -func (s *ModifyVpcEndpointInput) SetRemoveRouteTableIds(v []*string) *ModifyVpcEndpointInput { - s.RemoveRouteTableIds = v - return s -} - -// SetResetPolicy sets the ResetPolicy field's value. -func (s *ModifyVpcEndpointInput) SetResetPolicy(v bool) *ModifyVpcEndpointInput { - s.ResetPolicy = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *ModifyVpcEndpointInput) SetVpcEndpointId(v string) *ModifyVpcEndpointInput { - s.VpcEndpointId = &v - return s -} - -// Contains the output of ModifyVpcEndpoint. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointResult -type ModifyVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s ModifyVpcEndpointOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *ModifyVpcEndpointOutput) SetReturn(v bool) *ModifyVpcEndpointOutput { - s.Return = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptionsRequest -type ModifyVpcPeeringConnectionOptionsInput struct { - _ struct{} `type:"structure"` - - // The VPC peering connection options for the accepter VPC. - AccepterPeeringConnectionOptions *PeeringConnectionOptionsRequest `type:"structure"` - - // Checks whether you have the required permissions for the operation, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The VPC peering connection options for the requester VPC. - RequesterPeeringConnectionOptions *PeeringConnectionOptionsRequest `type:"structure"` - - // The ID of the VPC peering connection. - // - // VpcPeeringConnectionId is a required field - VpcPeeringConnectionId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModifyVpcPeeringConnectionOptionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcPeeringConnectionOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyVpcPeeringConnectionOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyVpcPeeringConnectionOptionsInput"} - if s.VpcPeeringConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccepterPeeringConnectionOptions sets the AccepterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetAccepterPeeringConnectionOptions(v *PeeringConnectionOptionsRequest) *ModifyVpcPeeringConnectionOptionsInput { - s.AccepterPeeringConnectionOptions = v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetDryRun(v bool) *ModifyVpcPeeringConnectionOptionsInput { - s.DryRun = &v - return s -} - -// SetRequesterPeeringConnectionOptions sets the RequesterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetRequesterPeeringConnectionOptions(v *PeeringConnectionOptionsRequest) *ModifyVpcPeeringConnectionOptionsInput { - s.RequesterPeeringConnectionOptions = v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *ModifyVpcPeeringConnectionOptionsInput) SetVpcPeeringConnectionId(v string) *ModifyVpcPeeringConnectionOptionsInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptionsResult -type ModifyVpcPeeringConnectionOptionsOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC peering connection options for the accepter VPC. - AccepterPeeringConnectionOptions *PeeringConnectionOptions `locationName:"accepterPeeringConnectionOptions" type:"structure"` - - // Information about the VPC peering connection options for the requester VPC. - RequesterPeeringConnectionOptions *PeeringConnectionOptions `locationName:"requesterPeeringConnectionOptions" type:"structure"` -} - -// String returns the string representation -func (s ModifyVpcPeeringConnectionOptionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyVpcPeeringConnectionOptionsOutput) GoString() string { - return s.String() -} - -// SetAccepterPeeringConnectionOptions sets the AccepterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsOutput) SetAccepterPeeringConnectionOptions(v *PeeringConnectionOptions) *ModifyVpcPeeringConnectionOptionsOutput { - s.AccepterPeeringConnectionOptions = v - return s -} - -// SetRequesterPeeringConnectionOptions sets the RequesterPeeringConnectionOptions field's value. -func (s *ModifyVpcPeeringConnectionOptionsOutput) SetRequesterPeeringConnectionOptions(v *PeeringConnectionOptions) *ModifyVpcPeeringConnectionOptionsOutput { - s.RequesterPeeringConnectionOptions = v - return s -} - -// Contains the parameters for MonitorInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstancesRequest -type MonitorInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s MonitorInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MonitorInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MonitorInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MonitorInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *MonitorInstancesInput) SetDryRun(v bool) *MonitorInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *MonitorInstancesInput) SetInstanceIds(v []*string) *MonitorInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of MonitorInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstancesResult -type MonitorInstancesOutput struct { - _ struct{} `type:"structure"` - - // The monitoring information. - InstanceMonitorings []*InstanceMonitoring `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s MonitorInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MonitorInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceMonitorings sets the InstanceMonitorings field's value. -func (s *MonitorInstancesOutput) SetInstanceMonitorings(v []*InstanceMonitoring) *MonitorInstancesOutput { - s.InstanceMonitorings = v - return s -} - -// Describes the monitoring of an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Monitoring -type Monitoring struct { - _ struct{} `type:"structure"` - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - State *string `locationName:"state" type:"string" enum:"MonitoringState"` -} - -// String returns the string representation -func (s Monitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Monitoring) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *Monitoring) SetState(v string) *Monitoring { - s.State = &v - return s -} - -// Contains the parameters for MoveAddressToVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpcRequest -type MoveAddressToVpcInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The Elastic IP address. - // - // PublicIp is a required field - PublicIp *string `locationName:"publicIp" type:"string" required:"true"` -} - -// String returns the string representation -func (s MoveAddressToVpcInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MoveAddressToVpcInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MoveAddressToVpcInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MoveAddressToVpcInput"} - if s.PublicIp == nil { - invalidParams.Add(request.NewErrParamRequired("PublicIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *MoveAddressToVpcInput) SetDryRun(v bool) *MoveAddressToVpcInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *MoveAddressToVpcInput) SetPublicIp(v string) *MoveAddressToVpcInput { - s.PublicIp = &v - return s -} - -// Contains the output of MoveAddressToVpc. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpcResult -type MoveAddressToVpcOutput struct { - _ struct{} `type:"structure"` - - // The allocation ID for the Elastic IP address. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The status of the move of the IP address. - Status *string `locationName:"status" type:"string" enum:"Status"` -} - -// String returns the string representation -func (s MoveAddressToVpcOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MoveAddressToVpcOutput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *MoveAddressToVpcOutput) SetAllocationId(v string) *MoveAddressToVpcOutput { - s.AllocationId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *MoveAddressToVpcOutput) SetStatus(v string) *MoveAddressToVpcOutput { - s.Status = &v - return s -} - -// Describes the status of a moving Elastic IP address. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MovingAddressStatus -type MovingAddressStatus struct { - _ struct{} `type:"structure"` - - // The status of the Elastic IP address that's being moved to the EC2-VPC platform, - // or restored to the EC2-Classic platform. - MoveStatus *string `locationName:"moveStatus" type:"string" enum:"MoveStatus"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s MovingAddressStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MovingAddressStatus) GoString() string { - return s.String() -} - -// SetMoveStatus sets the MoveStatus field's value. -func (s *MovingAddressStatus) SetMoveStatus(v string) *MovingAddressStatus { - s.MoveStatus = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *MovingAddressStatus) SetPublicIp(v string) *MovingAddressStatus { - s.PublicIp = &v - return s -} - -// Describes a NAT gateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NatGateway -type NatGateway struct { - _ struct{} `type:"structure"` - - // The date and time the NAT gateway was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // The date and time the NAT gateway was deleted, if applicable. - DeleteTime *time.Time `locationName:"deleteTime" type:"timestamp" timestampFormat:"iso8601"` - - // If the NAT gateway could not be created, specifies the error code for the - // failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound - // | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound) - FailureCode *string `locationName:"failureCode" type:"string"` - - // If the NAT gateway could not be created, specifies the error message for - // the failure, that corresponds to the error code. - // - // * For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free - // addresses to create this NAT gateway" - // - // * For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway - // attached" - // - // * For InvalidAllocationID.NotFound: "Elastic IP address eipalloc-xxxxxxxx - // could not be associated with this NAT gateway" - // - // * For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx - // is already associated" - // - // * For InternalError: "Network interface eni-xxxxxxxx, created and used - // internally by this NAT gateway is in an invalid state. Please try again." - // - // * For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx - // does not exist or could not be found." - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // Information about the IP addresses and network interface associated with - // the NAT gateway. - NatGatewayAddresses []*NatGatewayAddress `locationName:"natGatewayAddressSet" locationNameList:"item" type:"list"` - - // The ID of the NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - ProvisionedBandwidth *ProvisionedBandwidth `locationName:"provisionedBandwidth" type:"structure"` - - // The state of the NAT gateway. - // - // * pending: The NAT gateway is being created and is not ready to process - // traffic. - // - // * failed: The NAT gateway could not be created. Check the failureCode - // and failureMessage fields for the reason. - // - // * available: The NAT gateway is able to process traffic. This status remains - // until you delete the NAT gateway, and does not indicate the health of - // the NAT gateway. - // - // * deleting: The NAT gateway is in the process of being terminated and - // may still be processing traffic. - // - // * deleted: The NAT gateway has been terminated and is no longer processing - // traffic. - State *string `locationName:"state" type:"string" enum:"NatGatewayState"` - - // The ID of the subnet in which the NAT gateway is located. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The ID of the VPC in which the NAT gateway is located. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s NatGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NatGateway) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *NatGateway) SetCreateTime(v time.Time) *NatGateway { - s.CreateTime = &v - return s -} - -// SetDeleteTime sets the DeleteTime field's value. -func (s *NatGateway) SetDeleteTime(v time.Time) *NatGateway { - s.DeleteTime = &v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *NatGateway) SetFailureCode(v string) *NatGateway { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *NatGateway) SetFailureMessage(v string) *NatGateway { - s.FailureMessage = &v - return s -} - -// SetNatGatewayAddresses sets the NatGatewayAddresses field's value. -func (s *NatGateway) SetNatGatewayAddresses(v []*NatGatewayAddress) *NatGateway { - s.NatGatewayAddresses = v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *NatGateway) SetNatGatewayId(v string) *NatGateway { - s.NatGatewayId = &v - return s -} - -// SetProvisionedBandwidth sets the ProvisionedBandwidth field's value. -func (s *NatGateway) SetProvisionedBandwidth(v *ProvisionedBandwidth) *NatGateway { - s.ProvisionedBandwidth = v - return s -} - -// SetState sets the State field's value. -func (s *NatGateway) SetState(v string) *NatGateway { - s.State = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NatGateway) SetSubnetId(v string) *NatGateway { - s.SubnetId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *NatGateway) SetVpcId(v string) *NatGateway { - s.VpcId = &v - return s -} - -// Describes the IP addresses and network interface associated with a NAT gateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NatGatewayAddress -type NatGatewayAddress struct { - _ struct{} `type:"structure"` - - // The allocation ID of the Elastic IP address that's associated with the NAT - // gateway. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The ID of the network interface associated with the NAT gateway. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The private IP address associated with the Elastic IP address. - PrivateIp *string `locationName:"privateIp" type:"string"` - - // The Elastic IP address associated with the NAT gateway. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s NatGatewayAddress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NatGatewayAddress) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *NatGatewayAddress) SetAllocationId(v string) *NatGatewayAddress { - s.AllocationId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NatGatewayAddress) SetNetworkInterfaceId(v string) *NatGatewayAddress { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIp sets the PrivateIp field's value. -func (s *NatGatewayAddress) SetPrivateIp(v string) *NatGatewayAddress { - s.PrivateIp = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *NatGatewayAddress) SetPublicIp(v string) *NatGatewayAddress { - s.PublicIp = &v - return s -} - -// Describes a network ACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkAcl -type NetworkAcl struct { - _ struct{} `type:"structure"` - - // Any associations between the network ACL and one or more subnets - Associations []*NetworkAclAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` - - // One or more entries (rules) in the network ACL. - Entries []*NetworkAclEntry `locationName:"entrySet" locationNameList:"item" type:"list"` - - // Indicates whether this is the default network ACL for the VPC. - IsDefault *bool `locationName:"default" type:"boolean"` - - // The ID of the network ACL. - NetworkAclId *string `locationName:"networkAclId" type:"string"` - - // Any tags assigned to the network ACL. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC for the network ACL. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s NetworkAcl) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkAcl) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *NetworkAcl) SetAssociations(v []*NetworkAclAssociation) *NetworkAcl { - s.Associations = v - return s -} - -// SetEntries sets the Entries field's value. -func (s *NetworkAcl) SetEntries(v []*NetworkAclEntry) *NetworkAcl { - s.Entries = v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *NetworkAcl) SetIsDefault(v bool) *NetworkAcl { - s.IsDefault = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *NetworkAcl) SetNetworkAclId(v string) *NetworkAcl { - s.NetworkAclId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *NetworkAcl) SetTags(v []*Tag) *NetworkAcl { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *NetworkAcl) SetVpcId(v string) *NetworkAcl { - s.VpcId = &v - return s -} - -// Describes an association between a network ACL and a subnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkAclAssociation -type NetworkAclAssociation struct { - _ struct{} `type:"structure"` - - // The ID of the association between a network ACL and a subnet. - NetworkAclAssociationId *string `locationName:"networkAclAssociationId" type:"string"` - - // The ID of the network ACL. - NetworkAclId *string `locationName:"networkAclId" type:"string"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s NetworkAclAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkAclAssociation) GoString() string { - return s.String() -} - -// SetNetworkAclAssociationId sets the NetworkAclAssociationId field's value. -func (s *NetworkAclAssociation) SetNetworkAclAssociationId(v string) *NetworkAclAssociation { - s.NetworkAclAssociationId = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *NetworkAclAssociation) SetNetworkAclId(v string) *NetworkAclAssociation { - s.NetworkAclId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkAclAssociation) SetSubnetId(v string) *NetworkAclAssociation { - s.SubnetId = &v - return s -} - -// Describes an entry in a network ACL. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkAclEntry -type NetworkAclEntry struct { - _ struct{} `type:"structure"` - - // The IPv4 network range to allow or deny, in CIDR notation. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Indicates whether the rule is an egress rule (applied to traffic leaving - // the subnet). - Egress *bool `locationName:"egress" type:"boolean"` - - // ICMP protocol: The ICMP type and code. - IcmpTypeCode *IcmpTypeCode `locationName:"icmpTypeCode" type:"structure"` - - // The IPv6 network range to allow or deny, in CIDR notation. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // TCP or UDP protocols: The range of ports the rule applies to. - PortRange *PortRange `locationName:"portRange" type:"structure"` - - // The protocol. A value of -1 means all protocols. - Protocol *string `locationName:"protocol" type:"string"` - - // Indicates whether to allow or deny the traffic that matches the rule. - RuleAction *string `locationName:"ruleAction" type:"string" enum:"RuleAction"` - - // The rule number for the entry. ACL entries are processed in ascending order - // by rule number. - RuleNumber *int64 `locationName:"ruleNumber" type:"integer"` -} - -// String returns the string representation -func (s NetworkAclEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkAclEntry) GoString() string { - return s.String() -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *NetworkAclEntry) SetCidrBlock(v string) *NetworkAclEntry { - s.CidrBlock = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *NetworkAclEntry) SetEgress(v bool) *NetworkAclEntry { - s.Egress = &v - return s -} - -// SetIcmpTypeCode sets the IcmpTypeCode field's value. -func (s *NetworkAclEntry) SetIcmpTypeCode(v *IcmpTypeCode) *NetworkAclEntry { - s.IcmpTypeCode = v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *NetworkAclEntry) SetIpv6CidrBlock(v string) *NetworkAclEntry { - s.Ipv6CidrBlock = &v - return s -} - -// SetPortRange sets the PortRange field's value. -func (s *NetworkAclEntry) SetPortRange(v *PortRange) *NetworkAclEntry { - s.PortRange = v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *NetworkAclEntry) SetProtocol(v string) *NetworkAclEntry { - s.Protocol = &v - return s -} - -// SetRuleAction sets the RuleAction field's value. -func (s *NetworkAclEntry) SetRuleAction(v string) *NetworkAclEntry { - s.RuleAction = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *NetworkAclEntry) SetRuleNumber(v int64) *NetworkAclEntry { - s.RuleNumber = &v - return s -} - -// Describes a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkInterface -type NetworkInterface struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IP address (IPv4) associated with - // the network interface. - Association *NetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // The network interface attachment. - Attachment *NetworkInterfaceAttachment `locationName:"attachment" type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // A description. - Description *string `locationName:"description" type:"string"` - - // Any security groups for the network interface. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The type of interface. - InterfaceType *string `locationName:"interfaceType" type:"string" enum:"NetworkInterfaceType"` - - // The IPv6 addresses associated with the network interface. - Ipv6Addresses []*NetworkInterfaceIpv6Address `locationName:"ipv6AddressesSet" locationNameList:"item" type:"list"` - - // The MAC address. - MacAddress *string `locationName:"macAddress" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The AWS account ID of the owner of the network interface. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The private DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The private IPv4 addresses associated with the network interface. - PrivateIpAddresses []*NetworkInterfacePrivateIpAddress `locationName:"privateIpAddressesSet" locationNameList:"item" type:"list"` - - // The ID of the entity that launched the instance on your behalf (for example, - // AWS Management Console or Auto Scaling). - RequesterId *string `locationName:"requesterId" type:"string"` - - // Indicates whether the network interface is being managed by AWS. - RequesterManaged *bool `locationName:"requesterManaged" type:"boolean"` - - // Indicates whether traffic to or from the instance is validated. - SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"` - - // The status of the network interface. - Status *string `locationName:"status" type:"string" enum:"NetworkInterfaceStatus"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` - - // Any tags assigned to the network interface. - TagSet []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s NetworkInterface) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterface) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *NetworkInterface) SetAssociation(v *NetworkInterfaceAssociation) *NetworkInterface { - s.Association = v - return s -} - -// SetAttachment sets the Attachment field's value. -func (s *NetworkInterface) SetAttachment(v *NetworkInterfaceAttachment) *NetworkInterface { - s.Attachment = v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *NetworkInterface) SetAvailabilityZone(v string) *NetworkInterface { - s.AvailabilityZone = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *NetworkInterface) SetDescription(v string) *NetworkInterface { - s.Description = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *NetworkInterface) SetGroups(v []*GroupIdentifier) *NetworkInterface { - s.Groups = v - return s -} - -// SetInterfaceType sets the InterfaceType field's value. -func (s *NetworkInterface) SetInterfaceType(v string) *NetworkInterface { - s.InterfaceType = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *NetworkInterface) SetIpv6Addresses(v []*NetworkInterfaceIpv6Address) *NetworkInterface { - s.Ipv6Addresses = v - return s -} - -// SetMacAddress sets the MacAddress field's value. -func (s *NetworkInterface) SetMacAddress(v string) *NetworkInterface { - s.MacAddress = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NetworkInterface) SetNetworkInterfaceId(v string) *NetworkInterface { - s.NetworkInterfaceId = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *NetworkInterface) SetOwnerId(v string) *NetworkInterface { - s.OwnerId = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *NetworkInterface) SetPrivateDnsName(v string) *NetworkInterface { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *NetworkInterface) SetPrivateIpAddress(v string) *NetworkInterface { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *NetworkInterface) SetPrivateIpAddresses(v []*NetworkInterfacePrivateIpAddress) *NetworkInterface { - s.PrivateIpAddresses = v - return s -} - -// SetRequesterId sets the RequesterId field's value. -func (s *NetworkInterface) SetRequesterId(v string) *NetworkInterface { - s.RequesterId = &v - return s -} - -// SetRequesterManaged sets the RequesterManaged field's value. -func (s *NetworkInterface) SetRequesterManaged(v bool) *NetworkInterface { - s.RequesterManaged = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *NetworkInterface) SetSourceDestCheck(v bool) *NetworkInterface { - s.SourceDestCheck = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *NetworkInterface) SetStatus(v string) *NetworkInterface { - s.Status = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkInterface) SetSubnetId(v string) *NetworkInterface { - s.SubnetId = &v - return s -} - -// SetTagSet sets the TagSet field's value. -func (s *NetworkInterface) SetTagSet(v []*Tag) *NetworkInterface { - s.TagSet = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *NetworkInterface) SetVpcId(v string) *NetworkInterface { - s.VpcId = &v - return s -} - -// Describes association information for an Elastic IP address (IPv4 only). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkInterfaceAssociation -type NetworkInterfaceAssociation struct { - _ struct{} `type:"structure"` - - // The allocation ID. - AllocationId *string `locationName:"allocationId" type:"string"` - - // The association ID. - AssociationId *string `locationName:"associationId" type:"string"` - - // The ID of the Elastic IP address owner. - IpOwnerId *string `locationName:"ipOwnerId" type:"string"` - - // The public DNS name. - PublicDnsName *string `locationName:"publicDnsName" type:"string"` - - // The address of the Elastic IP address bound to the network interface. - PublicIp *string `locationName:"publicIp" type:"string"` -} - -// String returns the string representation -func (s NetworkInterfaceAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceAssociation) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *NetworkInterfaceAssociation) SetAllocationId(v string) *NetworkInterfaceAssociation { - s.AllocationId = &v - return s -} - -// SetAssociationId sets the AssociationId field's value. -func (s *NetworkInterfaceAssociation) SetAssociationId(v string) *NetworkInterfaceAssociation { - s.AssociationId = &v - return s -} - -// SetIpOwnerId sets the IpOwnerId field's value. -func (s *NetworkInterfaceAssociation) SetIpOwnerId(v string) *NetworkInterfaceAssociation { - s.IpOwnerId = &v - return s -} - -// SetPublicDnsName sets the PublicDnsName field's value. -func (s *NetworkInterfaceAssociation) SetPublicDnsName(v string) *NetworkInterfaceAssociation { - s.PublicDnsName = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *NetworkInterfaceAssociation) SetPublicIp(v string) *NetworkInterfaceAssociation { - s.PublicIp = &v - return s -} - -// Describes a network interface attachment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkInterfaceAttachment -type NetworkInterfaceAttachment struct { - _ struct{} `type:"structure"` - - // The timestamp indicating when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The device index of the network interface attachment on the instance. - DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The AWS account ID of the owner of the instance. - InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` - - // The attachment state. - Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` -} - -// String returns the string representation -func (s NetworkInterfaceAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceAttachment) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *NetworkInterfaceAttachment) SetAttachTime(v time.Time) *NetworkInterfaceAttachment { - s.AttachTime = &v - return s -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *NetworkInterfaceAttachment) SetAttachmentId(v string) *NetworkInterfaceAttachment { - s.AttachmentId = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *NetworkInterfaceAttachment) SetDeleteOnTermination(v bool) *NetworkInterfaceAttachment { - s.DeleteOnTermination = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *NetworkInterfaceAttachment) SetDeviceIndex(v int64) *NetworkInterfaceAttachment { - s.DeviceIndex = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *NetworkInterfaceAttachment) SetInstanceId(v string) *NetworkInterfaceAttachment { - s.InstanceId = &v - return s -} - -// SetInstanceOwnerId sets the InstanceOwnerId field's value. -func (s *NetworkInterfaceAttachment) SetInstanceOwnerId(v string) *NetworkInterfaceAttachment { - s.InstanceOwnerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *NetworkInterfaceAttachment) SetStatus(v string) *NetworkInterfaceAttachment { - s.Status = &v - return s -} - -// Describes an attachment change. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkInterfaceAttachmentChanges -type NetworkInterfaceAttachmentChanges struct { - _ struct{} `type:"structure"` - - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` - - // Indicates whether the network interface is deleted when the instance is terminated. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` -} - -// String returns the string representation -func (s NetworkInterfaceAttachmentChanges) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceAttachmentChanges) GoString() string { - return s.String() -} - -// SetAttachmentId sets the AttachmentId field's value. -func (s *NetworkInterfaceAttachmentChanges) SetAttachmentId(v string) *NetworkInterfaceAttachmentChanges { - s.AttachmentId = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *NetworkInterfaceAttachmentChanges) SetDeleteOnTermination(v bool) *NetworkInterfaceAttachmentChanges { - s.DeleteOnTermination = &v - return s -} - -// Describes an IPv6 address associated with a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkInterfaceIpv6Address -type NetworkInterfaceIpv6Address struct { - _ struct{} `type:"structure"` - - // The IPv6 address. - Ipv6Address *string `locationName:"ipv6Address" type:"string"` -} - -// String returns the string representation -func (s NetworkInterfaceIpv6Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceIpv6Address) GoString() string { - return s.String() -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *NetworkInterfaceIpv6Address) SetIpv6Address(v string) *NetworkInterfaceIpv6Address { - s.Ipv6Address = &v - return s -} - -// Describes the private IPv4 address of a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NetworkInterfacePrivateIpAddress -type NetworkInterfacePrivateIpAddress struct { - _ struct{} `type:"structure"` - - // The association information for an Elastic IP address (IPv4) associated with - // the network interface. - Association *NetworkInterfaceAssociation `locationName:"association" type:"structure"` - - // Indicates whether this IPv4 address is the primary private IPv4 address of - // the network interface. - Primary *bool `locationName:"primary" type:"boolean"` - - // The private DNS name. - PrivateDnsName *string `locationName:"privateDnsName" type:"string"` - - // The private IPv4 address. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` -} - -// String returns the string representation -func (s NetworkInterfacePrivateIpAddress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfacePrivateIpAddress) GoString() string { - return s.String() -} - -// SetAssociation sets the Association field's value. -func (s *NetworkInterfacePrivateIpAddress) SetAssociation(v *NetworkInterfaceAssociation) *NetworkInterfacePrivateIpAddress { - s.Association = v - return s -} - -// SetPrimary sets the Primary field's value. -func (s *NetworkInterfacePrivateIpAddress) SetPrimary(v bool) *NetworkInterfacePrivateIpAddress { - s.Primary = &v - return s -} - -// SetPrivateDnsName sets the PrivateDnsName field's value. -func (s *NetworkInterfacePrivateIpAddress) SetPrivateDnsName(v string) *NetworkInterfacePrivateIpAddress { - s.PrivateDnsName = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *NetworkInterfacePrivateIpAddress) SetPrivateIpAddress(v string) *NetworkInterfacePrivateIpAddress { - s.PrivateIpAddress = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/NewDhcpConfiguration -type NewDhcpConfiguration struct { - _ struct{} `type:"structure"` - - Key *string `locationName:"key" type:"string"` - - Values []*string `locationName:"Value" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s NewDhcpConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NewDhcpConfiguration) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *NewDhcpConfiguration) SetKey(v string) *NewDhcpConfiguration { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *NewDhcpConfiguration) SetValues(v []*string) *NewDhcpConfiguration { - s.Values = v - return s -} - -// Describes the VPC peering connection options. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PeeringConnectionOptions -type PeeringConnectionOptions struct { - _ struct{} `type:"structure"` - - // If true, enables a local VPC to resolve public DNS hostnames to private IP - // addresses when queried from instances in the peer VPC. - AllowDnsResolutionFromRemoteVpc *bool `locationName:"allowDnsResolutionFromRemoteVpc" type:"boolean"` - - // If true, enables outbound communication from an EC2-Classic instance that's - // linked to a local VPC via ClassicLink to instances in a peer VPC. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool `locationName:"allowEgressFromLocalClassicLinkToRemoteVpc" type:"boolean"` - - // If true, enables outbound communication from instances in a local VPC to - // an EC2-Classic instance that's linked to a peer VPC via ClassicLink. - AllowEgressFromLocalVpcToRemoteClassicLink *bool `locationName:"allowEgressFromLocalVpcToRemoteClassicLink" type:"boolean"` -} - -// String returns the string representation -func (s PeeringConnectionOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PeeringConnectionOptions) GoString() string { - return s.String() -} - -// SetAllowDnsResolutionFromRemoteVpc sets the AllowDnsResolutionFromRemoteVpc field's value. -func (s *PeeringConnectionOptions) SetAllowDnsResolutionFromRemoteVpc(v bool) *PeeringConnectionOptions { - s.AllowDnsResolutionFromRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalClassicLinkToRemoteVpc sets the AllowEgressFromLocalClassicLinkToRemoteVpc field's value. -func (s *PeeringConnectionOptions) SetAllowEgressFromLocalClassicLinkToRemoteVpc(v bool) *PeeringConnectionOptions { - s.AllowEgressFromLocalClassicLinkToRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalVpcToRemoteClassicLink sets the AllowEgressFromLocalVpcToRemoteClassicLink field's value. -func (s *PeeringConnectionOptions) SetAllowEgressFromLocalVpcToRemoteClassicLink(v bool) *PeeringConnectionOptions { - s.AllowEgressFromLocalVpcToRemoteClassicLink = &v - return s -} - -// The VPC peering connection options. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PeeringConnectionOptionsRequest -type PeeringConnectionOptionsRequest struct { - _ struct{} `type:"structure"` - - // If true, enables a local VPC to resolve public DNS hostnames to private IP - // addresses when queried from instances in the peer VPC. - AllowDnsResolutionFromRemoteVpc *bool `type:"boolean"` - - // If true, enables outbound communication from an EC2-Classic instance that's - // linked to a local VPC via ClassicLink to instances in a peer VPC. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool `type:"boolean"` - - // If true, enables outbound communication from instances in a local VPC to - // an EC2-Classic instance that's linked to a peer VPC via ClassicLink. - AllowEgressFromLocalVpcToRemoteClassicLink *bool `type:"boolean"` -} - -// String returns the string representation -func (s PeeringConnectionOptionsRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PeeringConnectionOptionsRequest) GoString() string { - return s.String() -} - -// SetAllowDnsResolutionFromRemoteVpc sets the AllowDnsResolutionFromRemoteVpc field's value. -func (s *PeeringConnectionOptionsRequest) SetAllowDnsResolutionFromRemoteVpc(v bool) *PeeringConnectionOptionsRequest { - s.AllowDnsResolutionFromRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalClassicLinkToRemoteVpc sets the AllowEgressFromLocalClassicLinkToRemoteVpc field's value. -func (s *PeeringConnectionOptionsRequest) SetAllowEgressFromLocalClassicLinkToRemoteVpc(v bool) *PeeringConnectionOptionsRequest { - s.AllowEgressFromLocalClassicLinkToRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalVpcToRemoteClassicLink sets the AllowEgressFromLocalVpcToRemoteClassicLink field's value. -func (s *PeeringConnectionOptionsRequest) SetAllowEgressFromLocalVpcToRemoteClassicLink(v bool) *PeeringConnectionOptionsRequest { - s.AllowEgressFromLocalVpcToRemoteClassicLink = &v - return s -} - -// Describes the placement of an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Placement -type Placement struct { - _ struct{} `type:"structure"` - - // The affinity setting for the instance on the Dedicated Host. This parameter - // is not supported for the ImportInstance command. - Affinity *string `locationName:"affinity" type:"string"` - - // The Availability Zone of the instance. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The name of the placement group the instance is in (for cluster compute instances). - GroupName *string `locationName:"groupName" type:"string"` - - // The ID of the Dedicated Host on which the instance resides. This parameter - // is not supported for the ImportInstance command. - HostId *string `locationName:"hostId" type:"string"` - - // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. The host tenancy - // is not supported for the ImportInstance command. - Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s Placement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Placement) GoString() string { - return s.String() -} - -// SetAffinity sets the Affinity field's value. -func (s *Placement) SetAffinity(v string) *Placement { - s.Affinity = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Placement) SetAvailabilityZone(v string) *Placement { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *Placement) SetGroupName(v string) *Placement { - s.GroupName = &v - return s -} - -// SetHostId sets the HostId field's value. -func (s *Placement) SetHostId(v string) *Placement { - s.HostId = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *Placement) SetTenancy(v string) *Placement { - s.Tenancy = &v - return s -} - -// Describes a placement group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PlacementGroup -type PlacementGroup struct { - _ struct{} `type:"structure"` - - // The name of the placement group. - GroupName *string `locationName:"groupName" type:"string"` - - // The state of the placement group. - State *string `locationName:"state" type:"string" enum:"PlacementGroupState"` - - // The placement strategy. - Strategy *string `locationName:"strategy" type:"string" enum:"PlacementStrategy"` -} - -// String returns the string representation -func (s PlacementGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlacementGroup) GoString() string { - return s.String() -} - -// SetGroupName sets the GroupName field's value. -func (s *PlacementGroup) SetGroupName(v string) *PlacementGroup { - s.GroupName = &v - return s -} - -// SetState sets the State field's value. -func (s *PlacementGroup) SetState(v string) *PlacementGroup { - s.State = &v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *PlacementGroup) SetStrategy(v string) *PlacementGroup { - s.Strategy = &v - return s -} - -// Describes a range of ports. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PortRange -type PortRange struct { - _ struct{} `type:"structure"` - - // The first port in the range. - From *int64 `locationName:"from" type:"integer"` - - // The last port in the range. - To *int64 `locationName:"to" type:"integer"` -} - -// String returns the string representation -func (s PortRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PortRange) GoString() string { - return s.String() -} - -// SetFrom sets the From field's value. -func (s *PortRange) SetFrom(v int64) *PortRange { - s.From = &v - return s -} - -// SetTo sets the To field's value. -func (s *PortRange) SetTo(v int64) *PortRange { - s.To = &v - return s -} - -// Describes prefixes for AWS services. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PrefixList -type PrefixList struct { - _ struct{} `type:"structure"` - - // The IP address range of the AWS service. - Cidrs []*string `locationName:"cidrSet" locationNameList:"item" type:"list"` - - // The ID of the prefix. - PrefixListId *string `locationName:"prefixListId" type:"string"` - - // The name of the prefix. - PrefixListName *string `locationName:"prefixListName" type:"string"` -} - -// String returns the string representation -func (s PrefixList) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PrefixList) GoString() string { - return s.String() -} - -// SetCidrs sets the Cidrs field's value. -func (s *PrefixList) SetCidrs(v []*string) *PrefixList { - s.Cidrs = v - return s -} - -// SetPrefixListId sets the PrefixListId field's value. -func (s *PrefixList) SetPrefixListId(v string) *PrefixList { - s.PrefixListId = &v - return s -} - -// SetPrefixListName sets the PrefixListName field's value. -func (s *PrefixList) SetPrefixListName(v string) *PrefixList { - s.PrefixListName = &v - return s -} - -// The ID of the prefix. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PrefixListId -type PrefixListId struct { - _ struct{} `type:"structure"` - - // The ID of the prefix. - PrefixListId *string `locationName:"prefixListId" type:"string"` -} - -// String returns the string representation -func (s PrefixListId) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PrefixListId) GoString() string { - return s.String() -} - -// SetPrefixListId sets the PrefixListId field's value. -func (s *PrefixListId) SetPrefixListId(v string) *PrefixListId { - s.PrefixListId = &v - return s -} - -// Describes the price for a Reserved Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PriceSchedule -type PriceSchedule struct { - _ struct{} `type:"structure"` - - // The current price schedule, as determined by the term remaining for the Reserved - // Instance in the listing. - // - // A specific price schedule is always in effect, but only one price schedule - // can be active at any time. Take, for example, a Reserved Instance listing - // that has five months remaining in its term. When you specify price schedules - // for five months and two months, this means that schedule 1, covering the - // first three months of the remaining term, will be active during months 5, - // 4, and 3. Then schedule 2, covering the last two months of the term, will - // be active for months 2 and 1. - Active *bool `locationName:"active" type:"boolean"` - - // The currency for transacting the Reserved Instance resale. At this time, - // the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The fixed price for the term. - Price *float64 `locationName:"price" type:"double"` - - // The number of months remaining in the reservation. For example, 2 is the - // second to the last month before the capacity reservation expires. - Term *int64 `locationName:"term" type:"long"` -} - -// String returns the string representation -func (s PriceSchedule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PriceSchedule) GoString() string { - return s.String() -} - -// SetActive sets the Active field's value. -func (s *PriceSchedule) SetActive(v bool) *PriceSchedule { - s.Active = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PriceSchedule) SetCurrencyCode(v string) *PriceSchedule { - s.CurrencyCode = &v - return s -} - -// SetPrice sets the Price field's value. -func (s *PriceSchedule) SetPrice(v float64) *PriceSchedule { - s.Price = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *PriceSchedule) SetTerm(v int64) *PriceSchedule { - s.Term = &v - return s -} - -// Describes the price for a Reserved Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PriceScheduleSpecification -type PriceScheduleSpecification struct { - _ struct{} `type:"structure"` - - // The currency for transacting the Reserved Instance resale. At this time, - // the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The fixed price for the term. - Price *float64 `locationName:"price" type:"double"` - - // The number of months remaining in the reservation. For example, 2 is the - // second to the last month before the capacity reservation expires. - Term *int64 `locationName:"term" type:"long"` -} - -// String returns the string representation -func (s PriceScheduleSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PriceScheduleSpecification) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PriceScheduleSpecification) SetCurrencyCode(v string) *PriceScheduleSpecification { - s.CurrencyCode = &v - return s -} - -// SetPrice sets the Price field's value. -func (s *PriceScheduleSpecification) SetPrice(v float64) *PriceScheduleSpecification { - s.Price = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *PriceScheduleSpecification) SetTerm(v int64) *PriceScheduleSpecification { - s.Term = &v - return s -} - -// Describes a Reserved Instance offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PricingDetail -type PricingDetail struct { - _ struct{} `type:"structure"` - - // The number of reservations available for the price. - Count *int64 `locationName:"count" type:"integer"` - - // The price per instance. - Price *float64 `locationName:"price" type:"double"` -} - -// String returns the string representation -func (s PricingDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PricingDetail) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *PricingDetail) SetCount(v int64) *PricingDetail { - s.Count = &v - return s -} - -// SetPrice sets the Price field's value. -func (s *PricingDetail) SetPrice(v float64) *PricingDetail { - s.Price = &v - return s -} - -// Describes a secondary private IPv4 address for a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PrivateIpAddressSpecification -type PrivateIpAddressSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether the private IPv4 address is the primary private IPv4 address. - // Only one IPv4 address can be designated as primary. - Primary *bool `locationName:"primary" type:"boolean"` - - // The private IPv4 addresses. - // - // PrivateIpAddress is a required field - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string" required:"true"` -} - -// String returns the string representation -func (s PrivateIpAddressSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PrivateIpAddressSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateIpAddressSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateIpAddressSpecification"} - if s.PrivateIpAddress == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateIpAddress")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrimary sets the Primary field's value. -func (s *PrivateIpAddressSpecification) SetPrimary(v bool) *PrivateIpAddressSpecification { - s.Primary = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *PrivateIpAddressSpecification) SetPrivateIpAddress(v string) *PrivateIpAddressSpecification { - s.PrivateIpAddress = &v - return s -} - -// Describes a product code. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProductCode -type ProductCode struct { - _ struct{} `type:"structure"` - - // The product code. - ProductCodeId *string `locationName:"productCode" type:"string"` - - // The type of product code. - ProductCodeType *string `locationName:"type" type:"string" enum:"ProductCodeValues"` -} - -// String returns the string representation -func (s ProductCode) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProductCode) GoString() string { - return s.String() -} - -// SetProductCodeId sets the ProductCodeId field's value. -func (s *ProductCode) SetProductCodeId(v string) *ProductCode { - s.ProductCodeId = &v - return s -} - -// SetProductCodeType sets the ProductCodeType field's value. -func (s *ProductCode) SetProductCodeType(v string) *ProductCode { - s.ProductCodeType = &v - return s -} - -// Describes a virtual private gateway propagating route. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PropagatingVgw -type PropagatingVgw struct { - _ struct{} `type:"structure"` - - // The ID of the virtual private gateway (VGW). - GatewayId *string `locationName:"gatewayId" type:"string"` -} - -// String returns the string representation -func (s PropagatingVgw) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PropagatingVgw) GoString() string { - return s.String() -} - -// SetGatewayId sets the GatewayId field's value. -func (s *PropagatingVgw) SetGatewayId(v string) *PropagatingVgw { - s.GatewayId = &v - return s -} - -// Reserved. If you need to sustain traffic greater than the documented limits -// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), -// contact us through the Support Center (https://console.aws.amazon.com/support/home?). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProvisionedBandwidth -type ProvisionedBandwidth struct { - _ struct{} `type:"structure"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - ProvisionTime *time.Time `locationName:"provisionTime" type:"timestamp" timestampFormat:"iso8601"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - Provisioned *string `locationName:"provisioned" type:"string"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - RequestTime *time.Time `locationName:"requestTime" type:"timestamp" timestampFormat:"iso8601"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - Requested *string `locationName:"requested" type:"string"` - - // Reserved. If you need to sustain traffic greater than the documented limits - // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html), - // contact us through the Support Center (https://console.aws.amazon.com/support/home?). - Status *string `locationName:"status" type:"string"` -} - -// String returns the string representation -func (s ProvisionedBandwidth) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProvisionedBandwidth) GoString() string { - return s.String() -} - -// SetProvisionTime sets the ProvisionTime field's value. -func (s *ProvisionedBandwidth) SetProvisionTime(v time.Time) *ProvisionedBandwidth { - s.ProvisionTime = &v - return s -} - -// SetProvisioned sets the Provisioned field's value. -func (s *ProvisionedBandwidth) SetProvisioned(v string) *ProvisionedBandwidth { - s.Provisioned = &v - return s -} - -// SetRequestTime sets the RequestTime field's value. -func (s *ProvisionedBandwidth) SetRequestTime(v time.Time) *ProvisionedBandwidth { - s.RequestTime = &v - return s -} - -// SetRequested sets the Requested field's value. -func (s *ProvisionedBandwidth) SetRequested(v string) *ProvisionedBandwidth { - s.Requested = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ProvisionedBandwidth) SetStatus(v string) *ProvisionedBandwidth { - s.Status = &v - return s -} - -// Describes the result of the purchase. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Purchase -type Purchase struct { - _ struct{} `type:"structure"` - - // The currency in which the UpfrontPrice and HourlyPrice amounts are specified. - // At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the reservation's term in seconds. - Duration *int64 `locationName:"duration" type:"integer"` - - // The IDs of the Dedicated Hosts associated with the reservation. - HostIdSet []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` - - // The ID of the reservation. - HostReservationId *string `locationName:"hostReservationId" type:"string"` - - // The hourly price of the reservation per hour. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance family on the Dedicated Host that the reservation can be associated - // with. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The payment option for the reservation. - PaymentOption *string `locationName:"paymentOption" type:"string" enum:"PaymentOption"` - - // The upfront price of the reservation. - UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` -} - -// String returns the string representation -func (s Purchase) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Purchase) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *Purchase) SetCurrencyCode(v string) *Purchase { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *Purchase) SetDuration(v int64) *Purchase { - s.Duration = &v - return s -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *Purchase) SetHostIdSet(v []*string) *Purchase { - s.HostIdSet = v - return s -} - -// SetHostReservationId sets the HostReservationId field's value. -func (s *Purchase) SetHostReservationId(v string) *Purchase { - s.HostReservationId = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *Purchase) SetHourlyPrice(v string) *Purchase { - s.HourlyPrice = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *Purchase) SetInstanceFamily(v string) *Purchase { - s.InstanceFamily = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *Purchase) SetPaymentOption(v string) *Purchase { - s.PaymentOption = &v - return s -} - -// SetUpfrontPrice sets the UpfrontPrice field's value. -func (s *Purchase) SetUpfrontPrice(v string) *Purchase { - s.UpfrontPrice = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservationRequest -type PurchaseHostReservationInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `type:"string"` - - // The currency in which the totalUpfrontPrice, LimitPrice, and totalHourlyPrice - // amounts are specified. At this time, the only supported currency is USD. - CurrencyCode *string `type:"string" enum:"CurrencyCodeValues"` - - // The ID/s of the Dedicated Host/s that the reservation will be associated - // with. - // - // HostIdSet is a required field - HostIdSet []*string `locationNameList:"item" type:"list" required:"true"` - - // The specified limit is checked against the total upfront cost of the reservation - // (calculated as the offering's upfront cost multiplied by the host count). - // If the total upfront cost is greater than the specified price limit, the - // request will fail. This is used to ensure that the purchase does not exceed - // the expected upfront cost of the purchase. At this time, the only supported - // currency is USD. For example, to indicate a limit price of USD 100, specify - // 100.00. - LimitPrice *string `type:"string"` - - // The ID of the offering. - // - // OfferingId is a required field - OfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseHostReservationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseHostReservationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseHostReservationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseHostReservationInput"} - if s.HostIdSet == nil { - invalidParams.Add(request.NewErrParamRequired("HostIdSet")) - } - if s.OfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("OfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *PurchaseHostReservationInput) SetClientToken(v string) *PurchaseHostReservationInput { - s.ClientToken = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PurchaseHostReservationInput) SetCurrencyCode(v string) *PurchaseHostReservationInput { - s.CurrencyCode = &v - return s -} - -// SetHostIdSet sets the HostIdSet field's value. -func (s *PurchaseHostReservationInput) SetHostIdSet(v []*string) *PurchaseHostReservationInput { - s.HostIdSet = v - return s -} - -// SetLimitPrice sets the LimitPrice field's value. -func (s *PurchaseHostReservationInput) SetLimitPrice(v string) *PurchaseHostReservationInput { - s.LimitPrice = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *PurchaseHostReservationInput) SetOfferingId(v string) *PurchaseHostReservationInput { - s.OfferingId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservationResult -type PurchaseHostReservationOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide - ClientToken *string `locationName:"clientToken" type:"string"` - - // The currency in which the totalUpfrontPrice and totalHourlyPrice amounts - // are specified. At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // Describes the details of the purchase. - Purchase []*Purchase `locationName:"purchase" type:"list"` - - // The total hourly price of the reservation calculated per hour. - TotalHourlyPrice *string `locationName:"totalHourlyPrice" type:"string"` - - // The total amount that will be charged to your account when you purchase the - // reservation. - TotalUpfrontPrice *string `locationName:"totalUpfrontPrice" type:"string"` -} - -// String returns the string representation -func (s PurchaseHostReservationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseHostReservationOutput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *PurchaseHostReservationOutput) SetClientToken(v string) *PurchaseHostReservationOutput { - s.ClientToken = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *PurchaseHostReservationOutput) SetCurrencyCode(v string) *PurchaseHostReservationOutput { - s.CurrencyCode = &v - return s -} - -// SetPurchase sets the Purchase field's value. -func (s *PurchaseHostReservationOutput) SetPurchase(v []*Purchase) *PurchaseHostReservationOutput { - s.Purchase = v - return s -} - -// SetTotalHourlyPrice sets the TotalHourlyPrice field's value. -func (s *PurchaseHostReservationOutput) SetTotalHourlyPrice(v string) *PurchaseHostReservationOutput { - s.TotalHourlyPrice = &v - return s -} - -// SetTotalUpfrontPrice sets the TotalUpfrontPrice field's value. -func (s *PurchaseHostReservationOutput) SetTotalUpfrontPrice(v string) *PurchaseHostReservationOutput { - s.TotalUpfrontPrice = &v - return s -} - -// Describes a request to purchase Scheduled Instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseRequest -type PurchaseRequest struct { - _ struct{} `type:"structure"` - - // The number of instances. - // - // InstanceCount is a required field - InstanceCount *int64 `type:"integer" required:"true"` - - // The purchase token. - // - // PurchaseToken is a required field - PurchaseToken *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseRequest"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.PurchaseToken == nil { - invalidParams.Add(request.NewErrParamRequired("PurchaseToken")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *PurchaseRequest) SetInstanceCount(v int64) *PurchaseRequest { - s.InstanceCount = &v - return s -} - -// SetPurchaseToken sets the PurchaseToken field's value. -func (s *PurchaseRequest) SetPurchaseToken(v string) *PurchaseRequest { - s.PurchaseToken = &v - return s -} - -// Contains the parameters for PurchaseReservedInstancesOffering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOfferingRequest -type PurchaseReservedInstancesOfferingInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The number of Reserved Instances to purchase. - // - // InstanceCount is a required field - InstanceCount *int64 `type:"integer" required:"true"` - - // Specified for Reserved Instance Marketplace offerings to limit the total - // order and ensure that the Reserved Instances are not purchased at unexpected - // prices. - LimitPrice *ReservedInstanceLimitPrice `locationName:"limitPrice" type:"structure"` - - // The ID of the Reserved Instance offering to purchase. - // - // ReservedInstancesOfferingId is a required field - ReservedInstancesOfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurchaseReservedInstancesOfferingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedInstancesOfferingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseReservedInstancesOfferingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseReservedInstancesOfferingInput"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.ReservedInstancesOfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesOfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetDryRun(v bool) *PurchaseReservedInstancesOfferingInput { - s.DryRun = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetInstanceCount(v int64) *PurchaseReservedInstancesOfferingInput { - s.InstanceCount = &v - return s -} - -// SetLimitPrice sets the LimitPrice field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetLimitPrice(v *ReservedInstanceLimitPrice) *PurchaseReservedInstancesOfferingInput { - s.LimitPrice = v - return s -} - -// SetReservedInstancesOfferingId sets the ReservedInstancesOfferingId field's value. -func (s *PurchaseReservedInstancesOfferingInput) SetReservedInstancesOfferingId(v string) *PurchaseReservedInstancesOfferingInput { - s.ReservedInstancesOfferingId = &v - return s -} - -// Contains the output of PurchaseReservedInstancesOffering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOfferingResult -type PurchaseReservedInstancesOfferingOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the purchased Reserved Instances. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` -} - -// String returns the string representation -func (s PurchaseReservedInstancesOfferingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseReservedInstancesOfferingOutput) GoString() string { - return s.String() -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *PurchaseReservedInstancesOfferingOutput) SetReservedInstancesId(v string) *PurchaseReservedInstancesOfferingOutput { - s.ReservedInstancesId = &v - return s -} - -// Contains the parameters for PurchaseScheduledInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstancesRequest -type PurchaseScheduledInstancesInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that ensures the idempotency of the request. - // For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // One or more purchase requests. - // - // PurchaseRequests is a required field - PurchaseRequests []*PurchaseRequest `locationName:"PurchaseRequest" locationNameList:"PurchaseRequest" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PurchaseScheduledInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseScheduledInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurchaseScheduledInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurchaseScheduledInstancesInput"} - if s.PurchaseRequests == nil { - invalidParams.Add(request.NewErrParamRequired("PurchaseRequests")) - } - if s.PurchaseRequests != nil && len(s.PurchaseRequests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PurchaseRequests", 1)) - } - if s.PurchaseRequests != nil { - for i, v := range s.PurchaseRequests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PurchaseRequests", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *PurchaseScheduledInstancesInput) SetClientToken(v string) *PurchaseScheduledInstancesInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *PurchaseScheduledInstancesInput) SetDryRun(v bool) *PurchaseScheduledInstancesInput { - s.DryRun = &v - return s -} - -// SetPurchaseRequests sets the PurchaseRequests field's value. -func (s *PurchaseScheduledInstancesInput) SetPurchaseRequests(v []*PurchaseRequest) *PurchaseScheduledInstancesInput { - s.PurchaseRequests = v - return s -} - -// Contains the output of PurchaseScheduledInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstancesResult -type PurchaseScheduledInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about the Scheduled Instances. - ScheduledInstanceSet []*ScheduledInstance `locationName:"scheduledInstanceSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s PurchaseScheduledInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurchaseScheduledInstancesOutput) GoString() string { - return s.String() -} - -// SetScheduledInstanceSet sets the ScheduledInstanceSet field's value. -func (s *PurchaseScheduledInstancesOutput) SetScheduledInstanceSet(v []*ScheduledInstance) *PurchaseScheduledInstancesOutput { - s.ScheduledInstanceSet = v - return s -} - -// Contains the parameters for RebootInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstancesRequest -type RebootInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s RebootInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RebootInstancesInput) SetDryRun(v bool) *RebootInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *RebootInstancesInput) SetInstanceIds(v []*string) *RebootInstancesInput { - s.InstanceIds = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstancesOutput -type RebootInstancesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RebootInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstancesOutput) GoString() string { - return s.String() -} - -// Describes a recurring charge. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RecurringCharge -type RecurringCharge struct { - _ struct{} `type:"structure"` - - // The amount of the recurring charge. - Amount *float64 `locationName:"amount" type:"double"` - - // The frequency of the recurring charge. - Frequency *string `locationName:"frequency" type:"string" enum:"RecurringChargeFrequency"` -} - -// String returns the string representation -func (s RecurringCharge) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RecurringCharge) GoString() string { - return s.String() -} - -// SetAmount sets the Amount field's value. -func (s *RecurringCharge) SetAmount(v float64) *RecurringCharge { - s.Amount = &v - return s -} - -// SetFrequency sets the Frequency field's value. -func (s *RecurringCharge) SetFrequency(v string) *RecurringCharge { - s.Frequency = &v - return s -} - -// Describes a region. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Region -type Region struct { - _ struct{} `type:"structure"` - - // The region service endpoint. - Endpoint *string `locationName:"regionEndpoint" type:"string"` - - // The name of the region. - RegionName *string `locationName:"regionName" type:"string"` -} - -// String returns the string representation -func (s Region) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Region) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *Region) SetEndpoint(v string) *Region { - s.Endpoint = &v - return s -} - -// SetRegionName sets the RegionName field's value. -func (s *Region) SetRegionName(v string) *Region { - s.RegionName = &v - return s -} - -// Contains the parameters for RegisterImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImageRequest -type RegisterImageInput struct { - _ struct{} `type:"structure"` - - // The architecture of the AMI. - // - // Default: For Amazon EBS-backed AMIs, i386. For instance store-backed AMIs, - // the architecture specified in the manifest file. - Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"` - - // The billing product codes. Your account must be authorized to specify billing - // product codes. Otherwise, you can use the AWS Marketplace to bill for the - // use of an AMI. - BillingProducts []*string `locationName:"BillingProduct" locationNameList:"item" type:"list"` - - // One or more block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // A description for your AMI. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Set to true to enable enhanced networking with ENA for the AMI and any instances - // that you launch from the AMI. - // - // This option is supported only for HVM AMIs. Specifying this option with a - // PV AMI can make instances launched from the AMI unreachable. - EnaSupport *bool `locationName:"enaSupport" type:"boolean"` - - // The full path to your AMI manifest in Amazon S3 storage. - ImageLocation *string `type:"string"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // A name for your AMI. - // - // Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets - // ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), - // at-signs (@), or underscores(_) - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // The name of the root device (for example, /dev/sda1, or /dev/xvda). - RootDeviceName *string `locationName:"rootDeviceName" type:"string"` - - // Set to simple to enable enhanced networking with the Intel 82599 Virtual - // Function interface for the AMI and any instances that you launch from the - // AMI. - // - // There is no way to disable sriovNetSupport at this time. - // - // This option is supported only for HVM AMIs. Specifying this option with a - // PV AMI can make instances launched from the AMI unreachable. - SriovNetSupport *string `locationName:"sriovNetSupport" type:"string"` - - // The type of virtualization. - // - // Default: paravirtual - VirtualizationType *string `locationName:"virtualizationType" type:"string"` -} - -// String returns the string representation -func (s RegisterImageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterImageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterImageInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArchitecture sets the Architecture field's value. -func (s *RegisterImageInput) SetArchitecture(v string) *RegisterImageInput { - s.Architecture = &v - return s -} - -// SetBillingProducts sets the BillingProducts field's value. -func (s *RegisterImageInput) SetBillingProducts(v []*string) *RegisterImageInput { - s.BillingProducts = v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *RegisterImageInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *RegisterImageInput { - s.BlockDeviceMappings = v - return s -} - -// SetDescription sets the Description field's value. -func (s *RegisterImageInput) SetDescription(v string) *RegisterImageInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RegisterImageInput) SetDryRun(v bool) *RegisterImageInput { - s.DryRun = &v - return s -} - -// SetEnaSupport sets the EnaSupport field's value. -func (s *RegisterImageInput) SetEnaSupport(v bool) *RegisterImageInput { - s.EnaSupport = &v - return s -} - -// SetImageLocation sets the ImageLocation field's value. -func (s *RegisterImageInput) SetImageLocation(v string) *RegisterImageInput { - s.ImageLocation = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *RegisterImageInput) SetKernelId(v string) *RegisterImageInput { - s.KernelId = &v - return s -} - -// SetName sets the Name field's value. -func (s *RegisterImageInput) SetName(v string) *RegisterImageInput { - s.Name = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *RegisterImageInput) SetRamdiskId(v string) *RegisterImageInput { - s.RamdiskId = &v - return s -} - -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *RegisterImageInput) SetRootDeviceName(v string) *RegisterImageInput { - s.RootDeviceName = &v - return s -} - -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *RegisterImageInput) SetSriovNetSupport(v string) *RegisterImageInput { - s.SriovNetSupport = &v - return s -} - -// SetVirtualizationType sets the VirtualizationType field's value. -func (s *RegisterImageInput) SetVirtualizationType(v string) *RegisterImageInput { - s.VirtualizationType = &v - return s -} - -// Contains the output of RegisterImage. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImageResult -type RegisterImageOutput struct { - _ struct{} `type:"structure"` - - // The ID of the newly registered AMI. - ImageId *string `locationName:"imageId" type:"string"` -} - -// String returns the string representation -func (s RegisterImageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RegisterImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *RegisterImageOutput) SetImageId(v string) *RegisterImageOutput { - s.ImageId = &v - return s -} - -// Contains the parameters for RejectVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnectionRequest -type RejectVpcPeeringConnectionInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the VPC peering connection. - // - // VpcPeeringConnectionId is a required field - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` -} - -// String returns the string representation -func (s RejectVpcPeeringConnectionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RejectVpcPeeringConnectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RejectVpcPeeringConnectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RejectVpcPeeringConnectionInput"} - if s.VpcPeeringConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RejectVpcPeeringConnectionInput) SetDryRun(v bool) *RejectVpcPeeringConnectionInput { - s.DryRun = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *RejectVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *RejectVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Contains the output of RejectVpcPeeringConnection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnectionResult -type RejectVpcPeeringConnectionOutput struct { - _ struct{} `type:"structure"` - - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` -} - -// String returns the string representation -func (s RejectVpcPeeringConnectionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RejectVpcPeeringConnectionOutput) GoString() string { - return s.String() -} - -// SetReturn sets the Return field's value. -func (s *RejectVpcPeeringConnectionOutput) SetReturn(v bool) *RejectVpcPeeringConnectionOutput { - s.Return = &v - return s -} - -// Contains the parameters for ReleaseAddress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddressRequest -type ReleaseAddressInput struct { - _ struct{} `type:"structure"` - - // [EC2-VPC] The allocation ID. Required for EC2-VPC. - AllocationId *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. - PublicIp *string `type:"string"` -} - -// String returns the string representation -func (s ReleaseAddressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseAddressInput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *ReleaseAddressInput) SetAllocationId(v string) *ReleaseAddressInput { - s.AllocationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReleaseAddressInput) SetDryRun(v bool) *ReleaseAddressInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *ReleaseAddressInput) SetPublicIp(v string) *ReleaseAddressInput { - s.PublicIp = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddressOutput -type ReleaseAddressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReleaseAddressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseAddressOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ReleaseHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHostsRequest -type ReleaseHostsInput struct { - _ struct{} `type:"structure"` - - // The IDs of the Dedicated Hosts you want to release. - // - // HostIds is a required field - HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"` -} - -// String returns the string representation -func (s ReleaseHostsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseHostsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReleaseHostsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReleaseHostsInput"} - if s.HostIds == nil { - invalidParams.Add(request.NewErrParamRequired("HostIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostIds sets the HostIds field's value. -func (s *ReleaseHostsInput) SetHostIds(v []*string) *ReleaseHostsInput { - s.HostIds = v - return s -} - -// Contains the output of ReleaseHosts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHostsResult -type ReleaseHostsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the Dedicated Hosts that were successfully released. - Successful []*string `locationName:"successful" locationNameList:"item" type:"list"` - - // The IDs of the Dedicated Hosts that could not be released, including an error - // message. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s ReleaseHostsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReleaseHostsOutput) GoString() string { - return s.String() -} - -// SetSuccessful sets the Successful field's value. -func (s *ReleaseHostsOutput) SetSuccessful(v []*string) *ReleaseHostsOutput { - s.Successful = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *ReleaseHostsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *ReleaseHostsOutput { - s.Unsuccessful = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociationRequest -type ReplaceIamInstanceProfileAssociationInput struct { - _ struct{} `type:"structure"` - - // The ID of the existing IAM instance profile association. - // - // AssociationId is a required field - AssociationId *string `type:"string" required:"true"` - - // The IAM instance profile. - // - // IamInstanceProfile is a required field - IamInstanceProfile *IamInstanceProfileSpecification `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ReplaceIamInstanceProfileAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceIamInstanceProfileAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceIamInstanceProfileAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceIamInstanceProfileAssociationInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - if s.IamInstanceProfile == nil { - invalidParams.Add(request.NewErrParamRequired("IamInstanceProfile")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *ReplaceIamInstanceProfileAssociationInput) SetAssociationId(v string) *ReplaceIamInstanceProfileAssociationInput { - s.AssociationId = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *ReplaceIamInstanceProfileAssociationInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *ReplaceIamInstanceProfileAssociationInput { - s.IamInstanceProfile = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociationResult -type ReplaceIamInstanceProfileAssociationOutput struct { - _ struct{} `type:"structure"` - - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` -} - -// String returns the string representation -func (s ReplaceIamInstanceProfileAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceIamInstanceProfileAssociationOutput) GoString() string { - return s.String() -} - -// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. -func (s *ReplaceIamInstanceProfileAssociationOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *ReplaceIamInstanceProfileAssociationOutput { - s.IamInstanceProfileAssociation = v - return s -} - -// Contains the parameters for ReplaceNetworkAclAssociation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociationRequest -type ReplaceNetworkAclAssociationInput struct { - _ struct{} `type:"structure"` - - // The ID of the current association between the original network ACL and the - // subnet. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the new network ACL to associate with the subnet. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReplaceNetworkAclAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceNetworkAclAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceNetworkAclAssociationInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *ReplaceNetworkAclAssociationInput) SetAssociationId(v string) *ReplaceNetworkAclAssociationInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceNetworkAclAssociationInput) SetDryRun(v bool) *ReplaceNetworkAclAssociationInput { - s.DryRun = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *ReplaceNetworkAclAssociationInput) SetNetworkAclId(v string) *ReplaceNetworkAclAssociationInput { - s.NetworkAclId = &v - return s -} - -// Contains the output of ReplaceNetworkAclAssociation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociationResult -type ReplaceNetworkAclAssociationOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new association. - NewAssociationId *string `locationName:"newAssociationId" type:"string"` -} - -// String returns the string representation -func (s ReplaceNetworkAclAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclAssociationOutput) GoString() string { - return s.String() -} - -// SetNewAssociationId sets the NewAssociationId field's value. -func (s *ReplaceNetworkAclAssociationOutput) SetNewAssociationId(v string) *ReplaceNetworkAclAssociationOutput { - s.NewAssociationId = &v - return s -} - -// Contains the parameters for ReplaceNetworkAclEntry. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntryRequest -type ReplaceNetworkAclEntryInput struct { - _ struct{} `type:"structure"` - - // The IPv4 network range to allow or deny, in CIDR notation (for example 172.16.0.0/24). - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether to replace the egress rule. - // - // Default: If no value is specified, we replace the ingress rule. - // - // Egress is a required field - Egress *bool `locationName:"egress" type:"boolean" required:"true"` - - // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying the - // ICMP (1) protocol, or protocol 58 (ICMPv6) with an IPv6 CIDR block. - IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` - - // The IPv6 network range to allow or deny, in CIDR notation (for example 2001:bd8:1234:1a00::/64). - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // The ID of the ACL. - // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - - // TCP or UDP protocols: The range of ports the rule applies to. Required if - // specifying TCP (6) or UDP (17) for the protocol. - PortRange *PortRange `locationName:"portRange" type:"structure"` - - // The IP protocol. You can specify all or -1 to mean all protocols. If you - // specify all, -1, or a protocol number other than tcp, udp, or icmp, traffic - // on all ports is allowed, regardless of any ports or ICMP types or codes you - // specify. If you specify protocol 58 (ICMPv6) and specify an IPv4 CIDR block, - // traffic for all ICMP types and codes allowed, regardless of any that you - // specify. If you specify protocol 58 (ICMPv6) and specify an IPv6 CIDR block, - // you must specify an ICMP type and code. - // - // Protocol is a required field - Protocol *string `locationName:"protocol" type:"string" required:"true"` - - // Indicates whether to allow or deny the traffic that matches the rule. - // - // RuleAction is a required field - RuleAction *string `locationName:"ruleAction" type:"string" required:"true" enum:"RuleAction"` - - // The rule number of the entry to replace. - // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` -} - -// String returns the string representation -func (s ReplaceNetworkAclEntryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceNetworkAclEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceNetworkAclEntryInput"} - if s.Egress == nil { - invalidParams.Add(request.NewErrParamRequired("Egress")) - } - if s.NetworkAclId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.RuleAction == nil { - invalidParams.Add(request.NewErrParamRequired("RuleAction")) - } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *ReplaceNetworkAclEntryInput) SetCidrBlock(v string) *ReplaceNetworkAclEntryInput { - s.CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceNetworkAclEntryInput) SetDryRun(v bool) *ReplaceNetworkAclEntryInput { - s.DryRun = &v - return s -} - -// SetEgress sets the Egress field's value. -func (s *ReplaceNetworkAclEntryInput) SetEgress(v bool) *ReplaceNetworkAclEntryInput { - s.Egress = &v - return s -} - -// SetIcmpTypeCode sets the IcmpTypeCode field's value. -func (s *ReplaceNetworkAclEntryInput) SetIcmpTypeCode(v *IcmpTypeCode) *ReplaceNetworkAclEntryInput { - s.IcmpTypeCode = v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *ReplaceNetworkAclEntryInput) SetIpv6CidrBlock(v string) *ReplaceNetworkAclEntryInput { - s.Ipv6CidrBlock = &v - return s -} - -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *ReplaceNetworkAclEntryInput) SetNetworkAclId(v string) *ReplaceNetworkAclEntryInput { - s.NetworkAclId = &v - return s -} - -// SetPortRange sets the PortRange field's value. -func (s *ReplaceNetworkAclEntryInput) SetPortRange(v *PortRange) *ReplaceNetworkAclEntryInput { - s.PortRange = v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *ReplaceNetworkAclEntryInput) SetProtocol(v string) *ReplaceNetworkAclEntryInput { - s.Protocol = &v - return s -} - -// SetRuleAction sets the RuleAction field's value. -func (s *ReplaceNetworkAclEntryInput) SetRuleAction(v string) *ReplaceNetworkAclEntryInput { - s.RuleAction = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *ReplaceNetworkAclEntryInput) SetRuleNumber(v int64) *ReplaceNetworkAclEntryInput { - s.RuleNumber = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntryOutput -type ReplaceNetworkAclEntryOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReplaceNetworkAclEntryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceNetworkAclEntryOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ReplaceRoute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteRequest -type ReplaceRouteInput struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR address block used for the destination match. The value you - // provide must match the CIDR of an existing route in the table. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR address block used for the destination match. The value you - // provide must match the CIDR of an existing route in the table. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // [IPv6 traffic only] The ID of an egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` - - // The ID of an Internet gateway or virtual private gateway. - GatewayId *string `locationName:"gatewayId" type:"string"` - - // The ID of a NAT instance in your VPC. - InstanceId *string `locationName:"instanceId" type:"string"` - - // [IPv4 traffic only] The ID of a NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // The ID of a network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` - - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s ReplaceRouteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceRouteInput"} - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *ReplaceRouteInput) SetDestinationCidrBlock(v string) *ReplaceRouteInput { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *ReplaceRouteInput) SetDestinationIpv6CidrBlock(v string) *ReplaceRouteInput { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceRouteInput) SetDryRun(v bool) *ReplaceRouteInput { - s.DryRun = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *ReplaceRouteInput) SetEgressOnlyInternetGatewayId(v string) *ReplaceRouteInput { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// SetGatewayId sets the GatewayId field's value. -func (s *ReplaceRouteInput) SetGatewayId(v string) *ReplaceRouteInput { - s.GatewayId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ReplaceRouteInput) SetInstanceId(v string) *ReplaceRouteInput { - s.InstanceId = &v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *ReplaceRouteInput) SetNatGatewayId(v string) *ReplaceRouteInput { - s.NatGatewayId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ReplaceRouteInput) SetNetworkInterfaceId(v string) *ReplaceRouteInput { - s.NetworkInterfaceId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *ReplaceRouteInput) SetRouteTableId(v string) *ReplaceRouteInput { - s.RouteTableId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *ReplaceRouteInput) SetVpcPeeringConnectionId(v string) *ReplaceRouteInput { - s.VpcPeeringConnectionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteOutput -type ReplaceRouteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReplaceRouteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ReplaceRouteTableAssociation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociationRequest -type ReplaceRouteTableAssociationInput struct { - _ struct{} `type:"structure"` - - // The association ID. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the new route table to associate with the subnet. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReplaceRouteTableAssociationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteTableAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceRouteTableAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceRouteTableAssociationInput"} - if s.AssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationId")) - } - if s.RouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("RouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationId sets the AssociationId field's value. -func (s *ReplaceRouteTableAssociationInput) SetAssociationId(v string) *ReplaceRouteTableAssociationInput { - s.AssociationId = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReplaceRouteTableAssociationInput) SetDryRun(v bool) *ReplaceRouteTableAssociationInput { - s.DryRun = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *ReplaceRouteTableAssociationInput) SetRouteTableId(v string) *ReplaceRouteTableAssociationInput { - s.RouteTableId = &v - return s -} - -// Contains the output of ReplaceRouteTableAssociation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociationResult -type ReplaceRouteTableAssociationOutput struct { - _ struct{} `type:"structure"` - - // The ID of the new association. - NewAssociationId *string `locationName:"newAssociationId" type:"string"` -} - -// String returns the string representation -func (s ReplaceRouteTableAssociationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceRouteTableAssociationOutput) GoString() string { - return s.String() -} - -// SetNewAssociationId sets the NewAssociationId field's value. -func (s *ReplaceRouteTableAssociationOutput) SetNewAssociationId(v string) *ReplaceRouteTableAssociationOutput { - s.NewAssociationId = &v - return s -} - -// Contains the parameters for ReportInstanceStatus. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatusRequest -type ReportInstanceStatusInput struct { - _ struct{} `type:"structure"` - - // Descriptive text about the health state of your instance. - Description *string `locationName:"description" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The time at which the reported instance health state ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // One or more instances. - // - // Instances is a required field - Instances []*string `locationName:"instanceId" locationNameList:"InstanceId" type:"list" required:"true"` - - // One or more reason codes that describes the health state of your instance. - // - // * instance-stuck-in-state: My instance is stuck in a state. - // - // * unresponsive: My instance is unresponsive. - // - // * not-accepting-credentials: My instance is not accepting my credentials. - // - // * password-not-available: A password is not available for my instance. - // - // * performance-network: My instance is experiencing performance problems - // which I believe are network related. - // - // * performance-instance-store: My instance is experiencing performance - // problems which I believe are related to the instance stores. - // - // * performance-ebs-volume: My instance is experiencing performance problems - // which I believe are related to an EBS volume. - // - // * performance-other: My instance is experiencing performance problems. - // - // * other: [explain using the description parameter] - // - // ReasonCodes is a required field - ReasonCodes []*string `locationName:"reasonCode" locationNameList:"item" type:"list" required:"true"` - - // The time at which the reported instance health state began. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The status of all instances listed. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReportStatusType"` -} - -// String returns the string representation -func (s ReportInstanceStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReportInstanceStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReportInstanceStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReportInstanceStatusInput"} - if s.Instances == nil { - invalidParams.Add(request.NewErrParamRequired("Instances")) - } - if s.ReasonCodes == nil { - invalidParams.Add(request.NewErrParamRequired("ReasonCodes")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *ReportInstanceStatusInput) SetDescription(v string) *ReportInstanceStatusInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ReportInstanceStatusInput) SetDryRun(v bool) *ReportInstanceStatusInput { - s.DryRun = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *ReportInstanceStatusInput) SetEndTime(v time.Time) *ReportInstanceStatusInput { - s.EndTime = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *ReportInstanceStatusInput) SetInstances(v []*string) *ReportInstanceStatusInput { - s.Instances = v - return s -} - -// SetReasonCodes sets the ReasonCodes field's value. -func (s *ReportInstanceStatusInput) SetReasonCodes(v []*string) *ReportInstanceStatusInput { - s.ReasonCodes = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ReportInstanceStatusInput) SetStartTime(v time.Time) *ReportInstanceStatusInput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReportInstanceStatusInput) SetStatus(v string) *ReportInstanceStatusInput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatusOutput -type ReportInstanceStatusOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ReportInstanceStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReportInstanceStatusOutput) GoString() string { - return s.String() -} - -// Contains the parameters for RequestSpotFleet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleetRequest -type RequestSpotFleetInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The configuration for the Spot fleet request. - // - // SpotFleetRequestConfig is a required field - SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"` -} - -// String returns the string representation -func (s RequestSpotFleetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestSpotFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestSpotFleetInput"} - if s.SpotFleetRequestConfig == nil { - invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestConfig")) - } - if s.SpotFleetRequestConfig != nil { - if err := s.SpotFleetRequestConfig.Validate(); err != nil { - invalidParams.AddNested("SpotFleetRequestConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RequestSpotFleetInput) SetDryRun(v bool) *RequestSpotFleetInput { - s.DryRun = &v - return s -} - -// SetSpotFleetRequestConfig sets the SpotFleetRequestConfig field's value. -func (s *RequestSpotFleetInput) SetSpotFleetRequestConfig(v *SpotFleetRequestConfigData) *RequestSpotFleetInput { - s.SpotFleetRequestConfig = v - return s -} - -// Contains the output of RequestSpotFleet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleetResponse -type RequestSpotFleetOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s RequestSpotFleetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotFleetOutput) GoString() string { - return s.String() -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *RequestSpotFleetOutput) SetSpotFleetRequestId(v string) *RequestSpotFleetOutput { - s.SpotFleetRequestId = &v - return s -} - -// Contains the parameters for RequestSpotInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstancesRequest -type RequestSpotInstancesInput struct { - _ struct{} `type:"structure"` - - // The user-specified name for a logical grouping of bids. - // - // When you specify an Availability Zone group in a Spot Instance request, all - // Spot instances in the request are launched in the same Availability Zone. - // Instance proximity is maintained with this parameter, but the choice of Availability - // Zone is not. The group applies only to bids for Spot Instances of the same - // instance type. Any additional Spot instance requests that are specified with - // the same Availability Zone group name are launched in that same Availability - // Zone, as long as at least one instance from the group is still active. - // - // If there is no active instance running in the Availability Zone group that - // you specify for a new Spot instance request (all instances are terminated, - // the bid is expired, or the bid falls below current market), then Amazon EC2 - // launches the instance in any Availability Zone where the constraint can be - // met. Consequently, the subsequent set of Spot instances could be placed in - // a different zone from the original request, even if you specified the same - // Availability Zone group. - // - // Default: Instances are launched in any available Availability Zone. - AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` - - // The required duration for the Spot instances (also known as Spot blocks), - // in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, - // or 360). - // - // The duration period starts as soon as your Spot instance receives its instance - // ID. At the end of the duration period, Amazon EC2 marks the Spot instance - // for termination and provides a Spot instance termination notice, which gives - // the instance a two-minute warning before it terminates. - // - // Note that you can't specify an Availability Zone group or a launch group - // if you specify a duration. - BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The maximum number of Spot instances to launch. - // - // Default: 1 - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The instance launch group. Launch groups are Spot instances that launch together - // and terminate together. - // - // Default: Instances are launched and terminated individually - LaunchGroup *string `locationName:"launchGroup" type:"string"` - - // Describes the launch specification for an instance. - LaunchSpecification *RequestSpotLaunchSpecification `type:"structure"` - - // The maximum hourly price (bid) for any Spot instance launched to fulfill - // the request. - // - // SpotPrice is a required field - SpotPrice *string `locationName:"spotPrice" type:"string" required:"true"` - - // The Spot instance request type. - // - // Default: one-time - Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` - - // The start date of the request. If this is a one-time request, the request - // becomes active at this date and time and remains active until all instances - // launch, the request expires, or the request is canceled. If the request is - // persistent, the request becomes active at this date and time and remains - // active until it expires or is canceled. - // - // Default: The request is effective indefinitely. - ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - - // The end date of the request. If this is a one-time request, the request remains - // active until all instances launch, the request is canceled, or this date - // is reached. If the request is persistent, it remains active until it is canceled - // or this date and time is reached. - // - // Default: The request is effective indefinitely. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s RequestSpotInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestSpotInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestSpotInstancesInput"} - if s.SpotPrice == nil { - invalidParams.Add(request.NewErrParamRequired("SpotPrice")) - } - if s.LaunchSpecification != nil { - if err := s.LaunchSpecification.Validate(); err != nil { - invalidParams.AddNested("LaunchSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZoneGroup sets the AvailabilityZoneGroup field's value. -func (s *RequestSpotInstancesInput) SetAvailabilityZoneGroup(v string) *RequestSpotInstancesInput { - s.AvailabilityZoneGroup = &v - return s -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *RequestSpotInstancesInput) SetBlockDurationMinutes(v int64) *RequestSpotInstancesInput { - s.BlockDurationMinutes = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *RequestSpotInstancesInput) SetClientToken(v string) *RequestSpotInstancesInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RequestSpotInstancesInput) SetDryRun(v bool) *RequestSpotInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *RequestSpotInstancesInput) SetInstanceCount(v int64) *RequestSpotInstancesInput { - s.InstanceCount = &v - return s -} - -// SetLaunchGroup sets the LaunchGroup field's value. -func (s *RequestSpotInstancesInput) SetLaunchGroup(v string) *RequestSpotInstancesInput { - s.LaunchGroup = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *RequestSpotInstancesInput) SetLaunchSpecification(v *RequestSpotLaunchSpecification) *RequestSpotInstancesInput { - s.LaunchSpecification = v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *RequestSpotInstancesInput) SetSpotPrice(v string) *RequestSpotInstancesInput { - s.SpotPrice = &v - return s -} - -// SetType sets the Type field's value. -func (s *RequestSpotInstancesInput) SetType(v string) *RequestSpotInstancesInput { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *RequestSpotInstancesInput) SetValidFrom(v time.Time) *RequestSpotInstancesInput { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *RequestSpotInstancesInput) SetValidUntil(v time.Time) *RequestSpotInstancesInput { - s.ValidUntil = &v - return s -} - -// Contains the output of RequestSpotInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstancesResult -type RequestSpotInstancesOutput struct { - _ struct{} `type:"structure"` - - // One or more Spot instance requests. - SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s RequestSpotInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotInstancesOutput) GoString() string { - return s.String() -} - -// SetSpotInstanceRequests sets the SpotInstanceRequests field's value. -func (s *RequestSpotInstancesOutput) SetSpotInstanceRequests(v []*SpotInstanceRequest) *RequestSpotInstancesOutput { - s.SpotInstanceRequests = v - return s -} - -// Describes the launch specification for an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotLaunchSpecification -type RequestSpotLaunchSpecification struct { - _ struct{} `type:"structure"` - - // Deprecated. - AddressingType *string `locationName:"addressingType" type:"string"` - - // One or more block device mapping entries. - // - // Although you can specify encrypted EBS volumes in this block device mapping - // for your Spot Instances, these volumes are not encrypted. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // Describes the monitoring of an instance. - Monitoring *RunInstancesMonitoringEnabled `locationName:"monitoring" type:"structure"` - - // One or more network interfaces. If you specify a network interface, you must - // specify subnet IDs and security group IDs using the network interface. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"NetworkInterface" locationNameList:"item" type:"list"` - - // The placement information for the instance. - Placement *SpotPlacement `locationName:"placement" type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` - - SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"item" type:"list"` - - // The ID of the subnet in which to launch the instance. - SubnetId *string `locationName:"subnetId" type:"string"` - - // The user data to make available to the instances. If you are using an AWS - // SDK or command line tool, Base64-encoding is performed for you, and you can - // load the text from a file. Otherwise, you must provide Base64-encoded text. - UserData *string `locationName:"userData" type:"string"` -} - -// String returns the string representation -func (s RequestSpotLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestSpotLaunchSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestSpotLaunchSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestSpotLaunchSpecification"} - if s.Monitoring != nil { - if err := s.Monitoring.Validate(); err != nil { - invalidParams.AddNested("Monitoring", err.(request.ErrInvalidParams)) - } - } - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddressingType sets the AddressingType field's value. -func (s *RequestSpotLaunchSpecification) SetAddressingType(v string) *RequestSpotLaunchSpecification { - s.AddressingType = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *RequestSpotLaunchSpecification) SetBlockDeviceMappings(v []*BlockDeviceMapping) *RequestSpotLaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *RequestSpotLaunchSpecification) SetEbsOptimized(v bool) *RequestSpotLaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *RequestSpotLaunchSpecification) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *RequestSpotLaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *RequestSpotLaunchSpecification) SetImageId(v string) *RequestSpotLaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RequestSpotLaunchSpecification) SetInstanceType(v string) *RequestSpotLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *RequestSpotLaunchSpecification) SetKernelId(v string) *RequestSpotLaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *RequestSpotLaunchSpecification) SetKeyName(v string) *RequestSpotLaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *RequestSpotLaunchSpecification) SetMonitoring(v *RunInstancesMonitoringEnabled) *RequestSpotLaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *RequestSpotLaunchSpecification) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *RequestSpotLaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *RequestSpotLaunchSpecification) SetPlacement(v *SpotPlacement) *RequestSpotLaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *RequestSpotLaunchSpecification) SetRamdiskId(v string) *RequestSpotLaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *RequestSpotLaunchSpecification) SetSecurityGroupIds(v []*string) *RequestSpotLaunchSpecification { - s.SecurityGroupIds = v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *RequestSpotLaunchSpecification) SetSecurityGroups(v []*string) *RequestSpotLaunchSpecification { - s.SecurityGroups = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *RequestSpotLaunchSpecification) SetSubnetId(v string) *RequestSpotLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *RequestSpotLaunchSpecification) SetUserData(v string) *RequestSpotLaunchSpecification { - s.UserData = &v - return s -} - -// Describes a reservation. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Reservation -type Reservation struct { - _ struct{} `type:"structure"` - - // [EC2-Classic only] One or more security groups. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // One or more instances. - Instances []*Instance `locationName:"instancesSet" locationNameList:"item" type:"list"` - - // The ID of the AWS account that owns the reservation. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The ID of the requester that launched the instances on your behalf (for example, - // AWS Management Console or Auto Scaling). - RequesterId *string `locationName:"requesterId" type:"string"` - - // The ID of the reservation. - ReservationId *string `locationName:"reservationId" type:"string"` -} - -// String returns the string representation -func (s Reservation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Reservation) GoString() string { - return s.String() -} - -// SetGroups sets the Groups field's value. -func (s *Reservation) SetGroups(v []*GroupIdentifier) *Reservation { - s.Groups = v - return s -} - -// SetInstances sets the Instances field's value. -func (s *Reservation) SetInstances(v []*Instance) *Reservation { - s.Instances = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *Reservation) SetOwnerId(v string) *Reservation { - s.OwnerId = &v - return s -} - -// SetRequesterId sets the RequesterId field's value. -func (s *Reservation) SetRequesterId(v string) *Reservation { - s.RequesterId = &v - return s -} - -// SetReservationId sets the ReservationId field's value. -func (s *Reservation) SetReservationId(v string) *Reservation { - s.ReservationId = &v - return s -} - -// The cost associated with the Reserved Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservationValue -type ReservationValue struct { - _ struct{} `type:"structure"` - - // The hourly rate of the reservation. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The balance of the total value (the sum of remainingUpfrontValue + hourlyPrice - // * number of hours remaining). - RemainingTotalValue *string `locationName:"remainingTotalValue" type:"string"` - - // The remaining upfront cost of the reservation. - RemainingUpfrontValue *string `locationName:"remainingUpfrontValue" type:"string"` -} - -// String returns the string representation -func (s ReservationValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservationValue) GoString() string { - return s.String() -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *ReservationValue) SetHourlyPrice(v string) *ReservationValue { - s.HourlyPrice = &v - return s -} - -// SetRemainingTotalValue sets the RemainingTotalValue field's value. -func (s *ReservationValue) SetRemainingTotalValue(v string) *ReservationValue { - s.RemainingTotalValue = &v - return s -} - -// SetRemainingUpfrontValue sets the RemainingUpfrontValue field's value. -func (s *ReservationValue) SetRemainingUpfrontValue(v string) *ReservationValue { - s.RemainingUpfrontValue = &v - return s -} - -// Describes the limit price of a Reserved Instance offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstanceLimitPrice -type ReservedInstanceLimitPrice struct { - _ struct{} `type:"structure"` - - // Used for Reserved Instance Marketplace offerings. Specifies the limit price - // on the total order (instanceCount * price). - Amount *float64 `locationName:"amount" type:"double"` - - // The currency in which the limitPrice amount is specified. At this time, the - // only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` -} - -// String returns the string representation -func (s ReservedInstanceLimitPrice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstanceLimitPrice) GoString() string { - return s.String() -} - -// SetAmount sets the Amount field's value. -func (s *ReservedInstanceLimitPrice) SetAmount(v float64) *ReservedInstanceLimitPrice { - s.Amount = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedInstanceLimitPrice) SetCurrencyCode(v string) *ReservedInstanceLimitPrice { - s.CurrencyCode = &v - return s -} - -// The total value of the Convertible Reserved Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstanceReservationValue -type ReservedInstanceReservationValue struct { - _ struct{} `type:"structure"` - - // The total value of the Convertible Reserved Instance that you are exchanging. - ReservationValue *ReservationValue `locationName:"reservationValue" type:"structure"` - - // The ID of the Convertible Reserved Instance that you are exchanging. - ReservedInstanceId *string `locationName:"reservedInstanceId" type:"string"` -} - -// String returns the string representation -func (s ReservedInstanceReservationValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstanceReservationValue) GoString() string { - return s.String() -} - -// SetReservationValue sets the ReservationValue field's value. -func (s *ReservedInstanceReservationValue) SetReservationValue(v *ReservationValue) *ReservedInstanceReservationValue { - s.ReservationValue = v - return s -} - -// SetReservedInstanceId sets the ReservedInstanceId field's value. -func (s *ReservedInstanceReservationValue) SetReservedInstanceId(v string) *ReservedInstanceReservationValue { - s.ReservedInstanceId = &v - return s -} - -// Describes a Reserved Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstances -type ReservedInstances struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The currency of the Reserved Instance. It's specified using ISO 4217 standard - // currency codes. At this time, the only supported currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the Reserved Instance, in seconds. - Duration *int64 `locationName:"duration" type:"long"` - - // The time when the Reserved Instance expires. - End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"iso8601"` - - // The purchase price of the Reserved Instance. - FixedPrice *float64 `locationName:"fixedPrice" type:"float"` - - // The number of reservations purchased. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The tenancy of the instance. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // The instance type on which the Reserved Instance can be used. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The offering class of the Reserved Instance. - OfferingClass *string `locationName:"offeringClass" type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // The Reserved Instance product platform description. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The recurring charge tag assigned to the resource. - RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` - - // The ID of the Reserved Instance. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // The scope of the Reserved Instance. - Scope *string `locationName:"scope" type:"string" enum:"scope"` - - // The date and time the Reserved Instance started. - Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"` - - // The state of the Reserved Instance purchase. - State *string `locationName:"state" type:"string" enum:"ReservedInstanceState"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The usage price of the Reserved Instance, per hour. - UsagePrice *float64 `locationName:"usagePrice" type:"float"` -} - -// String returns the string representation -func (s ReservedInstances) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstances) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ReservedInstances) SetAvailabilityZone(v string) *ReservedInstances { - s.AvailabilityZone = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedInstances) SetCurrencyCode(v string) *ReservedInstances { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedInstances) SetDuration(v int64) *ReservedInstances { - s.Duration = &v - return s -} - -// SetEnd sets the End field's value. -func (s *ReservedInstances) SetEnd(v time.Time) *ReservedInstances { - s.End = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedInstances) SetFixedPrice(v float64) *ReservedInstances { - s.FixedPrice = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *ReservedInstances) SetInstanceCount(v int64) *ReservedInstances { - s.InstanceCount = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *ReservedInstances) SetInstanceTenancy(v string) *ReservedInstances { - s.InstanceTenancy = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ReservedInstances) SetInstanceType(v string) *ReservedInstances { - s.InstanceType = &v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *ReservedInstances) SetOfferingClass(v string) *ReservedInstances { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedInstances) SetOfferingType(v string) *ReservedInstances { - s.OfferingType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedInstances) SetProductDescription(v string) *ReservedInstances { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedInstances) SetRecurringCharges(v []*RecurringCharge) *ReservedInstances { - s.RecurringCharges = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstances) SetReservedInstancesId(v string) *ReservedInstances { - s.ReservedInstancesId = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ReservedInstances) SetScope(v string) *ReservedInstances { - s.Scope = &v - return s -} - -// SetStart sets the Start field's value. -func (s *ReservedInstances) SetStart(v time.Time) *ReservedInstances { - s.Start = &v - return s -} - -// SetState sets the State field's value. -func (s *ReservedInstances) SetState(v string) *ReservedInstances { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ReservedInstances) SetTags(v []*Tag) *ReservedInstances { - s.Tags = v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedInstances) SetUsagePrice(v float64) *ReservedInstances { - s.UsagePrice = &v - return s -} - -// Describes the configuration settings for the modified Reserved Instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstancesConfiguration -type ReservedInstancesConfiguration struct { - _ struct{} `type:"structure"` - - // The Availability Zone for the modified Reserved Instances. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of modified Reserved Instances. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The instance type for the modified Reserved Instances. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The network platform of the modified Reserved Instances, which is either - // EC2-Classic or EC2-VPC. - Platform *string `locationName:"platform" type:"string"` - - // Whether the Reserved Instance is applied to instances in a region or instances - // in a specific Availability Zone. - Scope *string `locationName:"scope" type:"string" enum:"scope"` -} - -// String returns the string representation -func (s ReservedInstancesConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesConfiguration) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ReservedInstancesConfiguration) SetAvailabilityZone(v string) *ReservedInstancesConfiguration { - s.AvailabilityZone = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *ReservedInstancesConfiguration) SetInstanceCount(v int64) *ReservedInstancesConfiguration { - s.InstanceCount = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ReservedInstancesConfiguration) SetInstanceType(v string) *ReservedInstancesConfiguration { - s.InstanceType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ReservedInstancesConfiguration) SetPlatform(v string) *ReservedInstancesConfiguration { - s.Platform = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ReservedInstancesConfiguration) SetScope(v string) *ReservedInstancesConfiguration { - s.Scope = &v - return s -} - -// Describes the ID of a Reserved Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstancesId -type ReservedInstancesId struct { - _ struct{} `type:"structure"` - - // The ID of the Reserved Instance. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` -} - -// String returns the string representation -func (s ReservedInstancesId) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesId) GoString() string { - return s.String() -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstancesId) SetReservedInstancesId(v string) *ReservedInstancesId { - s.ReservedInstancesId = &v - return s -} - -// Describes a Reserved Instance listing. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstancesListing -type ReservedInstancesListing struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive key supplied by the client to ensure that the request - // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // The time the listing was created. - CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"` - - // The number of instances in this state. - InstanceCounts []*InstanceCount `locationName:"instanceCounts" locationNameList:"item" type:"list"` - - // The price of the Reserved Instance listing. - PriceSchedules []*PriceSchedule `locationName:"priceSchedules" locationNameList:"item" type:"list"` - - // The ID of the Reserved Instance. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // The ID of the Reserved Instance listing. - ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string"` - - // The status of the Reserved Instance listing. - Status *string `locationName:"status" type:"string" enum:"ListingStatus"` - - // The reason for the current status of the Reserved Instance listing. The response - // can be blank. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The last modified timestamp of the listing. - UpdateDate *time.Time `locationName:"updateDate" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ReservedInstancesListing) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesListing) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *ReservedInstancesListing) SetClientToken(v string) *ReservedInstancesListing { - s.ClientToken = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ReservedInstancesListing) SetCreateDate(v time.Time) *ReservedInstancesListing { - s.CreateDate = &v - return s -} - -// SetInstanceCounts sets the InstanceCounts field's value. -func (s *ReservedInstancesListing) SetInstanceCounts(v []*InstanceCount) *ReservedInstancesListing { - s.InstanceCounts = v - return s -} - -// SetPriceSchedules sets the PriceSchedules field's value. -func (s *ReservedInstancesListing) SetPriceSchedules(v []*PriceSchedule) *ReservedInstancesListing { - s.PriceSchedules = v - return s -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstancesListing) SetReservedInstancesId(v string) *ReservedInstancesListing { - s.ReservedInstancesId = &v - return s -} - -// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. -func (s *ReservedInstancesListing) SetReservedInstancesListingId(v string) *ReservedInstancesListing { - s.ReservedInstancesListingId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReservedInstancesListing) SetStatus(v string) *ReservedInstancesListing { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ReservedInstancesListing) SetStatusMessage(v string) *ReservedInstancesListing { - s.StatusMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ReservedInstancesListing) SetTags(v []*Tag) *ReservedInstancesListing { - s.Tags = v - return s -} - -// SetUpdateDate sets the UpdateDate field's value. -func (s *ReservedInstancesListing) SetUpdateDate(v time.Time) *ReservedInstancesListing { - s.UpdateDate = &v - return s -} - -// Describes a Reserved Instance modification. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstancesModification -type ReservedInstancesModification struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive key supplied by the client to ensure that the request - // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // The time when the modification request was created. - CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"` - - // The time for the modification to become effective. - EffectiveDate *time.Time `locationName:"effectiveDate" type:"timestamp" timestampFormat:"iso8601"` - - // Contains target configurations along with their corresponding new Reserved - // Instance IDs. - ModificationResults []*ReservedInstancesModificationResult `locationName:"modificationResultSet" locationNameList:"item" type:"list"` - - // The IDs of one or more Reserved Instances. - ReservedInstancesIds []*ReservedInstancesId `locationName:"reservedInstancesSet" locationNameList:"item" type:"list"` - - // A unique ID for the Reserved Instance modification. - ReservedInstancesModificationId *string `locationName:"reservedInstancesModificationId" type:"string"` - - // The status of the Reserved Instances modification request. - Status *string `locationName:"status" type:"string"` - - // The reason for the status. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The time when the modification request was last updated. - UpdateDate *time.Time `locationName:"updateDate" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s ReservedInstancesModification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesModification) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *ReservedInstancesModification) SetClientToken(v string) *ReservedInstancesModification { - s.ClientToken = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ReservedInstancesModification) SetCreateDate(v time.Time) *ReservedInstancesModification { - s.CreateDate = &v - return s -} - -// SetEffectiveDate sets the EffectiveDate field's value. -func (s *ReservedInstancesModification) SetEffectiveDate(v time.Time) *ReservedInstancesModification { - s.EffectiveDate = &v - return s -} - -// SetModificationResults sets the ModificationResults field's value. -func (s *ReservedInstancesModification) SetModificationResults(v []*ReservedInstancesModificationResult) *ReservedInstancesModification { - s.ModificationResults = v - return s -} - -// SetReservedInstancesIds sets the ReservedInstancesIds field's value. -func (s *ReservedInstancesModification) SetReservedInstancesIds(v []*ReservedInstancesId) *ReservedInstancesModification { - s.ReservedInstancesIds = v - return s -} - -// SetReservedInstancesModificationId sets the ReservedInstancesModificationId field's value. -func (s *ReservedInstancesModification) SetReservedInstancesModificationId(v string) *ReservedInstancesModification { - s.ReservedInstancesModificationId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReservedInstancesModification) SetStatus(v string) *ReservedInstancesModification { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ReservedInstancesModification) SetStatusMessage(v string) *ReservedInstancesModification { - s.StatusMessage = &v - return s -} - -// SetUpdateDate sets the UpdateDate field's value. -func (s *ReservedInstancesModification) SetUpdateDate(v time.Time) *ReservedInstancesModification { - s.UpdateDate = &v - return s -} - -// Describes the modification request/s. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstancesModificationResult -type ReservedInstancesModificationResult struct { - _ struct{} `type:"structure"` - - // The ID for the Reserved Instances that were created as part of the modification - // request. This field is only available when the modification is fulfilled. - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` - - // The target Reserved Instances configurations supplied as part of the modification - // request. - TargetConfiguration *ReservedInstancesConfiguration `locationName:"targetConfiguration" type:"structure"` -} - -// String returns the string representation -func (s ReservedInstancesModificationResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesModificationResult) GoString() string { - return s.String() -} - -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *ReservedInstancesModificationResult) SetReservedInstancesId(v string) *ReservedInstancesModificationResult { - s.ReservedInstancesId = &v - return s -} - -// SetTargetConfiguration sets the TargetConfiguration field's value. -func (s *ReservedInstancesModificationResult) SetTargetConfiguration(v *ReservedInstancesConfiguration) *ReservedInstancesModificationResult { - s.TargetConfiguration = v - return s -} - -// Describes a Reserved Instance offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReservedInstancesOffering -type ReservedInstancesOffering struct { - _ struct{} `type:"structure"` - - // The Availability Zone in which the Reserved Instance can be used. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The currency of the Reserved Instance offering you are purchasing. It's specified - // using ISO 4217 standard currency codes. At this time, the only supported - // currency is USD. - CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"` - - // The duration of the Reserved Instance, in seconds. - Duration *int64 `locationName:"duration" type:"long"` - - // The purchase price of the Reserved Instance. - FixedPrice *float64 `locationName:"fixedPrice" type:"float"` - - // The tenancy of the instance. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // The instance type on which the Reserved Instance can be used. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // Indicates whether the offering is available through the Reserved Instance - // Marketplace (resale) or AWS. If it's a Reserved Instance Marketplace offering, - // this is true. - Marketplace *bool `locationName:"marketplace" type:"boolean"` - - // If convertible it can be exchanged for Reserved Instances of the same or - // higher monetary value, with different configurations. If standard, it is - // not possible to perform an exchange. - OfferingClass *string `locationName:"offeringClass" type:"string" enum:"OfferingClassType"` - - // The Reserved Instance offering type. - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingTypeValues"` - - // The pricing details of the Reserved Instance offering. - PricingDetails []*PricingDetail `locationName:"pricingDetailsSet" locationNameList:"item" type:"list"` - - // The Reserved Instance product platform description. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The recurring charge tag assigned to the resource. - RecurringCharges []*RecurringCharge `locationName:"recurringCharges" locationNameList:"item" type:"list"` - - // The ID of the Reserved Instance offering. This is the offering ID used in - // GetReservedInstancesExchangeQuote to confirm that an exchange can be made. - ReservedInstancesOfferingId *string `locationName:"reservedInstancesOfferingId" type:"string"` - - // Whether the Reserved Instance is applied to instances in a region or an Availability - // Zone. - Scope *string `locationName:"scope" type:"string" enum:"scope"` - - // The usage price of the Reserved Instance, per hour. - UsagePrice *float64 `locationName:"usagePrice" type:"float"` -} - -// String returns the string representation -func (s ReservedInstancesOffering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReservedInstancesOffering) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ReservedInstancesOffering) SetAvailabilityZone(v string) *ReservedInstancesOffering { - s.AvailabilityZone = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ReservedInstancesOffering) SetCurrencyCode(v string) *ReservedInstancesOffering { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ReservedInstancesOffering) SetDuration(v int64) *ReservedInstancesOffering { - s.Duration = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *ReservedInstancesOffering) SetFixedPrice(v float64) *ReservedInstancesOffering { - s.FixedPrice = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *ReservedInstancesOffering) SetInstanceTenancy(v string) *ReservedInstancesOffering { - s.InstanceTenancy = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ReservedInstancesOffering) SetInstanceType(v string) *ReservedInstancesOffering { - s.InstanceType = &v - return s -} - -// SetMarketplace sets the Marketplace field's value. -func (s *ReservedInstancesOffering) SetMarketplace(v bool) *ReservedInstancesOffering { - s.Marketplace = &v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *ReservedInstancesOffering) SetOfferingClass(v string) *ReservedInstancesOffering { - s.OfferingClass = &v - return s -} - -// SetOfferingType sets the OfferingType field's value. -func (s *ReservedInstancesOffering) SetOfferingType(v string) *ReservedInstancesOffering { - s.OfferingType = &v - return s -} - -// SetPricingDetails sets the PricingDetails field's value. -func (s *ReservedInstancesOffering) SetPricingDetails(v []*PricingDetail) *ReservedInstancesOffering { - s.PricingDetails = v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *ReservedInstancesOffering) SetProductDescription(v string) *ReservedInstancesOffering { - s.ProductDescription = &v - return s -} - -// SetRecurringCharges sets the RecurringCharges field's value. -func (s *ReservedInstancesOffering) SetRecurringCharges(v []*RecurringCharge) *ReservedInstancesOffering { - s.RecurringCharges = v - return s -} - -// SetReservedInstancesOfferingId sets the ReservedInstancesOfferingId field's value. -func (s *ReservedInstancesOffering) SetReservedInstancesOfferingId(v string) *ReservedInstancesOffering { - s.ReservedInstancesOfferingId = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *ReservedInstancesOffering) SetScope(v string) *ReservedInstancesOffering { - s.Scope = &v - return s -} - -// SetUsagePrice sets the UsagePrice field's value. -func (s *ReservedInstancesOffering) SetUsagePrice(v float64) *ReservedInstancesOffering { - s.UsagePrice = &v - return s -} - -// Contains the parameters for ResetImageAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttributeRequest -type ResetImageAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute to reset (currently you can only reset the launch permission - // attribute). - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"ResetImageAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the AMI. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ResetImageAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetImageAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetImageAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ResetImageAttributeInput) SetAttribute(v string) *ResetImageAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetImageAttributeInput) SetDryRun(v bool) *ResetImageAttributeInput { - s.DryRun = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ResetImageAttributeInput) SetImageId(v string) *ResetImageAttributeInput { - s.ImageId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttributeOutput -type ResetImageAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetImageAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetImageAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ResetInstanceAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttributeRequest -type ResetInstanceAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute to reset. - // - // You can only reset the following attributes: kernel | ramdisk | sourceDestCheck. - // To change an instance attribute, use ModifyInstanceAttribute. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"InstanceAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ResetInstanceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetInstanceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetInstanceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetInstanceAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ResetInstanceAttributeInput) SetAttribute(v string) *ResetInstanceAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetInstanceAttributeInput) SetDryRun(v bool) *ResetInstanceAttributeInput { - s.DryRun = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ResetInstanceAttributeInput) SetInstanceId(v string) *ResetInstanceAttributeInput { - s.InstanceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttributeOutput -type ResetInstanceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetInstanceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetInstanceAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ResetNetworkInterfaceAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttributeRequest -type ResetNetworkInterfaceAttributeInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // The source/destination checking attribute. Resets the value to true. - SourceDestCheck *string `locationName:"sourceDestCheck" type:"string"` -} - -// String returns the string representation -func (s ResetNetworkInterfaceAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetNetworkInterfaceAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetNetworkInterfaceAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetNetworkInterfaceAttributeInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetNetworkInterfaceAttributeInput) SetDryRun(v bool) *ResetNetworkInterfaceAttributeInput { - s.DryRun = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ResetNetworkInterfaceAttributeInput) SetNetworkInterfaceId(v string) *ResetNetworkInterfaceAttributeInput { - s.NetworkInterfaceId = &v - return s -} - -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *ResetNetworkInterfaceAttributeInput) SetSourceDestCheck(v string) *ResetNetworkInterfaceAttributeInput { - s.SourceDestCheck = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttributeOutput -type ResetNetworkInterfaceAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetNetworkInterfaceAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetNetworkInterfaceAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for ResetSnapshotAttribute. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttributeRequest -type ResetSnapshotAttributeInput struct { - _ struct{} `type:"structure"` - - // The attribute to reset. Currently, only the attribute for permission to create - // volumes can be reset. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"SnapshotAttributeName"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The ID of the snapshot. - // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ResetSnapshotAttributeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetSnapshotAttributeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetSnapshotAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetSnapshotAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.SnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *ResetSnapshotAttributeInput) SetAttribute(v string) *ResetSnapshotAttributeInput { - s.Attribute = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *ResetSnapshotAttributeInput) SetDryRun(v bool) *ResetSnapshotAttributeInput { - s.DryRun = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ResetSnapshotAttributeInput) SetSnapshotId(v string) *ResetSnapshotAttributeInput { - s.SnapshotId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttributeOutput -type ResetSnapshotAttributeOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ResetSnapshotAttributeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResetSnapshotAttributeOutput) GoString() string { - return s.String() -} - -// Contains the parameters for RestoreAddressToClassic. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassicRequest -type RestoreAddressToClassicInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The Elastic IP address. - // - // PublicIp is a required field - PublicIp *string `locationName:"publicIp" type:"string" required:"true"` -} - -// String returns the string representation -func (s RestoreAddressToClassicInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreAddressToClassicInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreAddressToClassicInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreAddressToClassicInput"} - if s.PublicIp == nil { - invalidParams.Add(request.NewErrParamRequired("PublicIp")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *RestoreAddressToClassicInput) SetDryRun(v bool) *RestoreAddressToClassicInput { - s.DryRun = &v - return s -} - -// SetPublicIp sets the PublicIp field's value. -func (s *RestoreAddressToClassicInput) SetPublicIp(v string) *RestoreAddressToClassicInput { - s.PublicIp = &v - return s -} - -// Contains the output of RestoreAddressToClassic. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassicResult -type RestoreAddressToClassicOutput struct { - _ struct{} `type:"structure"` - - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` - - // The move status for the IP address. - Status *string `locationName:"status" type:"string" enum:"Status"` -} - -// String returns the string representation -func (s RestoreAddressToClassicOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreAddressToClassicOutput) GoString() string { - return s.String() -} - -// SetPublicIp sets the PublicIp field's value. -func (s *RestoreAddressToClassicOutput) SetPublicIp(v string) *RestoreAddressToClassicOutput { - s.PublicIp = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RestoreAddressToClassicOutput) SetStatus(v string) *RestoreAddressToClassicOutput { - s.Status = &v - return s -} - -// Contains the parameters for RevokeSecurityGroupEgress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgressRequest -type RevokeSecurityGroupEgressInput struct { - _ struct{} `type:"structure"` - - // The CIDR IP address range. We recommend that you specify the CIDR range in - // a set of IP permissions instead. - CidrIp *string `locationName:"cidrIp" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The start of port range for the TCP and UDP protocols, or an ICMP type number. - // We recommend that you specify the port range in a set of IP permissions instead. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The ID of the security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // A set of IP permissions. You can't specify a destination security group and - // a CIDR IP address range. - IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` - - // The IP protocol name or number. We recommend that you specify the protocol - // in a set of IP permissions instead. - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // The name of a destination security group. To revoke outbound access to a - // destination security group, we recommend that you use a set of IP permissions - // instead. - SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` - - // The AWS account number for a destination security group. To revoke outbound - // access to a destination security group, we recommend that you use a set of - // IP permissions instead. - SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` - - // The end of port range for the TCP and UDP protocols, or an ICMP type number. - // We recommend that you specify the port range in a set of IP permissions instead. - ToPort *int64 `locationName:"toPort" type:"integer"` -} - -// String returns the string representation -func (s RevokeSecurityGroupEgressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupEgressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeSecurityGroupEgressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeSecurityGroupEgressInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidrIp sets the CidrIp field's value. -func (s *RevokeSecurityGroupEgressInput) SetCidrIp(v string) *RevokeSecurityGroupEgressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RevokeSecurityGroupEgressInput) SetDryRun(v bool) *RevokeSecurityGroupEgressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *RevokeSecurityGroupEgressInput) SetFromPort(v int64) *RevokeSecurityGroupEgressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *RevokeSecurityGroupEgressInput) SetGroupId(v string) *RevokeSecurityGroupEgressInput { - s.GroupId = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *RevokeSecurityGroupEgressInput) SetIpPermissions(v []*IpPermission) *RevokeSecurityGroupEgressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *RevokeSecurityGroupEgressInput) SetIpProtocol(v string) *RevokeSecurityGroupEgressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *RevokeSecurityGroupEgressInput) SetSourceSecurityGroupName(v string) *RevokeSecurityGroupEgressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *RevokeSecurityGroupEgressInput) SetSourceSecurityGroupOwnerId(v string) *RevokeSecurityGroupEgressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *RevokeSecurityGroupEgressInput) SetToPort(v int64) *RevokeSecurityGroupEgressInput { - s.ToPort = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgressOutput -type RevokeSecurityGroupEgressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RevokeSecurityGroupEgressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupEgressOutput) GoString() string { - return s.String() -} - -// Contains the parameters for RevokeSecurityGroupIngress. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngressRequest -type RevokeSecurityGroupIngressInput struct { - _ struct{} `type:"structure"` - - // The CIDR IP address range. You can't specify this parameter when specifying - // a source security group. - CidrIp *string `type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The start of port range for the TCP and UDP protocols, or an ICMP type number. - // For the ICMP type number, use -1 to specify all ICMP types. - FromPort *int64 `type:"integer"` - - // The ID of the security group. Required for a security group in a nondefault - // VPC. - GroupId *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the security group. - GroupName *string `type:"string"` - - // A set of IP permissions. You can't specify a source security group and a - // CIDR IP address range. - IpPermissions []*IpPermission `locationNameList:"item" type:"list"` - - // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // Use -1 to specify all. - IpProtocol *string `type:"string"` - - // [EC2-Classic, default VPC] The name of the source security group. You can't - // specify this parameter in combination with the following parameters: the - // CIDR IP address range, the start of the port range, the IP protocol, and - // the end of the port range. For EC2-VPC, the source security group must be - // in the same VPC. To revoke a specific rule for an IP protocol and port range, - // use a set of IP permissions instead. - SourceSecurityGroupName *string `type:"string"` - - // [EC2-Classic] The AWS account ID of the source security group, if the source - // security group is in a different account. You can't specify this parameter - // in combination with the following parameters: the CIDR IP address range, - // the IP protocol, the start of the port range, and the end of the port range. - // To revoke a specific rule for an IP protocol and port range, use a set of - // IP permissions instead. - SourceSecurityGroupOwnerId *string `type:"string"` - - // The end of port range for the TCP and UDP protocols, or an ICMP code number. - // For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type. - ToPort *int64 `type:"integer"` -} - -// String returns the string representation -func (s RevokeSecurityGroupIngressInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupIngressInput) GoString() string { - return s.String() -} - -// SetCidrIp sets the CidrIp field's value. -func (s *RevokeSecurityGroupIngressInput) SetCidrIp(v string) *RevokeSecurityGroupIngressInput { - s.CidrIp = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RevokeSecurityGroupIngressInput) SetDryRun(v bool) *RevokeSecurityGroupIngressInput { - s.DryRun = &v - return s -} - -// SetFromPort sets the FromPort field's value. -func (s *RevokeSecurityGroupIngressInput) SetFromPort(v int64) *RevokeSecurityGroupIngressInput { - s.FromPort = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *RevokeSecurityGroupIngressInput) SetGroupId(v string) *RevokeSecurityGroupIngressInput { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *RevokeSecurityGroupIngressInput) SetGroupName(v string) *RevokeSecurityGroupIngressInput { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *RevokeSecurityGroupIngressInput) SetIpPermissions(v []*IpPermission) *RevokeSecurityGroupIngressInput { - s.IpPermissions = v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *RevokeSecurityGroupIngressInput) SetIpProtocol(v string) *RevokeSecurityGroupIngressInput { - s.IpProtocol = &v - return s -} - -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *RevokeSecurityGroupIngressInput) SetSourceSecurityGroupName(v string) *RevokeSecurityGroupIngressInput { - s.SourceSecurityGroupName = &v - return s -} - -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *RevokeSecurityGroupIngressInput) SetSourceSecurityGroupOwnerId(v string) *RevokeSecurityGroupIngressInput { - s.SourceSecurityGroupOwnerId = &v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *RevokeSecurityGroupIngressInput) SetToPort(v int64) *RevokeSecurityGroupIngressInput { - s.ToPort = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngressOutput -type RevokeSecurityGroupIngressOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RevokeSecurityGroupIngressOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RevokeSecurityGroupIngressOutput) GoString() string { - return s.String() -} - -// Describes a route in a route table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Route -type Route struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR block used for the destination match. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // The IPv6 CIDR block used for the destination match. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` - - // The prefix of the AWS service. - DestinationPrefixListId *string `locationName:"destinationPrefixListId" type:"string"` - - // The ID of the egress-only Internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` - - // The ID of a gateway attached to your VPC. - GatewayId *string `locationName:"gatewayId" type:"string"` - - // The ID of a NAT instance in your VPC. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The AWS account ID of the owner of the instance. - InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` - - // The ID of a NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // Describes how the route was created. - // - // * CreateRouteTable - The route was automatically created when the route - // table was created. - // - // * CreateRoute - The route was manually added to the route table. - // - // * EnableVgwRoutePropagation - The route was propagated by route propagation. - Origin *string `locationName:"origin" type:"string" enum:"RouteOrigin"` - - // The state of the route. The blackhole state indicates that the route's target - // isn't available (for example, the specified gateway isn't attached to the - // VPC, or the specified NAT instance has been terminated). - State *string `locationName:"state" type:"string" enum:"RouteState"` - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s Route) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Route) GoString() string { - return s.String() -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *Route) SetDestinationCidrBlock(v string) *Route { - s.DestinationCidrBlock = &v - return s -} - -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *Route) SetDestinationIpv6CidrBlock(v string) *Route { - s.DestinationIpv6CidrBlock = &v - return s -} - -// SetDestinationPrefixListId sets the DestinationPrefixListId field's value. -func (s *Route) SetDestinationPrefixListId(v string) *Route { - s.DestinationPrefixListId = &v - return s -} - -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *Route) SetEgressOnlyInternetGatewayId(v string) *Route { - s.EgressOnlyInternetGatewayId = &v - return s -} - -// SetGatewayId sets the GatewayId field's value. -func (s *Route) SetGatewayId(v string) *Route { - s.GatewayId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Route) SetInstanceId(v string) *Route { - s.InstanceId = &v - return s -} - -// SetInstanceOwnerId sets the InstanceOwnerId field's value. -func (s *Route) SetInstanceOwnerId(v string) *Route { - s.InstanceOwnerId = &v - return s -} - -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *Route) SetNatGatewayId(v string) *Route { - s.NatGatewayId = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *Route) SetNetworkInterfaceId(v string) *Route { - s.NetworkInterfaceId = &v - return s -} - -// SetOrigin sets the Origin field's value. -func (s *Route) SetOrigin(v string) *Route { - s.Origin = &v - return s -} - -// SetState sets the State field's value. -func (s *Route) SetState(v string) *Route { - s.State = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *Route) SetVpcPeeringConnectionId(v string) *Route { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes a route table. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RouteTable -type RouteTable struct { - _ struct{} `type:"structure"` - - // The associations between the route table and one or more subnets. - Associations []*RouteTableAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` - - // Any virtual private gateway (VGW) propagating routes. - PropagatingVgws []*PropagatingVgw `locationName:"propagatingVgwSet" locationNameList:"item" type:"list"` - - // The ID of the route table. - RouteTableId *string `locationName:"routeTableId" type:"string"` - - // The routes in the route table. - Routes []*Route `locationName:"routeSet" locationNameList:"item" type:"list"` - - // Any tags assigned to the route table. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s RouteTable) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RouteTable) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *RouteTable) SetAssociations(v []*RouteTableAssociation) *RouteTable { - s.Associations = v - return s -} - -// SetPropagatingVgws sets the PropagatingVgws field's value. -func (s *RouteTable) SetPropagatingVgws(v []*PropagatingVgw) *RouteTable { - s.PropagatingVgws = v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *RouteTable) SetRouteTableId(v string) *RouteTable { - s.RouteTableId = &v - return s -} - -// SetRoutes sets the Routes field's value. -func (s *RouteTable) SetRoutes(v []*Route) *RouteTable { - s.Routes = v - return s -} - -// SetTags sets the Tags field's value. -func (s *RouteTable) SetTags(v []*Tag) *RouteTable { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *RouteTable) SetVpcId(v string) *RouteTable { - s.VpcId = &v - return s -} - -// Describes an association between a route table and a subnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RouteTableAssociation -type RouteTableAssociation struct { - _ struct{} `type:"structure"` - - // Indicates whether this is the main route table. - Main *bool `locationName:"main" type:"boolean"` - - // The ID of the association between a route table and a subnet. - RouteTableAssociationId *string `locationName:"routeTableAssociationId" type:"string"` - - // The ID of the route table. - RouteTableId *string `locationName:"routeTableId" type:"string"` - - // The ID of the subnet. A subnet ID is not returned for an implicit association. - SubnetId *string `locationName:"subnetId" type:"string"` -} - -// String returns the string representation -func (s RouteTableAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RouteTableAssociation) GoString() string { - return s.String() -} - -// SetMain sets the Main field's value. -func (s *RouteTableAssociation) SetMain(v bool) *RouteTableAssociation { - s.Main = &v - return s -} - -// SetRouteTableAssociationId sets the RouteTableAssociationId field's value. -func (s *RouteTableAssociation) SetRouteTableAssociationId(v string) *RouteTableAssociation { - s.RouteTableAssociationId = &v - return s -} - -// SetRouteTableId sets the RouteTableId field's value. -func (s *RouteTableAssociation) SetRouteTableId(v string) *RouteTableAssociation { - s.RouteTableId = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *RouteTableAssociation) SetSubnetId(v string) *RouteTableAssociation { - s.SubnetId = &v - return s -} - -// Contains the parameters for RunInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstancesRequest -type RunInstancesInput struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `locationName:"additionalInfo" type:"string"` - - // The block device mapping. - // - // Supplying both a snapshot ID and an encryption value as arguments for block-device - // mapping results in an error. This is because only blank volumes can be encrypted - // on start, and these are not created from a snapshot. If a snapshot is the - // basis for the volume, it contains data by definition and its encryption status - // cannot be changed using this action. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraints: Maximum 64 ASCII characters - ClientToken *string `locationName:"clientToken" type:"string"` - - // If you set this parameter to true, you can't terminate the instance using - // the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute - // to false after launch, use ModifyInstanceAttribute. Alternatively, if you - // set InstanceInitiatedShutdownBehavior to terminate, you can terminate the - // instance by running the shutdown command from the instance. - // - // Default: false - DisableApiTermination *bool `locationName:"disableApiTermination" type:"boolean"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Indicates whether the instance is optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS-optimized - // instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI, which you can get by calling DescribeImages. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` - - // Indicates whether an instance stops or terminates when you initiate shutdown - // from the instance (using the operating system command for system shutdown). - // - // Default: stop - InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"` - - // The instance type. For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Default: m1.small - InstanceType *string `type:"string" enum:"InstanceType"` - - // [EC2-VPC] A number of IPv6 addresses to associate with the primary network - // interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. - // You cannot specify this option and the option to assign specific IPv6 addresses - // in the same request. You can specify this option if you've specified a minimum - // number of instances to launch. - Ipv6AddressCount *int64 `type:"integer"` - - // [EC2-VPC] Specify one or more IPv6 addresses from the range of the subnet - // to associate with the primary network interface. You cannot specify this - // option and the option to assign a number of IPv6 addresses in the same request. - // You cannot specify this option if you've specified a minimum number of instances - // to launch. - Ipv6Addresses []*InstanceIpv6Address `locationName:"Ipv6Address" locationNameList:"item" type:"list"` - - // The ID of the kernel. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. - KernelId *string `type:"string"` - - // The name of the key pair. You can create a key pair using CreateKeyPair or - // ImportKeyPair. - // - // If you do not specify a key pair, you can't connect to the instance unless - // you choose an AMI that is configured to allow users another way to log in. - KeyName *string `type:"string"` - - // The maximum number of instances to launch. If you specify more instances - // than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches - // the largest possible number of instances above MinCount. - // - // Constraints: Between 1 and the maximum number you're allowed for the specified - // instance type. For more information about the default limits, and how to - // request an increase, see How many instances can I run in Amazon EC2 (http://aws.amazon.com/ec2/faqs/#How_many_instances_can_I_run_in_Amazon_EC2) - // in the Amazon EC2 FAQ. - // - // MaxCount is a required field - MaxCount *int64 `type:"integer" required:"true"` - - // The minimum number of instances to launch. If you specify a minimum that - // is more instances than Amazon EC2 can launch in the target Availability Zone, - // Amazon EC2 launches no instances. - // - // Constraints: Between 1 and the maximum number you're allowed for the specified - // instance type. For more information about the default limits, and how to - // request an increase, see How many instances can I run in Amazon EC2 (http://aws.amazon.com/ec2/faqs/#How_many_instances_can_I_run_in_Amazon_EC2) - // in the Amazon EC2 General FAQ. - // - // MinCount is a required field - MinCount *int64 `type:"integer" required:"true"` - - // The monitoring for the instance. - Monitoring *RunInstancesMonitoringEnabled `type:"structure"` - - // One or more network interfaces. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterface" locationNameList:"item" type:"list"` - - // The placement for the instance. - Placement *Placement `type:"structure"` - - // [EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 - // address range of the subnet. - // - // Only one private IP address can be designated as primary. You can't specify - // this option if you've specified the option to designate a private IP address - // as the primary IP address in a network interface specification. You cannot - // specify this option if you're launching more than one instance in the request. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The ID of the RAM disk. - // - // We recommend that you use PV-GRUB instead of kernels and RAM disks. For more - // information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html) - // in the Amazon Elastic Compute Cloud User Guide. - RamdiskId *string `type:"string"` - - // One or more security group IDs. You can create a security group using CreateSecurityGroup. - // - // Default: Amazon EC2 uses the default security group. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // [EC2-Classic, default VPC] One or more security group names. For a nondefault - // VPC, you must use security group IDs instead. - // - // Default: Amazon EC2 uses the default security group. - SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"` - - // [EC2-VPC] The ID of the subnet to launch the instance into. - SubnetId *string `type:"string"` - - // The tags to apply to the resources during launch. You can tag instances and - // volumes. The specified tags are applied to all instances or volumes that - // are created during launch. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The user data to make available to the instance. For more information, see - // Running Commands on Your Linux Instance at Launch (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) - // (Linux) and Adding User Data (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data) - // (Windows). If you are using an AWS SDK or command line tool, Base64-encoding - // is performed for you, and you can load the text from a file. Otherwise, you - // must provide Base64-encoded text. - UserData *string `type:"string"` -} - -// String returns the string representation -func (s RunInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunInstancesInput"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - if s.MaxCount == nil { - invalidParams.Add(request.NewErrParamRequired("MaxCount")) - } - if s.MinCount == nil { - invalidParams.Add(request.NewErrParamRequired("MinCount")) - } - if s.Monitoring != nil { - if err := s.Monitoring.Validate(); err != nil { - invalidParams.AddNested("Monitoring", err.(request.ErrInvalidParams)) - } - } - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *RunInstancesInput) SetAdditionalInfo(v string) *RunInstancesInput { - s.AdditionalInfo = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *RunInstancesInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *RunInstancesInput { - s.BlockDeviceMappings = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *RunInstancesInput) SetClientToken(v string) *RunInstancesInput { - s.ClientToken = &v - return s -} - -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *RunInstancesInput) SetDisableApiTermination(v bool) *RunInstancesInput { - s.DisableApiTermination = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RunInstancesInput) SetDryRun(v bool) *RunInstancesInput { - s.DryRun = &v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *RunInstancesInput) SetEbsOptimized(v bool) *RunInstancesInput { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *RunInstancesInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *RunInstancesInput { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *RunInstancesInput) SetImageId(v string) *RunInstancesInput { - s.ImageId = &v - return s -} - -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *RunInstancesInput) SetInstanceInitiatedShutdownBehavior(v string) *RunInstancesInput { - s.InstanceInitiatedShutdownBehavior = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RunInstancesInput) SetInstanceType(v string) *RunInstancesInput { - s.InstanceType = &v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *RunInstancesInput) SetIpv6AddressCount(v int64) *RunInstancesInput { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *RunInstancesInput) SetIpv6Addresses(v []*InstanceIpv6Address) *RunInstancesInput { - s.Ipv6Addresses = v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *RunInstancesInput) SetKernelId(v string) *RunInstancesInput { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *RunInstancesInput) SetKeyName(v string) *RunInstancesInput { - s.KeyName = &v - return s -} - -// SetMaxCount sets the MaxCount field's value. -func (s *RunInstancesInput) SetMaxCount(v int64) *RunInstancesInput { - s.MaxCount = &v - return s -} - -// SetMinCount sets the MinCount field's value. -func (s *RunInstancesInput) SetMinCount(v int64) *RunInstancesInput { - s.MinCount = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *RunInstancesInput) SetMonitoring(v *RunInstancesMonitoringEnabled) *RunInstancesInput { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *RunInstancesInput) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *RunInstancesInput { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *RunInstancesInput) SetPlacement(v *Placement) *RunInstancesInput { - s.Placement = v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *RunInstancesInput) SetPrivateIpAddress(v string) *RunInstancesInput { - s.PrivateIpAddress = &v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *RunInstancesInput) SetRamdiskId(v string) *RunInstancesInput { - s.RamdiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *RunInstancesInput) SetSecurityGroupIds(v []*string) *RunInstancesInput { - s.SecurityGroupIds = v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *RunInstancesInput) SetSecurityGroups(v []*string) *RunInstancesInput { - s.SecurityGroups = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *RunInstancesInput) SetSubnetId(v string) *RunInstancesInput { - s.SubnetId = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *RunInstancesInput) SetTagSpecifications(v []*TagSpecification) *RunInstancesInput { - s.TagSpecifications = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *RunInstancesInput) SetUserData(v string) *RunInstancesInput { - s.UserData = &v - return s -} - -// Describes the monitoring of an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstancesMonitoringEnabled -type RunInstancesMonitoringEnabled struct { - _ struct{} `type:"structure"` - - // Indicates whether detailed monitoring is enabled. Otherwise, basic monitoring - // is enabled. - // - // Enabled is a required field - Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` -} - -// String returns the string representation -func (s RunInstancesMonitoringEnabled) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunInstancesMonitoringEnabled) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunInstancesMonitoringEnabled) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunInstancesMonitoringEnabled"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *RunInstancesMonitoringEnabled) SetEnabled(v bool) *RunInstancesMonitoringEnabled { - s.Enabled = &v - return s -} - -// Contains the parameters for RunScheduledInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstancesRequest -type RunScheduledInstancesInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that ensures the idempotency of the request. - // For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` - - // The number of instances. - // - // Default: 1 - InstanceCount *int64 `type:"integer"` - - // The launch specification. You must match the instance type, Availability - // Zone, network, and platform of the schedule that you purchased. - // - // LaunchSpecification is a required field - LaunchSpecification *ScheduledInstancesLaunchSpecification `type:"structure" required:"true"` - - // The Scheduled Instance ID. - // - // ScheduledInstanceId is a required field - ScheduledInstanceId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RunScheduledInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunScheduledInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RunScheduledInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RunScheduledInstancesInput"} - if s.LaunchSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchSpecification")) - } - if s.ScheduledInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ScheduledInstanceId")) - } - if s.LaunchSpecification != nil { - if err := s.LaunchSpecification.Validate(); err != nil { - invalidParams.AddNested("LaunchSpecification", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *RunScheduledInstancesInput) SetClientToken(v string) *RunScheduledInstancesInput { - s.ClientToken = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RunScheduledInstancesInput) SetDryRun(v bool) *RunScheduledInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *RunScheduledInstancesInput) SetInstanceCount(v int64) *RunScheduledInstancesInput { - s.InstanceCount = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *RunScheduledInstancesInput) SetLaunchSpecification(v *ScheduledInstancesLaunchSpecification) *RunScheduledInstancesInput { - s.LaunchSpecification = v - return s -} - -// SetScheduledInstanceId sets the ScheduledInstanceId field's value. -func (s *RunScheduledInstancesInput) SetScheduledInstanceId(v string) *RunScheduledInstancesInput { - s.ScheduledInstanceId = &v - return s -} - -// Contains the output of RunScheduledInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstancesResult -type RunScheduledInstancesOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the newly launched instances. - InstanceIdSet []*string `locationName:"instanceIdSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s RunScheduledInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunScheduledInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceIdSet sets the InstanceIdSet field's value. -func (s *RunScheduledInstancesOutput) SetInstanceIdSet(v []*string) *RunScheduledInstancesOutput { - s.InstanceIdSet = v - return s -} - -// Describes the storage parameters for S3 and S3 buckets for an instance store-backed -// AMI. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/S3Storage -type S3Storage struct { - _ struct{} `type:"structure"` - - // The access key ID of the owner of the bucket. Before you specify a value - // for your access key ID, review and follow the guidance in Best Practices - // for Managing AWS Access Keys (http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html). - AWSAccessKeyId *string `type:"string"` - - // The bucket in which to store the AMI. You can specify a bucket that you already - // own or a new bucket that Amazon EC2 creates on your behalf. If you specify - // a bucket that belongs to someone else, Amazon EC2 returns an error. - Bucket *string `locationName:"bucket" type:"string"` - - // The beginning of the file name of the AMI. - Prefix *string `locationName:"prefix" type:"string"` - - // An Amazon S3 upload policy that gives Amazon EC2 permission to upload items - // into Amazon S3 on your behalf. - // - // UploadPolicy is automatically base64 encoded/decoded by the SDK. - UploadPolicy []byte `locationName:"uploadPolicy" type:"blob"` - - // The signature of the JSON document. - UploadPolicySignature *string `locationName:"uploadPolicySignature" type:"string"` -} - -// String returns the string representation -func (s S3Storage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s S3Storage) GoString() string { - return s.String() -} - -// SetAWSAccessKeyId sets the AWSAccessKeyId field's value. -func (s *S3Storage) SetAWSAccessKeyId(v string) *S3Storage { - s.AWSAccessKeyId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *S3Storage) SetBucket(v string) *S3Storage { - s.Bucket = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3Storage) SetPrefix(v string) *S3Storage { - s.Prefix = &v - return s -} - -// SetUploadPolicy sets the UploadPolicy field's value. -func (s *S3Storage) SetUploadPolicy(v []byte) *S3Storage { - s.UploadPolicy = v - return s -} - -// SetUploadPolicySignature sets the UploadPolicySignature field's value. -func (s *S3Storage) SetUploadPolicySignature(v string) *S3Storage { - s.UploadPolicySignature = &v - return s -} - -// Describes a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstance -type ScheduledInstance struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The date when the Scheduled Instance was purchased. - CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"` - - // The hourly price for a single instance. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The number of instances. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The network platform (EC2-Classic or EC2-VPC). - NetworkPlatform *string `locationName:"networkPlatform" type:"string"` - - // The time for the next schedule to start. - NextSlotStartTime *time.Time `locationName:"nextSlotStartTime" type:"timestamp" timestampFormat:"iso8601"` - - // The platform (Linux/UNIX or Windows). - Platform *string `locationName:"platform" type:"string"` - - // The time that the previous schedule ended or will end. - PreviousSlotEndTime *time.Time `locationName:"previousSlotEndTime" type:"timestamp" timestampFormat:"iso8601"` - - // The schedule recurrence. - Recurrence *ScheduledInstanceRecurrence `locationName:"recurrence" type:"structure"` - - // The Scheduled Instance ID. - ScheduledInstanceId *string `locationName:"scheduledInstanceId" type:"string"` - - // The number of hours in the schedule. - SlotDurationInHours *int64 `locationName:"slotDurationInHours" type:"integer"` - - // The end date for the Scheduled Instance. - TermEndDate *time.Time `locationName:"termEndDate" type:"timestamp" timestampFormat:"iso8601"` - - // The start date for the Scheduled Instance. - TermStartDate *time.Time `locationName:"termStartDate" type:"timestamp" timestampFormat:"iso8601"` - - // The total number of hours for a single instance for the entire term. - TotalScheduledInstanceHours *int64 `locationName:"totalScheduledInstanceHours" type:"integer"` -} - -// String returns the string representation -func (s ScheduledInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstance) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ScheduledInstance) SetAvailabilityZone(v string) *ScheduledInstance { - s.AvailabilityZone = &v - return s -} - -// SetCreateDate sets the CreateDate field's value. -func (s *ScheduledInstance) SetCreateDate(v time.Time) *ScheduledInstance { - s.CreateDate = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *ScheduledInstance) SetHourlyPrice(v string) *ScheduledInstance { - s.HourlyPrice = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *ScheduledInstance) SetInstanceCount(v int64) *ScheduledInstance { - s.InstanceCount = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ScheduledInstance) SetInstanceType(v string) *ScheduledInstance { - s.InstanceType = &v - return s -} - -// SetNetworkPlatform sets the NetworkPlatform field's value. -func (s *ScheduledInstance) SetNetworkPlatform(v string) *ScheduledInstance { - s.NetworkPlatform = &v - return s -} - -// SetNextSlotStartTime sets the NextSlotStartTime field's value. -func (s *ScheduledInstance) SetNextSlotStartTime(v time.Time) *ScheduledInstance { - s.NextSlotStartTime = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ScheduledInstance) SetPlatform(v string) *ScheduledInstance { - s.Platform = &v - return s -} - -// SetPreviousSlotEndTime sets the PreviousSlotEndTime field's value. -func (s *ScheduledInstance) SetPreviousSlotEndTime(v time.Time) *ScheduledInstance { - s.PreviousSlotEndTime = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *ScheduledInstance) SetRecurrence(v *ScheduledInstanceRecurrence) *ScheduledInstance { - s.Recurrence = v - return s -} - -// SetScheduledInstanceId sets the ScheduledInstanceId field's value. -func (s *ScheduledInstance) SetScheduledInstanceId(v string) *ScheduledInstance { - s.ScheduledInstanceId = &v - return s -} - -// SetSlotDurationInHours sets the SlotDurationInHours field's value. -func (s *ScheduledInstance) SetSlotDurationInHours(v int64) *ScheduledInstance { - s.SlotDurationInHours = &v - return s -} - -// SetTermEndDate sets the TermEndDate field's value. -func (s *ScheduledInstance) SetTermEndDate(v time.Time) *ScheduledInstance { - s.TermEndDate = &v - return s -} - -// SetTermStartDate sets the TermStartDate field's value. -func (s *ScheduledInstance) SetTermStartDate(v time.Time) *ScheduledInstance { - s.TermStartDate = &v - return s -} - -// SetTotalScheduledInstanceHours sets the TotalScheduledInstanceHours field's value. -func (s *ScheduledInstance) SetTotalScheduledInstanceHours(v int64) *ScheduledInstance { - s.TotalScheduledInstanceHours = &v - return s -} - -// Describes a schedule that is available for your Scheduled Instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstanceAvailability -type ScheduledInstanceAvailability struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of available instances. - AvailableInstanceCount *int64 `locationName:"availableInstanceCount" type:"integer"` - - // The time period for the first schedule to start. - FirstSlotStartTime *time.Time `locationName:"firstSlotStartTime" type:"timestamp" timestampFormat:"iso8601"` - - // The hourly price for a single instance. - HourlyPrice *string `locationName:"hourlyPrice" type:"string"` - - // The instance type. You can specify one of the C3, C4, M4, or R3 instance - // types. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The maximum term. The only possible value is 365 days. - MaxTermDurationInDays *int64 `locationName:"maxTermDurationInDays" type:"integer"` - - // The minimum term. The only possible value is 365 days. - MinTermDurationInDays *int64 `locationName:"minTermDurationInDays" type:"integer"` - - // The network platform (EC2-Classic or EC2-VPC). - NetworkPlatform *string `locationName:"networkPlatform" type:"string"` - - // The platform (Linux/UNIX or Windows). - Platform *string `locationName:"platform" type:"string"` - - // The purchase token. This token expires in two hours. - PurchaseToken *string `locationName:"purchaseToken" type:"string"` - - // The schedule recurrence. - Recurrence *ScheduledInstanceRecurrence `locationName:"recurrence" type:"structure"` - - // The number of hours in the schedule. - SlotDurationInHours *int64 `locationName:"slotDurationInHours" type:"integer"` - - // The total number of hours for a single instance for the entire term. - TotalScheduledInstanceHours *int64 `locationName:"totalScheduledInstanceHours" type:"integer"` -} - -// String returns the string representation -func (s ScheduledInstanceAvailability) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstanceAvailability) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ScheduledInstanceAvailability) SetAvailabilityZone(v string) *ScheduledInstanceAvailability { - s.AvailabilityZone = &v - return s -} - -// SetAvailableInstanceCount sets the AvailableInstanceCount field's value. -func (s *ScheduledInstanceAvailability) SetAvailableInstanceCount(v int64) *ScheduledInstanceAvailability { - s.AvailableInstanceCount = &v - return s -} - -// SetFirstSlotStartTime sets the FirstSlotStartTime field's value. -func (s *ScheduledInstanceAvailability) SetFirstSlotStartTime(v time.Time) *ScheduledInstanceAvailability { - s.FirstSlotStartTime = &v - return s -} - -// SetHourlyPrice sets the HourlyPrice field's value. -func (s *ScheduledInstanceAvailability) SetHourlyPrice(v string) *ScheduledInstanceAvailability { - s.HourlyPrice = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ScheduledInstanceAvailability) SetInstanceType(v string) *ScheduledInstanceAvailability { - s.InstanceType = &v - return s -} - -// SetMaxTermDurationInDays sets the MaxTermDurationInDays field's value. -func (s *ScheduledInstanceAvailability) SetMaxTermDurationInDays(v int64) *ScheduledInstanceAvailability { - s.MaxTermDurationInDays = &v - return s -} - -// SetMinTermDurationInDays sets the MinTermDurationInDays field's value. -func (s *ScheduledInstanceAvailability) SetMinTermDurationInDays(v int64) *ScheduledInstanceAvailability { - s.MinTermDurationInDays = &v - return s -} - -// SetNetworkPlatform sets the NetworkPlatform field's value. -func (s *ScheduledInstanceAvailability) SetNetworkPlatform(v string) *ScheduledInstanceAvailability { - s.NetworkPlatform = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ScheduledInstanceAvailability) SetPlatform(v string) *ScheduledInstanceAvailability { - s.Platform = &v - return s -} - -// SetPurchaseToken sets the PurchaseToken field's value. -func (s *ScheduledInstanceAvailability) SetPurchaseToken(v string) *ScheduledInstanceAvailability { - s.PurchaseToken = &v - return s -} - -// SetRecurrence sets the Recurrence field's value. -func (s *ScheduledInstanceAvailability) SetRecurrence(v *ScheduledInstanceRecurrence) *ScheduledInstanceAvailability { - s.Recurrence = v - return s -} - -// SetSlotDurationInHours sets the SlotDurationInHours field's value. -func (s *ScheduledInstanceAvailability) SetSlotDurationInHours(v int64) *ScheduledInstanceAvailability { - s.SlotDurationInHours = &v - return s -} - -// SetTotalScheduledInstanceHours sets the TotalScheduledInstanceHours field's value. -func (s *ScheduledInstanceAvailability) SetTotalScheduledInstanceHours(v int64) *ScheduledInstanceAvailability { - s.TotalScheduledInstanceHours = &v - return s -} - -// Describes the recurring schedule for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstanceRecurrence -type ScheduledInstanceRecurrence struct { - _ struct{} `type:"structure"` - - // The frequency (Daily, Weekly, or Monthly). - Frequency *string `locationName:"frequency" type:"string"` - - // The interval quantity. The interval unit depends on the value of frequency. - // For example, every 2 weeks or every 2 months. - Interval *int64 `locationName:"interval" type:"integer"` - - // The days. For a monthly schedule, this is one or more days of the month (1-31). - // For a weekly schedule, this is one or more days of the week (1-7, where 1 - // is Sunday). - OccurrenceDaySet []*int64 `locationName:"occurrenceDaySet" locationNameList:"item" type:"list"` - - // Indicates whether the occurrence is relative to the end of the specified - // week or month. - OccurrenceRelativeToEnd *bool `locationName:"occurrenceRelativeToEnd" type:"boolean"` - - // The unit for occurrenceDaySet (DayOfWeek or DayOfMonth). - OccurrenceUnit *string `locationName:"occurrenceUnit" type:"string"` -} - -// String returns the string representation -func (s ScheduledInstanceRecurrence) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstanceRecurrence) GoString() string { - return s.String() -} - -// SetFrequency sets the Frequency field's value. -func (s *ScheduledInstanceRecurrence) SetFrequency(v string) *ScheduledInstanceRecurrence { - s.Frequency = &v - return s -} - -// SetInterval sets the Interval field's value. -func (s *ScheduledInstanceRecurrence) SetInterval(v int64) *ScheduledInstanceRecurrence { - s.Interval = &v - return s -} - -// SetOccurrenceDaySet sets the OccurrenceDaySet field's value. -func (s *ScheduledInstanceRecurrence) SetOccurrenceDaySet(v []*int64) *ScheduledInstanceRecurrence { - s.OccurrenceDaySet = v - return s -} - -// SetOccurrenceRelativeToEnd sets the OccurrenceRelativeToEnd field's value. -func (s *ScheduledInstanceRecurrence) SetOccurrenceRelativeToEnd(v bool) *ScheduledInstanceRecurrence { - s.OccurrenceRelativeToEnd = &v - return s -} - -// SetOccurrenceUnit sets the OccurrenceUnit field's value. -func (s *ScheduledInstanceRecurrence) SetOccurrenceUnit(v string) *ScheduledInstanceRecurrence { - s.OccurrenceUnit = &v - return s -} - -// Describes the recurring schedule for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstanceRecurrenceRequest -type ScheduledInstanceRecurrenceRequest struct { - _ struct{} `type:"structure"` - - // The frequency (Daily, Weekly, or Monthly). - Frequency *string `type:"string"` - - // The interval quantity. The interval unit depends on the value of Frequency. - // For example, every 2 weeks or every 2 months. - Interval *int64 `type:"integer"` - - // The days. For a monthly schedule, this is one or more days of the month (1-31). - // For a weekly schedule, this is one or more days of the week (1-7, where 1 - // is Sunday). You can't specify this value with a daily schedule. If the occurrence - // is relative to the end of the month, you can specify only a single day. - OccurrenceDays []*int64 `locationName:"OccurrenceDay" locationNameList:"OccurenceDay" type:"list"` - - // Indicates whether the occurrence is relative to the end of the specified - // week or month. You can't specify this value with a daily schedule. - OccurrenceRelativeToEnd *bool `type:"boolean"` - - // The unit for OccurrenceDays (DayOfWeek or DayOfMonth). This value is required - // for a monthly schedule. You can't specify DayOfWeek with a weekly schedule. - // You can't specify this value with a daily schedule. - OccurrenceUnit *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstanceRecurrenceRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstanceRecurrenceRequest) GoString() string { - return s.String() -} - -// SetFrequency sets the Frequency field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetFrequency(v string) *ScheduledInstanceRecurrenceRequest { - s.Frequency = &v - return s -} - -// SetInterval sets the Interval field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetInterval(v int64) *ScheduledInstanceRecurrenceRequest { - s.Interval = &v - return s -} - -// SetOccurrenceDays sets the OccurrenceDays field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetOccurrenceDays(v []*int64) *ScheduledInstanceRecurrenceRequest { - s.OccurrenceDays = v - return s -} - -// SetOccurrenceRelativeToEnd sets the OccurrenceRelativeToEnd field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetOccurrenceRelativeToEnd(v bool) *ScheduledInstanceRecurrenceRequest { - s.OccurrenceRelativeToEnd = &v - return s -} - -// SetOccurrenceUnit sets the OccurrenceUnit field's value. -func (s *ScheduledInstanceRecurrenceRequest) SetOccurrenceUnit(v string) *ScheduledInstanceRecurrenceRequest { - s.OccurrenceUnit = &v - return s -} - -// Describes a block device mapping for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesBlockDeviceMapping -type ScheduledInstancesBlockDeviceMapping struct { - _ struct{} `type:"structure"` - - // The device name exposed to the instance (for example, /dev/sdh or xvdh). - DeviceName *string `type:"string"` - - // Parameters used to set up EBS volumes automatically when the instance is - // launched. - Ebs *ScheduledInstancesEbs `type:"structure"` - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice *string `type:"string"` - - // The virtual device name (ephemeralN). Instance store volumes are numbered - // starting from 0. An instance type with two available instance store volumes - // can specify mappings for ephemeral0 and ephemeral1.The number of available - // instance store volumes depends on the instance type. After you connect to - // the instance, you must mount the volume. - // - // Constraints: For M3 instances, you must specify instance store volumes in - // the block device mapping for the instance. When you launch an M3 instance, - // we ignore any instance store volumes specified in the block device mapping - // for the AMI. - VirtualName *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesBlockDeviceMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesBlockDeviceMapping) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetDeviceName(v string) *ScheduledInstancesBlockDeviceMapping { - s.DeviceName = &v - return s -} - -// SetEbs sets the Ebs field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetEbs(v *ScheduledInstancesEbs) *ScheduledInstancesBlockDeviceMapping { - s.Ebs = v - return s -} - -// SetNoDevice sets the NoDevice field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetNoDevice(v string) *ScheduledInstancesBlockDeviceMapping { - s.NoDevice = &v - return s -} - -// SetVirtualName sets the VirtualName field's value. -func (s *ScheduledInstancesBlockDeviceMapping) SetVirtualName(v string) *ScheduledInstancesBlockDeviceMapping { - s.VirtualName = &v - return s -} - -// Describes an EBS volume for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesEbs -type ScheduledInstancesEbs struct { - _ struct{} `type:"structure"` - - // Indicates whether the volume is deleted on instance termination. - DeleteOnTermination *bool `type:"boolean"` - - // Indicates whether the volume is encrypted. You can attached encrypted volumes - // only to instances that support them. - Encrypted *bool `type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1 volumes, this represents the number of IOPS that are provisioned - // for the volume. For gp2 volumes, this represents the baseline performance - // of the volume and the rate at which the volume accumulates I/O credits for - // bursting. For more information about gp2 baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops *int64 `type:"integer"` - - // The ID of the snapshot. - SnapshotId *string `type:"string"` - - // The size of the volume, in GiB. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - VolumeSize *int64 `type:"integer"` - - // The volume type. gp2 for General Purpose SSD, io1 for Provisioned IOPS SSD, - // Throughput Optimized HDD for st1, Cold HDD for sc1, or standard for Magnetic. - // - // Default: standard - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesEbs) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesEbs) GoString() string { - return s.String() -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *ScheduledInstancesEbs) SetDeleteOnTermination(v bool) *ScheduledInstancesEbs { - s.DeleteOnTermination = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *ScheduledInstancesEbs) SetEncrypted(v bool) *ScheduledInstancesEbs { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *ScheduledInstancesEbs) SetIops(v int64) *ScheduledInstancesEbs { - s.Iops = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *ScheduledInstancesEbs) SetSnapshotId(v string) *ScheduledInstancesEbs { - s.SnapshotId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *ScheduledInstancesEbs) SetVolumeSize(v int64) *ScheduledInstancesEbs { - s.VolumeSize = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *ScheduledInstancesEbs) SetVolumeType(v string) *ScheduledInstancesEbs { - s.VolumeType = &v - return s -} - -// Describes an IAM instance profile for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesIamInstanceProfile -type ScheduledInstancesIamInstanceProfile struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN). - Arn *string `type:"string"` - - // The name. - Name *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesIamInstanceProfile) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesIamInstanceProfile) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ScheduledInstancesIamInstanceProfile) SetArn(v string) *ScheduledInstancesIamInstanceProfile { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *ScheduledInstancesIamInstanceProfile) SetName(v string) *ScheduledInstancesIamInstanceProfile { - s.Name = &v - return s -} - -// Describes an IPv6 address. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesIpv6Address -type ScheduledInstancesIpv6Address struct { - _ struct{} `type:"structure"` - - // The IPv6 address. - Ipv6Address *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesIpv6Address) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesIpv6Address) GoString() string { - return s.String() -} - -// SetIpv6Address sets the Ipv6Address field's value. -func (s *ScheduledInstancesIpv6Address) SetIpv6Address(v string) *ScheduledInstancesIpv6Address { - s.Ipv6Address = &v - return s -} - -// Describes the launch specification for a Scheduled Instance. -// -// If you are launching the Scheduled Instance in EC2-VPC, you must specify -// the ID of the subnet. You can specify the subnet using either SubnetId or -// NetworkInterface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesLaunchSpecification -type ScheduledInstancesLaunchSpecification struct { - _ struct{} `type:"structure"` - - // One or more block device mapping entries. - BlockDeviceMappings []*ScheduledInstancesBlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - - // Indicates whether the instances are optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS-optimized - // instance. - // - // Default: false - EbsOptimized *bool `type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *ScheduledInstancesIamInstanceProfile `type:"structure"` - - // The ID of the Amazon Machine Image (AMI). - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` - - // The instance type. - InstanceType *string `type:"string"` - - // The ID of the kernel. - KernelId *string `type:"string"` - - // The name of the key pair. - KeyName *string `type:"string"` - - // Enable or disable monitoring for the instances. - Monitoring *ScheduledInstancesMonitoring `type:"structure"` - - // One or more network interfaces. - NetworkInterfaces []*ScheduledInstancesNetworkInterface `locationName:"NetworkInterface" locationNameList:"NetworkInterface" type:"list"` - - // The placement information. - Placement *ScheduledInstancesPlacement `type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `type:"string"` - - // The IDs of one or more security groups. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - - // The ID of the subnet in which to launch the instances. - SubnetId *string `type:"string"` - - // The base64-encoded MIME user data. - UserData *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesLaunchSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScheduledInstancesLaunchSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScheduledInstancesLaunchSpecification"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *ScheduledInstancesLaunchSpecification) SetBlockDeviceMappings(v []*ScheduledInstancesBlockDeviceMapping) *ScheduledInstancesLaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *ScheduledInstancesLaunchSpecification) SetEbsOptimized(v bool) *ScheduledInstancesLaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *ScheduledInstancesLaunchSpecification) SetIamInstanceProfile(v *ScheduledInstancesIamInstanceProfile) *ScheduledInstancesLaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetImageId(v string) *ScheduledInstancesLaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ScheduledInstancesLaunchSpecification) SetInstanceType(v string) *ScheduledInstancesLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetKernelId(v string) *ScheduledInstancesLaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *ScheduledInstancesLaunchSpecification) SetKeyName(v string) *ScheduledInstancesLaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *ScheduledInstancesLaunchSpecification) SetMonitoring(v *ScheduledInstancesMonitoring) *ScheduledInstancesLaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *ScheduledInstancesLaunchSpecification) SetNetworkInterfaces(v []*ScheduledInstancesNetworkInterface) *ScheduledInstancesLaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *ScheduledInstancesLaunchSpecification) SetPlacement(v *ScheduledInstancesPlacement) *ScheduledInstancesLaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetRamdiskId(v string) *ScheduledInstancesLaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ScheduledInstancesLaunchSpecification) SetSecurityGroupIds(v []*string) *ScheduledInstancesLaunchSpecification { - s.SecurityGroupIds = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ScheduledInstancesLaunchSpecification) SetSubnetId(v string) *ScheduledInstancesLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ScheduledInstancesLaunchSpecification) SetUserData(v string) *ScheduledInstancesLaunchSpecification { - s.UserData = &v - return s -} - -// Describes whether monitoring is enabled for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesMonitoring -type ScheduledInstancesMonitoring struct { - _ struct{} `type:"structure"` - - // Indicates whether monitoring is enabled. - Enabled *bool `type:"boolean"` -} - -// String returns the string representation -func (s ScheduledInstancesMonitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesMonitoring) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *ScheduledInstancesMonitoring) SetEnabled(v bool) *ScheduledInstancesMonitoring { - s.Enabled = &v - return s -} - -// Describes a network interface for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesNetworkInterface -type ScheduledInstancesNetworkInterface struct { - _ struct{} `type:"structure"` - - // Indicates whether to assign a public IPv4 address to instances launched in - // a VPC. The public IPv4 address can only be assigned to a network interface - // for eth0, and can only be assigned to a new network interface, not an existing - // one. You cannot specify more than one network interface in the request. If - // launching into a default subnet, the default value is true. - AssociatePublicIpAddress *bool `type:"boolean"` - - // Indicates whether to delete the interface when the instance is terminated. - DeleteOnTermination *bool `type:"boolean"` - - // The description. - Description *string `type:"string"` - - // The index of the device for the network interface attachment. - DeviceIndex *int64 `type:"integer"` - - // The IDs of one or more security groups. - Groups []*string `locationName:"Group" locationNameList:"SecurityGroupId" type:"list"` - - // The number of IPv6 addresses to assign to the network interface. The IPv6 - // addresses are automatically selected from the subnet range. - Ipv6AddressCount *int64 `type:"integer"` - - // One or more specific IPv6 addresses from the subnet range. - Ipv6Addresses []*ScheduledInstancesIpv6Address `locationName:"Ipv6Address" locationNameList:"Ipv6Address" type:"list"` - - // The ID of the network interface. - NetworkInterfaceId *string `type:"string"` - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string `type:"string"` - - // The private IPv4 addresses. - PrivateIpAddressConfigs []*ScheduledInstancesPrivateIpAddressConfig `locationName:"PrivateIpAddressConfig" locationNameList:"PrivateIpAddressConfigSet" type:"list"` - - // The number of secondary private IPv4 addresses. - SecondaryPrivateIpAddressCount *int64 `type:"integer"` - - // The ID of the subnet. - SubnetId *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesNetworkInterface) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesNetworkInterface) GoString() string { - return s.String() -} - -// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value. -func (s *ScheduledInstancesNetworkInterface) SetAssociatePublicIpAddress(v bool) *ScheduledInstancesNetworkInterface { - s.AssociatePublicIpAddress = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *ScheduledInstancesNetworkInterface) SetDeleteOnTermination(v bool) *ScheduledInstancesNetworkInterface { - s.DeleteOnTermination = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ScheduledInstancesNetworkInterface) SetDescription(v string) *ScheduledInstancesNetworkInterface { - s.Description = &v - return s -} - -// SetDeviceIndex sets the DeviceIndex field's value. -func (s *ScheduledInstancesNetworkInterface) SetDeviceIndex(v int64) *ScheduledInstancesNetworkInterface { - s.DeviceIndex = &v - return s -} - -// SetGroups sets the Groups field's value. -func (s *ScheduledInstancesNetworkInterface) SetGroups(v []*string) *ScheduledInstancesNetworkInterface { - s.Groups = v - return s -} - -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *ScheduledInstancesNetworkInterface) SetIpv6AddressCount(v int64) *ScheduledInstancesNetworkInterface { - s.Ipv6AddressCount = &v - return s -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *ScheduledInstancesNetworkInterface) SetIpv6Addresses(v []*ScheduledInstancesIpv6Address) *ScheduledInstancesNetworkInterface { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *ScheduledInstancesNetworkInterface) SetNetworkInterfaceId(v string) *ScheduledInstancesNetworkInterface { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *ScheduledInstancesNetworkInterface) SetPrivateIpAddress(v string) *ScheduledInstancesNetworkInterface { - s.PrivateIpAddress = &v - return s -} - -// SetPrivateIpAddressConfigs sets the PrivateIpAddressConfigs field's value. -func (s *ScheduledInstancesNetworkInterface) SetPrivateIpAddressConfigs(v []*ScheduledInstancesPrivateIpAddressConfig) *ScheduledInstancesNetworkInterface { - s.PrivateIpAddressConfigs = v - return s -} - -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *ScheduledInstancesNetworkInterface) SetSecondaryPrivateIpAddressCount(v int64) *ScheduledInstancesNetworkInterface { - s.SecondaryPrivateIpAddressCount = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *ScheduledInstancesNetworkInterface) SetSubnetId(v string) *ScheduledInstancesNetworkInterface { - s.SubnetId = &v - return s -} - -// Describes the placement for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesPlacement -type ScheduledInstancesPlacement struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `type:"string"` - - // The name of the placement group. - GroupName *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesPlacement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesPlacement) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ScheduledInstancesPlacement) SetAvailabilityZone(v string) *ScheduledInstancesPlacement { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *ScheduledInstancesPlacement) SetGroupName(v string) *ScheduledInstancesPlacement { - s.GroupName = &v - return s -} - -// Describes a private IPv4 address for a Scheduled Instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstancesPrivateIpAddressConfig -type ScheduledInstancesPrivateIpAddressConfig struct { - _ struct{} `type:"structure"` - - // Indicates whether this is a primary IPv4 address. Otherwise, this is a secondary - // IPv4 address. - Primary *bool `type:"boolean"` - - // The IPv4 address. - PrivateIpAddress *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledInstancesPrivateIpAddressConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledInstancesPrivateIpAddressConfig) GoString() string { - return s.String() -} - -// SetPrimary sets the Primary field's value. -func (s *ScheduledInstancesPrivateIpAddressConfig) SetPrimary(v bool) *ScheduledInstancesPrivateIpAddressConfig { - s.Primary = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *ScheduledInstancesPrivateIpAddressConfig) SetPrivateIpAddress(v string) *ScheduledInstancesPrivateIpAddressConfig { - s.PrivateIpAddress = &v - return s -} - -// Describes a security group -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SecurityGroup -type SecurityGroup struct { - _ struct{} `type:"structure"` - - // A description of the security group. - Description *string `locationName:"groupDescription" type:"string"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` - - // The name of the security group. - GroupName *string `locationName:"groupName" type:"string"` - - // One or more inbound rules associated with the security group. - IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` - - // [EC2-VPC] One or more outbound rules associated with the security group. - IpPermissionsEgress []*IpPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"` - - // The AWS account ID of the owner of the security group. - OwnerId *string `locationName:"ownerId" type:"string"` - - // Any tags assigned to the security group. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // [EC2-VPC] The ID of the VPC for the security group. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s SecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecurityGroup) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SecurityGroup) SetDescription(v string) *SecurityGroup { - s.Description = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *SecurityGroup) SetGroupId(v string) *SecurityGroup { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *SecurityGroup) SetGroupName(v string) *SecurityGroup { - s.GroupName = &v - return s -} - -// SetIpPermissions sets the IpPermissions field's value. -func (s *SecurityGroup) SetIpPermissions(v []*IpPermission) *SecurityGroup { - s.IpPermissions = v - return s -} - -// SetIpPermissionsEgress sets the IpPermissionsEgress field's value. -func (s *SecurityGroup) SetIpPermissionsEgress(v []*IpPermission) *SecurityGroup { - s.IpPermissionsEgress = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *SecurityGroup) SetOwnerId(v string) *SecurityGroup { - s.OwnerId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SecurityGroup) SetTags(v []*Tag) *SecurityGroup { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *SecurityGroup) SetVpcId(v string) *SecurityGroup { - s.VpcId = &v - return s -} - -// Describes a VPC with a security group that references your security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SecurityGroupReference -type SecurityGroupReference struct { - _ struct{} `type:"structure"` - - // The ID of your security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // The ID of the VPC with the referencing security group. - // - // ReferencingVpcId is a required field - ReferencingVpcId *string `locationName:"referencingVpcId" type:"string" required:"true"` - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s SecurityGroupReference) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecurityGroupReference) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *SecurityGroupReference) SetGroupId(v string) *SecurityGroupReference { - s.GroupId = &v - return s -} - -// SetReferencingVpcId sets the ReferencingVpcId field's value. -func (s *SecurityGroupReference) SetReferencingVpcId(v string) *SecurityGroupReference { - s.ReferencingVpcId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *SecurityGroupReference) SetVpcPeeringConnectionId(v string) *SecurityGroupReference { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes the time period for a Scheduled Instance to start its first schedule. -// The time period must span less than one day. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SlotDateTimeRangeRequest -type SlotDateTimeRangeRequest struct { - _ struct{} `type:"structure"` - - // The earliest date and time, in UTC, for the Scheduled Instance to start. - // - // EarliestTime is a required field - EarliestTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The latest date and time, in UTC, for the Scheduled Instance to start. This - // value must be later than or equal to the earliest date and at most three - // months in the future. - // - // LatestTime is a required field - LatestTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s SlotDateTimeRangeRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SlotDateTimeRangeRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SlotDateTimeRangeRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SlotDateTimeRangeRequest"} - if s.EarliestTime == nil { - invalidParams.Add(request.NewErrParamRequired("EarliestTime")) - } - if s.LatestTime == nil { - invalidParams.Add(request.NewErrParamRequired("LatestTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEarliestTime sets the EarliestTime field's value. -func (s *SlotDateTimeRangeRequest) SetEarliestTime(v time.Time) *SlotDateTimeRangeRequest { - s.EarliestTime = &v - return s -} - -// SetLatestTime sets the LatestTime field's value. -func (s *SlotDateTimeRangeRequest) SetLatestTime(v time.Time) *SlotDateTimeRangeRequest { - s.LatestTime = &v - return s -} - -// Describes the time period for a Scheduled Instance to start its first schedule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SlotStartTimeRangeRequest -type SlotStartTimeRangeRequest struct { - _ struct{} `type:"structure"` - - // The earliest date and time, in UTC, for the Scheduled Instance to start. - EarliestTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The latest date and time, in UTC, for the Scheduled Instance to start. - LatestTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SlotStartTimeRangeRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SlotStartTimeRangeRequest) GoString() string { - return s.String() -} - -// SetEarliestTime sets the EarliestTime field's value. -func (s *SlotStartTimeRangeRequest) SetEarliestTime(v time.Time) *SlotStartTimeRangeRequest { - s.EarliestTime = &v - return s -} - -// SetLatestTime sets the LatestTime field's value. -func (s *SlotStartTimeRangeRequest) SetLatestTime(v time.Time) *SlotStartTimeRangeRequest { - s.LatestTime = &v - return s -} - -// Describes a snapshot. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Snapshot -type Snapshot struct { - _ struct{} `type:"structure"` - - // The data encryption key identifier for the snapshot. This value is a unique - // identifier that corresponds to the data encryption key that was used to encrypt - // the original volume or snapshot copy. Because data encryption keys are inherited - // by volumes created from snapshots, and vice versa, if snapshots share the - // same data encryption key identifier, then they belong to the same volume/snapshot - // lineage. This parameter is only returned by the DescribeSnapshots API operation. - DataEncryptionKeyId *string `locationName:"dataEncryptionKeyId" type:"string"` - - // The description for the snapshot. - Description *string `locationName:"description" type:"string"` - - // Indicates whether the snapshot is encrypted. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The full ARN of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) that was used to protect the volume encryption key for the parent - // volume. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // Value from an Amazon-maintained list (amazon | aws-marketplace | microsoft) - // of snapshot owners. Not to be confused with the user-configured AWS account - // alias, which is set from the IAM console. - OwnerAlias *string `locationName:"ownerAlias" type:"string"` - - // The AWS account ID of the EBS snapshot owner. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The progress of the snapshot, as a percentage. - Progress *string `locationName:"progress" type:"string"` - - // The ID of the snapshot. Each snapshot receives a unique identifier when it - // is created. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // The time stamp when the snapshot was initiated. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The snapshot state. - State *string `locationName:"status" type:"string" enum:"SnapshotState"` - - // Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy - // operation fails (for example, if the proper AWS Key Management Service (AWS - // KMS) permissions are not obtained) this field displays error state details - // to help you diagnose why the error occurred. This parameter is only returned - // by the DescribeSnapshots API operation. - StateMessage *string `locationName:"statusMessage" type:"string"` - - // Any tags assigned to the snapshot. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the volume that was used to create the snapshot. Snapshots created - // by the CopySnapshot action have an arbitrary volume ID that should not be - // used for any purpose. - VolumeId *string `locationName:"volumeId" type:"string"` - - // The size of the volume, in GiB. - VolumeSize *int64 `locationName:"volumeSize" type:"integer"` -} - -// String returns the string representation -func (s Snapshot) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Snapshot) GoString() string { - return s.String() -} - -// SetDataEncryptionKeyId sets the DataEncryptionKeyId field's value. -func (s *Snapshot) SetDataEncryptionKeyId(v string) *Snapshot { - s.DataEncryptionKeyId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Snapshot) SetDescription(v string) *Snapshot { - s.Description = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *Snapshot) SetEncrypted(v bool) *Snapshot { - s.Encrypted = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Snapshot) SetKmsKeyId(v string) *Snapshot { - s.KmsKeyId = &v - return s -} - -// SetOwnerAlias sets the OwnerAlias field's value. -func (s *Snapshot) SetOwnerAlias(v string) *Snapshot { - s.OwnerAlias = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *Snapshot) SetOwnerId(v string) *Snapshot { - s.OwnerId = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *Snapshot) SetProgress(v string) *Snapshot { - s.Progress = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *Snapshot) SetSnapshotId(v string) *Snapshot { - s.SnapshotId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Snapshot) SetStartTime(v time.Time) *Snapshot { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *Snapshot) SetState(v string) *Snapshot { - s.State = &v - return s -} - -// SetStateMessage sets the StateMessage field's value. -func (s *Snapshot) SetStateMessage(v string) *Snapshot { - s.StateMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Snapshot) SetTags(v []*Tag) *Snapshot { - s.Tags = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *Snapshot) SetVolumeId(v string) *Snapshot { - s.VolumeId = &v - return s -} - -// SetVolumeSize sets the VolumeSize field's value. -func (s *Snapshot) SetVolumeSize(v int64) *Snapshot { - s.VolumeSize = &v - return s -} - -// Describes the snapshot created from the imported disk. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SnapshotDetail -type SnapshotDetail struct { - _ struct{} `type:"structure"` - - // A description for the snapshot. - Description *string `locationName:"description" type:"string"` - - // The block device mapping for the snapshot. - DeviceName *string `locationName:"deviceName" type:"string"` - - // The size of the disk in the snapshot, in GiB. - DiskImageSize *float64 `locationName:"diskImageSize" type:"double"` - - // The format of the disk image from which the snapshot is created. - Format *string `locationName:"format" type:"string"` - - // The percentage of progress for the task. - Progress *string `locationName:"progress" type:"string"` - - // The snapshot ID of the disk being imported. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // A brief status of the snapshot creation. - Status *string `locationName:"status" type:"string"` - - // A detailed status message for the snapshot creation. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The URL used to access the disk image. - Url *string `locationName:"url" type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` -} - -// String returns the string representation -func (s SnapshotDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotDetail) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SnapshotDetail) SetDescription(v string) *SnapshotDetail { - s.Description = &v - return s -} - -// SetDeviceName sets the DeviceName field's value. -func (s *SnapshotDetail) SetDeviceName(v string) *SnapshotDetail { - s.DeviceName = &v - return s -} - -// SetDiskImageSize sets the DiskImageSize field's value. -func (s *SnapshotDetail) SetDiskImageSize(v float64) *SnapshotDetail { - s.DiskImageSize = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *SnapshotDetail) SetFormat(v string) *SnapshotDetail { - s.Format = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *SnapshotDetail) SetProgress(v string) *SnapshotDetail { - s.Progress = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *SnapshotDetail) SetSnapshotId(v string) *SnapshotDetail { - s.SnapshotId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SnapshotDetail) SetStatus(v string) *SnapshotDetail { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *SnapshotDetail) SetStatusMessage(v string) *SnapshotDetail { - s.StatusMessage = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SnapshotDetail) SetUrl(v string) *SnapshotDetail { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *SnapshotDetail) SetUserBucket(v *UserBucketDetails) *SnapshotDetail { - s.UserBucket = v - return s -} - -// The disk container object for the import snapshot request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SnapshotDiskContainer -type SnapshotDiskContainer struct { - _ struct{} `type:"structure"` - - // The description of the disk image being imported. - Description *string `type:"string"` - - // The format of the disk image being imported. - // - // Valid values: RAW | VHD | VMDK | OVA - Format *string `type:"string"` - - // The URL to the Amazon S3-based disk image being imported. It can either be - // a https URL (https://..) or an Amazon S3 URL (s3://..). - Url *string `type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucket `type:"structure"` -} - -// String returns the string representation -func (s SnapshotDiskContainer) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotDiskContainer) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SnapshotDiskContainer) SetDescription(v string) *SnapshotDiskContainer { - s.Description = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *SnapshotDiskContainer) SetFormat(v string) *SnapshotDiskContainer { - s.Format = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SnapshotDiskContainer) SetUrl(v string) *SnapshotDiskContainer { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *SnapshotDiskContainer) SetUserBucket(v *UserBucket) *SnapshotDiskContainer { - s.UserBucket = v - return s -} - -// Details about the import snapshot task. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SnapshotTaskDetail -type SnapshotTaskDetail struct { - _ struct{} `type:"structure"` - - // The description of the snapshot. - Description *string `locationName:"description" type:"string"` - - // The size of the disk in the snapshot, in GiB. - DiskImageSize *float64 `locationName:"diskImageSize" type:"double"` - - // The format of the disk image from which the snapshot is created. - Format *string `locationName:"format" type:"string"` - - // The percentage of completion for the import snapshot task. - Progress *string `locationName:"progress" type:"string"` - - // The snapshot ID of the disk being imported. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // A brief status for the import snapshot task. - Status *string `locationName:"status" type:"string"` - - // A detailed status message for the import snapshot task. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The URL of the disk image from which the snapshot is created. - Url *string `locationName:"url" type:"string"` - - // The S3 bucket for the disk image. - UserBucket *UserBucketDetails `locationName:"userBucket" type:"structure"` -} - -// String returns the string representation -func (s SnapshotTaskDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SnapshotTaskDetail) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SnapshotTaskDetail) SetDescription(v string) *SnapshotTaskDetail { - s.Description = &v - return s -} - -// SetDiskImageSize sets the DiskImageSize field's value. -func (s *SnapshotTaskDetail) SetDiskImageSize(v float64) *SnapshotTaskDetail { - s.DiskImageSize = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *SnapshotTaskDetail) SetFormat(v string) *SnapshotTaskDetail { - s.Format = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *SnapshotTaskDetail) SetProgress(v string) *SnapshotTaskDetail { - s.Progress = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *SnapshotTaskDetail) SetSnapshotId(v string) *SnapshotTaskDetail { - s.SnapshotId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SnapshotTaskDetail) SetStatus(v string) *SnapshotTaskDetail { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *SnapshotTaskDetail) SetStatusMessage(v string) *SnapshotTaskDetail { - s.StatusMessage = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SnapshotTaskDetail) SetUrl(v string) *SnapshotTaskDetail { - s.Url = &v - return s -} - -// SetUserBucket sets the UserBucket field's value. -func (s *SnapshotTaskDetail) SetUserBucket(v *UserBucketDetails) *SnapshotTaskDetail { - s.UserBucket = v - return s -} - -// Describes the data feed for a Spot instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotDatafeedSubscription -type SpotDatafeedSubscription struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket where the Spot instance data feed is located. - Bucket *string `locationName:"bucket" type:"string"` - - // The fault codes for the Spot instance request, if any. - Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` - - // The AWS account ID of the account. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The prefix that is prepended to data feed files. - Prefix *string `locationName:"prefix" type:"string"` - - // The state of the Spot instance data feed subscription. - State *string `locationName:"state" type:"string" enum:"DatafeedSubscriptionState"` -} - -// String returns the string representation -func (s SpotDatafeedSubscription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotDatafeedSubscription) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *SpotDatafeedSubscription) SetBucket(v string) *SpotDatafeedSubscription { - s.Bucket = &v - return s -} - -// SetFault sets the Fault field's value. -func (s *SpotDatafeedSubscription) SetFault(v *SpotInstanceStateFault) *SpotDatafeedSubscription { - s.Fault = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *SpotDatafeedSubscription) SetOwnerId(v string) *SpotDatafeedSubscription { - s.OwnerId = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *SpotDatafeedSubscription) SetPrefix(v string) *SpotDatafeedSubscription { - s.Prefix = &v - return s -} - -// SetState sets the State field's value. -func (s *SpotDatafeedSubscription) SetState(v string) *SpotDatafeedSubscription { - s.State = &v - return s -} - -// Describes the launch specification for one or more Spot instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotFleetLaunchSpecification -type SpotFleetLaunchSpecification struct { - _ struct{} `type:"structure"` - - // Deprecated. - AddressingType *string `locationName:"addressingType" type:"string"` - - // One or more block device mapping entries. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - - // Indicates whether the instances are optimized for EBS I/O. This optimization - // provides dedicated throughput to Amazon EBS and an optimized configuration - // stack to provide optimal EBS I/O performance. This optimization isn't available - // with all instance types. Additional usage charges apply when using an EBS - // Optimized instance. - // - // Default: false - EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"` - - // The IAM instance profile. - IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"` - - // The ID of the AMI. - ImageId *string `locationName:"imageId" type:"string"` - - // The instance type. Note that T2 and HS1 instance types are not supported. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // The ID of the kernel. - KernelId *string `locationName:"kernelId" type:"string"` - - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` - - // Enable or disable monitoring for the instances. - Monitoring *SpotFleetMonitoring `locationName:"monitoring" type:"structure"` - - // One or more network interfaces. If you specify a network interface, you must - // specify subnet IDs and security group IDs using the network interface. - NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` - - // The placement information. - Placement *SpotPlacement `locationName:"placement" type:"structure"` - - // The ID of the RAM disk. - RamdiskId *string `locationName:"ramdiskId" type:"string"` - - // One or more security groups. When requesting instances in a VPC, you must - // specify the IDs of the security groups. When requesting instances in EC2-Classic, - // you can specify the names or the IDs of the security groups. - SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` - - // The bid price per unit hour for the specified instance type. If this value - // is not specified, the default is the Spot bid price specified for the fleet. - // To determine the bid price per unit hour, divide the Spot bid price by the - // value of WeightedCapacity. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The ID of the subnet in which to launch the instances. To specify multiple - // subnets, separate them using commas; for example, "subnet-a61dafcf, subnet-65ea5f08". - SubnetId *string `locationName:"subnetId" type:"string"` - - // The user data to make available to the instances. If you are using an AWS - // SDK or command line tool, Base64-encoding is performed for you, and you can - // load the text from a file. Otherwise, you must provide Base64-encoded text. - UserData *string `locationName:"userData" type:"string"` - - // The number of units provided by the specified instance type. These are the - // same units that you chose to set the target capacity in terms (instances - // or a performance characteristic such as vCPUs, memory, or I/O). - // - // If the target capacity divided by this value is not a whole number, we round - // the number of instances to the next whole number. If this value is not specified, - // the default is 1. - WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"` -} - -// String returns the string representation -func (s SpotFleetLaunchSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetLaunchSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SpotFleetLaunchSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SpotFleetLaunchSpecification"} - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddressingType sets the AddressingType field's value. -func (s *SpotFleetLaunchSpecification) SetAddressingType(v string) *SpotFleetLaunchSpecification { - s.AddressingType = &v - return s -} - -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *SpotFleetLaunchSpecification) SetBlockDeviceMappings(v []*BlockDeviceMapping) *SpotFleetLaunchSpecification { - s.BlockDeviceMappings = v - return s -} - -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *SpotFleetLaunchSpecification) SetEbsOptimized(v bool) *SpotFleetLaunchSpecification { - s.EbsOptimized = &v - return s -} - -// SetIamInstanceProfile sets the IamInstanceProfile field's value. -func (s *SpotFleetLaunchSpecification) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *SpotFleetLaunchSpecification { - s.IamInstanceProfile = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *SpotFleetLaunchSpecification) SetImageId(v string) *SpotFleetLaunchSpecification { - s.ImageId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *SpotFleetLaunchSpecification) SetInstanceType(v string) *SpotFleetLaunchSpecification { - s.InstanceType = &v - return s -} - -// SetKernelId sets the KernelId field's value. -func (s *SpotFleetLaunchSpecification) SetKernelId(v string) *SpotFleetLaunchSpecification { - s.KernelId = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *SpotFleetLaunchSpecification) SetKeyName(v string) *SpotFleetLaunchSpecification { - s.KeyName = &v - return s -} - -// SetMonitoring sets the Monitoring field's value. -func (s *SpotFleetLaunchSpecification) SetMonitoring(v *SpotFleetMonitoring) *SpotFleetLaunchSpecification { - s.Monitoring = v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *SpotFleetLaunchSpecification) SetNetworkInterfaces(v []*InstanceNetworkInterfaceSpecification) *SpotFleetLaunchSpecification { - s.NetworkInterfaces = v - return s -} - -// SetPlacement sets the Placement field's value. -func (s *SpotFleetLaunchSpecification) SetPlacement(v *SpotPlacement) *SpotFleetLaunchSpecification { - s.Placement = v - return s -} - -// SetRamdiskId sets the RamdiskId field's value. -func (s *SpotFleetLaunchSpecification) SetRamdiskId(v string) *SpotFleetLaunchSpecification { - s.RamdiskId = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *SpotFleetLaunchSpecification) SetSecurityGroups(v []*GroupIdentifier) *SpotFleetLaunchSpecification { - s.SecurityGroups = v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotFleetLaunchSpecification) SetSpotPrice(v string) *SpotFleetLaunchSpecification { - s.SpotPrice = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *SpotFleetLaunchSpecification) SetSubnetId(v string) *SpotFleetLaunchSpecification { - s.SubnetId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *SpotFleetLaunchSpecification) SetUserData(v string) *SpotFleetLaunchSpecification { - s.UserData = &v - return s -} - -// SetWeightedCapacity sets the WeightedCapacity field's value. -func (s *SpotFleetLaunchSpecification) SetWeightedCapacity(v float64) *SpotFleetLaunchSpecification { - s.WeightedCapacity = &v - return s -} - -// Describes whether monitoring is enabled. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotFleetMonitoring -type SpotFleetMonitoring struct { - _ struct{} `type:"structure"` - - // Enables monitoring for the instance. - // - // Default: false - Enabled *bool `locationName:"enabled" type:"boolean"` -} - -// String returns the string representation -func (s SpotFleetMonitoring) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetMonitoring) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *SpotFleetMonitoring) SetEnabled(v bool) *SpotFleetMonitoring { - s.Enabled = &v - return s -} - -// Describes a Spot fleet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotFleetRequestConfig -type SpotFleetRequestConfig struct { - _ struct{} `type:"structure"` - - // The progress of the Spot fleet request. If there is an error, the status - // is error. After all bids are placed, the status is pending_fulfillment. If - // the size of the fleet is equal to or greater than its target capacity, the - // status is fulfilled. If the size of the fleet is decreased, the status is - // pending_termination while Spot instances are terminating. - ActivityStatus *string `locationName:"activityStatus" type:"string" enum:"ActivityStatus"` - - // The creation date and time of the request. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Information about the configuration of the Spot fleet request. - // - // SpotFleetRequestConfig is a required field - SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"` - - // The ID of the Spot fleet request. - // - // SpotFleetRequestId is a required field - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"` - - // The state of the Spot fleet request. - // - // SpotFleetRequestState is a required field - SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" required:"true" enum:"BatchState"` -} - -// String returns the string representation -func (s SpotFleetRequestConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetRequestConfig) GoString() string { - return s.String() -} - -// SetActivityStatus sets the ActivityStatus field's value. -func (s *SpotFleetRequestConfig) SetActivityStatus(v string) *SpotFleetRequestConfig { - s.ActivityStatus = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *SpotFleetRequestConfig) SetCreateTime(v time.Time) *SpotFleetRequestConfig { - s.CreateTime = &v - return s -} - -// SetSpotFleetRequestConfig sets the SpotFleetRequestConfig field's value. -func (s *SpotFleetRequestConfig) SetSpotFleetRequestConfig(v *SpotFleetRequestConfigData) *SpotFleetRequestConfig { - s.SpotFleetRequestConfig = v - return s -} - -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *SpotFleetRequestConfig) SetSpotFleetRequestId(v string) *SpotFleetRequestConfig { - s.SpotFleetRequestId = &v - return s -} - -// SetSpotFleetRequestState sets the SpotFleetRequestState field's value. -func (s *SpotFleetRequestConfig) SetSpotFleetRequestState(v string) *SpotFleetRequestConfig { - s.SpotFleetRequestState = &v - return s -} - -// Describes the configuration of a Spot fleet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotFleetRequestConfigData -type SpotFleetRequestConfigData struct { - _ struct{} `type:"structure"` - - // Indicates how to allocate the target capacity across the Spot pools specified - // by the Spot fleet request. The default is lowestPrice. - AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"AllocationStrategy"` - - // A unique, case-sensitive identifier you provide to ensure idempotency of - // your listings. This helps avoid duplicate listings. For more information, - // see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // Indicates whether running Spot instances should be terminated if the target - // capacity of the Spot fleet request is decreased below the current size of - // the Spot fleet. - ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"` - - // The number of units fulfilled by this request compared to the set target - // capacity. - FulfilledCapacity *float64 `locationName:"fulfilledCapacity" type:"double"` - - // Grants the Spot fleet permission to terminate Spot instances on your behalf - // when you cancel its Spot fleet request using CancelSpotFleetRequests or when - // the Spot fleet request expires, if you set terminateInstancesWithExpiration. - // - // IamFleetRole is a required field - IamFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"` - - // Information about the launch specifications for the Spot fleet request. - // - // LaunchSpecifications is a required field - LaunchSpecifications []*SpotFleetLaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" min:"1" type:"list" required:"true"` - - // Indicates whether Spot fleet should replace unhealthy instances. - ReplaceUnhealthyInstances *bool `locationName:"replaceUnhealthyInstances" type:"boolean"` - - // The bid price per unit hour. - // - // SpotPrice is a required field - SpotPrice *string `locationName:"spotPrice" type:"string" required:"true"` - - // The number of units to request. You can choose to set the target capacity - // in terms of instances or a performance characteristic that is important to - // your application workload, such as vCPUs, memory, or I/O. - // - // TargetCapacity is a required field - TargetCapacity *int64 `locationName:"targetCapacity" type:"integer" required:"true"` - - // Indicates whether running Spot instances should be terminated when the Spot - // fleet request expires. - TerminateInstancesWithExpiration *bool `locationName:"terminateInstancesWithExpiration" type:"boolean"` - - // The type of request. Indicates whether the fleet will only request the target - // capacity or also attempt to maintain it. When you request a certain target - // capacity, the fleet will only place the required bids. It will not attempt - // to replenish Spot instances if capacity is diminished, nor will it submit - // bids in alternative Spot pools if capacity is not available. When you want - // to maintain a certain target capacity, fleet will place the required bids - // to meet this target capacity. It will also automatically replenish any interrupted - // instances. Default: maintain. - Type *string `locationName:"type" type:"string" enum:"FleetType"` - - // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // The default is to start fulfilling the request immediately. - ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - - // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // At this point, no new Spot instance requests are placed or enabled to fulfill - // the request. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotFleetRequestConfigData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotFleetRequestConfigData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SpotFleetRequestConfigData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SpotFleetRequestConfigData"} - if s.IamFleetRole == nil { - invalidParams.Add(request.NewErrParamRequired("IamFleetRole")) - } - if s.LaunchSpecifications == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchSpecifications")) - } - if s.LaunchSpecifications != nil && len(s.LaunchSpecifications) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LaunchSpecifications", 1)) - } - if s.SpotPrice == nil { - invalidParams.Add(request.NewErrParamRequired("SpotPrice")) - } - if s.TargetCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("TargetCapacity")) - } - if s.LaunchSpecifications != nil { - for i, v := range s.LaunchSpecifications { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchSpecifications", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllocationStrategy sets the AllocationStrategy field's value. -func (s *SpotFleetRequestConfigData) SetAllocationStrategy(v string) *SpotFleetRequestConfigData { - s.AllocationStrategy = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *SpotFleetRequestConfigData) SetClientToken(v string) *SpotFleetRequestConfigData { - s.ClientToken = &v - return s -} - -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *SpotFleetRequestConfigData) SetExcessCapacityTerminationPolicy(v string) *SpotFleetRequestConfigData { - s.ExcessCapacityTerminationPolicy = &v - return s -} - -// SetFulfilledCapacity sets the FulfilledCapacity field's value. -func (s *SpotFleetRequestConfigData) SetFulfilledCapacity(v float64) *SpotFleetRequestConfigData { - s.FulfilledCapacity = &v - return s -} - -// SetIamFleetRole sets the IamFleetRole field's value. -func (s *SpotFleetRequestConfigData) SetIamFleetRole(v string) *SpotFleetRequestConfigData { - s.IamFleetRole = &v - return s -} - -// SetLaunchSpecifications sets the LaunchSpecifications field's value. -func (s *SpotFleetRequestConfigData) SetLaunchSpecifications(v []*SpotFleetLaunchSpecification) *SpotFleetRequestConfigData { - s.LaunchSpecifications = v - return s -} - -// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value. -func (s *SpotFleetRequestConfigData) SetReplaceUnhealthyInstances(v bool) *SpotFleetRequestConfigData { - s.ReplaceUnhealthyInstances = &v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotFleetRequestConfigData) SetSpotPrice(v string) *SpotFleetRequestConfigData { - s.SpotPrice = &v - return s -} - -// SetTargetCapacity sets the TargetCapacity field's value. -func (s *SpotFleetRequestConfigData) SetTargetCapacity(v int64) *SpotFleetRequestConfigData { - s.TargetCapacity = &v - return s -} - -// SetTerminateInstancesWithExpiration sets the TerminateInstancesWithExpiration field's value. -func (s *SpotFleetRequestConfigData) SetTerminateInstancesWithExpiration(v bool) *SpotFleetRequestConfigData { - s.TerminateInstancesWithExpiration = &v - return s -} - -// SetType sets the Type field's value. -func (s *SpotFleetRequestConfigData) SetType(v string) *SpotFleetRequestConfigData { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *SpotFleetRequestConfigData) SetValidFrom(v time.Time) *SpotFleetRequestConfigData { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *SpotFleetRequestConfigData) SetValidUntil(v time.Time) *SpotFleetRequestConfigData { - s.ValidUntil = &v - return s -} - -// Describes a Spot instance request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotInstanceRequest -type SpotInstanceRequest struct { - _ struct{} `type:"structure"` - - // If you specified a duration and your Spot instance request was fulfilled, - // this is the fixed hourly price in effect for the Spot instance while it runs. - ActualBlockHourlyPrice *string `locationName:"actualBlockHourlyPrice" type:"string"` - - // The Availability Zone group. If you specify the same Availability Zone group - // for all Spot instance requests, all Spot instances are launched in the same - // Availability Zone. - AvailabilityZoneGroup *string `locationName:"availabilityZoneGroup" type:"string"` - - // The duration for the Spot instance, in minutes. - BlockDurationMinutes *int64 `locationName:"blockDurationMinutes" type:"integer"` - - // The date and time when the Spot instance request was created, in UTC format - // (for example, YYYY-MM-DDTHH:MM:SSZ). - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // The fault codes for the Spot instance request, if any. - Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"` - - // The instance ID, if an instance has been launched to fulfill the Spot instance - // request. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance launch group. Launch groups are Spot instances that launch together - // and terminate together. - LaunchGroup *string `locationName:"launchGroup" type:"string"` - - // Additional information for launching instances. - LaunchSpecification *LaunchSpecification `locationName:"launchSpecification" type:"structure"` - - // The Availability Zone in which the bid is launched. - LaunchedAvailabilityZone *string `locationName:"launchedAvailabilityZone" type:"string"` - - // The product description associated with the Spot instance. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The ID of the Spot instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - - // The maximum hourly price (bid) for the Spot instance launched to fulfill - // the request. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The state of the Spot instance request. Spot bid status information can help - // you track your Spot instance requests. For more information, see Spot Bid - // Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html) - // in the Amazon Elastic Compute Cloud User Guide. - State *string `locationName:"state" type:"string" enum:"SpotInstanceState"` - - // The status code and status message describing the Spot instance request. - Status *SpotInstanceStatus `locationName:"status" type:"structure"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The Spot instance request type. - Type *string `locationName:"type" type:"string" enum:"SpotInstanceType"` - - // The start date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // The request becomes active at this date and time. - ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"` - - // The end date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // If this is a one-time request, it remains active until all instances launch, - // the request is canceled, or this date is reached. If the request is persistent, - // it remains active until it is canceled or this date is reached. - ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotInstanceRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotInstanceRequest) GoString() string { - return s.String() -} - -// SetActualBlockHourlyPrice sets the ActualBlockHourlyPrice field's value. -func (s *SpotInstanceRequest) SetActualBlockHourlyPrice(v string) *SpotInstanceRequest { - s.ActualBlockHourlyPrice = &v - return s -} - -// SetAvailabilityZoneGroup sets the AvailabilityZoneGroup field's value. -func (s *SpotInstanceRequest) SetAvailabilityZoneGroup(v string) *SpotInstanceRequest { - s.AvailabilityZoneGroup = &v - return s -} - -// SetBlockDurationMinutes sets the BlockDurationMinutes field's value. -func (s *SpotInstanceRequest) SetBlockDurationMinutes(v int64) *SpotInstanceRequest { - s.BlockDurationMinutes = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *SpotInstanceRequest) SetCreateTime(v time.Time) *SpotInstanceRequest { - s.CreateTime = &v - return s -} - -// SetFault sets the Fault field's value. -func (s *SpotInstanceRequest) SetFault(v *SpotInstanceStateFault) *SpotInstanceRequest { - s.Fault = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *SpotInstanceRequest) SetInstanceId(v string) *SpotInstanceRequest { - s.InstanceId = &v - return s -} - -// SetLaunchGroup sets the LaunchGroup field's value. -func (s *SpotInstanceRequest) SetLaunchGroup(v string) *SpotInstanceRequest { - s.LaunchGroup = &v - return s -} - -// SetLaunchSpecification sets the LaunchSpecification field's value. -func (s *SpotInstanceRequest) SetLaunchSpecification(v *LaunchSpecification) *SpotInstanceRequest { - s.LaunchSpecification = v - return s -} - -// SetLaunchedAvailabilityZone sets the LaunchedAvailabilityZone field's value. -func (s *SpotInstanceRequest) SetLaunchedAvailabilityZone(v string) *SpotInstanceRequest { - s.LaunchedAvailabilityZone = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *SpotInstanceRequest) SetProductDescription(v string) *SpotInstanceRequest { - s.ProductDescription = &v - return s -} - -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *SpotInstanceRequest) SetSpotInstanceRequestId(v string) *SpotInstanceRequest { - s.SpotInstanceRequestId = &v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotInstanceRequest) SetSpotPrice(v string) *SpotInstanceRequest { - s.SpotPrice = &v - return s -} - -// SetState sets the State field's value. -func (s *SpotInstanceRequest) SetState(v string) *SpotInstanceRequest { - s.State = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SpotInstanceRequest) SetStatus(v *SpotInstanceStatus) *SpotInstanceRequest { - s.Status = v - return s -} - -// SetTags sets the Tags field's value. -func (s *SpotInstanceRequest) SetTags(v []*Tag) *SpotInstanceRequest { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *SpotInstanceRequest) SetType(v string) *SpotInstanceRequest { - s.Type = &v - return s -} - -// SetValidFrom sets the ValidFrom field's value. -func (s *SpotInstanceRequest) SetValidFrom(v time.Time) *SpotInstanceRequest { - s.ValidFrom = &v - return s -} - -// SetValidUntil sets the ValidUntil field's value. -func (s *SpotInstanceRequest) SetValidUntil(v time.Time) *SpotInstanceRequest { - s.ValidUntil = &v - return s -} - -// Describes a Spot instance state change. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotInstanceStateFault -type SpotInstanceStateFault struct { - _ struct{} `type:"structure"` - - // The reason code for the Spot instance state change. - Code *string `locationName:"code" type:"string"` - - // The message for the Spot instance state change. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s SpotInstanceStateFault) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotInstanceStateFault) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *SpotInstanceStateFault) SetCode(v string) *SpotInstanceStateFault { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *SpotInstanceStateFault) SetMessage(v string) *SpotInstanceStateFault { - s.Message = &v - return s -} - -// Describes the status of a Spot instance request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotInstanceStatus -type SpotInstanceStatus struct { - _ struct{} `type:"structure"` - - // The status code. For a list of status codes, see Spot Bid Status Codes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand) - // in the Amazon Elastic Compute Cloud User Guide. - Code *string `locationName:"code" type:"string"` - - // The description for the status code. - Message *string `locationName:"message" type:"string"` - - // The date and time of the most recent status update, in UTC format (for example, - // YYYY-MM-DDTHH:MM:SSZ). - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotInstanceStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotInstanceStatus) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *SpotInstanceStatus) SetCode(v string) *SpotInstanceStatus { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *SpotInstanceStatus) SetMessage(v string) *SpotInstanceStatus { - s.Message = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *SpotInstanceStatus) SetUpdateTime(v time.Time) *SpotInstanceStatus { - s.UpdateTime = &v - return s -} - -// Describes Spot instance placement. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotPlacement -type SpotPlacement struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - // - // [Spot fleet only] To specify multiple Availability Zones, separate them using - // commas; for example, "us-west-2a, us-west-2b". - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The name of the placement group (for cluster instances). - GroupName *string `locationName:"groupName" type:"string"` - - // The tenancy of the instance (if the instance is running in a VPC). An instance - // with a tenancy of dedicated runs on single-tenant hardware. The host tenancy - // is not supported for Spot instances. - Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` -} - -// String returns the string representation -func (s SpotPlacement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotPlacement) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *SpotPlacement) SetAvailabilityZone(v string) *SpotPlacement { - s.AvailabilityZone = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *SpotPlacement) SetGroupName(v string) *SpotPlacement { - s.GroupName = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *SpotPlacement) SetTenancy(v string) *SpotPlacement { - s.Tenancy = &v - return s -} - -// Describes the maximum hourly price (bid) for any Spot instance launched to -// fulfill the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotPrice -type SpotPrice struct { - _ struct{} `type:"structure"` - - // The Availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The instance type. Note that T2 and HS1 instance types are not supported. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - - // A general description of the AMI. - ProductDescription *string `locationName:"productDescription" type:"string" enum:"RIProductDescription"` - - // The maximum price (bid) that you are willing to pay for a Spot instance. - SpotPrice *string `locationName:"spotPrice" type:"string"` - - // The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s SpotPrice) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SpotPrice) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *SpotPrice) SetAvailabilityZone(v string) *SpotPrice { - s.AvailabilityZone = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *SpotPrice) SetInstanceType(v string) *SpotPrice { - s.InstanceType = &v - return s -} - -// SetProductDescription sets the ProductDescription field's value. -func (s *SpotPrice) SetProductDescription(v string) *SpotPrice { - s.ProductDescription = &v - return s -} - -// SetSpotPrice sets the SpotPrice field's value. -func (s *SpotPrice) SetSpotPrice(v string) *SpotPrice { - s.SpotPrice = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *SpotPrice) SetTimestamp(v time.Time) *SpotPrice { - s.Timestamp = &v - return s -} - -// Describes a stale rule in a security group. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StaleIpPermission -type StaleIpPermission struct { - _ struct{} `type:"structure"` - - // The start of the port range for the TCP and UDP protocols, or an ICMP type - // number. A value of -1 indicates all ICMP types. - FromPort *int64 `locationName:"fromPort" type:"integer"` - - // The IP protocol name (for tcp, udp, and icmp) or number (see Protocol Numbers) - // (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). - IpProtocol *string `locationName:"ipProtocol" type:"string"` - - // One or more IP ranges. Not applicable for stale security group rules. - IpRanges []*string `locationName:"ipRanges" locationNameList:"item" type:"list"` - - // One or more prefix list IDs for an AWS service. Not applicable for stale - // security group rules. - PrefixListIds []*string `locationName:"prefixListIds" locationNameList:"item" type:"list"` - - // The end of the port range for the TCP and UDP protocols, or an ICMP type - // number. A value of -1 indicates all ICMP types. - ToPort *int64 `locationName:"toPort" type:"integer"` - - // One or more security group pairs. Returns the ID of the referenced security - // group and VPC, and the ID and status of the VPC peering connection. - UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s StaleIpPermission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StaleIpPermission) GoString() string { - return s.String() -} - -// SetFromPort sets the FromPort field's value. -func (s *StaleIpPermission) SetFromPort(v int64) *StaleIpPermission { - s.FromPort = &v - return s -} - -// SetIpProtocol sets the IpProtocol field's value. -func (s *StaleIpPermission) SetIpProtocol(v string) *StaleIpPermission { - s.IpProtocol = &v - return s -} - -// SetIpRanges sets the IpRanges field's value. -func (s *StaleIpPermission) SetIpRanges(v []*string) *StaleIpPermission { - s.IpRanges = v - return s -} - -// SetPrefixListIds sets the PrefixListIds field's value. -func (s *StaleIpPermission) SetPrefixListIds(v []*string) *StaleIpPermission { - s.PrefixListIds = v - return s -} - -// SetToPort sets the ToPort field's value. -func (s *StaleIpPermission) SetToPort(v int64) *StaleIpPermission { - s.ToPort = &v - return s -} - -// SetUserIdGroupPairs sets the UserIdGroupPairs field's value. -func (s *StaleIpPermission) SetUserIdGroupPairs(v []*UserIdGroupPair) *StaleIpPermission { - s.UserIdGroupPairs = v - return s -} - -// Describes a stale security group (a security group that contains stale rules). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StaleSecurityGroup -type StaleSecurityGroup struct { - _ struct{} `type:"structure"` - - // The description of the security group. - Description *string `locationName:"description" type:"string"` - - // The ID of the security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` - - // The name of the security group. - GroupName *string `locationName:"groupName" type:"string"` - - // Information about the stale inbound rules in the security group. - StaleIpPermissions []*StaleIpPermission `locationName:"staleIpPermissions" locationNameList:"item" type:"list"` - - // Information about the stale outbound rules in the security group. - StaleIpPermissionsEgress []*StaleIpPermission `locationName:"staleIpPermissionsEgress" locationNameList:"item" type:"list"` - - // The ID of the VPC for the security group. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s StaleSecurityGroup) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StaleSecurityGroup) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *StaleSecurityGroup) SetDescription(v string) *StaleSecurityGroup { - s.Description = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *StaleSecurityGroup) SetGroupId(v string) *StaleSecurityGroup { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *StaleSecurityGroup) SetGroupName(v string) *StaleSecurityGroup { - s.GroupName = &v - return s -} - -// SetStaleIpPermissions sets the StaleIpPermissions field's value. -func (s *StaleSecurityGroup) SetStaleIpPermissions(v []*StaleIpPermission) *StaleSecurityGroup { - s.StaleIpPermissions = v - return s -} - -// SetStaleIpPermissionsEgress sets the StaleIpPermissionsEgress field's value. -func (s *StaleSecurityGroup) SetStaleIpPermissionsEgress(v []*StaleIpPermission) *StaleSecurityGroup { - s.StaleIpPermissionsEgress = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *StaleSecurityGroup) SetVpcId(v string) *StaleSecurityGroup { - s.VpcId = &v - return s -} - -// Contains the parameters for StartInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstancesRequest -type StartInstancesInput struct { - _ struct{} `type:"structure"` - - // Reserved. - AdditionalInfo *string `locationName:"additionalInfo" type:"string"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s StartInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalInfo sets the AdditionalInfo field's value. -func (s *StartInstancesInput) SetAdditionalInfo(v string) *StartInstancesInput { - s.AdditionalInfo = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *StartInstancesInput) SetDryRun(v bool) *StartInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *StartInstancesInput) SetInstanceIds(v []*string) *StartInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of StartInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstancesResult -type StartInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more started instances. - StartingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s StartInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstancesOutput) GoString() string { - return s.String() -} - -// SetStartingInstances sets the StartingInstances field's value. -func (s *StartInstancesOutput) SetStartingInstances(v []*InstanceStateChange) *StartInstancesOutput { - s.StartingInstances = v - return s -} - -// Describes a state change. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StateReason -type StateReason struct { - _ struct{} `type:"structure"` - - // The reason code for the state change. - Code *string `locationName:"code" type:"string"` - - // The message for the state change. - // - // * Server.InsufficientInstanceCapacity: There was insufficient instance - // capacity to satisfy the launch request. - // - // * Server.InternalError: An internal error occurred during instance launch, - // resulting in termination. - // - // * Server.ScheduledStop: The instance was stopped due to a scheduled retirement. - // - // * Server.SpotInstanceTermination: A Spot instance was terminated due to - // an increase in the market price. - // - // * Client.InternalError: A client error caused the instance to terminate - // on launch. - // - // * Client.InstanceInitiatedShutdown: The instance was shut down using the - // shutdown -h command from the instance. - // - // * Client.UserInitiatedShutdown: The instance was shut down using the Amazon - // EC2 API. - // - // * Client.VolumeLimitExceeded: The limit on the number of EBS volumes or - // total storage was exceeded. Decrease usage or request an increase in your - // limits. - // - // * Client.InvalidSnapshot.NotFound: The specified snapshot was not found. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s StateReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StateReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *StateReason) SetCode(v string) *StateReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *StateReason) SetMessage(v string) *StateReason { - s.Message = &v - return s -} - -// Contains the parameters for StopInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstancesRequest -type StopInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // Forces the instances to stop. The instances do not have an opportunity to - // flush file system caches or file system metadata. If you use this option, - // you must perform file system check and repair procedures. This option is - // not recommended for Windows instances. - // - // Default: false - Force *bool `locationName:"force" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s StopInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *StopInstancesInput) SetDryRun(v bool) *StopInstancesInput { - s.DryRun = &v - return s -} - -// SetForce sets the Force field's value. -func (s *StopInstancesInput) SetForce(v bool) *StopInstancesInput { - s.Force = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *StopInstancesInput) SetInstanceIds(v []*string) *StopInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of StopInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstancesResult -type StopInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more stopped instances. - StoppingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s StopInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstancesOutput) GoString() string { - return s.String() -} - -// SetStoppingInstances sets the StoppingInstances field's value. -func (s *StopInstancesOutput) SetStoppingInstances(v []*InstanceStateChange) *StopInstancesOutput { - s.StoppingInstances = v - return s -} - -// Describes the storage location for an instance store-backed AMI. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Storage -type Storage struct { - _ struct{} `type:"structure"` - - // An Amazon S3 storage location. - S3 *S3Storage `type:"structure"` -} - -// String returns the string representation -func (s Storage) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Storage) GoString() string { - return s.String() -} - -// SetS3 sets the S3 field's value. -func (s *Storage) SetS3(v *S3Storage) *Storage { - s.S3 = v - return s -} - -// Describes a subnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Subnet -type Subnet struct { - _ struct{} `type:"structure"` - - // Indicates whether a network interface created in this subnet (including a - // network interface created by RunInstances) receives an IPv6 address. - AssignIpv6AddressOnCreation *bool `locationName:"assignIpv6AddressOnCreation" type:"boolean"` - - // The Availability Zone of the subnet. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The number of unused private IPv4 addresses in the subnet. Note that the - // IPv4 addresses for any stopped instances are considered unavailable. - AvailableIpAddressCount *int64 `locationName:"availableIpAddressCount" type:"integer"` - - // The IPv4 CIDR block assigned to the subnet. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // Indicates whether this is the default subnet for the Availability Zone. - DefaultForAz *bool `locationName:"defaultForAz" type:"boolean"` - - // Information about the IPv6 CIDR blocks associated with the subnet. - Ipv6CidrBlockAssociationSet []*SubnetIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociationSet" locationNameList:"item" type:"list"` - - // Indicates whether instances launched in this subnet receive a public IPv4 - // address. - MapPublicIpOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"` - - // The current state of the subnet. - State *string `locationName:"state" type:"string" enum:"SubnetState"` - - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` - - // Any tags assigned to the subnet. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC the subnet is in. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s Subnet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Subnet) GoString() string { - return s.String() -} - -// SetAssignIpv6AddressOnCreation sets the AssignIpv6AddressOnCreation field's value. -func (s *Subnet) SetAssignIpv6AddressOnCreation(v bool) *Subnet { - s.AssignIpv6AddressOnCreation = &v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Subnet) SetAvailabilityZone(v string) *Subnet { - s.AvailabilityZone = &v - return s -} - -// SetAvailableIpAddressCount sets the AvailableIpAddressCount field's value. -func (s *Subnet) SetAvailableIpAddressCount(v int64) *Subnet { - s.AvailableIpAddressCount = &v - return s -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *Subnet) SetCidrBlock(v string) *Subnet { - s.CidrBlock = &v - return s -} - -// SetDefaultForAz sets the DefaultForAz field's value. -func (s *Subnet) SetDefaultForAz(v bool) *Subnet { - s.DefaultForAz = &v - return s -} - -// SetIpv6CidrBlockAssociationSet sets the Ipv6CidrBlockAssociationSet field's value. -func (s *Subnet) SetIpv6CidrBlockAssociationSet(v []*SubnetIpv6CidrBlockAssociation) *Subnet { - s.Ipv6CidrBlockAssociationSet = v - return s -} - -// SetMapPublicIpOnLaunch sets the MapPublicIpOnLaunch field's value. -func (s *Subnet) SetMapPublicIpOnLaunch(v bool) *Subnet { - s.MapPublicIpOnLaunch = &v - return s -} - -// SetState sets the State field's value. -func (s *Subnet) SetState(v string) *Subnet { - s.State = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *Subnet) SetSubnetId(v string) *Subnet { - s.SubnetId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Subnet) SetTags(v []*Tag) *Subnet { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Subnet) SetVpcId(v string) *Subnet { - s.VpcId = &v - return s -} - -// Describes the state of a CIDR block. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SubnetCidrBlockState -type SubnetCidrBlockState struct { - _ struct{} `type:"structure"` - - // The state of a CIDR block. - State *string `locationName:"state" type:"string" enum:"SubnetCidrBlockStateCode"` - - // A message about the status of the CIDR block, if applicable. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s SubnetCidrBlockState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubnetCidrBlockState) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *SubnetCidrBlockState) SetState(v string) *SubnetCidrBlockState { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *SubnetCidrBlockState) SetStatusMessage(v string) *SubnetCidrBlockState { - s.StatusMessage = &v - return s -} - -// Describes an IPv6 CIDR block associated with a subnet. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SubnetIpv6CidrBlockAssociation -type SubnetIpv6CidrBlockAssociation struct { - _ struct{} `type:"structure"` - - // The association ID for the CIDR block. - AssociationId *string `locationName:"associationId" type:"string"` - - // The IPv6 CIDR block. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // Information about the state of the CIDR block. - Ipv6CidrBlockState *SubnetCidrBlockState `locationName:"ipv6CidrBlockState" type:"structure"` -} - -// String returns the string representation -func (s SubnetIpv6CidrBlockAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubnetIpv6CidrBlockAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *SubnetIpv6CidrBlockAssociation) SetAssociationId(v string) *SubnetIpv6CidrBlockAssociation { - s.AssociationId = &v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *SubnetIpv6CidrBlockAssociation) SetIpv6CidrBlock(v string) *SubnetIpv6CidrBlockAssociation { - s.Ipv6CidrBlock = &v - return s -} - -// SetIpv6CidrBlockState sets the Ipv6CidrBlockState field's value. -func (s *SubnetIpv6CidrBlockAssociation) SetIpv6CidrBlockState(v *SubnetCidrBlockState) *SubnetIpv6CidrBlockAssociation { - s.Ipv6CidrBlockState = v - return s -} - -// Describes a tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - // - // Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode - // characters. May not begin with aws: - Key *string `locationName:"key" type:"string"` - - // The value of the tag. - // - // Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode - // characters. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// Describes a tag. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TagDescription -type TagDescription struct { - _ struct{} `type:"structure"` - - // The tag key. - Key *string `locationName:"key" type:"string"` - - // The ID of the resource. For example, ami-1a2b3c4d. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The resource type. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The tag value. - Value *string `locationName:"value" type:"string"` -} - -// String returns the string representation -func (s TagDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagDescription) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagDescription) SetKey(v string) *TagDescription { - s.Key = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *TagDescription) SetResourceId(v string) *TagDescription { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *TagDescription) SetResourceType(v string) *TagDescription { - s.ResourceType = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TagDescription) SetValue(v string) *TagDescription { - s.Value = &v - return s -} - -// The tags to apply to a resource when the resource is being created. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TagSpecification -type TagSpecification struct { - _ struct{} `type:"structure"` - - // The type of resource to tag. Currently, the resource types that support tagging - // on creation are instance and volume. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The tags to apply to the resource. - Tags []*Tag `locationName:"Tag" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s TagSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagSpecification) GoString() string { - return s.String() -} - -// SetResourceType sets the ResourceType field's value. -func (s *TagSpecification) SetResourceType(v string) *TagSpecification { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagSpecification) SetTags(v []*Tag) *TagSpecification { - s.Tags = v - return s -} - -// Information about the Convertible Reserved Instance offering. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TargetConfiguration -type TargetConfiguration struct { - _ struct{} `type:"structure"` - - // The number of instances the Convertible Reserved Instance offering can be - // applied to. This parameter is reserved and cannot be specified in a request - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The ID of the Convertible Reserved Instance offering. - OfferingId *string `locationName:"offeringId" type:"string"` -} - -// String returns the string representation -func (s TargetConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetConfiguration) GoString() string { - return s.String() -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *TargetConfiguration) SetInstanceCount(v int64) *TargetConfiguration { - s.InstanceCount = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *TargetConfiguration) SetOfferingId(v string) *TargetConfiguration { - s.OfferingId = &v - return s -} - -// Details about the target configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TargetConfigurationRequest -type TargetConfigurationRequest struct { - _ struct{} `type:"structure"` - - // The number of instances the Covertible Reserved Instance offering can be - // applied to. This parameter is reserved and cannot be specified in a request - InstanceCount *int64 `type:"integer"` - - // The Convertible Reserved Instance offering ID. - // - // OfferingId is a required field - OfferingId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s TargetConfigurationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetConfigurationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetConfigurationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetConfigurationRequest"} - if s.OfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("OfferingId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *TargetConfigurationRequest) SetInstanceCount(v int64) *TargetConfigurationRequest { - s.InstanceCount = &v - return s -} - -// SetOfferingId sets the OfferingId field's value. -func (s *TargetConfigurationRequest) SetOfferingId(v string) *TargetConfigurationRequest { - s.OfferingId = &v - return s -} - -// The total value of the new Convertible Reserved Instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TargetReservationValue -type TargetReservationValue struct { - _ struct{} `type:"structure"` - - // The total value of the Convertible Reserved Instances that make up the exchange. - // This is the sum of the list value, remaining upfront price, and additional - // upfront cost of the exchange. - ReservationValue *ReservationValue `locationName:"reservationValue" type:"structure"` - - // The configuration of the Convertible Reserved Instances that make up the - // exchange. - TargetConfiguration *TargetConfiguration `locationName:"targetConfiguration" type:"structure"` -} - -// String returns the string representation -func (s TargetReservationValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetReservationValue) GoString() string { - return s.String() -} - -// SetReservationValue sets the ReservationValue field's value. -func (s *TargetReservationValue) SetReservationValue(v *ReservationValue) *TargetReservationValue { - s.ReservationValue = v - return s -} - -// SetTargetConfiguration sets the TargetConfiguration field's value. -func (s *TargetReservationValue) SetTargetConfiguration(v *TargetConfiguration) *TargetReservationValue { - s.TargetConfiguration = v - return s -} - -// Contains the parameters for TerminateInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstancesRequest -type TerminateInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // Constraints: Up to 1000 instance IDs. We recommend breaking up this request - // into smaller batches. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s TerminateInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TerminateInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TerminateInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *TerminateInstancesInput) SetDryRun(v bool) *TerminateInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *TerminateInstancesInput) SetInstanceIds(v []*string) *TerminateInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of TerminateInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstancesResult -type TerminateInstancesOutput struct { - _ struct{} `type:"structure"` - - // Information about one or more terminated instances. - TerminatingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s TerminateInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TerminateInstancesOutput) GoString() string { - return s.String() -} - -// SetTerminatingInstances sets the TerminatingInstances field's value. -func (s *TerminateInstancesOutput) SetTerminatingInstances(v []*InstanceStateChange) *TerminateInstancesOutput { - s.TerminatingInstances = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6AddressesRequest -type UnassignIpv6AddressesInput struct { - _ struct{} `type:"structure"` - - // The IPv6 addresses to unassign from the network interface. - // - // Ipv6Addresses is a required field - Ipv6Addresses []*string `locationName:"ipv6Addresses" locationNameList:"item" type:"list" required:"true"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` -} - -// String returns the string representation -func (s UnassignIpv6AddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignIpv6AddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnassignIpv6AddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnassignIpv6AddressesInput"} - if s.Ipv6Addresses == nil { - invalidParams.Add(request.NewErrParamRequired("Ipv6Addresses")) - } - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *UnassignIpv6AddressesInput) SetIpv6Addresses(v []*string) *UnassignIpv6AddressesInput { - s.Ipv6Addresses = v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *UnassignIpv6AddressesInput) SetNetworkInterfaceId(v string) *UnassignIpv6AddressesInput { - s.NetworkInterfaceId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6AddressesResult -type UnassignIpv6AddressesOutput struct { - _ struct{} `type:"structure"` - - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The IPv6 addresses that have been unassigned from the network interface. - UnassignedIpv6Addresses []*string `locationName:"unassignedIpv6Addresses" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s UnassignIpv6AddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignIpv6AddressesOutput) GoString() string { - return s.String() -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *UnassignIpv6AddressesOutput) SetNetworkInterfaceId(v string) *UnassignIpv6AddressesOutput { - s.NetworkInterfaceId = &v - return s -} - -// SetUnassignedIpv6Addresses sets the UnassignedIpv6Addresses field's value. -func (s *UnassignIpv6AddressesOutput) SetUnassignedIpv6Addresses(v []*string) *UnassignIpv6AddressesOutput { - s.UnassignedIpv6Addresses = v - return s -} - -// Contains the parameters for UnassignPrivateIpAddresses. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddressesRequest -type UnassignPrivateIpAddressesInput struct { - _ struct{} `type:"structure"` - - // The ID of the network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` - - // The secondary private IP addresses to unassign from the network interface. - // You can specify this option multiple times to unassign more than one IP address. - // - // PrivateIpAddresses is a required field - PrivateIpAddresses []*string `locationName:"privateIpAddress" locationNameList:"PrivateIpAddress" type:"list" required:"true"` -} - -// String returns the string representation -func (s UnassignPrivateIpAddressesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignPrivateIpAddressesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnassignPrivateIpAddressesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnassignPrivateIpAddressesInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - if s.PrivateIpAddresses == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateIpAddresses")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *UnassignPrivateIpAddressesInput) SetNetworkInterfaceId(v string) *UnassignPrivateIpAddressesInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *UnassignPrivateIpAddressesInput) SetPrivateIpAddresses(v []*string) *UnassignPrivateIpAddressesInput { - s.PrivateIpAddresses = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddressesOutput -type UnassignPrivateIpAddressesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s UnassignPrivateIpAddressesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnassignPrivateIpAddressesOutput) GoString() string { - return s.String() -} - -// Contains the parameters for UnmonitorInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstancesRequest -type UnmonitorInstancesInput struct { - _ struct{} `type:"structure"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // One or more instance IDs. - // - // InstanceIds is a required field - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"` -} - -// String returns the string representation -func (s UnmonitorInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnmonitorInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UnmonitorInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UnmonitorInstancesInput"} - if s.InstanceIds == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *UnmonitorInstancesInput) SetDryRun(v bool) *UnmonitorInstancesInput { - s.DryRun = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *UnmonitorInstancesInput) SetInstanceIds(v []*string) *UnmonitorInstancesInput { - s.InstanceIds = v - return s -} - -// Contains the output of UnmonitorInstances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstancesResult -type UnmonitorInstancesOutput struct { - _ struct{} `type:"structure"` - - // The monitoring information. - InstanceMonitorings []*InstanceMonitoring `locationName:"instancesSet" locationNameList:"item" type:"list"` -} - -// String returns the string representation -func (s UnmonitorInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnmonitorInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceMonitorings sets the InstanceMonitorings field's value. -func (s *UnmonitorInstancesOutput) SetInstanceMonitorings(v []*InstanceMonitoring) *UnmonitorInstancesOutput { - s.InstanceMonitorings = v - return s -} - -// Information about items that were not successfully processed in a batch call. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnsuccessfulItem -type UnsuccessfulItem struct { - _ struct{} `type:"structure"` - - // Information about the error. - // - // Error is a required field - Error *UnsuccessfulItemError `locationName:"error" type:"structure" required:"true"` - - // The ID of the resource. - ResourceId *string `locationName:"resourceId" type:"string"` -} - -// String returns the string representation -func (s UnsuccessfulItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsuccessfulItem) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *UnsuccessfulItem) SetError(v *UnsuccessfulItemError) *UnsuccessfulItem { - s.Error = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UnsuccessfulItem) SetResourceId(v string) *UnsuccessfulItem { - s.ResourceId = &v - return s -} - -// Information about the error that occurred. For more information about errors, -// see Error Codes (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnsuccessfulItemError -type UnsuccessfulItemError struct { - _ struct{} `type:"structure"` - - // The error code. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true"` - - // The error message accompanying the error code. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` -} - -// String returns the string representation -func (s UnsuccessfulItemError) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UnsuccessfulItemError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *UnsuccessfulItemError) SetCode(v string) *UnsuccessfulItemError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *UnsuccessfulItemError) SetMessage(v string) *UnsuccessfulItemError { - s.Message = &v - return s -} - -// Describes the S3 bucket for the disk image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UserBucket -type UserBucket struct { - _ struct{} `type:"structure"` - - // The name of the S3 bucket where the disk image is located. - S3Bucket *string `type:"string"` - - // The file name of the disk image. - S3Key *string `type:"string"` -} - -// String returns the string representation -func (s UserBucket) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserBucket) GoString() string { - return s.String() -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *UserBucket) SetS3Bucket(v string) *UserBucket { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *UserBucket) SetS3Key(v string) *UserBucket { - s.S3Key = &v - return s -} - -// Describes the S3 bucket for the disk image. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UserBucketDetails -type UserBucketDetails struct { - _ struct{} `type:"structure"` - - // The S3 bucket from which the disk image was created. - S3Bucket *string `locationName:"s3Bucket" type:"string"` - - // The file name of the disk image. - S3Key *string `locationName:"s3Key" type:"string"` -} - -// String returns the string representation -func (s UserBucketDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserBucketDetails) GoString() string { - return s.String() -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *UserBucketDetails) SetS3Bucket(v string) *UserBucketDetails { - s.S3Bucket = &v - return s -} - -// SetS3Key sets the S3Key field's value. -func (s *UserBucketDetails) SetS3Key(v string) *UserBucketDetails { - s.S3Key = &v - return s -} - -// Describes the user data for an instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UserData -type UserData struct { - _ struct{} `type:"structure"` - - // The user data. If you are using an AWS SDK or command line tool, Base64-encoding - // is performed for you, and you can load the text from a file. Otherwise, you - // must provide Base64-encoded text. - Data *string `locationName:"data" type:"string"` -} - -// String returns the string representation -func (s UserData) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserData) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *UserData) SetData(v string) *UserData { - s.Data = &v - return s -} - -// Describes a security group and AWS account ID pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UserIdGroupPair -type UserIdGroupPair struct { - _ struct{} `type:"structure"` - - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` - - // The name of the security group. In a request, use this parameter for a security - // group in EC2-Classic or a default VPC only. For a security group in a nondefault - // VPC, use the security group ID. - GroupName *string `locationName:"groupName" type:"string"` - - // The status of a VPC peering connection, if applicable. - PeeringStatus *string `locationName:"peeringStatus" type:"string"` - - // The ID of an AWS account. For a referenced security group in another VPC, - // the account ID of the referenced security group is returned. - // - // [EC2-Classic] Required when adding or removing rules that reference a security - // group in another AWS account. - UserId *string `locationName:"userId" type:"string"` - - // The ID of the VPC for the referenced security group, if applicable. - VpcId *string `locationName:"vpcId" type:"string"` - - // The ID of the VPC peering connection, if applicable. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s UserIdGroupPair) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UserIdGroupPair) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *UserIdGroupPair) SetGroupId(v string) *UserIdGroupPair { - s.GroupId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UserIdGroupPair) SetGroupName(v string) *UserIdGroupPair { - s.GroupName = &v - return s -} - -// SetPeeringStatus sets the PeeringStatus field's value. -func (s *UserIdGroupPair) SetPeeringStatus(v string) *UserIdGroupPair { - s.PeeringStatus = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *UserIdGroupPair) SetUserId(v string) *UserIdGroupPair { - s.UserId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *UserIdGroupPair) SetVpcId(v string) *UserIdGroupPair { - s.VpcId = &v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *UserIdGroupPair) SetVpcPeeringConnectionId(v string) *UserIdGroupPair { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes telemetry for a VPN tunnel. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VgwTelemetry -type VgwTelemetry struct { - _ struct{} `type:"structure"` - - // The number of accepted routes. - AcceptedRouteCount *int64 `locationName:"acceptedRouteCount" type:"integer"` - - // The date and time of the last change in status. - LastStatusChange *time.Time `locationName:"lastStatusChange" type:"timestamp" timestampFormat:"iso8601"` - - // The Internet-routable IP address of the virtual private gateway's outside - // interface. - OutsideIpAddress *string `locationName:"outsideIpAddress" type:"string"` - - // The status of the VPN tunnel. - Status *string `locationName:"status" type:"string" enum:"TelemetryStatus"` - - // If an error occurs, a description of the error. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s VgwTelemetry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VgwTelemetry) GoString() string { - return s.String() -} - -// SetAcceptedRouteCount sets the AcceptedRouteCount field's value. -func (s *VgwTelemetry) SetAcceptedRouteCount(v int64) *VgwTelemetry { - s.AcceptedRouteCount = &v - return s -} - -// SetLastStatusChange sets the LastStatusChange field's value. -func (s *VgwTelemetry) SetLastStatusChange(v time.Time) *VgwTelemetry { - s.LastStatusChange = &v - return s -} - -// SetOutsideIpAddress sets the OutsideIpAddress field's value. -func (s *VgwTelemetry) SetOutsideIpAddress(v string) *VgwTelemetry { - s.OutsideIpAddress = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VgwTelemetry) SetStatus(v string) *VgwTelemetry { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VgwTelemetry) SetStatusMessage(v string) *VgwTelemetry { - s.StatusMessage = &v - return s -} - -// Describes a volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Volume -type Volume struct { - _ struct{} `type:"structure"` - - // Information about the volume attachments. - Attachments []*VolumeAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"` - - // The Availability Zone for the volume. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The time stamp when volume creation was initiated. - CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the volume will be encrypted. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For Provisioned IOPS SSD volumes, this represents the number of IOPS that - // are provisioned for the volume. For General Purpose SSD volumes, this represents - // the baseline performance of the volume and the rate at which the volume accumulates - // I/O credits for bursting. For more information on General Purpose SSD baseline - // performance, I/O credits, and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops *int64 `locationName:"iops" type:"integer"` - - // The full ARN of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) that was used to protect the volume encryption key for the volume. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The size of the volume, in GiBs. - Size *int64 `locationName:"size" type:"integer"` - - // The snapshot from which the volume was created, if applicable. - SnapshotId *string `locationName:"snapshotId" type:"string"` - - // The volume state. - State *string `locationName:"status" type:"string" enum:"VolumeState"` - - // Any tags assigned to the volume. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the volume. - VolumeId *string `locationName:"volumeId" type:"string"` - - // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned - // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard - // for Magnetic volumes. - VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` -} - -// String returns the string representation -func (s Volume) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Volume) GoString() string { - return s.String() -} - -// SetAttachments sets the Attachments field's value. -func (s *Volume) SetAttachments(v []*VolumeAttachment) *Volume { - s.Attachments = v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Volume) SetAvailabilityZone(v string) *Volume { - s.AvailabilityZone = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *Volume) SetCreateTime(v time.Time) *Volume { - s.CreateTime = &v - return s -} - -// SetEncrypted sets the Encrypted field's value. -func (s *Volume) SetEncrypted(v bool) *Volume { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *Volume) SetIops(v int64) *Volume { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Volume) SetKmsKeyId(v string) *Volume { - s.KmsKeyId = &v - return s -} - -// SetSize sets the Size field's value. -func (s *Volume) SetSize(v int64) *Volume { - s.Size = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *Volume) SetSnapshotId(v string) *Volume { - s.SnapshotId = &v - return s -} - -// SetState sets the State field's value. -func (s *Volume) SetState(v string) *Volume { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Volume) SetTags(v []*Tag) *Volume { - s.Tags = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *Volume) SetVolumeId(v string) *Volume { - s.VolumeId = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *Volume) SetVolumeType(v string) *Volume { - s.VolumeType = &v - return s -} - -// Describes volume attachment details. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeAttachment -type VolumeAttachment struct { - _ struct{} `type:"structure"` - - // The time stamp when the attachment initiated. - AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the EBS volume is deleted on instance termination. - DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` - - // The device name. - Device *string `locationName:"device" type:"string"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The attachment state of the volume. - State *string `locationName:"status" type:"string" enum:"VolumeAttachmentState"` - - // The ID of the volume. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s VolumeAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeAttachment) GoString() string { - return s.String() -} - -// SetAttachTime sets the AttachTime field's value. -func (s *VolumeAttachment) SetAttachTime(v time.Time) *VolumeAttachment { - s.AttachTime = &v - return s -} - -// SetDeleteOnTermination sets the DeleteOnTermination field's value. -func (s *VolumeAttachment) SetDeleteOnTermination(v bool) *VolumeAttachment { - s.DeleteOnTermination = &v - return s -} - -// SetDevice sets the Device field's value. -func (s *VolumeAttachment) SetDevice(v string) *VolumeAttachment { - s.Device = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *VolumeAttachment) SetInstanceId(v string) *VolumeAttachment { - s.InstanceId = &v - return s -} - -// SetState sets the State field's value. -func (s *VolumeAttachment) SetState(v string) *VolumeAttachment { - s.State = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *VolumeAttachment) SetVolumeId(v string) *VolumeAttachment { - s.VolumeId = &v - return s -} - -// Describes an EBS volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeDetail -type VolumeDetail struct { - _ struct{} `type:"structure"` - - // The size of the volume, in GiB. - // - // Size is a required field - Size *int64 `locationName:"size" type:"long" required:"true"` -} - -// String returns the string representation -func (s VolumeDetail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeDetail) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VolumeDetail) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VolumeDetail"} - if s.Size == nil { - invalidParams.Add(request.NewErrParamRequired("Size")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSize sets the Size field's value. -func (s *VolumeDetail) SetSize(v int64) *VolumeDetail { - s.Size = &v - return s -} - -// Describes the modification status of an EBS volume. -// -// If the volume has never been modified, some element values will be null. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeModification -type VolumeModification struct { - _ struct{} `type:"structure"` - - // Modification completion or failure time. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // Current state of modification. Modification state is null for unmodified - // volumes. - ModificationState *string `locationName:"modificationState" type:"string" enum:"VolumeModificationState"` - - // Original IOPS rate of the volume being modified. - OriginalIops *int64 `locationName:"originalIops" type:"integer"` - - // Original size of the volume being modified. - OriginalSize *int64 `locationName:"originalSize" type:"integer"` - - // Original EBS volume type of the volume being modified. - OriginalVolumeType *string `locationName:"originalVolumeType" type:"string" enum:"VolumeType"` - - // Modification progress from 0 to 100%. - Progress *int64 `locationName:"progress" type:"long"` - - // Modification start time - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // Generic status message on modification progress or failure. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // Target IOPS rate of the volume being modified. - TargetIops *int64 `locationName:"targetIops" type:"integer"` - - // Target size of the volume being modified. - TargetSize *int64 `locationName:"targetSize" type:"integer"` - - // Target EBS volume type of the volume being modified. - TargetVolumeType *string `locationName:"targetVolumeType" type:"string" enum:"VolumeType"` - - // ID of the volume being modified. - VolumeId *string `locationName:"volumeId" type:"string"` -} - -// String returns the string representation -func (s VolumeModification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeModification) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *VolumeModification) SetEndTime(v time.Time) *VolumeModification { - s.EndTime = &v - return s -} - -// SetModificationState sets the ModificationState field's value. -func (s *VolumeModification) SetModificationState(v string) *VolumeModification { - s.ModificationState = &v - return s -} - -// SetOriginalIops sets the OriginalIops field's value. -func (s *VolumeModification) SetOriginalIops(v int64) *VolumeModification { - s.OriginalIops = &v - return s -} - -// SetOriginalSize sets the OriginalSize field's value. -func (s *VolumeModification) SetOriginalSize(v int64) *VolumeModification { - s.OriginalSize = &v - return s -} - -// SetOriginalVolumeType sets the OriginalVolumeType field's value. -func (s *VolumeModification) SetOriginalVolumeType(v string) *VolumeModification { - s.OriginalVolumeType = &v - return s -} - -// SetProgress sets the Progress field's value. -func (s *VolumeModification) SetProgress(v int64) *VolumeModification { - s.Progress = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *VolumeModification) SetStartTime(v time.Time) *VolumeModification { - s.StartTime = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VolumeModification) SetStatusMessage(v string) *VolumeModification { - s.StatusMessage = &v - return s -} - -// SetTargetIops sets the TargetIops field's value. -func (s *VolumeModification) SetTargetIops(v int64) *VolumeModification { - s.TargetIops = &v - return s -} - -// SetTargetSize sets the TargetSize field's value. -func (s *VolumeModification) SetTargetSize(v int64) *VolumeModification { - s.TargetSize = &v - return s -} - -// SetTargetVolumeType sets the TargetVolumeType field's value. -func (s *VolumeModification) SetTargetVolumeType(v string) *VolumeModification { - s.TargetVolumeType = &v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *VolumeModification) SetVolumeId(v string) *VolumeModification { - s.VolumeId = &v - return s -} - -// Describes a volume status operation code. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeStatusAction -type VolumeStatusAction struct { - _ struct{} `type:"structure"` - - // The code identifying the operation, for example, enable-volume-io. - Code *string `locationName:"code" type:"string"` - - // A description of the operation. - Description *string `locationName:"description" type:"string"` - - // The ID of the event associated with this operation. - EventId *string `locationName:"eventId" type:"string"` - - // The event type associated with this operation. - EventType *string `locationName:"eventType" type:"string"` -} - -// String returns the string representation -func (s VolumeStatusAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusAction) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *VolumeStatusAction) SetCode(v string) *VolumeStatusAction { - s.Code = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *VolumeStatusAction) SetDescription(v string) *VolumeStatusAction { - s.Description = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *VolumeStatusAction) SetEventId(v string) *VolumeStatusAction { - s.EventId = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *VolumeStatusAction) SetEventType(v string) *VolumeStatusAction { - s.EventType = &v - return s -} - -// Describes a volume status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeStatusDetails -type VolumeStatusDetails struct { - _ struct{} `type:"structure"` - - // The name of the volume status. - Name *string `locationName:"name" type:"string" enum:"VolumeStatusName"` - - // The intended status of the volume status. - Status *string `locationName:"status" type:"string"` -} - -// String returns the string representation -func (s VolumeStatusDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusDetails) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *VolumeStatusDetails) SetName(v string) *VolumeStatusDetails { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VolumeStatusDetails) SetStatus(v string) *VolumeStatusDetails { - s.Status = &v - return s -} - -// Describes a volume status event. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeStatusEvent -type VolumeStatusEvent struct { - _ struct{} `type:"structure"` - - // A description of the event. - Description *string `locationName:"description" type:"string"` - - // The ID of this event. - EventId *string `locationName:"eventId" type:"string"` - - // The type of this event. - EventType *string `locationName:"eventType" type:"string"` - - // The latest end time of the event. - NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The earliest start time of the event. - NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s VolumeStatusEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusEvent) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *VolumeStatusEvent) SetDescription(v string) *VolumeStatusEvent { - s.Description = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *VolumeStatusEvent) SetEventId(v string) *VolumeStatusEvent { - s.EventId = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *VolumeStatusEvent) SetEventType(v string) *VolumeStatusEvent { - s.EventType = &v - return s -} - -// SetNotAfter sets the NotAfter field's value. -func (s *VolumeStatusEvent) SetNotAfter(v time.Time) *VolumeStatusEvent { - s.NotAfter = &v - return s -} - -// SetNotBefore sets the NotBefore field's value. -func (s *VolumeStatusEvent) SetNotBefore(v time.Time) *VolumeStatusEvent { - s.NotBefore = &v - return s -} - -// Describes the status of a volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeStatusInfo -type VolumeStatusInfo struct { - _ struct{} `type:"structure"` - - // The details of the volume status. - Details []*VolumeStatusDetails `locationName:"details" locationNameList:"item" type:"list"` - - // The status of the volume. - Status *string `locationName:"status" type:"string" enum:"VolumeStatusInfoStatus"` -} - -// String returns the string representation -func (s VolumeStatusInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusInfo) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *VolumeStatusInfo) SetDetails(v []*VolumeStatusDetails) *VolumeStatusInfo { - s.Details = v - return s -} - -// SetStatus sets the Status field's value. -func (s *VolumeStatusInfo) SetStatus(v string) *VolumeStatusInfo { - s.Status = &v - return s -} - -// Describes the volume status. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeStatusItem -type VolumeStatusItem struct { - _ struct{} `type:"structure"` - - // The details of the operation. - Actions []*VolumeStatusAction `locationName:"actionsSet" locationNameList:"item" type:"list"` - - // The Availability Zone of the volume. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // A list of events associated with the volume. - Events []*VolumeStatusEvent `locationName:"eventsSet" locationNameList:"item" type:"list"` - - // The volume ID. - VolumeId *string `locationName:"volumeId" type:"string"` - - // The volume status. - VolumeStatus *VolumeStatusInfo `locationName:"volumeStatus" type:"structure"` -} - -// String returns the string representation -func (s VolumeStatusItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeStatusItem) GoString() string { - return s.String() -} - -// SetActions sets the Actions field's value. -func (s *VolumeStatusItem) SetActions(v []*VolumeStatusAction) *VolumeStatusItem { - s.Actions = v - return s -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *VolumeStatusItem) SetAvailabilityZone(v string) *VolumeStatusItem { - s.AvailabilityZone = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *VolumeStatusItem) SetEvents(v []*VolumeStatusEvent) *VolumeStatusItem { - s.Events = v - return s -} - -// SetVolumeId sets the VolumeId field's value. -func (s *VolumeStatusItem) SetVolumeId(v string) *VolumeStatusItem { - s.VolumeId = &v - return s -} - -// SetVolumeStatus sets the VolumeStatus field's value. -func (s *VolumeStatusItem) SetVolumeStatus(v *VolumeStatusInfo) *VolumeStatusItem { - s.VolumeStatus = v - return s -} - -// Describes a VPC. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Vpc -type Vpc struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR block for the VPC. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // The ID of the set of DHCP options you've associated with the VPC (or default - // if the default options are associated with the VPC). - DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"` - - // The allowed tenancy of instances launched into the VPC. - InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` - - // Information about the IPv6 CIDR blocks associated with the VPC. - Ipv6CidrBlockAssociationSet []*VpcIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociationSet" locationNameList:"item" type:"list"` - - // Indicates whether the VPC is the default VPC. - IsDefault *bool `locationName:"isDefault" type:"boolean"` - - // The current state of the VPC. - State *string `locationName:"state" type:"string" enum:"VpcState"` - - // Any tags assigned to the VPC. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s Vpc) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Vpc) GoString() string { - return s.String() -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *Vpc) SetCidrBlock(v string) *Vpc { - s.CidrBlock = &v - return s -} - -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *Vpc) SetDhcpOptionsId(v string) *Vpc { - s.DhcpOptionsId = &v - return s -} - -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *Vpc) SetInstanceTenancy(v string) *Vpc { - s.InstanceTenancy = &v - return s -} - -// SetIpv6CidrBlockAssociationSet sets the Ipv6CidrBlockAssociationSet field's value. -func (s *Vpc) SetIpv6CidrBlockAssociationSet(v []*VpcIpv6CidrBlockAssociation) *Vpc { - s.Ipv6CidrBlockAssociationSet = v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *Vpc) SetIsDefault(v bool) *Vpc { - s.IsDefault = &v - return s -} - -// SetState sets the State field's value. -func (s *Vpc) SetState(v string) *Vpc { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Vpc) SetTags(v []*Tag) *Vpc { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *Vpc) SetVpcId(v string) *Vpc { - s.VpcId = &v - return s -} - -// Describes an attachment between a virtual private gateway and a VPC. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcAttachment -type VpcAttachment struct { - _ struct{} `type:"structure"` - - // The current state of the attachment. - State *string `locationName:"state" type:"string" enum:"AttachmentStatus"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcAttachment) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcAttachment) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *VpcAttachment) SetState(v string) *VpcAttachment { - s.State = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcAttachment) SetVpcId(v string) *VpcAttachment { - s.VpcId = &v - return s -} - -// Describes the state of a CIDR block. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcCidrBlockState -type VpcCidrBlockState struct { - _ struct{} `type:"structure"` - - // The state of the CIDR block. - State *string `locationName:"state" type:"string" enum:"VpcCidrBlockStateCode"` - - // A message about the status of the CIDR block, if applicable. - StatusMessage *string `locationName:"statusMessage" type:"string"` -} - -// String returns the string representation -func (s VpcCidrBlockState) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcCidrBlockState) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *VpcCidrBlockState) SetState(v string) *VpcCidrBlockState { - s.State = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VpcCidrBlockState) SetStatusMessage(v string) *VpcCidrBlockState { - s.StatusMessage = &v - return s -} - -// Describes whether a VPC is enabled for ClassicLink. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcClassicLink -type VpcClassicLink struct { - _ struct{} `type:"structure"` - - // Indicates whether the VPC is enabled for ClassicLink. - ClassicLinkEnabled *bool `locationName:"classicLinkEnabled" type:"boolean"` - - // Any tags assigned to the VPC. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcClassicLink) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcClassicLink) GoString() string { - return s.String() -} - -// SetClassicLinkEnabled sets the ClassicLinkEnabled field's value. -func (s *VpcClassicLink) SetClassicLinkEnabled(v bool) *VpcClassicLink { - s.ClassicLinkEnabled = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpcClassicLink) SetTags(v []*Tag) *VpcClassicLink { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcClassicLink) SetVpcId(v string) *VpcClassicLink { - s.VpcId = &v - return s -} - -// Describes a VPC endpoint. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcEndpoint -type VpcEndpoint struct { - _ struct{} `type:"structure"` - - // The date and time the VPC endpoint was created. - CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"` - - // The policy document associated with the endpoint. - PolicyDocument *string `locationName:"policyDocument" type:"string"` - - // One or more route tables associated with the endpoint. - RouteTableIds []*string `locationName:"routeTableIdSet" locationNameList:"item" type:"list"` - - // The name of the AWS service to which the endpoint is associated. - ServiceName *string `locationName:"serviceName" type:"string"` - - // The state of the VPC endpoint. - State *string `locationName:"state" type:"string" enum:"State"` - - // The ID of the VPC endpoint. - VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` - - // The ID of the VPC to which the endpoint is associated. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcEndpoint) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcEndpoint) GoString() string { - return s.String() -} - -// SetCreationTimestamp sets the CreationTimestamp field's value. -func (s *VpcEndpoint) SetCreationTimestamp(v time.Time) *VpcEndpoint { - s.CreationTimestamp = &v - return s -} - -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *VpcEndpoint) SetPolicyDocument(v string) *VpcEndpoint { - s.PolicyDocument = &v - return s -} - -// SetRouteTableIds sets the RouteTableIds field's value. -func (s *VpcEndpoint) SetRouteTableIds(v []*string) *VpcEndpoint { - s.RouteTableIds = v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *VpcEndpoint) SetServiceName(v string) *VpcEndpoint { - s.ServiceName = &v - return s -} - -// SetState sets the State field's value. -func (s *VpcEndpoint) SetState(v string) *VpcEndpoint { - s.State = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *VpcEndpoint) SetVpcEndpointId(v string) *VpcEndpoint { - s.VpcEndpointId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcEndpoint) SetVpcId(v string) *VpcEndpoint { - s.VpcId = &v - return s -} - -// Describes an IPv6 CIDR block associated with a VPC. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcIpv6CidrBlockAssociation -type VpcIpv6CidrBlockAssociation struct { - _ struct{} `type:"structure"` - - // The association ID for the IPv6 CIDR block. - AssociationId *string `locationName:"associationId" type:"string"` - - // The IPv6 CIDR block. - Ipv6CidrBlock *string `locationName:"ipv6CidrBlock" type:"string"` - - // Information about the state of the CIDR block. - Ipv6CidrBlockState *VpcCidrBlockState `locationName:"ipv6CidrBlockState" type:"structure"` -} - -// String returns the string representation -func (s VpcIpv6CidrBlockAssociation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcIpv6CidrBlockAssociation) GoString() string { - return s.String() -} - -// SetAssociationId sets the AssociationId field's value. -func (s *VpcIpv6CidrBlockAssociation) SetAssociationId(v string) *VpcIpv6CidrBlockAssociation { - s.AssociationId = &v - return s -} - -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *VpcIpv6CidrBlockAssociation) SetIpv6CidrBlock(v string) *VpcIpv6CidrBlockAssociation { - s.Ipv6CidrBlock = &v - return s -} - -// SetIpv6CidrBlockState sets the Ipv6CidrBlockState field's value. -func (s *VpcIpv6CidrBlockAssociation) SetIpv6CidrBlockState(v *VpcCidrBlockState) *VpcIpv6CidrBlockAssociation { - s.Ipv6CidrBlockState = v - return s -} - -// Describes a VPC peering connection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcPeeringConnection -type VpcPeeringConnection struct { - _ struct{} `type:"structure"` - - // Information about the accepter VPC. CIDR block information is not returned - // when creating a VPC peering connection, or when describing a VPC peering - // connection that's in the initiating-request or pending-acceptance state. - AccepterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"accepterVpcInfo" type:"structure"` - - // The time that an unaccepted VPC peering connection will expire. - ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"` - - // Information about the requester VPC. - RequesterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"requesterVpcInfo" type:"structure"` - - // The status of the VPC peering connection. - Status *VpcPeeringConnectionStateReason `locationName:"status" type:"structure"` - - // Any tags assigned to the resource. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The ID of the VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` -} - -// String returns the string representation -func (s VpcPeeringConnection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnection) GoString() string { - return s.String() -} - -// SetAccepterVpcInfo sets the AccepterVpcInfo field's value. -func (s *VpcPeeringConnection) SetAccepterVpcInfo(v *VpcPeeringConnectionVpcInfo) *VpcPeeringConnection { - s.AccepterVpcInfo = v - return s -} - -// SetExpirationTime sets the ExpirationTime field's value. -func (s *VpcPeeringConnection) SetExpirationTime(v time.Time) *VpcPeeringConnection { - s.ExpirationTime = &v - return s -} - -// SetRequesterVpcInfo sets the RequesterVpcInfo field's value. -func (s *VpcPeeringConnection) SetRequesterVpcInfo(v *VpcPeeringConnectionVpcInfo) *VpcPeeringConnection { - s.RequesterVpcInfo = v - return s -} - -// SetStatus sets the Status field's value. -func (s *VpcPeeringConnection) SetStatus(v *VpcPeeringConnectionStateReason) *VpcPeeringConnection { - s.Status = v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpcPeeringConnection) SetTags(v []*Tag) *VpcPeeringConnection { - s.Tags = v - return s -} - -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *VpcPeeringConnection) SetVpcPeeringConnectionId(v string) *VpcPeeringConnection { - s.VpcPeeringConnectionId = &v - return s -} - -// Describes the VPC peering connection options. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcPeeringConnectionOptionsDescription -type VpcPeeringConnectionOptionsDescription struct { - _ struct{} `type:"structure"` - - // Indicates whether a local VPC can resolve public DNS hostnames to private - // IP addresses when queried from instances in a peer VPC. - AllowDnsResolutionFromRemoteVpc *bool `locationName:"allowDnsResolutionFromRemoteVpc" type:"boolean"` - - // Indicates whether a local ClassicLink connection can communicate with the - // peer VPC over the VPC peering connection. - AllowEgressFromLocalClassicLinkToRemoteVpc *bool `locationName:"allowEgressFromLocalClassicLinkToRemoteVpc" type:"boolean"` - - // Indicates whether a local VPC can communicate with a ClassicLink connection - // in the peer VPC over the VPC peering connection. - AllowEgressFromLocalVpcToRemoteClassicLink *bool `locationName:"allowEgressFromLocalVpcToRemoteClassicLink" type:"boolean"` -} - -// String returns the string representation -func (s VpcPeeringConnectionOptionsDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnectionOptionsDescription) GoString() string { - return s.String() -} - -// SetAllowDnsResolutionFromRemoteVpc sets the AllowDnsResolutionFromRemoteVpc field's value. -func (s *VpcPeeringConnectionOptionsDescription) SetAllowDnsResolutionFromRemoteVpc(v bool) *VpcPeeringConnectionOptionsDescription { - s.AllowDnsResolutionFromRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalClassicLinkToRemoteVpc sets the AllowEgressFromLocalClassicLinkToRemoteVpc field's value. -func (s *VpcPeeringConnectionOptionsDescription) SetAllowEgressFromLocalClassicLinkToRemoteVpc(v bool) *VpcPeeringConnectionOptionsDescription { - s.AllowEgressFromLocalClassicLinkToRemoteVpc = &v - return s -} - -// SetAllowEgressFromLocalVpcToRemoteClassicLink sets the AllowEgressFromLocalVpcToRemoteClassicLink field's value. -func (s *VpcPeeringConnectionOptionsDescription) SetAllowEgressFromLocalVpcToRemoteClassicLink(v bool) *VpcPeeringConnectionOptionsDescription { - s.AllowEgressFromLocalVpcToRemoteClassicLink = &v - return s -} - -// Describes the status of a VPC peering connection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcPeeringConnectionStateReason -type VpcPeeringConnectionStateReason struct { - _ struct{} `type:"structure"` - - // The status of the VPC peering connection. - Code *string `locationName:"code" type:"string" enum:"VpcPeeringConnectionStateReasonCode"` - - // A message that provides more information about the status, if applicable. - Message *string `locationName:"message" type:"string"` -} - -// String returns the string representation -func (s VpcPeeringConnectionStateReason) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnectionStateReason) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *VpcPeeringConnectionStateReason) SetCode(v string) *VpcPeeringConnectionStateReason { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *VpcPeeringConnectionStateReason) SetMessage(v string) *VpcPeeringConnectionStateReason { - s.Message = &v - return s -} - -// Describes a VPC in a VPC peering connection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpcPeeringConnectionVpcInfo -type VpcPeeringConnectionVpcInfo struct { - _ struct{} `type:"structure"` - - // The IPv4 CIDR block for the VPC. - CidrBlock *string `locationName:"cidrBlock" type:"string"` - - // The IPv6 CIDR block for the VPC. - Ipv6CidrBlockSet []*Ipv6CidrBlock `locationName:"ipv6CidrBlockSet" locationNameList:"item" type:"list"` - - // The AWS account ID of the VPC owner. - OwnerId *string `locationName:"ownerId" type:"string"` - - // Information about the VPC peering connection options for the accepter or - // requester VPC. - PeeringOptions *VpcPeeringConnectionOptionsDescription `locationName:"peeringOptions" type:"structure"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` -} - -// String returns the string representation -func (s VpcPeeringConnectionVpcInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpcPeeringConnectionVpcInfo) GoString() string { - return s.String() -} - -// SetCidrBlock sets the CidrBlock field's value. -func (s *VpcPeeringConnectionVpcInfo) SetCidrBlock(v string) *VpcPeeringConnectionVpcInfo { - s.CidrBlock = &v - return s -} - -// SetIpv6CidrBlockSet sets the Ipv6CidrBlockSet field's value. -func (s *VpcPeeringConnectionVpcInfo) SetIpv6CidrBlockSet(v []*Ipv6CidrBlock) *VpcPeeringConnectionVpcInfo { - s.Ipv6CidrBlockSet = v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *VpcPeeringConnectionVpcInfo) SetOwnerId(v string) *VpcPeeringConnectionVpcInfo { - s.OwnerId = &v - return s -} - -// SetPeeringOptions sets the PeeringOptions field's value. -func (s *VpcPeeringConnectionVpcInfo) SetPeeringOptions(v *VpcPeeringConnectionOptionsDescription) *VpcPeeringConnectionVpcInfo { - s.PeeringOptions = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcPeeringConnectionVpcInfo) SetVpcId(v string) *VpcPeeringConnectionVpcInfo { - s.VpcId = &v - return s -} - -// Describes a VPN connection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpnConnection -type VpnConnection struct { - _ struct{} `type:"structure"` - - // The configuration information for the VPN connection's customer gateway (in - // the native XML format). This element is always present in the CreateVpnConnection - // response; however, it's present in the DescribeVpnConnections response only - // if the VPN connection is in the pending or available state. - CustomerGatewayConfiguration *string `locationName:"customerGatewayConfiguration" type:"string"` - - // The ID of the customer gateway at your end of the VPN connection. - CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` - - // The VPN connection options. - Options *VpnConnectionOptions `locationName:"options" type:"structure"` - - // The static routes associated with the VPN connection. - Routes []*VpnStaticRoute `locationName:"routes" locationNameList:"item" type:"list"` - - // The current state of the VPN connection. - State *string `locationName:"state" type:"string" enum:"VpnState"` - - // Any tags assigned to the VPN connection. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection. - Type *string `locationName:"type" type:"string" enum:"GatewayType"` - - // Information about the VPN tunnel. - VgwTelemetry []*VgwTelemetry `locationName:"vgwTelemetry" locationNameList:"item" type:"list"` - - // The ID of the VPN connection. - VpnConnectionId *string `locationName:"vpnConnectionId" type:"string"` - - // The ID of the virtual private gateway at the AWS side of the VPN connection. - VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` -} - -// String returns the string representation -func (s VpnConnection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnConnection) GoString() string { - return s.String() -} - -// SetCustomerGatewayConfiguration sets the CustomerGatewayConfiguration field's value. -func (s *VpnConnection) SetCustomerGatewayConfiguration(v string) *VpnConnection { - s.CustomerGatewayConfiguration = &v - return s -} - -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *VpnConnection) SetCustomerGatewayId(v string) *VpnConnection { - s.CustomerGatewayId = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *VpnConnection) SetOptions(v *VpnConnectionOptions) *VpnConnection { - s.Options = v - return s -} - -// SetRoutes sets the Routes field's value. -func (s *VpnConnection) SetRoutes(v []*VpnStaticRoute) *VpnConnection { - s.Routes = v - return s -} - -// SetState sets the State field's value. -func (s *VpnConnection) SetState(v string) *VpnConnection { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpnConnection) SetTags(v []*Tag) *VpnConnection { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *VpnConnection) SetType(v string) *VpnConnection { - s.Type = &v - return s -} - -// SetVgwTelemetry sets the VgwTelemetry field's value. -func (s *VpnConnection) SetVgwTelemetry(v []*VgwTelemetry) *VpnConnection { - s.VgwTelemetry = v - return s -} - -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *VpnConnection) SetVpnConnectionId(v string) *VpnConnection { - s.VpnConnectionId = &v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *VpnConnection) SetVpnGatewayId(v string) *VpnConnection { - s.VpnGatewayId = &v - return s -} - -// Describes VPN connection options. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpnConnectionOptions -type VpnConnectionOptions struct { - _ struct{} `type:"structure"` - - // Indicates whether the VPN connection uses static routes only. Static routes - // must be used for devices that don't support BGP. - StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` -} - -// String returns the string representation -func (s VpnConnectionOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnConnectionOptions) GoString() string { - return s.String() -} - -// SetStaticRoutesOnly sets the StaticRoutesOnly field's value. -func (s *VpnConnectionOptions) SetStaticRoutesOnly(v bool) *VpnConnectionOptions { - s.StaticRoutesOnly = &v - return s -} - -// Describes VPN connection options. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpnConnectionOptionsSpecification -type VpnConnectionOptionsSpecification struct { - _ struct{} `type:"structure"` - - // Indicates whether the VPN connection uses static routes only. Static routes - // must be used for devices that don't support BGP. - StaticRoutesOnly *bool `locationName:"staticRoutesOnly" type:"boolean"` -} - -// String returns the string representation -func (s VpnConnectionOptionsSpecification) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnConnectionOptionsSpecification) GoString() string { - return s.String() -} - -// SetStaticRoutesOnly sets the StaticRoutesOnly field's value. -func (s *VpnConnectionOptionsSpecification) SetStaticRoutesOnly(v bool) *VpnConnectionOptionsSpecification { - s.StaticRoutesOnly = &v - return s -} - -// Describes a virtual private gateway. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpnGateway -type VpnGateway struct { - _ struct{} `type:"structure"` - - // The Availability Zone where the virtual private gateway was created, if applicable. - // This field may be empty or not returned. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The current state of the virtual private gateway. - State *string `locationName:"state" type:"string" enum:"VpnState"` - - // Any tags assigned to the virtual private gateway. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - - // The type of VPN connection the virtual private gateway supports. - Type *string `locationName:"type" type:"string" enum:"GatewayType"` - - // Any VPCs attached to the virtual private gateway. - VpcAttachments []*VpcAttachment `locationName:"attachments" locationNameList:"item" type:"list"` - - // The ID of the virtual private gateway. - VpnGatewayId *string `locationName:"vpnGatewayId" type:"string"` -} - -// String returns the string representation -func (s VpnGateway) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnGateway) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *VpnGateway) SetAvailabilityZone(v string) *VpnGateway { - s.AvailabilityZone = &v - return s -} - -// SetState sets the State field's value. -func (s *VpnGateway) SetState(v string) *VpnGateway { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *VpnGateway) SetTags(v []*Tag) *VpnGateway { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *VpnGateway) SetType(v string) *VpnGateway { - s.Type = &v - return s -} - -// SetVpcAttachments sets the VpcAttachments field's value. -func (s *VpnGateway) SetVpcAttachments(v []*VpcAttachment) *VpnGateway { - s.VpcAttachments = v - return s -} - -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *VpnGateway) SetVpnGatewayId(v string) *VpnGateway { - s.VpnGatewayId = &v - return s -} - -// Describes a static route for a VPN connection. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VpnStaticRoute -type VpnStaticRoute struct { - _ struct{} `type:"structure"` - - // The CIDR block associated with the local subnet of the customer data center. - DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` - - // Indicates how the routes were provided. - Source *string `locationName:"source" type:"string" enum:"VpnStaticRouteSource"` - - // The current state of the static route. - State *string `locationName:"state" type:"string" enum:"VpnState"` -} - -// String returns the string representation -func (s VpnStaticRoute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VpnStaticRoute) GoString() string { - return s.String() -} - -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *VpnStaticRoute) SetDestinationCidrBlock(v string) *VpnStaticRoute { - s.DestinationCidrBlock = &v - return s -} - -// SetSource sets the Source field's value. -func (s *VpnStaticRoute) SetSource(v string) *VpnStaticRoute { - s.Source = &v - return s -} - -// SetState sets the State field's value. -func (s *VpnStaticRoute) SetState(v string) *VpnStaticRoute { - s.State = &v - return s -} - -const ( - // AccountAttributeNameSupportedPlatforms is a AccountAttributeName enum value - AccountAttributeNameSupportedPlatforms = "supported-platforms" - - // AccountAttributeNameDefaultVpc is a AccountAttributeName enum value - AccountAttributeNameDefaultVpc = "default-vpc" -) - -const ( - // ActivityStatusError is a ActivityStatus enum value - ActivityStatusError = "error" - - // ActivityStatusPendingFulfillment is a ActivityStatus enum value - ActivityStatusPendingFulfillment = "pending_fulfillment" - - // ActivityStatusPendingTermination is a ActivityStatus enum value - ActivityStatusPendingTermination = "pending_termination" - - // ActivityStatusFulfilled is a ActivityStatus enum value - ActivityStatusFulfilled = "fulfilled" -) - -const ( - // AffinityDefault is a Affinity enum value - AffinityDefault = "default" - - // AffinityHost is a Affinity enum value - AffinityHost = "host" -) - -const ( - // AllocationStateAvailable is a AllocationState enum value - AllocationStateAvailable = "available" - - // AllocationStateUnderAssessment is a AllocationState enum value - AllocationStateUnderAssessment = "under-assessment" - - // AllocationStatePermanentFailure is a AllocationState enum value - AllocationStatePermanentFailure = "permanent-failure" - - // AllocationStateReleased is a AllocationState enum value - AllocationStateReleased = "released" - - // AllocationStateReleasedPermanentFailure is a AllocationState enum value - AllocationStateReleasedPermanentFailure = "released-permanent-failure" -) - -const ( - // AllocationStrategyLowestPrice is a AllocationStrategy enum value - AllocationStrategyLowestPrice = "lowestPrice" - - // AllocationStrategyDiversified is a AllocationStrategy enum value - AllocationStrategyDiversified = "diversified" -) - -const ( - // ArchitectureValuesI386 is a ArchitectureValues enum value - ArchitectureValuesI386 = "i386" - - // ArchitectureValuesX8664 is a ArchitectureValues enum value - ArchitectureValuesX8664 = "x86_64" -) - -const ( - // AttachmentStatusAttaching is a AttachmentStatus enum value - AttachmentStatusAttaching = "attaching" - - // AttachmentStatusAttached is a AttachmentStatus enum value - AttachmentStatusAttached = "attached" - - // AttachmentStatusDetaching is a AttachmentStatus enum value - AttachmentStatusDetaching = "detaching" - - // AttachmentStatusDetached is a AttachmentStatus enum value - AttachmentStatusDetached = "detached" -) - -const ( - // AutoPlacementOn is a AutoPlacement enum value - AutoPlacementOn = "on" - - // AutoPlacementOff is a AutoPlacement enum value - AutoPlacementOff = "off" -) - -const ( - // AvailabilityZoneStateAvailable is a AvailabilityZoneState enum value - AvailabilityZoneStateAvailable = "available" - - // AvailabilityZoneStateInformation is a AvailabilityZoneState enum value - AvailabilityZoneStateInformation = "information" - - // AvailabilityZoneStateImpaired is a AvailabilityZoneState enum value - AvailabilityZoneStateImpaired = "impaired" - - // AvailabilityZoneStateUnavailable is a AvailabilityZoneState enum value - AvailabilityZoneStateUnavailable = "unavailable" -) - -const ( - // BatchStateSubmitted is a BatchState enum value - BatchStateSubmitted = "submitted" - - // BatchStateActive is a BatchState enum value - BatchStateActive = "active" - - // BatchStateCancelled is a BatchState enum value - BatchStateCancelled = "cancelled" - - // BatchStateFailed is a BatchState enum value - BatchStateFailed = "failed" - - // BatchStateCancelledRunning is a BatchState enum value - BatchStateCancelledRunning = "cancelled_running" - - // BatchStateCancelledTerminating is a BatchState enum value - BatchStateCancelledTerminating = "cancelled_terminating" - - // BatchStateModifying is a BatchState enum value - BatchStateModifying = "modifying" -) - -const ( - // BundleTaskStatePending is a BundleTaskState enum value - BundleTaskStatePending = "pending" - - // BundleTaskStateWaitingForShutdown is a BundleTaskState enum value - BundleTaskStateWaitingForShutdown = "waiting-for-shutdown" - - // BundleTaskStateBundling is a BundleTaskState enum value - BundleTaskStateBundling = "bundling" - - // BundleTaskStateStoring is a BundleTaskState enum value - BundleTaskStateStoring = "storing" - - // BundleTaskStateCancelling is a BundleTaskState enum value - BundleTaskStateCancelling = "cancelling" - - // BundleTaskStateComplete is a BundleTaskState enum value - BundleTaskStateComplete = "complete" - - // BundleTaskStateFailed is a BundleTaskState enum value - BundleTaskStateFailed = "failed" -) - -const ( - // CancelBatchErrorCodeFleetRequestIdDoesNotExist is a CancelBatchErrorCode enum value - CancelBatchErrorCodeFleetRequestIdDoesNotExist = "fleetRequestIdDoesNotExist" - - // CancelBatchErrorCodeFleetRequestIdMalformed is a CancelBatchErrorCode enum value - CancelBatchErrorCodeFleetRequestIdMalformed = "fleetRequestIdMalformed" - - // CancelBatchErrorCodeFleetRequestNotInCancellableState is a CancelBatchErrorCode enum value - CancelBatchErrorCodeFleetRequestNotInCancellableState = "fleetRequestNotInCancellableState" - - // CancelBatchErrorCodeUnexpectedError is a CancelBatchErrorCode enum value - CancelBatchErrorCodeUnexpectedError = "unexpectedError" -) - -const ( - // CancelSpotInstanceRequestStateActive is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateActive = "active" - - // CancelSpotInstanceRequestStateOpen is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateOpen = "open" - - // CancelSpotInstanceRequestStateClosed is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateClosed = "closed" - - // CancelSpotInstanceRequestStateCancelled is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateCancelled = "cancelled" - - // CancelSpotInstanceRequestStateCompleted is a CancelSpotInstanceRequestState enum value - CancelSpotInstanceRequestStateCompleted = "completed" -) - -const ( - // ContainerFormatOva is a ContainerFormat enum value - ContainerFormatOva = "ova" -) - -const ( - // ConversionTaskStateActive is a ConversionTaskState enum value - ConversionTaskStateActive = "active" - - // ConversionTaskStateCancelling is a ConversionTaskState enum value - ConversionTaskStateCancelling = "cancelling" - - // ConversionTaskStateCancelled is a ConversionTaskState enum value - ConversionTaskStateCancelled = "cancelled" - - // ConversionTaskStateCompleted is a ConversionTaskState enum value - ConversionTaskStateCompleted = "completed" -) - -const ( - // CurrencyCodeValuesUsd is a CurrencyCodeValues enum value - CurrencyCodeValuesUsd = "USD" -) - -const ( - // DatafeedSubscriptionStateActive is a DatafeedSubscriptionState enum value - DatafeedSubscriptionStateActive = "Active" - - // DatafeedSubscriptionStateInactive is a DatafeedSubscriptionState enum value - DatafeedSubscriptionStateInactive = "Inactive" -) - -const ( - // DeviceTypeEbs is a DeviceType enum value - DeviceTypeEbs = "ebs" - - // DeviceTypeInstanceStore is a DeviceType enum value - DeviceTypeInstanceStore = "instance-store" -) - -const ( - // DiskImageFormatVmdk is a DiskImageFormat enum value - DiskImageFormatVmdk = "VMDK" - - // DiskImageFormatRaw is a DiskImageFormat enum value - DiskImageFormatRaw = "RAW" - - // DiskImageFormatVhd is a DiskImageFormat enum value - DiskImageFormatVhd = "VHD" -) - -const ( - // DomainTypeVpc is a DomainType enum value - DomainTypeVpc = "vpc" - - // DomainTypeStandard is a DomainType enum value - DomainTypeStandard = "standard" -) - -const ( - // EventCodeInstanceReboot is a EventCode enum value - EventCodeInstanceReboot = "instance-reboot" - - // EventCodeSystemReboot is a EventCode enum value - EventCodeSystemReboot = "system-reboot" - - // EventCodeSystemMaintenance is a EventCode enum value - EventCodeSystemMaintenance = "system-maintenance" - - // EventCodeInstanceRetirement is a EventCode enum value - EventCodeInstanceRetirement = "instance-retirement" - - // EventCodeInstanceStop is a EventCode enum value - EventCodeInstanceStop = "instance-stop" -) - -const ( - // EventTypeInstanceChange is a EventType enum value - EventTypeInstanceChange = "instanceChange" - - // EventTypeFleetRequestChange is a EventType enum value - EventTypeFleetRequestChange = "fleetRequestChange" - - // EventTypeError is a EventType enum value - EventTypeError = "error" -) - -const ( - // ExcessCapacityTerminationPolicyNoTermination is a ExcessCapacityTerminationPolicy enum value - ExcessCapacityTerminationPolicyNoTermination = "noTermination" - - // ExcessCapacityTerminationPolicyDefault is a ExcessCapacityTerminationPolicy enum value - ExcessCapacityTerminationPolicyDefault = "default" -) - -const ( - // ExportEnvironmentCitrix is a ExportEnvironment enum value - ExportEnvironmentCitrix = "citrix" - - // ExportEnvironmentVmware is a ExportEnvironment enum value - ExportEnvironmentVmware = "vmware" - - // ExportEnvironmentMicrosoft is a ExportEnvironment enum value - ExportEnvironmentMicrosoft = "microsoft" -) - -const ( - // ExportTaskStateActive is a ExportTaskState enum value - ExportTaskStateActive = "active" - - // ExportTaskStateCancelling is a ExportTaskState enum value - ExportTaskStateCancelling = "cancelling" - - // ExportTaskStateCancelled is a ExportTaskState enum value - ExportTaskStateCancelled = "cancelled" - - // ExportTaskStateCompleted is a ExportTaskState enum value - ExportTaskStateCompleted = "completed" -) - -const ( - // FleetTypeRequest is a FleetType enum value - FleetTypeRequest = "request" - - // FleetTypeMaintain is a FleetType enum value - FleetTypeMaintain = "maintain" -) - -const ( - // FlowLogsResourceTypeVpc is a FlowLogsResourceType enum value - FlowLogsResourceTypeVpc = "VPC" - - // FlowLogsResourceTypeSubnet is a FlowLogsResourceType enum value - FlowLogsResourceTypeSubnet = "Subnet" - - // FlowLogsResourceTypeNetworkInterface is a FlowLogsResourceType enum value - FlowLogsResourceTypeNetworkInterface = "NetworkInterface" -) - -const ( - // GatewayTypeIpsec1 is a GatewayType enum value - GatewayTypeIpsec1 = "ipsec.1" -) - -const ( - // HostTenancyDedicated is a HostTenancy enum value - HostTenancyDedicated = "dedicated" - - // HostTenancyHost is a HostTenancy enum value - HostTenancyHost = "host" -) - -const ( - // HypervisorTypeOvm is a HypervisorType enum value - HypervisorTypeOvm = "ovm" - - // HypervisorTypeXen is a HypervisorType enum value - HypervisorTypeXen = "xen" -) - -const ( - // IamInstanceProfileAssociationStateAssociating is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateAssociating = "associating" - - // IamInstanceProfileAssociationStateAssociated is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateAssociated = "associated" - - // IamInstanceProfileAssociationStateDisassociating is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateDisassociating = "disassociating" - - // IamInstanceProfileAssociationStateDisassociated is a IamInstanceProfileAssociationState enum value - IamInstanceProfileAssociationStateDisassociated = "disassociated" -) - -const ( - // ImageAttributeNameDescription is a ImageAttributeName enum value - ImageAttributeNameDescription = "description" - - // ImageAttributeNameKernel is a ImageAttributeName enum value - ImageAttributeNameKernel = "kernel" - - // ImageAttributeNameRamdisk is a ImageAttributeName enum value - ImageAttributeNameRamdisk = "ramdisk" - - // ImageAttributeNameLaunchPermission is a ImageAttributeName enum value - ImageAttributeNameLaunchPermission = "launchPermission" - - // ImageAttributeNameProductCodes is a ImageAttributeName enum value - ImageAttributeNameProductCodes = "productCodes" - - // ImageAttributeNameBlockDeviceMapping is a ImageAttributeName enum value - ImageAttributeNameBlockDeviceMapping = "blockDeviceMapping" - - // ImageAttributeNameSriovNetSupport is a ImageAttributeName enum value - ImageAttributeNameSriovNetSupport = "sriovNetSupport" -) - -const ( - // ImageStatePending is a ImageState enum value - ImageStatePending = "pending" - - // ImageStateAvailable is a ImageState enum value - ImageStateAvailable = "available" - - // ImageStateInvalid is a ImageState enum value - ImageStateInvalid = "invalid" - - // ImageStateDeregistered is a ImageState enum value - ImageStateDeregistered = "deregistered" - - // ImageStateTransient is a ImageState enum value - ImageStateTransient = "transient" - - // ImageStateFailed is a ImageState enum value - ImageStateFailed = "failed" - - // ImageStateError is a ImageState enum value - ImageStateError = "error" -) - -const ( - // ImageTypeValuesMachine is a ImageTypeValues enum value - ImageTypeValuesMachine = "machine" - - // ImageTypeValuesKernel is a ImageTypeValues enum value - ImageTypeValuesKernel = "kernel" - - // ImageTypeValuesRamdisk is a ImageTypeValues enum value - ImageTypeValuesRamdisk = "ramdisk" -) - -const ( - // InstanceAttributeNameInstanceType is a InstanceAttributeName enum value - InstanceAttributeNameInstanceType = "instanceType" - - // InstanceAttributeNameKernel is a InstanceAttributeName enum value - InstanceAttributeNameKernel = "kernel" - - // InstanceAttributeNameRamdisk is a InstanceAttributeName enum value - InstanceAttributeNameRamdisk = "ramdisk" - - // InstanceAttributeNameUserData is a InstanceAttributeName enum value - InstanceAttributeNameUserData = "userData" - - // InstanceAttributeNameDisableApiTermination is a InstanceAttributeName enum value - InstanceAttributeNameDisableApiTermination = "disableApiTermination" - - // InstanceAttributeNameInstanceInitiatedShutdownBehavior is a InstanceAttributeName enum value - InstanceAttributeNameInstanceInitiatedShutdownBehavior = "instanceInitiatedShutdownBehavior" - - // InstanceAttributeNameRootDeviceName is a InstanceAttributeName enum value - InstanceAttributeNameRootDeviceName = "rootDeviceName" - - // InstanceAttributeNameBlockDeviceMapping is a InstanceAttributeName enum value - InstanceAttributeNameBlockDeviceMapping = "blockDeviceMapping" - - // InstanceAttributeNameProductCodes is a InstanceAttributeName enum value - InstanceAttributeNameProductCodes = "productCodes" - - // InstanceAttributeNameSourceDestCheck is a InstanceAttributeName enum value - InstanceAttributeNameSourceDestCheck = "sourceDestCheck" - - // InstanceAttributeNameGroupSet is a InstanceAttributeName enum value - InstanceAttributeNameGroupSet = "groupSet" - - // InstanceAttributeNameEbsOptimized is a InstanceAttributeName enum value - InstanceAttributeNameEbsOptimized = "ebsOptimized" - - // InstanceAttributeNameSriovNetSupport is a InstanceAttributeName enum value - InstanceAttributeNameSriovNetSupport = "sriovNetSupport" - - // InstanceAttributeNameEnaSupport is a InstanceAttributeName enum value - InstanceAttributeNameEnaSupport = "enaSupport" -) - -const ( - // InstanceHealthStatusHealthy is a InstanceHealthStatus enum value - InstanceHealthStatusHealthy = "healthy" - - // InstanceHealthStatusUnhealthy is a InstanceHealthStatus enum value - InstanceHealthStatusUnhealthy = "unhealthy" -) - -const ( - // InstanceLifecycleTypeSpot is a InstanceLifecycleType enum value - InstanceLifecycleTypeSpot = "spot" - - // InstanceLifecycleTypeScheduled is a InstanceLifecycleType enum value - InstanceLifecycleTypeScheduled = "scheduled" -) - -const ( - // InstanceStateNamePending is a InstanceStateName enum value - InstanceStateNamePending = "pending" - - // InstanceStateNameRunning is a InstanceStateName enum value - InstanceStateNameRunning = "running" - - // InstanceStateNameShuttingDown is a InstanceStateName enum value - InstanceStateNameShuttingDown = "shutting-down" - - // InstanceStateNameTerminated is a InstanceStateName enum value - InstanceStateNameTerminated = "terminated" - - // InstanceStateNameStopping is a InstanceStateName enum value - InstanceStateNameStopping = "stopping" - - // InstanceStateNameStopped is a InstanceStateName enum value - InstanceStateNameStopped = "stopped" -) - -const ( - // InstanceTypeT1Micro is a InstanceType enum value - InstanceTypeT1Micro = "t1.micro" - - // InstanceTypeT2Nano is a InstanceType enum value - InstanceTypeT2Nano = "t2.nano" - - // InstanceTypeT2Micro is a InstanceType enum value - InstanceTypeT2Micro = "t2.micro" - - // InstanceTypeT2Small is a InstanceType enum value - InstanceTypeT2Small = "t2.small" - - // InstanceTypeT2Medium is a InstanceType enum value - InstanceTypeT2Medium = "t2.medium" - - // InstanceTypeT2Large is a InstanceType enum value - InstanceTypeT2Large = "t2.large" - - // InstanceTypeT2Xlarge is a InstanceType enum value - InstanceTypeT2Xlarge = "t2.xlarge" - - // InstanceTypeT22xlarge is a InstanceType enum value - InstanceTypeT22xlarge = "t2.2xlarge" - - // InstanceTypeM1Small is a InstanceType enum value - InstanceTypeM1Small = "m1.small" - - // InstanceTypeM1Medium is a InstanceType enum value - InstanceTypeM1Medium = "m1.medium" - - // InstanceTypeM1Large is a InstanceType enum value - InstanceTypeM1Large = "m1.large" - - // InstanceTypeM1Xlarge is a InstanceType enum value - InstanceTypeM1Xlarge = "m1.xlarge" - - // InstanceTypeM3Medium is a InstanceType enum value - InstanceTypeM3Medium = "m3.medium" - - // InstanceTypeM3Large is a InstanceType enum value - InstanceTypeM3Large = "m3.large" - - // InstanceTypeM3Xlarge is a InstanceType enum value - InstanceTypeM3Xlarge = "m3.xlarge" - - // InstanceTypeM32xlarge is a InstanceType enum value - InstanceTypeM32xlarge = "m3.2xlarge" - - // InstanceTypeM4Large is a InstanceType enum value - InstanceTypeM4Large = "m4.large" - - // InstanceTypeM4Xlarge is a InstanceType enum value - InstanceTypeM4Xlarge = "m4.xlarge" - - // InstanceTypeM42xlarge is a InstanceType enum value - InstanceTypeM42xlarge = "m4.2xlarge" - - // InstanceTypeM44xlarge is a InstanceType enum value - InstanceTypeM44xlarge = "m4.4xlarge" - - // InstanceTypeM410xlarge is a InstanceType enum value - InstanceTypeM410xlarge = "m4.10xlarge" - - // InstanceTypeM416xlarge is a InstanceType enum value - InstanceTypeM416xlarge = "m4.16xlarge" - - // InstanceTypeM2Xlarge is a InstanceType enum value - InstanceTypeM2Xlarge = "m2.xlarge" - - // InstanceTypeM22xlarge is a InstanceType enum value - InstanceTypeM22xlarge = "m2.2xlarge" - - // InstanceTypeM24xlarge is a InstanceType enum value - InstanceTypeM24xlarge = "m2.4xlarge" - - // InstanceTypeCr18xlarge is a InstanceType enum value - InstanceTypeCr18xlarge = "cr1.8xlarge" - - // InstanceTypeR3Large is a InstanceType enum value - InstanceTypeR3Large = "r3.large" - - // InstanceTypeR3Xlarge is a InstanceType enum value - InstanceTypeR3Xlarge = "r3.xlarge" - - // InstanceTypeR32xlarge is a InstanceType enum value - InstanceTypeR32xlarge = "r3.2xlarge" - - // InstanceTypeR34xlarge is a InstanceType enum value - InstanceTypeR34xlarge = "r3.4xlarge" - - // InstanceTypeR38xlarge is a InstanceType enum value - InstanceTypeR38xlarge = "r3.8xlarge" - - // InstanceTypeR4Large is a InstanceType enum value - InstanceTypeR4Large = "r4.large" - - // InstanceTypeR4Xlarge is a InstanceType enum value - InstanceTypeR4Xlarge = "r4.xlarge" - - // InstanceTypeR42xlarge is a InstanceType enum value - InstanceTypeR42xlarge = "r4.2xlarge" - - // InstanceTypeR44xlarge is a InstanceType enum value - InstanceTypeR44xlarge = "r4.4xlarge" - - // InstanceTypeR48xlarge is a InstanceType enum value - InstanceTypeR48xlarge = "r4.8xlarge" - - // InstanceTypeR416xlarge is a InstanceType enum value - InstanceTypeR416xlarge = "r4.16xlarge" - - // InstanceTypeX116xlarge is a InstanceType enum value - InstanceTypeX116xlarge = "x1.16xlarge" - - // InstanceTypeX132xlarge is a InstanceType enum value - InstanceTypeX132xlarge = "x1.32xlarge" - - // InstanceTypeI2Xlarge is a InstanceType enum value - InstanceTypeI2Xlarge = "i2.xlarge" - - // InstanceTypeI22xlarge is a InstanceType enum value - InstanceTypeI22xlarge = "i2.2xlarge" - - // InstanceTypeI24xlarge is a InstanceType enum value - InstanceTypeI24xlarge = "i2.4xlarge" - - // InstanceTypeI28xlarge is a InstanceType enum value - InstanceTypeI28xlarge = "i2.8xlarge" - - // InstanceTypeI3Large is a InstanceType enum value - InstanceTypeI3Large = "i3.large" - - // InstanceTypeI3Xlarge is a InstanceType enum value - InstanceTypeI3Xlarge = "i3.xlarge" - - // InstanceTypeI32xlarge is a InstanceType enum value - InstanceTypeI32xlarge = "i3.2xlarge" - - // InstanceTypeI34xlarge is a InstanceType enum value - InstanceTypeI34xlarge = "i3.4xlarge" - - // InstanceTypeI38xlarge is a InstanceType enum value - InstanceTypeI38xlarge = "i3.8xlarge" - - // InstanceTypeI316xlarge is a InstanceType enum value - InstanceTypeI316xlarge = "i3.16xlarge" - - // InstanceTypeHi14xlarge is a InstanceType enum value - InstanceTypeHi14xlarge = "hi1.4xlarge" - - // InstanceTypeHs18xlarge is a InstanceType enum value - InstanceTypeHs18xlarge = "hs1.8xlarge" - - // InstanceTypeC1Medium is a InstanceType enum value - InstanceTypeC1Medium = "c1.medium" - - // InstanceTypeC1Xlarge is a InstanceType enum value - InstanceTypeC1Xlarge = "c1.xlarge" - - // InstanceTypeC3Large is a InstanceType enum value - InstanceTypeC3Large = "c3.large" - - // InstanceTypeC3Xlarge is a InstanceType enum value - InstanceTypeC3Xlarge = "c3.xlarge" - - // InstanceTypeC32xlarge is a InstanceType enum value - InstanceTypeC32xlarge = "c3.2xlarge" - - // InstanceTypeC34xlarge is a InstanceType enum value - InstanceTypeC34xlarge = "c3.4xlarge" - - // InstanceTypeC38xlarge is a InstanceType enum value - InstanceTypeC38xlarge = "c3.8xlarge" - - // InstanceTypeC4Large is a InstanceType enum value - InstanceTypeC4Large = "c4.large" - - // InstanceTypeC4Xlarge is a InstanceType enum value - InstanceTypeC4Xlarge = "c4.xlarge" - - // InstanceTypeC42xlarge is a InstanceType enum value - InstanceTypeC42xlarge = "c4.2xlarge" - - // InstanceTypeC44xlarge is a InstanceType enum value - InstanceTypeC44xlarge = "c4.4xlarge" - - // InstanceTypeC48xlarge is a InstanceType enum value - InstanceTypeC48xlarge = "c4.8xlarge" - - // InstanceTypeCc14xlarge is a InstanceType enum value - InstanceTypeCc14xlarge = "cc1.4xlarge" - - // InstanceTypeCc28xlarge is a InstanceType enum value - InstanceTypeCc28xlarge = "cc2.8xlarge" - - // InstanceTypeG22xlarge is a InstanceType enum value - InstanceTypeG22xlarge = "g2.2xlarge" - - // InstanceTypeG28xlarge is a InstanceType enum value - InstanceTypeG28xlarge = "g2.8xlarge" - - // InstanceTypeCg14xlarge is a InstanceType enum value - InstanceTypeCg14xlarge = "cg1.4xlarge" - - // InstanceTypeP2Xlarge is a InstanceType enum value - InstanceTypeP2Xlarge = "p2.xlarge" - - // InstanceTypeP28xlarge is a InstanceType enum value - InstanceTypeP28xlarge = "p2.8xlarge" - - // InstanceTypeP216xlarge is a InstanceType enum value - InstanceTypeP216xlarge = "p2.16xlarge" - - // InstanceTypeD2Xlarge is a InstanceType enum value - InstanceTypeD2Xlarge = "d2.xlarge" - - // InstanceTypeD22xlarge is a InstanceType enum value - InstanceTypeD22xlarge = "d2.2xlarge" - - // InstanceTypeD24xlarge is a InstanceType enum value - InstanceTypeD24xlarge = "d2.4xlarge" - - // InstanceTypeD28xlarge is a InstanceType enum value - InstanceTypeD28xlarge = "d2.8xlarge" - - // InstanceTypeF12xlarge is a InstanceType enum value - InstanceTypeF12xlarge = "f1.2xlarge" - - // InstanceTypeF116xlarge is a InstanceType enum value - InstanceTypeF116xlarge = "f1.16xlarge" -) - -const ( - // ListingStateAvailable is a ListingState enum value - ListingStateAvailable = "available" - - // ListingStateSold is a ListingState enum value - ListingStateSold = "sold" - - // ListingStateCancelled is a ListingState enum value - ListingStateCancelled = "cancelled" - - // ListingStatePending is a ListingState enum value - ListingStatePending = "pending" -) - -const ( - // ListingStatusActive is a ListingStatus enum value - ListingStatusActive = "active" - - // ListingStatusPending is a ListingStatus enum value - ListingStatusPending = "pending" - - // ListingStatusCancelled is a ListingStatus enum value - ListingStatusCancelled = "cancelled" - - // ListingStatusClosed is a ListingStatus enum value - ListingStatusClosed = "closed" -) - -const ( - // MonitoringStateDisabled is a MonitoringState enum value - MonitoringStateDisabled = "disabled" - - // MonitoringStateDisabling is a MonitoringState enum value - MonitoringStateDisabling = "disabling" - - // MonitoringStateEnabled is a MonitoringState enum value - MonitoringStateEnabled = "enabled" - - // MonitoringStatePending is a MonitoringState enum value - MonitoringStatePending = "pending" -) - -const ( - // MoveStatusMovingToVpc is a MoveStatus enum value - MoveStatusMovingToVpc = "movingToVpc" - - // MoveStatusRestoringToClassic is a MoveStatus enum value - MoveStatusRestoringToClassic = "restoringToClassic" -) - -const ( - // NatGatewayStatePending is a NatGatewayState enum value - NatGatewayStatePending = "pending" - - // NatGatewayStateFailed is a NatGatewayState enum value - NatGatewayStateFailed = "failed" - - // NatGatewayStateAvailable is a NatGatewayState enum value - NatGatewayStateAvailable = "available" - - // NatGatewayStateDeleting is a NatGatewayState enum value - NatGatewayStateDeleting = "deleting" - - // NatGatewayStateDeleted is a NatGatewayState enum value - NatGatewayStateDeleted = "deleted" -) - -const ( - // NetworkInterfaceAttributeDescription is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeDescription = "description" - - // NetworkInterfaceAttributeGroupSet is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeGroupSet = "groupSet" - - // NetworkInterfaceAttributeSourceDestCheck is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeSourceDestCheck = "sourceDestCheck" - - // NetworkInterfaceAttributeAttachment is a NetworkInterfaceAttribute enum value - NetworkInterfaceAttributeAttachment = "attachment" -) - -const ( - // NetworkInterfaceStatusAvailable is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusAvailable = "available" - - // NetworkInterfaceStatusAttaching is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusAttaching = "attaching" - - // NetworkInterfaceStatusInUse is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusInUse = "in-use" - - // NetworkInterfaceStatusDetaching is a NetworkInterfaceStatus enum value - NetworkInterfaceStatusDetaching = "detaching" -) - -const ( - // NetworkInterfaceTypeInterface is a NetworkInterfaceType enum value - NetworkInterfaceTypeInterface = "interface" - - // NetworkInterfaceTypeNatGateway is a NetworkInterfaceType enum value - NetworkInterfaceTypeNatGateway = "natGateway" -) - -const ( - // OfferingClassTypeStandard is a OfferingClassType enum value - OfferingClassTypeStandard = "standard" - - // OfferingClassTypeConvertible is a OfferingClassType enum value - OfferingClassTypeConvertible = "convertible" -) - -const ( - // OfferingTypeValuesHeavyUtilization is a OfferingTypeValues enum value - OfferingTypeValuesHeavyUtilization = "Heavy Utilization" - - // OfferingTypeValuesMediumUtilization is a OfferingTypeValues enum value - OfferingTypeValuesMediumUtilization = "Medium Utilization" - - // OfferingTypeValuesLightUtilization is a OfferingTypeValues enum value - OfferingTypeValuesLightUtilization = "Light Utilization" - - // OfferingTypeValuesNoUpfront is a OfferingTypeValues enum value - OfferingTypeValuesNoUpfront = "No Upfront" - - // OfferingTypeValuesPartialUpfront is a OfferingTypeValues enum value - OfferingTypeValuesPartialUpfront = "Partial Upfront" - - // OfferingTypeValuesAllUpfront is a OfferingTypeValues enum value - OfferingTypeValuesAllUpfront = "All Upfront" -) - -const ( - // OperationTypeAdd is a OperationType enum value - OperationTypeAdd = "add" - - // OperationTypeRemove is a OperationType enum value - OperationTypeRemove = "remove" -) - -const ( - // PaymentOptionAllUpfront is a PaymentOption enum value - PaymentOptionAllUpfront = "AllUpfront" - - // PaymentOptionPartialUpfront is a PaymentOption enum value - PaymentOptionPartialUpfront = "PartialUpfront" - - // PaymentOptionNoUpfront is a PaymentOption enum value - PaymentOptionNoUpfront = "NoUpfront" -) - -const ( - // PermissionGroupAll is a PermissionGroup enum value - PermissionGroupAll = "all" -) - -const ( - // PlacementGroupStatePending is a PlacementGroupState enum value - PlacementGroupStatePending = "pending" - - // PlacementGroupStateAvailable is a PlacementGroupState enum value - PlacementGroupStateAvailable = "available" - - // PlacementGroupStateDeleting is a PlacementGroupState enum value - PlacementGroupStateDeleting = "deleting" - - // PlacementGroupStateDeleted is a PlacementGroupState enum value - PlacementGroupStateDeleted = "deleted" -) - -const ( - // PlacementStrategyCluster is a PlacementStrategy enum value - PlacementStrategyCluster = "cluster" -) - -const ( - // PlatformValuesWindows is a PlatformValues enum value - PlatformValuesWindows = "Windows" -) - -const ( - // ProductCodeValuesDevpay is a ProductCodeValues enum value - ProductCodeValuesDevpay = "devpay" - - // ProductCodeValuesMarketplace is a ProductCodeValues enum value - ProductCodeValuesMarketplace = "marketplace" -) - -const ( - // RIProductDescriptionLinuxUnix is a RIProductDescription enum value - RIProductDescriptionLinuxUnix = "Linux/UNIX" - - // RIProductDescriptionLinuxUnixamazonVpc is a RIProductDescription enum value - RIProductDescriptionLinuxUnixamazonVpc = "Linux/UNIX (Amazon VPC)" - - // RIProductDescriptionWindows is a RIProductDescription enum value - RIProductDescriptionWindows = "Windows" - - // RIProductDescriptionWindowsAmazonVpc is a RIProductDescription enum value - RIProductDescriptionWindowsAmazonVpc = "Windows (Amazon VPC)" -) - -const ( - // RecurringChargeFrequencyHourly is a RecurringChargeFrequency enum value - RecurringChargeFrequencyHourly = "Hourly" -) - -const ( - // ReportInstanceReasonCodesInstanceStuckInState is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesInstanceStuckInState = "instance-stuck-in-state" - - // ReportInstanceReasonCodesUnresponsive is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesUnresponsive = "unresponsive" - - // ReportInstanceReasonCodesNotAcceptingCredentials is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesNotAcceptingCredentials = "not-accepting-credentials" - - // ReportInstanceReasonCodesPasswordNotAvailable is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPasswordNotAvailable = "password-not-available" - - // ReportInstanceReasonCodesPerformanceNetwork is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceNetwork = "performance-network" - - // ReportInstanceReasonCodesPerformanceInstanceStore is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceInstanceStore = "performance-instance-store" - - // ReportInstanceReasonCodesPerformanceEbsVolume is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceEbsVolume = "performance-ebs-volume" - - // ReportInstanceReasonCodesPerformanceOther is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesPerformanceOther = "performance-other" - - // ReportInstanceReasonCodesOther is a ReportInstanceReasonCodes enum value - ReportInstanceReasonCodesOther = "other" -) - -const ( - // ReportStatusTypeOk is a ReportStatusType enum value - ReportStatusTypeOk = "ok" - - // ReportStatusTypeImpaired is a ReportStatusType enum value - ReportStatusTypeImpaired = "impaired" -) - -const ( - // ReservationStatePaymentPending is a ReservationState enum value - ReservationStatePaymentPending = "payment-pending" - - // ReservationStatePaymentFailed is a ReservationState enum value - ReservationStatePaymentFailed = "payment-failed" - - // ReservationStateActive is a ReservationState enum value - ReservationStateActive = "active" - - // ReservationStateRetired is a ReservationState enum value - ReservationStateRetired = "retired" -) - -const ( - // ReservedInstanceStatePaymentPending is a ReservedInstanceState enum value - ReservedInstanceStatePaymentPending = "payment-pending" - - // ReservedInstanceStateActive is a ReservedInstanceState enum value - ReservedInstanceStateActive = "active" - - // ReservedInstanceStatePaymentFailed is a ReservedInstanceState enum value - ReservedInstanceStatePaymentFailed = "payment-failed" - - // ReservedInstanceStateRetired is a ReservedInstanceState enum value - ReservedInstanceStateRetired = "retired" -) - -const ( - // ResetImageAttributeNameLaunchPermission is a ResetImageAttributeName enum value - ResetImageAttributeNameLaunchPermission = "launchPermission" -) - -const ( - // ResourceTypeCustomerGateway is a ResourceType enum value - ResourceTypeCustomerGateway = "customer-gateway" - - // ResourceTypeDhcpOptions is a ResourceType enum value - ResourceTypeDhcpOptions = "dhcp-options" - - // ResourceTypeImage is a ResourceType enum value - ResourceTypeImage = "image" - - // ResourceTypeInstance is a ResourceType enum value - ResourceTypeInstance = "instance" - - // ResourceTypeInternetGateway is a ResourceType enum value - ResourceTypeInternetGateway = "internet-gateway" - - // ResourceTypeNetworkAcl is a ResourceType enum value - ResourceTypeNetworkAcl = "network-acl" - - // ResourceTypeNetworkInterface is a ResourceType enum value - ResourceTypeNetworkInterface = "network-interface" - - // ResourceTypeReservedInstances is a ResourceType enum value - ResourceTypeReservedInstances = "reserved-instances" - - // ResourceTypeRouteTable is a ResourceType enum value - ResourceTypeRouteTable = "route-table" - - // ResourceTypeSnapshot is a ResourceType enum value - ResourceTypeSnapshot = "snapshot" - - // ResourceTypeSpotInstancesRequest is a ResourceType enum value - ResourceTypeSpotInstancesRequest = "spot-instances-request" - - // ResourceTypeSubnet is a ResourceType enum value - ResourceTypeSubnet = "subnet" - - // ResourceTypeSecurityGroup is a ResourceType enum value - ResourceTypeSecurityGroup = "security-group" - - // ResourceTypeVolume is a ResourceType enum value - ResourceTypeVolume = "volume" - - // ResourceTypeVpc is a ResourceType enum value - ResourceTypeVpc = "vpc" - - // ResourceTypeVpnConnection is a ResourceType enum value - ResourceTypeVpnConnection = "vpn-connection" - - // ResourceTypeVpnGateway is a ResourceType enum value - ResourceTypeVpnGateway = "vpn-gateway" -) - -const ( - // RouteOriginCreateRouteTable is a RouteOrigin enum value - RouteOriginCreateRouteTable = "CreateRouteTable" - - // RouteOriginCreateRoute is a RouteOrigin enum value - RouteOriginCreateRoute = "CreateRoute" - - // RouteOriginEnableVgwRoutePropagation is a RouteOrigin enum value - RouteOriginEnableVgwRoutePropagation = "EnableVgwRoutePropagation" -) - -const ( - // RouteStateActive is a RouteState enum value - RouteStateActive = "active" - - // RouteStateBlackhole is a RouteState enum value - RouteStateBlackhole = "blackhole" -) - -const ( - // RuleActionAllow is a RuleAction enum value - RuleActionAllow = "allow" - - // RuleActionDeny is a RuleAction enum value - RuleActionDeny = "deny" -) - -const ( - // ShutdownBehaviorStop is a ShutdownBehavior enum value - ShutdownBehaviorStop = "stop" - - // ShutdownBehaviorTerminate is a ShutdownBehavior enum value - ShutdownBehaviorTerminate = "terminate" -) - -const ( - // SnapshotAttributeNameProductCodes is a SnapshotAttributeName enum value - SnapshotAttributeNameProductCodes = "productCodes" - - // SnapshotAttributeNameCreateVolumePermission is a SnapshotAttributeName enum value - SnapshotAttributeNameCreateVolumePermission = "createVolumePermission" -) - -const ( - // SnapshotStatePending is a SnapshotState enum value - SnapshotStatePending = "pending" - - // SnapshotStateCompleted is a SnapshotState enum value - SnapshotStateCompleted = "completed" - - // SnapshotStateError is a SnapshotState enum value - SnapshotStateError = "error" -) - -const ( - // SpotInstanceStateOpen is a SpotInstanceState enum value - SpotInstanceStateOpen = "open" - - // SpotInstanceStateActive is a SpotInstanceState enum value - SpotInstanceStateActive = "active" - - // SpotInstanceStateClosed is a SpotInstanceState enum value - SpotInstanceStateClosed = "closed" - - // SpotInstanceStateCancelled is a SpotInstanceState enum value - SpotInstanceStateCancelled = "cancelled" - - // SpotInstanceStateFailed is a SpotInstanceState enum value - SpotInstanceStateFailed = "failed" -) - -const ( - // SpotInstanceTypeOneTime is a SpotInstanceType enum value - SpotInstanceTypeOneTime = "one-time" - - // SpotInstanceTypePersistent is a SpotInstanceType enum value - SpotInstanceTypePersistent = "persistent" -) - -const ( - // StatePending is a State enum value - StatePending = "Pending" - - // StateAvailable is a State enum value - StateAvailable = "Available" - - // StateDeleting is a State enum value - StateDeleting = "Deleting" - - // StateDeleted is a State enum value - StateDeleted = "Deleted" -) - -const ( - // StatusMoveInProgress is a Status enum value - StatusMoveInProgress = "MoveInProgress" - - // StatusInVpc is a Status enum value - StatusInVpc = "InVpc" - - // StatusInClassic is a Status enum value - StatusInClassic = "InClassic" -) - -const ( - // StatusNameReachability is a StatusName enum value - StatusNameReachability = "reachability" -) - -const ( - // StatusTypePassed is a StatusType enum value - StatusTypePassed = "passed" - - // StatusTypeFailed is a StatusType enum value - StatusTypeFailed = "failed" - - // StatusTypeInsufficientData is a StatusType enum value - StatusTypeInsufficientData = "insufficient-data" - - // StatusTypeInitializing is a StatusType enum value - StatusTypeInitializing = "initializing" -) - -const ( - // SubnetCidrBlockStateCodeAssociating is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeAssociating = "associating" - - // SubnetCidrBlockStateCodeAssociated is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeAssociated = "associated" - - // SubnetCidrBlockStateCodeDisassociating is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeDisassociating = "disassociating" - - // SubnetCidrBlockStateCodeDisassociated is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeDisassociated = "disassociated" - - // SubnetCidrBlockStateCodeFailing is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeFailing = "failing" - - // SubnetCidrBlockStateCodeFailed is a SubnetCidrBlockStateCode enum value - SubnetCidrBlockStateCodeFailed = "failed" -) - -const ( - // SubnetStatePending is a SubnetState enum value - SubnetStatePending = "pending" - - // SubnetStateAvailable is a SubnetState enum value - SubnetStateAvailable = "available" -) - -const ( - // SummaryStatusOk is a SummaryStatus enum value - SummaryStatusOk = "ok" - - // SummaryStatusImpaired is a SummaryStatus enum value - SummaryStatusImpaired = "impaired" - - // SummaryStatusInsufficientData is a SummaryStatus enum value - SummaryStatusInsufficientData = "insufficient-data" - - // SummaryStatusNotApplicable is a SummaryStatus enum value - SummaryStatusNotApplicable = "not-applicable" - - // SummaryStatusInitializing is a SummaryStatus enum value - SummaryStatusInitializing = "initializing" -) - -const ( - // TelemetryStatusUp is a TelemetryStatus enum value - TelemetryStatusUp = "UP" - - // TelemetryStatusDown is a TelemetryStatus enum value - TelemetryStatusDown = "DOWN" -) - -const ( - // TenancyDefault is a Tenancy enum value - TenancyDefault = "default" - - // TenancyDedicated is a Tenancy enum value - TenancyDedicated = "dedicated" - - // TenancyHost is a Tenancy enum value - TenancyHost = "host" -) - -const ( - // TrafficTypeAccept is a TrafficType enum value - TrafficTypeAccept = "ACCEPT" - - // TrafficTypeReject is a TrafficType enum value - TrafficTypeReject = "REJECT" - - // TrafficTypeAll is a TrafficType enum value - TrafficTypeAll = "ALL" -) - -const ( - // VirtualizationTypeHvm is a VirtualizationType enum value - VirtualizationTypeHvm = "hvm" - - // VirtualizationTypeParavirtual is a VirtualizationType enum value - VirtualizationTypeParavirtual = "paravirtual" -) - -const ( - // VolumeAttachmentStateAttaching is a VolumeAttachmentState enum value - VolumeAttachmentStateAttaching = "attaching" - - // VolumeAttachmentStateAttached is a VolumeAttachmentState enum value - VolumeAttachmentStateAttached = "attached" - - // VolumeAttachmentStateDetaching is a VolumeAttachmentState enum value - VolumeAttachmentStateDetaching = "detaching" - - // VolumeAttachmentStateDetached is a VolumeAttachmentState enum value - VolumeAttachmentStateDetached = "detached" -) - -const ( - // VolumeAttributeNameAutoEnableIo is a VolumeAttributeName enum value - VolumeAttributeNameAutoEnableIo = "autoEnableIO" - - // VolumeAttributeNameProductCodes is a VolumeAttributeName enum value - VolumeAttributeNameProductCodes = "productCodes" -) - -const ( - // VolumeModificationStateModifying is a VolumeModificationState enum value - VolumeModificationStateModifying = "modifying" - - // VolumeModificationStateOptimizing is a VolumeModificationState enum value - VolumeModificationStateOptimizing = "optimizing" - - // VolumeModificationStateCompleted is a VolumeModificationState enum value - VolumeModificationStateCompleted = "completed" - - // VolumeModificationStateFailed is a VolumeModificationState enum value - VolumeModificationStateFailed = "failed" -) - -const ( - // VolumeStateCreating is a VolumeState enum value - VolumeStateCreating = "creating" - - // VolumeStateAvailable is a VolumeState enum value - VolumeStateAvailable = "available" - - // VolumeStateInUse is a VolumeState enum value - VolumeStateInUse = "in-use" - - // VolumeStateDeleting is a VolumeState enum value - VolumeStateDeleting = "deleting" - - // VolumeStateDeleted is a VolumeState enum value - VolumeStateDeleted = "deleted" - - // VolumeStateError is a VolumeState enum value - VolumeStateError = "error" -) - -const ( - // VolumeStatusInfoStatusOk is a VolumeStatusInfoStatus enum value - VolumeStatusInfoStatusOk = "ok" - - // VolumeStatusInfoStatusImpaired is a VolumeStatusInfoStatus enum value - VolumeStatusInfoStatusImpaired = "impaired" - - // VolumeStatusInfoStatusInsufficientData is a VolumeStatusInfoStatus enum value - VolumeStatusInfoStatusInsufficientData = "insufficient-data" -) - -const ( - // VolumeStatusNameIoEnabled is a VolumeStatusName enum value - VolumeStatusNameIoEnabled = "io-enabled" - - // VolumeStatusNameIoPerformance is a VolumeStatusName enum value - VolumeStatusNameIoPerformance = "io-performance" -) - -const ( - // VolumeTypeStandard is a VolumeType enum value - VolumeTypeStandard = "standard" - - // VolumeTypeIo1 is a VolumeType enum value - VolumeTypeIo1 = "io1" - - // VolumeTypeGp2 is a VolumeType enum value - VolumeTypeGp2 = "gp2" - - // VolumeTypeSc1 is a VolumeType enum value - VolumeTypeSc1 = "sc1" - - // VolumeTypeSt1 is a VolumeType enum value - VolumeTypeSt1 = "st1" -) - -const ( - // VpcAttributeNameEnableDnsSupport is a VpcAttributeName enum value - VpcAttributeNameEnableDnsSupport = "enableDnsSupport" - - // VpcAttributeNameEnableDnsHostnames is a VpcAttributeName enum value - VpcAttributeNameEnableDnsHostnames = "enableDnsHostnames" -) - -const ( - // VpcCidrBlockStateCodeAssociating is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeAssociating = "associating" - - // VpcCidrBlockStateCodeAssociated is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeAssociated = "associated" - - // VpcCidrBlockStateCodeDisassociating is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeDisassociating = "disassociating" - - // VpcCidrBlockStateCodeDisassociated is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeDisassociated = "disassociated" - - // VpcCidrBlockStateCodeFailing is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeFailing = "failing" - - // VpcCidrBlockStateCodeFailed is a VpcCidrBlockStateCode enum value - VpcCidrBlockStateCodeFailed = "failed" -) - -const ( - // VpcPeeringConnectionStateReasonCodeInitiatingRequest is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeInitiatingRequest = "initiating-request" - - // VpcPeeringConnectionStateReasonCodePendingAcceptance is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodePendingAcceptance = "pending-acceptance" - - // VpcPeeringConnectionStateReasonCodeActive is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeActive = "active" - - // VpcPeeringConnectionStateReasonCodeDeleted is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeDeleted = "deleted" - - // VpcPeeringConnectionStateReasonCodeRejected is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeRejected = "rejected" - - // VpcPeeringConnectionStateReasonCodeFailed is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeFailed = "failed" - - // VpcPeeringConnectionStateReasonCodeExpired is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeExpired = "expired" - - // VpcPeeringConnectionStateReasonCodeProvisioning is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeProvisioning = "provisioning" - - // VpcPeeringConnectionStateReasonCodeDeleting is a VpcPeeringConnectionStateReasonCode enum value - VpcPeeringConnectionStateReasonCodeDeleting = "deleting" -) - -const ( - // VpcStatePending is a VpcState enum value - VpcStatePending = "pending" - - // VpcStateAvailable is a VpcState enum value - VpcStateAvailable = "available" -) - -const ( - // VpnStatePending is a VpnState enum value - VpnStatePending = "pending" - - // VpnStateAvailable is a VpnState enum value - VpnStateAvailable = "available" - - // VpnStateDeleting is a VpnState enum value - VpnStateDeleting = "deleting" - - // VpnStateDeleted is a VpnState enum value - VpnStateDeleted = "deleted" -) - -const ( - // VpnStaticRouteSourceStatic is a VpnStaticRouteSource enum value - VpnStaticRouteSourceStatic = "Static" -) - -const ( - // ScopeAvailabilityZone is a scope enum value - ScopeAvailabilityZone = "Availability Zone" - - // ScopeRegion is a scope enum value - ScopeRegion = "Region" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go deleted file mode 100644 index 36b69ff..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go +++ /dev/null @@ -1,67 +0,0 @@ -package ec2 - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" -) - -func init() { - initRequest = func(r *request.Request) { - if r.Operation.Name == opCopySnapshot { // fill the PresignedURL parameter - r.Handlers.Build.PushFront(fillPresignedURL) - } - } -} - -func fillPresignedURL(r *request.Request) { - if !r.ParamsFilled() { - return - } - - origParams := r.Params.(*CopySnapshotInput) - - // Stop if PresignedURL/DestinationRegion is set - if origParams.PresignedUrl != nil || origParams.DestinationRegion != nil { - return - } - - origParams.DestinationRegion = r.Config.Region - newParams := awsutil.CopyOf(r.Params).(*CopySnapshotInput) - - // Create a new request based on the existing request. We will use this to - // presign the CopySnapshot request against the source region. - cfg := r.Config.Copy(aws.NewConfig(). - WithEndpoint(""). - WithRegion(aws.StringValue(origParams.SourceRegion))) - - clientInfo := r.ClientInfo - resolved, err := r.Config.EndpointResolver.EndpointFor( - clientInfo.ServiceName, aws.StringValue(cfg.Region), - func(opt *endpoints.Options) { - opt.DisableSSL = aws.BoolValue(cfg.DisableSSL) - opt.UseDualStack = aws.BoolValue(cfg.UseDualStack) - }, - ) - if err != nil { - r.Error = err - return - } - - clientInfo.Endpoint = resolved.URL - clientInfo.SigningRegion = resolved.SigningRegion - - // Presign a CopySnapshot request with modified params - req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data) - url, err := req.Presign(5 * time.Minute) // 5 minutes should be enough. - if err != nil { // bubble error back up to original request - r.Error = err - return - } - - // We have our URL, set it on params - origParams.PresignedUrl = &url -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go deleted file mode 100644 index 195d9b5..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/customizations_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package ec2_test - -import ( - "io/ioutil" - "net/url" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/stretchr/testify/assert" -) - -func TestCopySnapshotPresignedURL(t *testing.T) { - svc := ec2.New(unit.Session, &aws.Config{Region: aws.String("us-west-2")}) - - assert.NotPanics(t, func() { - // Doesn't panic on nil input - req, _ := svc.CopySnapshotRequest(nil) - req.Sign() - }) - - req, _ := svc.CopySnapshotRequest(&ec2.CopySnapshotInput{ - SourceRegion: aws.String("us-west-1"), - SourceSnapshotId: aws.String("snap-id"), - }) - req.Sign() - - b, _ := ioutil.ReadAll(req.HTTPRequest.Body) - q, _ := url.ParseQuery(string(b)) - u, _ := url.QueryUnescape(q.Get("PresignedUrl")) - assert.Equal(t, "us-west-2", q.Get("DestinationRegion")) - assert.Equal(t, "us-west-1", q.Get("SourceRegion")) - assert.Regexp(t, `^https://ec2\.us-west-1\.amazonaws\.com/.+&DestinationRegion=us-west-2`, u) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go deleted file mode 100644 index 3d61d7e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/errors.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go deleted file mode 100644 index 05ad961..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/examples_test.go +++ /dev/null @@ -1,6932 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleEC2_AcceptReservedInstancesExchangeQuote() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AcceptReservedInstancesExchangeQuoteInput{ - ReservedInstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - TargetConfigurations: []*ec2.TargetConfigurationRequest{ - { // Required - OfferingId: aws.String("String"), // Required - InstanceCount: aws.Int64(1), - }, - // More values... - }, - } - resp, err := svc.AcceptReservedInstancesExchangeQuote(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AcceptVpcPeeringConnection() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AcceptVpcPeeringConnectionInput{ - DryRun: aws.Bool(true), - VpcPeeringConnectionId: aws.String("String"), - } - resp, err := svc.AcceptVpcPeeringConnection(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AllocateAddress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AllocateAddressInput{ - Domain: aws.String("DomainType"), - DryRun: aws.Bool(true), - } - resp, err := svc.AllocateAddress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AllocateHosts() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AllocateHostsInput{ - AvailabilityZone: aws.String("String"), // Required - InstanceType: aws.String("String"), // Required - Quantity: aws.Int64(1), // Required - AutoPlacement: aws.String("AutoPlacement"), - ClientToken: aws.String("String"), - } - resp, err := svc.AllocateHosts(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssignIpv6Addresses() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssignIpv6AddressesInput{ - NetworkInterfaceId: aws.String("String"), // Required - Ipv6AddressCount: aws.Int64(1), - Ipv6Addresses: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.AssignIpv6Addresses(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssignPrivateIpAddresses() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssignPrivateIpAddressesInput{ - NetworkInterfaceId: aws.String("String"), // Required - AllowReassignment: aws.Bool(true), - PrivateIpAddresses: []*string{ - aws.String("String"), // Required - // More values... - }, - SecondaryPrivateIpAddressCount: aws.Int64(1), - } - resp, err := svc.AssignPrivateIpAddresses(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssociateAddress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssociateAddressInput{ - AllocationId: aws.String("String"), - AllowReassociation: aws.Bool(true), - DryRun: aws.Bool(true), - InstanceId: aws.String("String"), - NetworkInterfaceId: aws.String("String"), - PrivateIpAddress: aws.String("String"), - PublicIp: aws.String("String"), - } - resp, err := svc.AssociateAddress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssociateDhcpOptions() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssociateDhcpOptionsInput{ - DhcpOptionsId: aws.String("String"), // Required - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.AssociateDhcpOptions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssociateIamInstanceProfile() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssociateIamInstanceProfileInput{ - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ // Required - Arn: aws.String("String"), - Name: aws.String("String"), - }, - InstanceId: aws.String("String"), // Required - } - resp, err := svc.AssociateIamInstanceProfile(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssociateRouteTable() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssociateRouteTableInput{ - RouteTableId: aws.String("String"), // Required - SubnetId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.AssociateRouteTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssociateSubnetCidrBlock() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssociateSubnetCidrBlockInput{ - Ipv6CidrBlock: aws.String("String"), // Required - SubnetId: aws.String("String"), // Required - } - resp, err := svc.AssociateSubnetCidrBlock(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AssociateVpcCidrBlock() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AssociateVpcCidrBlockInput{ - VpcId: aws.String("String"), // Required - AmazonProvidedIpv6CidrBlock: aws.Bool(true), - } - resp, err := svc.AssociateVpcCidrBlock(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AttachClassicLinkVpc() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AttachClassicLinkVpcInput{ - Groups: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - InstanceId: aws.String("String"), // Required - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.AttachClassicLinkVpc(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AttachInternetGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AttachInternetGatewayInput{ - InternetGatewayId: aws.String("String"), // Required - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.AttachInternetGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AttachNetworkInterface() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AttachNetworkInterfaceInput{ - DeviceIndex: aws.Int64(1), // Required - InstanceId: aws.String("String"), // Required - NetworkInterfaceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.AttachNetworkInterface(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AttachVolume() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AttachVolumeInput{ - Device: aws.String("String"), // Required - InstanceId: aws.String("String"), // Required - VolumeId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.AttachVolume(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AttachVpnGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AttachVpnGatewayInput{ - VpcId: aws.String("String"), // Required - VpnGatewayId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.AttachVpnGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AuthorizeSecurityGroupEgress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupId: aws.String("String"), // Required - CidrIp: aws.String("String"), - DryRun: aws.Bool(true), - FromPort: aws.Int64(1), - IpPermissions: []*ec2.IpPermission{ - { // Required - FromPort: aws.Int64(1), - IpProtocol: aws.String("String"), - IpRanges: []*ec2.IpRange{ - { // Required - CidrIp: aws.String("String"), - }, - // More values... - }, - Ipv6Ranges: []*ec2.Ipv6Range{ - { // Required - CidrIpv6: aws.String("String"), - }, - // More values... - }, - PrefixListIds: []*ec2.PrefixListId{ - { // Required - PrefixListId: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Int64(1), - UserIdGroupPairs: []*ec2.UserIdGroupPair{ - { // Required - GroupId: aws.String("String"), - GroupName: aws.String("String"), - PeeringStatus: aws.String("String"), - UserId: aws.String("String"), - VpcId: aws.String("String"), - VpcPeeringConnectionId: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IpProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerId: aws.String("String"), - ToPort: aws.Int64(1), - } - resp, err := svc.AuthorizeSecurityGroupEgress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_AuthorizeSecurityGroupIngress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.AuthorizeSecurityGroupIngressInput{ - CidrIp: aws.String("String"), - DryRun: aws.Bool(true), - FromPort: aws.Int64(1), - GroupId: aws.String("String"), - GroupName: aws.String("String"), - IpPermissions: []*ec2.IpPermission{ - { // Required - FromPort: aws.Int64(1), - IpProtocol: aws.String("String"), - IpRanges: []*ec2.IpRange{ - { // Required - CidrIp: aws.String("String"), - }, - // More values... - }, - Ipv6Ranges: []*ec2.Ipv6Range{ - { // Required - CidrIpv6: aws.String("String"), - }, - // More values... - }, - PrefixListIds: []*ec2.PrefixListId{ - { // Required - PrefixListId: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Int64(1), - UserIdGroupPairs: []*ec2.UserIdGroupPair{ - { // Required - GroupId: aws.String("String"), - GroupName: aws.String("String"), - PeeringStatus: aws.String("String"), - UserId: aws.String("String"), - VpcId: aws.String("String"), - VpcPeeringConnectionId: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IpProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerId: aws.String("String"), - ToPort: aws.Int64(1), - } - resp, err := svc.AuthorizeSecurityGroupIngress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_BundleInstance() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.BundleInstanceInput{ - InstanceId: aws.String("String"), // Required - Storage: &ec2.Storage{ // Required - S3: &ec2.S3Storage{ - AWSAccessKeyId: aws.String("String"), - Bucket: aws.String("String"), - Prefix: aws.String("String"), - UploadPolicy: []byte("PAYLOAD"), - UploadPolicySignature: aws.String("String"), - }, - }, - DryRun: aws.Bool(true), - } - resp, err := svc.BundleInstance(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CancelBundleTask() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CancelBundleTaskInput{ - BundleId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.CancelBundleTask(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CancelConversionTask() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CancelConversionTaskInput{ - ConversionTaskId: aws.String("String"), // Required - DryRun: aws.Bool(true), - ReasonMessage: aws.String("String"), - } - resp, err := svc.CancelConversionTask(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CancelExportTask() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CancelExportTaskInput{ - ExportTaskId: aws.String("String"), // Required - } - resp, err := svc.CancelExportTask(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CancelImportTask() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CancelImportTaskInput{ - CancelReason: aws.String("String"), - DryRun: aws.Bool(true), - ImportTaskId: aws.String("String"), - } - resp, err := svc.CancelImportTask(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CancelReservedInstancesListing() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CancelReservedInstancesListingInput{ - ReservedInstancesListingId: aws.String("String"), // Required - } - resp, err := svc.CancelReservedInstancesListing(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CancelSpotFleetRequests() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CancelSpotFleetRequestsInput{ - SpotFleetRequestIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - TerminateInstances: aws.Bool(true), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.CancelSpotFleetRequests(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CancelSpotInstanceRequests() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CancelSpotInstanceRequestsInput{ - SpotInstanceRequestIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.CancelSpotInstanceRequests(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ConfirmProductInstance() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ConfirmProductInstanceInput{ - InstanceId: aws.String("String"), // Required - ProductCode: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.ConfirmProductInstance(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CopyImage() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CopyImageInput{ - Name: aws.String("String"), // Required - SourceImageId: aws.String("String"), // Required - SourceRegion: aws.String("String"), // Required - ClientToken: aws.String("String"), - Description: aws.String("String"), - DryRun: aws.Bool(true), - Encrypted: aws.Bool(true), - KmsKeyId: aws.String("String"), - } - resp, err := svc.CopyImage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CopySnapshot() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CopySnapshotInput{ - SourceRegion: aws.String("String"), // Required - SourceSnapshotId: aws.String("String"), // Required - Description: aws.String("String"), - DestinationRegion: aws.String("String"), - DryRun: aws.Bool(true), - Encrypted: aws.Bool(true), - KmsKeyId: aws.String("String"), - PresignedUrl: aws.String("String"), - } - resp, err := svc.CopySnapshot(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateCustomerGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateCustomerGatewayInput{ - BgpAsn: aws.Int64(1), // Required - PublicIp: aws.String("String"), // Required - Type: aws.String("GatewayType"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.CreateCustomerGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateDhcpOptions() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateDhcpOptionsInput{ - DhcpConfigurations: []*ec2.NewDhcpConfiguration{ // Required - { // Required - Key: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.CreateDhcpOptions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateEgressOnlyInternetGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateEgressOnlyInternetGatewayInput{ - VpcId: aws.String("String"), // Required - ClientToken: aws.String("String"), - DryRun: aws.Bool(true), - } - resp, err := svc.CreateEgressOnlyInternetGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateFlowLogs() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateFlowLogsInput{ - DeliverLogsPermissionArn: aws.String("String"), // Required - LogGroupName: aws.String("String"), // Required - ResourceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - ResourceType: aws.String("FlowLogsResourceType"), // Required - TrafficType: aws.String("TrafficType"), // Required - ClientToken: aws.String("String"), - } - resp, err := svc.CreateFlowLogs(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateImage() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateImageInput{ - InstanceId: aws.String("String"), // Required - Name: aws.String("String"), // Required - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - { // Required - DeviceName: aws.String("String"), - Ebs: &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(true), - Encrypted: aws.Bool(true), - Iops: aws.Int64(1), - SnapshotId: aws.String("String"), - VolumeSize: aws.Int64(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - Description: aws.String("String"), - DryRun: aws.Bool(true), - NoReboot: aws.Bool(true), - } - resp, err := svc.CreateImage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateInstanceExportTask() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateInstanceExportTaskInput{ - InstanceId: aws.String("String"), // Required - Description: aws.String("String"), - ExportToS3Task: &ec2.ExportToS3TaskSpecification{ - ContainerFormat: aws.String("ContainerFormat"), - DiskImageFormat: aws.String("DiskImageFormat"), - S3Bucket: aws.String("String"), - S3Prefix: aws.String("String"), - }, - TargetEnvironment: aws.String("ExportEnvironment"), - } - resp, err := svc.CreateInstanceExportTask(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateInternetGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateInternetGatewayInput{ - DryRun: aws.Bool(true), - } - resp, err := svc.CreateInternetGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateKeyPair() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateKeyPairInput{ - KeyName: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.CreateKeyPair(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateNatGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateNatGatewayInput{ - AllocationId: aws.String("String"), // Required - SubnetId: aws.String("String"), // Required - ClientToken: aws.String("String"), - } - resp, err := svc.CreateNatGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateNetworkAcl() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateNetworkAclInput{ - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.CreateNetworkAcl(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateNetworkAclEntry() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateNetworkAclEntryInput{ - Egress: aws.Bool(true), // Required - NetworkAclId: aws.String("String"), // Required - Protocol: aws.String("String"), // Required - RuleAction: aws.String("RuleAction"), // Required - RuleNumber: aws.Int64(1), // Required - CidrBlock: aws.String("String"), - DryRun: aws.Bool(true), - IcmpTypeCode: &ec2.IcmpTypeCode{ - Code: aws.Int64(1), - Type: aws.Int64(1), - }, - Ipv6CidrBlock: aws.String("String"), - PortRange: &ec2.PortRange{ - From: aws.Int64(1), - To: aws.Int64(1), - }, - } - resp, err := svc.CreateNetworkAclEntry(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateNetworkInterface() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateNetworkInterfaceInput{ - SubnetId: aws.String("String"), // Required - Description: aws.String("String"), - DryRun: aws.Bool(true), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - Ipv6AddressCount: aws.Int64(1), - Ipv6Addresses: []*ec2.InstanceIpv6Address{ - { // Required - Ipv6Address: aws.String("String"), - }, - // More values... - }, - PrivateIpAddress: aws.String("String"), - PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ - { // Required - PrivateIpAddress: aws.String("String"), // Required - Primary: aws.Bool(true), - }, - // More values... - }, - SecondaryPrivateIpAddressCount: aws.Int64(1), - } - resp, err := svc.CreateNetworkInterface(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreatePlacementGroup() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreatePlacementGroupInput{ - GroupName: aws.String("String"), // Required - Strategy: aws.String("PlacementStrategy"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.CreatePlacementGroup(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateReservedInstancesListing() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateReservedInstancesListingInput{ - ClientToken: aws.String("String"), // Required - InstanceCount: aws.Int64(1), // Required - PriceSchedules: []*ec2.PriceScheduleSpecification{ // Required - { // Required - CurrencyCode: aws.String("CurrencyCodeValues"), - Price: aws.Float64(1.0), - Term: aws.Int64(1), - }, - // More values... - }, - ReservedInstancesId: aws.String("String"), // Required - } - resp, err := svc.CreateReservedInstancesListing(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateRoute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateRouteInput{ - RouteTableId: aws.String("String"), // Required - DestinationCidrBlock: aws.String("String"), - DestinationIpv6CidrBlock: aws.String("String"), - DryRun: aws.Bool(true), - EgressOnlyInternetGatewayId: aws.String("String"), - GatewayId: aws.String("String"), - InstanceId: aws.String("String"), - NatGatewayId: aws.String("String"), - NetworkInterfaceId: aws.String("String"), - VpcPeeringConnectionId: aws.String("String"), - } - resp, err := svc.CreateRoute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateRouteTable() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateRouteTableInput{ - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.CreateRouteTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateSecurityGroup() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateSecurityGroupInput{ - Description: aws.String("String"), // Required - GroupName: aws.String("String"), // Required - DryRun: aws.Bool(true), - VpcId: aws.String("String"), - } - resp, err := svc.CreateSecurityGroup(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateSnapshot() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateSnapshotInput{ - VolumeId: aws.String("String"), // Required - Description: aws.String("String"), - DryRun: aws.Bool(true), - } - resp, err := svc.CreateSnapshot(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateSpotDatafeedSubscription() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateSpotDatafeedSubscriptionInput{ - Bucket: aws.String("String"), // Required - DryRun: aws.Bool(true), - Prefix: aws.String("String"), - } - resp, err := svc.CreateSpotDatafeedSubscription(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateSubnet() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateSubnetInput{ - CidrBlock: aws.String("String"), // Required - VpcId: aws.String("String"), // Required - AvailabilityZone: aws.String("String"), - DryRun: aws.Bool(true), - Ipv6CidrBlock: aws.String("String"), - } - resp, err := svc.CreateSubnet(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateTags() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateTagsInput{ - Resources: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - Tags: []*ec2.Tag{ // Required - { // Required - Key: aws.String("String"), - Value: aws.String("String"), - }, - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.CreateTags(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateVolume() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateVolumeInput{ - AvailabilityZone: aws.String("String"), // Required - DryRun: aws.Bool(true), - Encrypted: aws.Bool(true), - Iops: aws.Int64(1), - KmsKeyId: aws.String("String"), - Size: aws.Int64(1), - SnapshotId: aws.String("String"), - TagSpecifications: []*ec2.TagSpecification{ - { // Required - ResourceType: aws.String("ResourceType"), - Tags: []*ec2.Tag{ - { // Required - Key: aws.String("String"), - Value: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - VolumeType: aws.String("VolumeType"), - } - resp, err := svc.CreateVolume(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateVpc() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateVpcInput{ - CidrBlock: aws.String("String"), // Required - AmazonProvidedIpv6CidrBlock: aws.Bool(true), - DryRun: aws.Bool(true), - InstanceTenancy: aws.String("Tenancy"), - } - resp, err := svc.CreateVpc(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateVpcEndpoint() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateVpcEndpointInput{ - ServiceName: aws.String("String"), // Required - VpcId: aws.String("String"), // Required - ClientToken: aws.String("String"), - DryRun: aws.Bool(true), - PolicyDocument: aws.String("String"), - RouteTableIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.CreateVpcEndpoint(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateVpcPeeringConnection() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateVpcPeeringConnectionInput{ - DryRun: aws.Bool(true), - PeerOwnerId: aws.String("String"), - PeerVpcId: aws.String("String"), - VpcId: aws.String("String"), - } - resp, err := svc.CreateVpcPeeringConnection(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateVpnConnection() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateVpnConnectionInput{ - CustomerGatewayId: aws.String("String"), // Required - Type: aws.String("String"), // Required - VpnGatewayId: aws.String("String"), // Required - DryRun: aws.Bool(true), - Options: &ec2.VpnConnectionOptionsSpecification{ - StaticRoutesOnly: aws.Bool(true), - }, - } - resp, err := svc.CreateVpnConnection(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateVpnConnectionRoute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateVpnConnectionRouteInput{ - DestinationCidrBlock: aws.String("String"), // Required - VpnConnectionId: aws.String("String"), // Required - } - resp, err := svc.CreateVpnConnectionRoute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_CreateVpnGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.CreateVpnGatewayInput{ - Type: aws.String("GatewayType"), // Required - AvailabilityZone: aws.String("String"), - DryRun: aws.Bool(true), - } - resp, err := svc.CreateVpnGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteCustomerGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteCustomerGatewayInput{ - CustomerGatewayId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteCustomerGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteDhcpOptions() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteDhcpOptionsInput{ - DhcpOptionsId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteDhcpOptions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteEgressOnlyInternetGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteEgressOnlyInternetGatewayInput{ - EgressOnlyInternetGatewayId: aws.String("EgressOnlyInternetGatewayId"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteEgressOnlyInternetGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteFlowLogs() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteFlowLogsInput{ - FlowLogIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DeleteFlowLogs(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteInternetGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteInternetGatewayInput{ - InternetGatewayId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteInternetGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteKeyPair() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteKeyPairInput{ - KeyName: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteKeyPair(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteNatGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteNatGatewayInput{ - NatGatewayId: aws.String("String"), // Required - } - resp, err := svc.DeleteNatGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteNetworkAcl() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteNetworkAclInput{ - NetworkAclId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteNetworkAcl(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteNetworkAclEntry() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteNetworkAclEntryInput{ - Egress: aws.Bool(true), // Required - NetworkAclId: aws.String("String"), // Required - RuleNumber: aws.Int64(1), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteNetworkAclEntry(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteNetworkInterface() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteNetworkInterfaceInput{ - NetworkInterfaceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteNetworkInterface(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeletePlacementGroup() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeletePlacementGroupInput{ - GroupName: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeletePlacementGroup(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteRoute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteRouteInput{ - RouteTableId: aws.String("String"), // Required - DestinationCidrBlock: aws.String("String"), - DestinationIpv6CidrBlock: aws.String("String"), - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteRoute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteRouteTable() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteRouteTableInput{ - RouteTableId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteRouteTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteSecurityGroup() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteSecurityGroupInput{ - DryRun: aws.Bool(true), - GroupId: aws.String("String"), - GroupName: aws.String("String"), - } - resp, err := svc.DeleteSecurityGroup(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteSnapshot() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteSnapshotInput{ - SnapshotId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteSnapshot(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteSpotDatafeedSubscription() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteSpotDatafeedSubscriptionInput{ - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteSpotDatafeedSubscription(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteSubnet() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteSubnetInput{ - SubnetId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteSubnet(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteTags() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteTagsInput{ - Resources: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - Tags: []*ec2.Tag{ - { // Required - Key: aws.String("String"), - Value: aws.String("String"), - }, - // More values... - }, - } - resp, err := svc.DeleteTags(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteVolume() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteVolumeInput{ - VolumeId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteVolume(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteVpc() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteVpcInput{ - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteVpc(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteVpcEndpoints() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteVpcEndpointsInput{ - VpcEndpointIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteVpcEndpoints(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteVpcPeeringConnection() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteVpcPeeringConnectionInput{ - VpcPeeringConnectionId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteVpcPeeringConnection(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteVpnConnection() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteVpnConnectionInput{ - VpnConnectionId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteVpnConnection(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteVpnConnectionRoute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteVpnConnectionRouteInput{ - DestinationCidrBlock: aws.String("String"), // Required - VpnConnectionId: aws.String("String"), // Required - } - resp, err := svc.DeleteVpnConnectionRoute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeleteVpnGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeleteVpnGatewayInput{ - VpnGatewayId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeleteVpnGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DeregisterImage() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DeregisterImageInput{ - ImageId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DeregisterImage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeAccountAttributes() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeAccountAttributesInput{ - AttributeNames: []*string{ - aws.String("AccountAttributeName"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeAccountAttributes(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeAddresses() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeAddressesInput{ - AllocationIds: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - PublicIps: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeAddresses(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeAvailabilityZones() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeAvailabilityZonesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ZoneNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeAvailabilityZones(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeBundleTasks() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeBundleTasksInput{ - BundleIds: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - } - resp, err := svc.DescribeBundleTasks(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeClassicLinkInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeClassicLinkInstancesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InstanceIds: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeClassicLinkInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeConversionTasks() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeConversionTasksInput{ - ConversionTaskIds: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeConversionTasks(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeCustomerGateways() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeCustomerGatewaysInput{ - CustomerGatewayIds: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - } - resp, err := svc.DescribeCustomerGateways(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeDhcpOptions() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeDhcpOptionsInput{ - DhcpOptionsIds: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - } - resp, err := svc.DescribeDhcpOptions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeEgressOnlyInternetGateways() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeEgressOnlyInternetGatewaysInput{ - DryRun: aws.Bool(true), - EgressOnlyInternetGatewayIds: []*string{ - aws.String("EgressOnlyInternetGatewayId"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeEgressOnlyInternetGateways(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeExportTasks() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeExportTasksInput{ - ExportTaskIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeExportTasks(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeFlowLogs() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeFlowLogsInput{ - Filter: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - FlowLogIds: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeFlowLogs(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeHostReservationOfferings() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeHostReservationOfferingsInput{ - Filter: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxDuration: aws.Int64(1), - MaxResults: aws.Int64(1), - MinDuration: aws.Int64(1), - NextToken: aws.String("String"), - OfferingId: aws.String("String"), - } - resp, err := svc.DescribeHostReservationOfferings(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeHostReservations() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeHostReservationsInput{ - Filter: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - HostReservationIdSet: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeHostReservations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeHosts() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeHostsInput{ - Filter: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - HostIds: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeHosts(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeIamInstanceProfileAssociations() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeIamInstanceProfileAssociationsInput{ - AssociationIds: []*string{ - aws.String("String"), // Required - // More values... - }, - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("NextToken"), - } - resp, err := svc.DescribeIamInstanceProfileAssociations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeIdFormat() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeIdFormatInput{ - Resource: aws.String("String"), - } - resp, err := svc.DescribeIdFormat(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeIdentityIdFormat() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeIdentityIdFormatInput{ - PrincipalArn: aws.String("String"), // Required - Resource: aws.String("String"), - } - resp, err := svc.DescribeIdentityIdFormat(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeImageAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeImageAttributeInput{ - Attribute: aws.String("ImageAttributeName"), // Required - ImageId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeImageAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeImages() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeImagesInput{ - DryRun: aws.Bool(true), - ExecutableUsers: []*string{ - aws.String("String"), // Required - // More values... - }, - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ImageIds: []*string{ - aws.String("String"), // Required - // More values... - }, - Owners: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeImages(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeImportImageTasks() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeImportImageTasksInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ImportTaskIds: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeImportImageTasks(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeImportSnapshotTasks() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeImportSnapshotTasksInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ImportTaskIds: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeImportSnapshotTasks(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeInstanceAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeInstanceAttributeInput{ - Attribute: aws.String("InstanceAttributeName"), // Required - InstanceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeInstanceAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeInstanceStatus() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeInstanceStatusInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - IncludeAllInstances: aws.Bool(true), - InstanceIds: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeInstanceStatus(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeInstancesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InstanceIds: []*string{ - aws.String("String"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeInternetGateways() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeInternetGatewaysInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InternetGatewayIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeInternetGateways(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeKeyPairs() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeKeyPairsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - KeyNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeKeyPairs(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeMovingAddresses() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeMovingAddressesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - PublicIps: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeMovingAddresses(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeNatGateways() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeNatGatewaysInput{ - Filter: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NatGatewayIds: []*string{ - aws.String("String"), // Required - // More values... - }, - NextToken: aws.String("String"), - } - resp, err := svc.DescribeNatGateways(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeNetworkAcls() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeNetworkAclsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - NetworkAclIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeNetworkAcls(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeNetworkInterfaceAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeNetworkInterfaceAttributeInput{ - NetworkInterfaceId: aws.String("String"), // Required - Attribute: aws.String("NetworkInterfaceAttribute"), - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeNetworkInterfaceAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeNetworkInterfaces() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeNetworkInterfacesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - NetworkInterfaceIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeNetworkInterfaces(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribePlacementGroups() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribePlacementGroupsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribePlacementGroups(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribePrefixLists() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribePrefixListsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - PrefixListIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribePrefixLists(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeRegions() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeRegionsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - RegionNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeRegions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeReservedInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeReservedInstancesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - OfferingClass: aws.String("OfferingClassType"), - OfferingType: aws.String("OfferingTypeValues"), - ReservedInstancesIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeReservedInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeReservedInstancesListings() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeReservedInstancesListingsInput{ - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - ReservedInstancesId: aws.String("String"), - ReservedInstancesListingId: aws.String("String"), - } - resp, err := svc.DescribeReservedInstancesListings(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeReservedInstancesModifications() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeReservedInstancesModificationsInput{ - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - NextToken: aws.String("String"), - ReservedInstancesModificationIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeReservedInstancesModifications(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeReservedInstancesOfferings() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeReservedInstancesOfferingsInput{ - AvailabilityZone: aws.String("String"), - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - IncludeMarketplace: aws.Bool(true), - InstanceTenancy: aws.String("Tenancy"), - InstanceType: aws.String("InstanceType"), - MaxDuration: aws.Int64(1), - MaxInstanceCount: aws.Int64(1), - MaxResults: aws.Int64(1), - MinDuration: aws.Int64(1), - NextToken: aws.String("String"), - OfferingClass: aws.String("OfferingClassType"), - OfferingType: aws.String("OfferingTypeValues"), - ProductDescription: aws.String("RIProductDescription"), - ReservedInstancesOfferingIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeReservedInstancesOfferings(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeRouteTables() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeRouteTablesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - RouteTableIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeRouteTables(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeScheduledInstanceAvailability() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeScheduledInstanceAvailabilityInput{ - FirstSlotStartTimeRange: &ec2.SlotDateTimeRangeRequest{ // Required - EarliestTime: aws.Time(time.Now()), // Required - LatestTime: aws.Time(time.Now()), // Required - }, - Recurrence: &ec2.ScheduledInstanceRecurrenceRequest{ // Required - Frequency: aws.String("String"), - Interval: aws.Int64(1), - OccurrenceDays: []*int64{ - aws.Int64(1), // Required - // More values... - }, - OccurrenceRelativeToEnd: aws.Bool(true), - OccurrenceUnit: aws.String("String"), - }, - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - MaxSlotDurationInHours: aws.Int64(1), - MinSlotDurationInHours: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeScheduledInstanceAvailability(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeScheduledInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeScheduledInstancesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - ScheduledInstanceIds: []*string{ - aws.String("String"), // Required - // More values... - }, - SlotStartTimeRange: &ec2.SlotStartTimeRangeRequest{ - EarliestTime: aws.Time(time.Now()), - LatestTime: aws.Time(time.Now()), - }, - } - resp, err := svc.DescribeScheduledInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSecurityGroupReferences() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSecurityGroupReferencesInput{ - GroupId: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeSecurityGroupReferences(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSecurityGroups() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSecurityGroupsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - GroupIds: []*string{ - aws.String("String"), // Required - // More values... - }, - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSecurityGroups(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSnapshotAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSnapshotAttributeInput{ - Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeSnapshotAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSnapshots() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSnapshotsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - OwnerIds: []*string{ - aws.String("String"), // Required - // More values... - }, - RestorableByUserIds: []*string{ - aws.String("String"), // Required - // More values... - }, - SnapshotIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSnapshots(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSpotDatafeedSubscription() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSpotDatafeedSubscriptionInput{ - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeSpotDatafeedSubscription(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSpotFleetInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSpotFleetInstancesInput{ - SpotFleetRequestId: aws.String("String"), // Required - DryRun: aws.Bool(true), - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeSpotFleetInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSpotFleetRequestHistory() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSpotFleetRequestHistoryInput{ - SpotFleetRequestId: aws.String("String"), // Required - StartTime: aws.Time(time.Now()), // Required - DryRun: aws.Bool(true), - EventType: aws.String("EventType"), - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeSpotFleetRequestHistory(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSpotFleetRequests() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSpotFleetRequestsInput{ - DryRun: aws.Bool(true), - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - SpotFleetRequestIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSpotFleetRequests(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSpotInstanceRequests() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSpotInstanceRequestsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - SpotInstanceRequestIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSpotInstanceRequests(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSpotPriceHistory() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSpotPriceHistoryInput{ - AvailabilityZone: aws.String("String"), - DryRun: aws.Bool(true), - EndTime: aws.Time(time.Now()), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - InstanceTypes: []*string{ - aws.String("InstanceType"), // Required - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - ProductDescriptions: []*string{ - aws.String("String"), // Required - // More values... - }, - StartTime: aws.Time(time.Now()), - } - resp, err := svc.DescribeSpotPriceHistory(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeStaleSecurityGroups() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeStaleSecurityGroupsInput{ - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - MaxResults: aws.Int64(1), - NextToken: aws.String("NextToken"), - } - resp, err := svc.DescribeStaleSecurityGroups(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeSubnets() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeSubnetsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - SubnetIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeSubnets(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeTags() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeTagsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeTags(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVolumeAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVolumeAttributeInput{ - VolumeId: aws.String("String"), // Required - Attribute: aws.String("VolumeAttributeName"), - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeVolumeAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVolumeStatus() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVolumeStatusInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - VolumeIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVolumeStatus(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVolumes() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVolumesInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - VolumeIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVolumes(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVolumesModifications() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVolumesModificationsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - VolumeIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVolumesModifications(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpcAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpcAttributeInput{ - Attribute: aws.String("VpcAttributeName"), // Required - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DescribeVpcAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpcClassicLink() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpcClassicLinkInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VpcIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVpcClassicLink(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpcClassicLinkDnsSupport() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpcClassicLinkDnsSupportInput{ - MaxResults: aws.Int64(1), - NextToken: aws.String("NextToken"), - VpcIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVpcClassicLinkDnsSupport(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpcEndpointServices() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpcEndpointServicesInput{ - DryRun: aws.Bool(true), - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - } - resp, err := svc.DescribeVpcEndpointServices(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpcEndpoints() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpcEndpointsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - MaxResults: aws.Int64(1), - NextToken: aws.String("String"), - VpcEndpointIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVpcEndpoints(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpcPeeringConnections() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpcPeeringConnectionsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VpcPeeringConnectionIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVpcPeeringConnections(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpcs() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpcsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VpcIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVpcs(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpnConnections() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpnConnectionsInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VpnConnectionIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVpnConnections(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DescribeVpnGateways() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DescribeVpnGatewaysInput{ - DryRun: aws.Bool(true), - Filters: []*ec2.Filter{ - { // Required - Name: aws.String("String"), - Values: []*string{ - aws.String("String"), // Required - // More values... - }, - }, - // More values... - }, - VpnGatewayIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.DescribeVpnGateways(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DetachClassicLinkVpc() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DetachClassicLinkVpcInput{ - InstanceId: aws.String("String"), // Required - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DetachClassicLinkVpc(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DetachInternetGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DetachInternetGatewayInput{ - InternetGatewayId: aws.String("String"), // Required - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DetachInternetGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DetachNetworkInterface() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DetachNetworkInterfaceInput{ - AttachmentId: aws.String("String"), // Required - DryRun: aws.Bool(true), - Force: aws.Bool(true), - } - resp, err := svc.DetachNetworkInterface(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DetachVolume() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DetachVolumeInput{ - VolumeId: aws.String("String"), // Required - Device: aws.String("String"), - DryRun: aws.Bool(true), - Force: aws.Bool(true), - InstanceId: aws.String("String"), - } - resp, err := svc.DetachVolume(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DetachVpnGateway() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DetachVpnGatewayInput{ - VpcId: aws.String("String"), // Required - VpnGatewayId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DetachVpnGateway(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisableVgwRoutePropagation() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisableVgwRoutePropagationInput{ - GatewayId: aws.String("String"), // Required - RouteTableId: aws.String("String"), // Required - } - resp, err := svc.DisableVgwRoutePropagation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisableVpcClassicLink() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisableVpcClassicLinkInput{ - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DisableVpcClassicLink(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisableVpcClassicLinkDnsSupport() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisableVpcClassicLinkDnsSupportInput{ - VpcId: aws.String("String"), - } - resp, err := svc.DisableVpcClassicLinkDnsSupport(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisassociateAddress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisassociateAddressInput{ - AssociationId: aws.String("String"), - DryRun: aws.Bool(true), - PublicIp: aws.String("String"), - } - resp, err := svc.DisassociateAddress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisassociateIamInstanceProfile() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisassociateIamInstanceProfileInput{ - AssociationId: aws.String("String"), // Required - } - resp, err := svc.DisassociateIamInstanceProfile(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisassociateRouteTable() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisassociateRouteTableInput{ - AssociationId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.DisassociateRouteTable(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisassociateSubnetCidrBlock() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisassociateSubnetCidrBlockInput{ - AssociationId: aws.String("String"), // Required - } - resp, err := svc.DisassociateSubnetCidrBlock(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_DisassociateVpcCidrBlock() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.DisassociateVpcCidrBlockInput{ - AssociationId: aws.String("String"), // Required - } - resp, err := svc.DisassociateVpcCidrBlock(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_EnableVgwRoutePropagation() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.EnableVgwRoutePropagationInput{ - GatewayId: aws.String("String"), // Required - RouteTableId: aws.String("String"), // Required - } - resp, err := svc.EnableVgwRoutePropagation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_EnableVolumeIO() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.EnableVolumeIOInput{ - VolumeId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.EnableVolumeIO(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_EnableVpcClassicLink() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.EnableVpcClassicLinkInput{ - VpcId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.EnableVpcClassicLink(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_EnableVpcClassicLinkDnsSupport() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.EnableVpcClassicLinkDnsSupportInput{ - VpcId: aws.String("String"), - } - resp, err := svc.EnableVpcClassicLinkDnsSupport(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_GetConsoleOutput() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.GetConsoleOutputInput{ - InstanceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.GetConsoleOutput(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_GetConsoleScreenshot() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.GetConsoleScreenshotInput{ - InstanceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - WakeUp: aws.Bool(true), - } - resp, err := svc.GetConsoleScreenshot(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_GetHostReservationPurchasePreview() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.GetHostReservationPurchasePreviewInput{ - HostIdSet: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - OfferingId: aws.String("String"), // Required - } - resp, err := svc.GetHostReservationPurchasePreview(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_GetPasswordData() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.GetPasswordDataInput{ - InstanceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.GetPasswordData(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_GetReservedInstancesExchangeQuote() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.GetReservedInstancesExchangeQuoteInput{ - ReservedInstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - TargetConfigurations: []*ec2.TargetConfigurationRequest{ - { // Required - OfferingId: aws.String("String"), // Required - InstanceCount: aws.Int64(1), - }, - // More values... - }, - } - resp, err := svc.GetReservedInstancesExchangeQuote(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ImportImage() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ImportImageInput{ - Architecture: aws.String("String"), - ClientData: &ec2.ClientData{ - Comment: aws.String("String"), - UploadEnd: aws.Time(time.Now()), - UploadSize: aws.Float64(1.0), - UploadStart: aws.Time(time.Now()), - }, - ClientToken: aws.String("String"), - Description: aws.String("String"), - DiskContainers: []*ec2.ImageDiskContainer{ - { // Required - Description: aws.String("String"), - DeviceName: aws.String("String"), - Format: aws.String("String"), - SnapshotId: aws.String("String"), - Url: aws.String("String"), - UserBucket: &ec2.UserBucket{ - S3Bucket: aws.String("String"), - S3Key: aws.String("String"), - }, - }, - // More values... - }, - DryRun: aws.Bool(true), - Hypervisor: aws.String("String"), - LicenseType: aws.String("String"), - Platform: aws.String("String"), - RoleName: aws.String("String"), - } - resp, err := svc.ImportImage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ImportInstance() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ImportInstanceInput{ - Platform: aws.String("PlatformValues"), // Required - Description: aws.String("String"), - DiskImages: []*ec2.DiskImage{ - { // Required - Description: aws.String("String"), - Image: &ec2.DiskImageDetail{ - Bytes: aws.Int64(1), // Required - Format: aws.String("DiskImageFormat"), // Required - ImportManifestUrl: aws.String("String"), // Required - }, - Volume: &ec2.VolumeDetail{ - Size: aws.Int64(1), // Required - }, - }, - // More values... - }, - DryRun: aws.Bool(true), - LaunchSpecification: &ec2.ImportInstanceLaunchSpecification{ - AdditionalInfo: aws.String("String"), - Architecture: aws.String("ArchitectureValues"), - GroupIds: []*string{ - aws.String("String"), // Required - // More values... - }, - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), - InstanceType: aws.String("InstanceType"), - Monitoring: aws.Bool(true), - Placement: &ec2.Placement{ - Affinity: aws.String("String"), - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - HostId: aws.String("String"), - Tenancy: aws.String("Tenancy"), - }, - PrivateIpAddress: aws.String("String"), - SubnetId: aws.String("String"), - UserData: &ec2.UserData{ - Data: aws.String("String"), - }, - }, - } - resp, err := svc.ImportInstance(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ImportKeyPair() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ImportKeyPairInput{ - KeyName: aws.String("String"), // Required - PublicKeyMaterial: []byte("PAYLOAD"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.ImportKeyPair(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ImportSnapshot() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ImportSnapshotInput{ - ClientData: &ec2.ClientData{ - Comment: aws.String("String"), - UploadEnd: aws.Time(time.Now()), - UploadSize: aws.Float64(1.0), - UploadStart: aws.Time(time.Now()), - }, - ClientToken: aws.String("String"), - Description: aws.String("String"), - DiskContainer: &ec2.SnapshotDiskContainer{ - Description: aws.String("String"), - Format: aws.String("String"), - Url: aws.String("String"), - UserBucket: &ec2.UserBucket{ - S3Bucket: aws.String("String"), - S3Key: aws.String("String"), - }, - }, - DryRun: aws.Bool(true), - RoleName: aws.String("String"), - } - resp, err := svc.ImportSnapshot(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ImportVolume() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ImportVolumeInput{ - AvailabilityZone: aws.String("String"), // Required - Image: &ec2.DiskImageDetail{ // Required - Bytes: aws.Int64(1), // Required - Format: aws.String("DiskImageFormat"), // Required - ImportManifestUrl: aws.String("String"), // Required - }, - Volume: &ec2.VolumeDetail{ // Required - Size: aws.Int64(1), // Required - }, - Description: aws.String("String"), - DryRun: aws.Bool(true), - } - resp, err := svc.ImportVolume(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyHosts() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyHostsInput{ - AutoPlacement: aws.String("AutoPlacement"), // Required - HostIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.ModifyHosts(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyIdFormat() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyIdFormatInput{ - Resource: aws.String("String"), // Required - UseLongIds: aws.Bool(true), // Required - } - resp, err := svc.ModifyIdFormat(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyIdentityIdFormat() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyIdentityIdFormatInput{ - PrincipalArn: aws.String("String"), // Required - Resource: aws.String("String"), // Required - UseLongIds: aws.Bool(true), // Required - } - resp, err := svc.ModifyIdentityIdFormat(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyImageAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyImageAttributeInput{ - ImageId: aws.String("String"), // Required - Attribute: aws.String("String"), - Description: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - DryRun: aws.Bool(true), - LaunchPermission: &ec2.LaunchPermissionModifications{ - Add: []*ec2.LaunchPermission{ - { // Required - Group: aws.String("PermissionGroup"), - UserId: aws.String("String"), - }, - // More values... - }, - Remove: []*ec2.LaunchPermission{ - { // Required - Group: aws.String("PermissionGroup"), - UserId: aws.String("String"), - }, - // More values... - }, - }, - OperationType: aws.String("OperationType"), - ProductCodes: []*string{ - aws.String("String"), // Required - // More values... - }, - UserGroups: []*string{ - aws.String("String"), // Required - // More values... - }, - UserIds: []*string{ - aws.String("String"), // Required - // More values... - }, - Value: aws.String("String"), - } - resp, err := svc.ModifyImageAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyInstanceAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyInstanceAttributeInput{ - InstanceId: aws.String("String"), // Required - Attribute: aws.String("InstanceAttributeName"), - BlockDeviceMappings: []*ec2.InstanceBlockDeviceMappingSpecification{ - { // Required - DeviceName: aws.String("String"), - Ebs: &ec2.EbsInstanceBlockDeviceSpecification{ - DeleteOnTermination: aws.Bool(true), - VolumeId: aws.String("String"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - DisableApiTermination: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - DryRun: aws.Bool(true), - EbsOptimized: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - EnaSupport: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - InstanceInitiatedShutdownBehavior: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - InstanceType: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - Kernel: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - Ramdisk: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - SourceDestCheck: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - SriovNetSupport: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - UserData: &ec2.BlobAttributeValue{ - Value: []byte("PAYLOAD"), - }, - Value: aws.String("String"), - } - resp, err := svc.ModifyInstanceAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyInstancePlacement() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyInstancePlacementInput{ - InstanceId: aws.String("String"), // Required - Affinity: aws.String("Affinity"), - HostId: aws.String("String"), - Tenancy: aws.String("HostTenancy"), - } - resp, err := svc.ModifyInstancePlacement(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyNetworkInterfaceAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyNetworkInterfaceAttributeInput{ - NetworkInterfaceId: aws.String("String"), // Required - Attachment: &ec2.NetworkInterfaceAttachmentChanges{ - AttachmentId: aws.String("String"), - DeleteOnTermination: aws.Bool(true), - }, - Description: &ec2.AttributeValue{ - Value: aws.String("String"), - }, - DryRun: aws.Bool(true), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - SourceDestCheck: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - } - resp, err := svc.ModifyNetworkInterfaceAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyReservedInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyReservedInstancesInput{ - ReservedInstancesIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - TargetConfigurations: []*ec2.ReservedInstancesConfiguration{ // Required - { // Required - AvailabilityZone: aws.String("String"), - InstanceCount: aws.Int64(1), - InstanceType: aws.String("InstanceType"), - Platform: aws.String("String"), - Scope: aws.String("scope"), - }, - // More values... - }, - ClientToken: aws.String("String"), - } - resp, err := svc.ModifyReservedInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifySnapshotAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifySnapshotAttributeInput{ - SnapshotId: aws.String("String"), // Required - Attribute: aws.String("SnapshotAttributeName"), - CreateVolumePermission: &ec2.CreateVolumePermissionModifications{ - Add: []*ec2.CreateVolumePermission{ - { // Required - Group: aws.String("PermissionGroup"), - UserId: aws.String("String"), - }, - // More values... - }, - Remove: []*ec2.CreateVolumePermission{ - { // Required - Group: aws.String("PermissionGroup"), - UserId: aws.String("String"), - }, - // More values... - }, - }, - DryRun: aws.Bool(true), - GroupNames: []*string{ - aws.String("String"), // Required - // More values... - }, - OperationType: aws.String("OperationType"), - UserIds: []*string{ - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.ModifySnapshotAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifySpotFleetRequest() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifySpotFleetRequestInput{ - SpotFleetRequestId: aws.String("String"), // Required - ExcessCapacityTerminationPolicy: aws.String("ExcessCapacityTerminationPolicy"), - TargetCapacity: aws.Int64(1), - } - resp, err := svc.ModifySpotFleetRequest(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifySubnetAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifySubnetAttributeInput{ - SubnetId: aws.String("String"), // Required - AssignIpv6AddressOnCreation: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - MapPublicIpOnLaunch: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - } - resp, err := svc.ModifySubnetAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyVolume() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyVolumeInput{ - VolumeId: aws.String("String"), // Required - DryRun: aws.Bool(true), - Iops: aws.Int64(1), - Size: aws.Int64(1), - VolumeType: aws.String("VolumeType"), - } - resp, err := svc.ModifyVolume(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyVolumeAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyVolumeAttributeInput{ - VolumeId: aws.String("String"), // Required - AutoEnableIO: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - DryRun: aws.Bool(true), - } - resp, err := svc.ModifyVolumeAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyVpcAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyVpcAttributeInput{ - VpcId: aws.String("String"), // Required - EnableDnsHostnames: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - EnableDnsSupport: &ec2.AttributeBooleanValue{ - Value: aws.Bool(true), - }, - } - resp, err := svc.ModifyVpcAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyVpcEndpoint() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyVpcEndpointInput{ - VpcEndpointId: aws.String("String"), // Required - AddRouteTableIds: []*string{ - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - PolicyDocument: aws.String("String"), - RemoveRouteTableIds: []*string{ - aws.String("String"), // Required - // More values... - }, - ResetPolicy: aws.Bool(true), - } - resp, err := svc.ModifyVpcEndpoint(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ModifyVpcPeeringConnectionOptions() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ModifyVpcPeeringConnectionOptionsInput{ - VpcPeeringConnectionId: aws.String("String"), // Required - AccepterPeeringConnectionOptions: &ec2.PeeringConnectionOptionsRequest{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(true), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(true), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(true), - }, - DryRun: aws.Bool(true), - RequesterPeeringConnectionOptions: &ec2.PeeringConnectionOptionsRequest{ - AllowDnsResolutionFromRemoteVpc: aws.Bool(true), - AllowEgressFromLocalClassicLinkToRemoteVpc: aws.Bool(true), - AllowEgressFromLocalVpcToRemoteClassicLink: aws.Bool(true), - }, - } - resp, err := svc.ModifyVpcPeeringConnectionOptions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_MonitorInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.MonitorInstancesInput{ - InstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.MonitorInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_MoveAddressToVpc() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.MoveAddressToVpcInput{ - PublicIp: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.MoveAddressToVpc(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_PurchaseHostReservation() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.PurchaseHostReservationInput{ - HostIdSet: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - OfferingId: aws.String("String"), // Required - ClientToken: aws.String("String"), - CurrencyCode: aws.String("CurrencyCodeValues"), - LimitPrice: aws.String("String"), - } - resp, err := svc.PurchaseHostReservation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_PurchaseReservedInstancesOffering() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.PurchaseReservedInstancesOfferingInput{ - InstanceCount: aws.Int64(1), // Required - ReservedInstancesOfferingId: aws.String("String"), // Required - DryRun: aws.Bool(true), - LimitPrice: &ec2.ReservedInstanceLimitPrice{ - Amount: aws.Float64(1.0), - CurrencyCode: aws.String("CurrencyCodeValues"), - }, - } - resp, err := svc.PurchaseReservedInstancesOffering(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_PurchaseScheduledInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.PurchaseScheduledInstancesInput{ - PurchaseRequests: []*ec2.PurchaseRequest{ // Required - { // Required - InstanceCount: aws.Int64(1), // Required - PurchaseToken: aws.String("String"), // Required - }, - // More values... - }, - ClientToken: aws.String("String"), - DryRun: aws.Bool(true), - } - resp, err := svc.PurchaseScheduledInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RebootInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RebootInstancesInput{ - InstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.RebootInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RegisterImage() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RegisterImageInput{ - Name: aws.String("String"), // Required - Architecture: aws.String("ArchitectureValues"), - BillingProducts: []*string{ - aws.String("String"), // Required - // More values... - }, - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - { // Required - DeviceName: aws.String("String"), - Ebs: &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(true), - Encrypted: aws.Bool(true), - Iops: aws.Int64(1), - SnapshotId: aws.String("String"), - VolumeSize: aws.Int64(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - Description: aws.String("String"), - DryRun: aws.Bool(true), - EnaSupport: aws.Bool(true), - ImageLocation: aws.String("String"), - KernelId: aws.String("String"), - RamdiskId: aws.String("String"), - RootDeviceName: aws.String("String"), - SriovNetSupport: aws.String("String"), - VirtualizationType: aws.String("String"), - } - resp, err := svc.RegisterImage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RejectVpcPeeringConnection() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RejectVpcPeeringConnectionInput{ - VpcPeeringConnectionId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.RejectVpcPeeringConnection(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReleaseAddress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReleaseAddressInput{ - AllocationId: aws.String("String"), - DryRun: aws.Bool(true), - PublicIp: aws.String("String"), - } - resp, err := svc.ReleaseAddress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReleaseHosts() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReleaseHostsInput{ - HostIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.ReleaseHosts(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReplaceIamInstanceProfileAssociation() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReplaceIamInstanceProfileAssociationInput{ - AssociationId: aws.String("String"), // Required - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ // Required - Arn: aws.String("String"), - Name: aws.String("String"), - }, - } - resp, err := svc.ReplaceIamInstanceProfileAssociation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReplaceNetworkAclAssociation() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReplaceNetworkAclAssociationInput{ - AssociationId: aws.String("String"), // Required - NetworkAclId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.ReplaceNetworkAclAssociation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReplaceNetworkAclEntry() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReplaceNetworkAclEntryInput{ - Egress: aws.Bool(true), // Required - NetworkAclId: aws.String("String"), // Required - Protocol: aws.String("String"), // Required - RuleAction: aws.String("RuleAction"), // Required - RuleNumber: aws.Int64(1), // Required - CidrBlock: aws.String("String"), - DryRun: aws.Bool(true), - IcmpTypeCode: &ec2.IcmpTypeCode{ - Code: aws.Int64(1), - Type: aws.Int64(1), - }, - Ipv6CidrBlock: aws.String("String"), - PortRange: &ec2.PortRange{ - From: aws.Int64(1), - To: aws.Int64(1), - }, - } - resp, err := svc.ReplaceNetworkAclEntry(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReplaceRoute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReplaceRouteInput{ - RouteTableId: aws.String("String"), // Required - DestinationCidrBlock: aws.String("String"), - DestinationIpv6CidrBlock: aws.String("String"), - DryRun: aws.Bool(true), - EgressOnlyInternetGatewayId: aws.String("String"), - GatewayId: aws.String("String"), - InstanceId: aws.String("String"), - NatGatewayId: aws.String("String"), - NetworkInterfaceId: aws.String("String"), - VpcPeeringConnectionId: aws.String("String"), - } - resp, err := svc.ReplaceRoute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReplaceRouteTableAssociation() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReplaceRouteTableAssociationInput{ - AssociationId: aws.String("String"), // Required - RouteTableId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.ReplaceRouteTableAssociation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ReportInstanceStatus() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ReportInstanceStatusInput{ - Instances: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - ReasonCodes: []*string{ // Required - aws.String("ReportInstanceReasonCodes"), // Required - // More values... - }, - Status: aws.String("ReportStatusType"), // Required - Description: aws.String("String"), - DryRun: aws.Bool(true), - EndTime: aws.Time(time.Now()), - StartTime: aws.Time(time.Now()), - } - resp, err := svc.ReportInstanceStatus(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RequestSpotFleet() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RequestSpotFleetInput{ - SpotFleetRequestConfig: &ec2.SpotFleetRequestConfigData{ // Required - IamFleetRole: aws.String("String"), // Required - LaunchSpecifications: []*ec2.SpotFleetLaunchSpecification{ // Required - { // Required - AddressingType: aws.String("String"), - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - { // Required - DeviceName: aws.String("String"), - Ebs: &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(true), - Encrypted: aws.Bool(true), - Iops: aws.Int64(1), - SnapshotId: aws.String("String"), - VolumeSize: aws.Int64(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - EbsOptimized: aws.Bool(true), - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ - Arn: aws.String("String"), - Name: aws.String("String"), - }, - ImageId: aws.String("String"), - InstanceType: aws.String("InstanceType"), - KernelId: aws.String("String"), - KeyName: aws.String("String"), - Monitoring: &ec2.SpotFleetMonitoring{ - Enabled: aws.Bool(true), - }, - NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - { // Required - AssociatePublicIpAddress: aws.Bool(true), - DeleteOnTermination: aws.Bool(true), - Description: aws.String("String"), - DeviceIndex: aws.Int64(1), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - Ipv6AddressCount: aws.Int64(1), - Ipv6Addresses: []*ec2.InstanceIpv6Address{ - { // Required - Ipv6Address: aws.String("String"), - }, - // More values... - }, - NetworkInterfaceId: aws.String("String"), - PrivateIpAddress: aws.String("String"), - PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ - { // Required - PrivateIpAddress: aws.String("String"), // Required - Primary: aws.Bool(true), - }, - // More values... - }, - SecondaryPrivateIpAddressCount: aws.Int64(1), - SubnetId: aws.String("String"), - }, - // More values... - }, - Placement: &ec2.SpotPlacement{ - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - Tenancy: aws.String("Tenancy"), - }, - RamdiskId: aws.String("String"), - SecurityGroups: []*ec2.GroupIdentifier{ - { // Required - GroupId: aws.String("String"), - GroupName: aws.String("String"), - }, - // More values... - }, - SpotPrice: aws.String("String"), - SubnetId: aws.String("String"), - UserData: aws.String("String"), - WeightedCapacity: aws.Float64(1.0), - }, - // More values... - }, - SpotPrice: aws.String("String"), // Required - TargetCapacity: aws.Int64(1), // Required - AllocationStrategy: aws.String("AllocationStrategy"), - ClientToken: aws.String("String"), - ExcessCapacityTerminationPolicy: aws.String("ExcessCapacityTerminationPolicy"), - FulfilledCapacity: aws.Float64(1.0), - ReplaceUnhealthyInstances: aws.Bool(true), - TerminateInstancesWithExpiration: aws.Bool(true), - Type: aws.String("FleetType"), - ValidFrom: aws.Time(time.Now()), - ValidUntil: aws.Time(time.Now()), - }, - DryRun: aws.Bool(true), - } - resp, err := svc.RequestSpotFleet(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RequestSpotInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RequestSpotInstancesInput{ - SpotPrice: aws.String("String"), // Required - AvailabilityZoneGroup: aws.String("String"), - BlockDurationMinutes: aws.Int64(1), - ClientToken: aws.String("String"), - DryRun: aws.Bool(true), - InstanceCount: aws.Int64(1), - LaunchGroup: aws.String("String"), - LaunchSpecification: &ec2.RequestSpotLaunchSpecification{ - AddressingType: aws.String("String"), - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - { // Required - DeviceName: aws.String("String"), - Ebs: &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(true), - Encrypted: aws.Bool(true), - Iops: aws.Int64(1), - SnapshotId: aws.String("String"), - VolumeSize: aws.Int64(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - EbsOptimized: aws.Bool(true), - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ - Arn: aws.String("String"), - Name: aws.String("String"), - }, - ImageId: aws.String("String"), - InstanceType: aws.String("InstanceType"), - KernelId: aws.String("String"), - KeyName: aws.String("String"), - Monitoring: &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Bool(true), // Required - }, - NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - { // Required - AssociatePublicIpAddress: aws.Bool(true), - DeleteOnTermination: aws.Bool(true), - Description: aws.String("String"), - DeviceIndex: aws.Int64(1), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - Ipv6AddressCount: aws.Int64(1), - Ipv6Addresses: []*ec2.InstanceIpv6Address{ - { // Required - Ipv6Address: aws.String("String"), - }, - // More values... - }, - NetworkInterfaceId: aws.String("String"), - PrivateIpAddress: aws.String("String"), - PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ - { // Required - PrivateIpAddress: aws.String("String"), // Required - Primary: aws.Bool(true), - }, - // More values... - }, - SecondaryPrivateIpAddressCount: aws.Int64(1), - SubnetId: aws.String("String"), - }, - // More values... - }, - Placement: &ec2.SpotPlacement{ - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - Tenancy: aws.String("Tenancy"), - }, - RamdiskId: aws.String("String"), - SecurityGroupIds: []*string{ - aws.String("String"), // Required - // More values... - }, - SecurityGroups: []*string{ - aws.String("String"), // Required - // More values... - }, - SubnetId: aws.String("String"), - UserData: aws.String("String"), - }, - Type: aws.String("SpotInstanceType"), - ValidFrom: aws.Time(time.Now()), - ValidUntil: aws.Time(time.Now()), - } - resp, err := svc.RequestSpotInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ResetImageAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ResetImageAttributeInput{ - Attribute: aws.String("ResetImageAttributeName"), // Required - ImageId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.ResetImageAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ResetInstanceAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ResetInstanceAttributeInput{ - Attribute: aws.String("InstanceAttributeName"), // Required - InstanceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.ResetInstanceAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ResetNetworkInterfaceAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ResetNetworkInterfaceAttributeInput{ - NetworkInterfaceId: aws.String("String"), // Required - DryRun: aws.Bool(true), - SourceDestCheck: aws.String("String"), - } - resp, err := svc.ResetNetworkInterfaceAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_ResetSnapshotAttribute() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.ResetSnapshotAttributeInput{ - Attribute: aws.String("SnapshotAttributeName"), // Required - SnapshotId: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.ResetSnapshotAttribute(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RestoreAddressToClassic() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RestoreAddressToClassicInput{ - PublicIp: aws.String("String"), // Required - DryRun: aws.Bool(true), - } - resp, err := svc.RestoreAddressToClassic(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RevokeSecurityGroupEgress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RevokeSecurityGroupEgressInput{ - GroupId: aws.String("String"), // Required - CidrIp: aws.String("String"), - DryRun: aws.Bool(true), - FromPort: aws.Int64(1), - IpPermissions: []*ec2.IpPermission{ - { // Required - FromPort: aws.Int64(1), - IpProtocol: aws.String("String"), - IpRanges: []*ec2.IpRange{ - { // Required - CidrIp: aws.String("String"), - }, - // More values... - }, - Ipv6Ranges: []*ec2.Ipv6Range{ - { // Required - CidrIpv6: aws.String("String"), - }, - // More values... - }, - PrefixListIds: []*ec2.PrefixListId{ - { // Required - PrefixListId: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Int64(1), - UserIdGroupPairs: []*ec2.UserIdGroupPair{ - { // Required - GroupId: aws.String("String"), - GroupName: aws.String("String"), - PeeringStatus: aws.String("String"), - UserId: aws.String("String"), - VpcId: aws.String("String"), - VpcPeeringConnectionId: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IpProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerId: aws.String("String"), - ToPort: aws.Int64(1), - } - resp, err := svc.RevokeSecurityGroupEgress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RevokeSecurityGroupIngress() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RevokeSecurityGroupIngressInput{ - CidrIp: aws.String("String"), - DryRun: aws.Bool(true), - FromPort: aws.Int64(1), - GroupId: aws.String("String"), - GroupName: aws.String("String"), - IpPermissions: []*ec2.IpPermission{ - { // Required - FromPort: aws.Int64(1), - IpProtocol: aws.String("String"), - IpRanges: []*ec2.IpRange{ - { // Required - CidrIp: aws.String("String"), - }, - // More values... - }, - Ipv6Ranges: []*ec2.Ipv6Range{ - { // Required - CidrIpv6: aws.String("String"), - }, - // More values... - }, - PrefixListIds: []*ec2.PrefixListId{ - { // Required - PrefixListId: aws.String("String"), - }, - // More values... - }, - ToPort: aws.Int64(1), - UserIdGroupPairs: []*ec2.UserIdGroupPair{ - { // Required - GroupId: aws.String("String"), - GroupName: aws.String("String"), - PeeringStatus: aws.String("String"), - UserId: aws.String("String"), - VpcId: aws.String("String"), - VpcPeeringConnectionId: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - IpProtocol: aws.String("String"), - SourceSecurityGroupName: aws.String("String"), - SourceSecurityGroupOwnerId: aws.String("String"), - ToPort: aws.Int64(1), - } - resp, err := svc.RevokeSecurityGroupIngress(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RunInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RunInstancesInput{ - ImageId: aws.String("String"), // Required - MaxCount: aws.Int64(1), // Required - MinCount: aws.Int64(1), // Required - AdditionalInfo: aws.String("String"), - BlockDeviceMappings: []*ec2.BlockDeviceMapping{ - { // Required - DeviceName: aws.String("String"), - Ebs: &ec2.EbsBlockDevice{ - DeleteOnTermination: aws.Bool(true), - Encrypted: aws.Bool(true), - Iops: aws.Int64(1), - SnapshotId: aws.String("String"), - VolumeSize: aws.Int64(1), - VolumeType: aws.String("VolumeType"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - ClientToken: aws.String("String"), - DisableApiTermination: aws.Bool(true), - DryRun: aws.Bool(true), - EbsOptimized: aws.Bool(true), - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ - Arn: aws.String("String"), - Name: aws.String("String"), - }, - InstanceInitiatedShutdownBehavior: aws.String("ShutdownBehavior"), - InstanceType: aws.String("InstanceType"), - Ipv6AddressCount: aws.Int64(1), - Ipv6Addresses: []*ec2.InstanceIpv6Address{ - { // Required - Ipv6Address: aws.String("String"), - }, - // More values... - }, - KernelId: aws.String("String"), - KeyName: aws.String("String"), - Monitoring: &ec2.RunInstancesMonitoringEnabled{ - Enabled: aws.Bool(true), // Required - }, - NetworkInterfaces: []*ec2.InstanceNetworkInterfaceSpecification{ - { // Required - AssociatePublicIpAddress: aws.Bool(true), - DeleteOnTermination: aws.Bool(true), - Description: aws.String("String"), - DeviceIndex: aws.Int64(1), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - Ipv6AddressCount: aws.Int64(1), - Ipv6Addresses: []*ec2.InstanceIpv6Address{ - { // Required - Ipv6Address: aws.String("String"), - }, - // More values... - }, - NetworkInterfaceId: aws.String("String"), - PrivateIpAddress: aws.String("String"), - PrivateIpAddresses: []*ec2.PrivateIpAddressSpecification{ - { // Required - PrivateIpAddress: aws.String("String"), // Required - Primary: aws.Bool(true), - }, - // More values... - }, - SecondaryPrivateIpAddressCount: aws.Int64(1), - SubnetId: aws.String("String"), - }, - // More values... - }, - Placement: &ec2.Placement{ - Affinity: aws.String("String"), - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - HostId: aws.String("String"), - Tenancy: aws.String("Tenancy"), - }, - PrivateIpAddress: aws.String("String"), - RamdiskId: aws.String("String"), - SecurityGroupIds: []*string{ - aws.String("String"), // Required - // More values... - }, - SecurityGroups: []*string{ - aws.String("String"), // Required - // More values... - }, - SubnetId: aws.String("String"), - TagSpecifications: []*ec2.TagSpecification{ - { // Required - ResourceType: aws.String("ResourceType"), - Tags: []*ec2.Tag{ - { // Required - Key: aws.String("String"), - Value: aws.String("String"), - }, - // More values... - }, - }, - // More values... - }, - UserData: aws.String("String"), - } - resp, err := svc.RunInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_RunScheduledInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.RunScheduledInstancesInput{ - LaunchSpecification: &ec2.ScheduledInstancesLaunchSpecification{ // Required - ImageId: aws.String("String"), // Required - BlockDeviceMappings: []*ec2.ScheduledInstancesBlockDeviceMapping{ - { // Required - DeviceName: aws.String("String"), - Ebs: &ec2.ScheduledInstancesEbs{ - DeleteOnTermination: aws.Bool(true), - Encrypted: aws.Bool(true), - Iops: aws.Int64(1), - SnapshotId: aws.String("String"), - VolumeSize: aws.Int64(1), - VolumeType: aws.String("String"), - }, - NoDevice: aws.String("String"), - VirtualName: aws.String("String"), - }, - // More values... - }, - EbsOptimized: aws.Bool(true), - IamInstanceProfile: &ec2.ScheduledInstancesIamInstanceProfile{ - Arn: aws.String("String"), - Name: aws.String("String"), - }, - InstanceType: aws.String("String"), - KernelId: aws.String("String"), - KeyName: aws.String("String"), - Monitoring: &ec2.ScheduledInstancesMonitoring{ - Enabled: aws.Bool(true), - }, - NetworkInterfaces: []*ec2.ScheduledInstancesNetworkInterface{ - { // Required - AssociatePublicIpAddress: aws.Bool(true), - DeleteOnTermination: aws.Bool(true), - Description: aws.String("String"), - DeviceIndex: aws.Int64(1), - Groups: []*string{ - aws.String("String"), // Required - // More values... - }, - Ipv6AddressCount: aws.Int64(1), - Ipv6Addresses: []*ec2.ScheduledInstancesIpv6Address{ - { // Required - Ipv6Address: aws.String("Ipv6Address"), - }, - // More values... - }, - NetworkInterfaceId: aws.String("String"), - PrivateIpAddress: aws.String("String"), - PrivateIpAddressConfigs: []*ec2.ScheduledInstancesPrivateIpAddressConfig{ - { // Required - Primary: aws.Bool(true), - PrivateIpAddress: aws.String("String"), - }, - // More values... - }, - SecondaryPrivateIpAddressCount: aws.Int64(1), - SubnetId: aws.String("String"), - }, - // More values... - }, - Placement: &ec2.ScheduledInstancesPlacement{ - AvailabilityZone: aws.String("String"), - GroupName: aws.String("String"), - }, - RamdiskId: aws.String("String"), - SecurityGroupIds: []*string{ - aws.String("String"), // Required - // More values... - }, - SubnetId: aws.String("String"), - UserData: aws.String("String"), - }, - ScheduledInstanceId: aws.String("String"), // Required - ClientToken: aws.String("String"), - DryRun: aws.Bool(true), - InstanceCount: aws.Int64(1), - } - resp, err := svc.RunScheduledInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_StartInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.StartInstancesInput{ - InstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - AdditionalInfo: aws.String("String"), - DryRun: aws.Bool(true), - } - resp, err := svc.StartInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_StopInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.StopInstancesInput{ - InstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - Force: aws.Bool(true), - } - resp, err := svc.StopInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_TerminateInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.TerminateInstancesInput{ - InstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.TerminateInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_UnassignIpv6Addresses() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.UnassignIpv6AddressesInput{ - Ipv6Addresses: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - NetworkInterfaceId: aws.String("String"), // Required - } - resp, err := svc.UnassignIpv6Addresses(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_UnassignPrivateIpAddresses() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.UnassignPrivateIpAddressesInput{ - NetworkInterfaceId: aws.String("String"), // Required - PrivateIpAddresses: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.UnassignPrivateIpAddresses(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleEC2_UnmonitorInstances() { - sess := session.Must(session.NewSession()) - - svc := ec2.New(sess) - - params := &ec2.UnmonitorInstancesInput{ - InstanceIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - DryRun: aws.Bool(true), - } - resp, err := svc.UnmonitorInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go deleted file mode 100644 index e042205..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2 - -import ( - "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/private/protocol/ec2query" -) - -// Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity -// in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your -// need to invest in hardware up front, so you can develop and deploy applications -// faster. -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15 -type EC2 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ec2" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the EC2 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: -// // Create a EC2 client from just a session. -// svc := ec2.New(mySession) -// -// // Create a EC2 client with additional configuration -// svc := ec2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2 { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EC2 { - svc := &EC2{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2016-11-15", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(ec2query.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a EC2 operation and runs any -// custom request initialization. -func (c *EC2) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go deleted file mode 100644 index c0a655f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go +++ /dev/null @@ -1,1616 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ec2 - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilBundleTaskComplete uses the Amazon EC2 API operation -// DescribeBundleTasks to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error { - return c.WaitUntilBundleTaskCompleteWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilBundleTaskCompleteWithContext is an extended version of WaitUntilBundleTaskComplete. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilBundleTaskCompleteWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilBundleTaskComplete", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "BundleTasks[].State", - Expected: "complete", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "BundleTasks[].State", - Expected: "failed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeBundleTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeBundleTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilConversionTaskCancelled uses the Amazon EC2 API operation -// DescribeConversionTasks to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error { - return c.WaitUntilConversionTaskCancelledWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilConversionTaskCancelledWithContext is an extended version of WaitUntilConversionTaskCancelled. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilConversionTaskCancelledWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilConversionTaskCancelled", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "cancelled", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeConversionTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeConversionTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilConversionTaskCompleted uses the Amazon EC2 API operation -// DescribeConversionTasks to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error { - return c.WaitUntilConversionTaskCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilConversionTaskCompletedWithContext is an extended version of WaitUntilConversionTaskCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilConversionTaskCompletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilConversionTaskCompleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "completed", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "cancelled", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "cancelling", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeConversionTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeConversionTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilConversionTaskDeleted uses the Amazon EC2 API operation -// DescribeConversionTasks to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error { - return c.WaitUntilConversionTaskDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilConversionTaskDeletedWithContext is an extended version of WaitUntilConversionTaskDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilConversionTaskDeletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilConversionTaskDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeConversionTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeConversionTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilCustomerGatewayAvailable uses the Amazon EC2 API operation -// DescribeCustomerGateways to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error { - return c.WaitUntilCustomerGatewayAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilCustomerGatewayAvailableWithContext is an extended version of WaitUntilCustomerGatewayAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilCustomerGatewayAvailableWithContext(ctx aws.Context, input *DescribeCustomerGatewaysInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilCustomerGatewayAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "CustomerGateways[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", - Expected: "deleted", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", - Expected: "deleting", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeCustomerGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeCustomerGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilExportTaskCancelled uses the Amazon EC2 API operation -// DescribeExportTasks to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error { - return c.WaitUntilExportTaskCancelledWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilExportTaskCancelledWithContext is an extended version of WaitUntilExportTaskCancelled. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilExportTaskCancelledWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilExportTaskCancelled", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", - Expected: "cancelled", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeExportTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeExportTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilExportTaskCompleted uses the Amazon EC2 API operation -// DescribeExportTasks to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error { - return c.WaitUntilExportTaskCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilExportTaskCompletedWithContext is an extended version of WaitUntilExportTaskCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilExportTaskCompletedWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilExportTaskCompleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", - Expected: "completed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeExportTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeExportTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilImageAvailable uses the Amazon EC2 API operation -// DescribeImages to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error { - return c.WaitUntilImageAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilImageAvailableWithContext is an extended version of WaitUntilImageAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilImageAvailableWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilImageAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Images[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Images[].State", - Expected: "failed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeImagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeImagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilImageExists uses the Amazon EC2 API operation -// DescribeImages to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilImageExists(input *DescribeImagesInput) error { - return c.WaitUntilImageExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilImageExistsWithContext is an extended version of WaitUntilImageExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilImageExistsWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilImageExists", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(Images[]) > `0`", - Expected: true, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidAMIID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeImagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeImagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceExists uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceExistsWithContext is an extended version of WaitUntilInstanceExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilInstanceExistsWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceExists", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(Reservations[]) > `0`", - Expected: true, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidInstanceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceRunning uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceRunningWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceRunningWithContext is an extended version of WaitUntilInstanceRunning. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilInstanceRunningWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceRunning", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "running", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "shutting-down", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "stopping", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidInstanceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceStatusOk uses the Amazon EC2 API operation -// DescribeInstanceStatus to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error { - return c.WaitUntilInstanceStatusOkWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceStatusOkWithContext is an extended version of WaitUntilInstanceStatusOk. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilInstanceStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceStatusOk", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].InstanceStatus.Status", - Expected: "ok", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidInstanceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstanceStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstanceStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceStopped uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceStoppedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceStoppedWithContext is an extended version of WaitUntilInstanceStopped. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilInstanceStoppedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceStopped", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "stopped", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "pending", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilInstanceTerminated uses the Amazon EC2 API operation -// DescribeInstances to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { - return c.WaitUntilInstanceTerminatedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilInstanceTerminatedWithContext is an extended version of WaitUntilInstanceTerminated. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilInstanceTerminatedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilInstanceTerminated", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "terminated", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "pending", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", - Expected: "stopping", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilKeyPairExists uses the Amazon EC2 API operation -// DescribeKeyPairs to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error { - return c.WaitUntilKeyPairExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilKeyPairExistsWithContext is an extended version of WaitUntilKeyPairExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilKeyPairExistsWithContext(ctx aws.Context, input *DescribeKeyPairsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilKeyPairExists", - MaxAttempts: 6, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(KeyPairs[].KeyName) > `0`", - Expected: true, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidKeyPair.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeKeyPairsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeKeyPairsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilNatGatewayAvailable uses the Amazon EC2 API operation -// DescribeNatGateways to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilNatGatewayAvailable(input *DescribeNatGatewaysInput) error { - return c.WaitUntilNatGatewayAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilNatGatewayAvailableWithContext is an extended version of WaitUntilNatGatewayAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilNatGatewayAvailableWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilNatGatewayAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "NatGateways[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", - Expected: "failed", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", - Expected: "deleting", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", - Expected: "deleted", - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "NatGatewayNotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeNatGatewaysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeNatGatewaysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilNetworkInterfaceAvailable uses the Amazon EC2 API operation -// DescribeNetworkInterfaces to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error { - return c.WaitUntilNetworkInterfaceAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilNetworkInterfaceAvailableWithContext is an extended version of WaitUntilNetworkInterfaceAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilNetworkInterfaceAvailableWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilNetworkInterfaceAvailable", - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(20 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "NetworkInterfaces[].Status", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidNetworkInterfaceID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeNetworkInterfacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeNetworkInterfacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilPasswordDataAvailable uses the Amazon EC2 API operation -// GetPasswordData to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error { - return c.WaitUntilPasswordDataAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilPasswordDataAvailableWithContext is an extended version of WaitUntilPasswordDataAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilPasswordDataAvailableWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilPasswordDataAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "length(PasswordData) > `0`", - Expected: true, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetPasswordDataInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetPasswordDataRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSnapshotCompleted uses the Amazon EC2 API operation -// DescribeSnapshots to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error { - return c.WaitUntilSnapshotCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSnapshotCompletedWithContext is an extended version of WaitUntilSnapshotCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilSnapshotCompletedWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSnapshotCompleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Snapshots[].State", - Expected: "completed", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSpotInstanceRequestFulfilled uses the Amazon EC2 API operation -// DescribeSpotInstanceRequests to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error { - return c.WaitUntilSpotInstanceRequestFulfilledWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSpotInstanceRequestFulfilledWithContext is an extended version of WaitUntilSpotInstanceRequestFulfilled. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilSpotInstanceRequestFulfilledWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSpotInstanceRequestFulfilled", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "fulfilled", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "schedule-expired", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "canceled-before-fulfillment", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "bad-parameters", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", - Expected: "system-error", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeSpotInstanceRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSubnetAvailable uses the Amazon EC2 API operation -// DescribeSubnets to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error { - return c.WaitUntilSubnetAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSubnetAvailableWithContext is an extended version of WaitUntilSubnetAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilSubnetAvailableWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSubnetAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Subnets[].State", - Expected: "available", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeSubnetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSubnetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilSystemStatusOk uses the Amazon EC2 API operation -// DescribeInstanceStatus to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error { - return c.WaitUntilSystemStatusOkWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilSystemStatusOkWithContext is an extended version of WaitUntilSystemStatusOk. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilSystemStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilSystemStatusOk", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].SystemStatus.Status", - Expected: "ok", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeInstanceStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeInstanceStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVolumeAvailable uses the Amazon EC2 API operation -// DescribeVolumes to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error { - return c.WaitUntilVolumeAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVolumeAvailableWithContext is an extended version of WaitUntilVolumeAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVolumeAvailableWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVolumeAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVolumeDeleted uses the Amazon EC2 API operation -// DescribeVolumes to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error { - return c.WaitUntilVolumeDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVolumeDeletedWithContext is an extended version of WaitUntilVolumeDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVolumeDeletedWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVolumeDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", - Expected: "deleted", - }, - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVolume.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVolumeInUse uses the Amazon EC2 API operation -// DescribeVolumes to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error { - return c.WaitUntilVolumeInUseWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVolumeInUseWithContext is an extended version of WaitUntilVolumeInUse. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVolumeInUseWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVolumeInUse", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", - Expected: "in-use", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVolumesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVolumesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcAvailable uses the Amazon EC2 API operation -// DescribeVpcs to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error { - return c.WaitUntilVpcAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcAvailableWithContext is an extended version of WaitUntilVpcAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVpcAvailableWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "Vpcs[].State", - Expected: "available", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcExists uses the Amazon EC2 API operation -// DescribeVpcs to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVpcExists(input *DescribeVpcsInput) error { - return c.WaitUntilVpcExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcExistsWithContext is an extended version of WaitUntilVpcExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVpcExistsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcExists", - MaxAttempts: 5, - Delay: request.ConstantWaiterDelay(1 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVpcID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcPeeringConnectionDeleted uses the Amazon EC2 API operation -// DescribeVpcPeeringConnections to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVpcPeeringConnectionDeleted(input *DescribeVpcPeeringConnectionsInput) error { - return c.WaitUntilVpcPeeringConnectionDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcPeeringConnectionDeletedWithContext is an extended version of WaitUntilVpcPeeringConnectionDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVpcPeeringConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcPeeringConnectionDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "VpcPeeringConnections[].Status.Code", - Expected: "deleted", - }, - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVpcPeeringConnectionID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcPeeringConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpcPeeringConnectionExists uses the Amazon EC2 API operation -// DescribeVpcPeeringConnections to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVpcPeeringConnectionExists(input *DescribeVpcPeeringConnectionsInput) error { - return c.WaitUntilVpcPeeringConnectionExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpcPeeringConnectionExistsWithContext is an extended version of WaitUntilVpcPeeringConnectionExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVpcPeeringConnectionExistsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpcPeeringConnectionExists", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.RetryWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "InvalidVpcPeeringConnectionID.NotFound", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpcPeeringConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpnConnectionAvailable uses the Amazon EC2 API operation -// DescribeVpnConnections to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error { - return c.WaitUntilVpnConnectionAvailableWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpnConnectionAvailableWithContext is an extended version of WaitUntilVpnConnectionAvailable. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVpnConnectionAvailableWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpnConnectionAvailable", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", - Expected: "available", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", - Expected: "deleting", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", - Expected: "deleted", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpnConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpnConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVpnConnectionDeleted uses the Amazon EC2 API operation -// DescribeVpnConnections to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error { - return c.WaitUntilVpnConnectionDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVpnConnectionDeletedWithContext is an extended version of WaitUntilVpnConnectionDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *EC2) WaitUntilVpnConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVpnConnectionDeleted", - MaxAttempts: 40, - Delay: request.ConstantWaiterDelay(15 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", - Expected: "deleted", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", - Expected: "pending", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeVpnConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpnConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go deleted file mode 100644 index a4c0d3f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go +++ /dev/null @@ -1,8022 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package elastictranscoder provides a client for Amazon Elastic Transcoder. -package elastictranscoder - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opCancelJob = "CancelJob" - -// CancelJobRequest generates a "aws/request.Request" representing the -// client's request for the CancelJob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CancelJob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CancelJob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CancelJobRequest method. -// req, resp := client.CancelJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) CancelJobRequest(input *CancelJobInput) (req *request.Request, output *CancelJobOutput) { - op := &request.Operation{ - Name: opCancelJob, - HTTPMethod: "DELETE", - HTTPPath: "/2012-09-25/jobs/{Id}", - } - - if input == nil { - input = &CancelJobInput{} - } - - output = &CancelJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelJob API operation for Amazon Elastic Transcoder. -// -// The CancelJob operation cancels an unfinished job. -// -// You can only cancel a job that has a status of Submitted. To prevent a pipeline -// from starting to process a job while you're getting the job identifier, use -// UpdatePipelineStatus to temporarily pause the pipeline. -// -// 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 Amazon Elastic Transcoder's -// API operation CancelJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource you are attempting to change is in use. For example, you are -// attempting to delete a pipeline that is currently in use. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) CancelJob(input *CancelJobInput) (*CancelJobOutput, error) { - req, out := c.CancelJobRequest(input) - return out, req.Send() -} - -// CancelJobWithContext is the same as CancelJob with the addition of -// the ability to pass a context and additional request options. -// -// See CancelJob 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 *ElasticTranscoder) CancelJobWithContext(ctx aws.Context, input *CancelJobInput, opts ...request.Option) (*CancelJobOutput, error) { - req, out := c.CancelJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateJob = "CreateJob" - -// CreateJobRequest generates a "aws/request.Request" representing the -// client's request for the CreateJob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateJob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateJob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateJobRequest method. -// req, resp := client.CreateJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) CreateJobRequest(input *CreateJobInput) (req *request.Request, output *CreateJobResponse) { - op := &request.Operation{ - Name: opCreateJob, - HTTPMethod: "POST", - HTTPPath: "/2012-09-25/jobs", - } - - if input == nil { - input = &CreateJobInput{} - } - - output = &CreateJobResponse{} - req = c.newRequest(op, input, output) - return -} - -// CreateJob API operation for Amazon Elastic Transcoder. -// -// When you create a job, Elastic Transcoder returns JSON data that includes -// the values that you specified plus information about the job that is created. -// -// If you have specified more than one output for your jobs (for example, one -// output for the Kindle Fire and another output for the Apple iPhone 4s), you -// currently must use the Elastic Transcoder API to list the jobs (as opposed -// to the AWS Console). -// -// 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 Amazon Elastic Transcoder's -// API operation CreateJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Too many operations for a given AWS account. For example, the number of pipelines -// exceeds the maximum allowed. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) CreateJob(input *CreateJobInput) (*CreateJobResponse, error) { - req, out := c.CreateJobRequest(input) - return out, req.Send() -} - -// CreateJobWithContext is the same as CreateJob with the addition of -// the ability to pass a context and additional request options. -// -// See CreateJob 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 *ElasticTranscoder) CreateJobWithContext(ctx aws.Context, input *CreateJobInput, opts ...request.Option) (*CreateJobResponse, error) { - req, out := c.CreateJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePipeline = "CreatePipeline" - -// CreatePipelineRequest generates a "aws/request.Request" representing the -// client's request for the CreatePipeline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePipeline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePipeline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePipelineRequest method. -// req, resp := client.CreatePipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) CreatePipelineRequest(input *CreatePipelineInput) (req *request.Request, output *CreatePipelineOutput) { - op := &request.Operation{ - Name: opCreatePipeline, - HTTPMethod: "POST", - HTTPPath: "/2012-09-25/pipelines", - } - - if input == nil { - input = &CreatePipelineInput{} - } - - output = &CreatePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePipeline API operation for Amazon Elastic Transcoder. -// -// The CreatePipeline operation creates a pipeline with settings that you specify. -// -// 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 Amazon Elastic Transcoder's -// API operation CreatePipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Too many operations for a given AWS account. For example, the number of pipelines -// exceeds the maximum allowed. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) CreatePipeline(input *CreatePipelineInput) (*CreatePipelineOutput, error) { - req, out := c.CreatePipelineRequest(input) - return out, req.Send() -} - -// CreatePipelineWithContext is the same as CreatePipeline with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePipeline 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 *ElasticTranscoder) CreatePipelineWithContext(ctx aws.Context, input *CreatePipelineInput, opts ...request.Option) (*CreatePipelineOutput, error) { - req, out := c.CreatePipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePreset = "CreatePreset" - -// CreatePresetRequest generates a "aws/request.Request" representing the -// client's request for the CreatePreset operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreatePreset for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreatePreset method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreatePresetRequest method. -// req, resp := client.CreatePresetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) CreatePresetRequest(input *CreatePresetInput) (req *request.Request, output *CreatePresetOutput) { - op := &request.Operation{ - Name: opCreatePreset, - HTTPMethod: "POST", - HTTPPath: "/2012-09-25/presets", - } - - if input == nil { - input = &CreatePresetInput{} - } - - output = &CreatePresetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePreset API operation for Amazon Elastic Transcoder. -// -// The CreatePreset operation creates a preset with settings that you specify. -// -// Elastic Transcoder checks the CreatePreset settings to ensure that they meet -// Elastic Transcoder requirements and to determine whether they comply with -// H.264 standards. If your settings are not valid for Elastic Transcoder, Elastic -// Transcoder returns an HTTP 400 response (ValidationException) and does not -// create the preset. If the settings are valid for Elastic Transcoder but aren't -// strictly compliant with the H.264 standard, Elastic Transcoder creates the -// preset and returns a warning message in the response. This helps you determine -// whether your settings comply with the H.264 standard while giving you greater -// flexibility with respect to the video that Elastic Transcoder produces. -// -// Elastic Transcoder uses the H.264 video-compression format. For more information, -// see the International Telecommunication Union publication Recommendation -// ITU-T H.264: Advanced video coding for generic audiovisual services. -// -// 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 Amazon Elastic Transcoder's -// API operation CreatePreset for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// Too many operations for a given AWS account. For example, the number of pipelines -// exceeds the maximum allowed. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) CreatePreset(input *CreatePresetInput) (*CreatePresetOutput, error) { - req, out := c.CreatePresetRequest(input) - return out, req.Send() -} - -// CreatePresetWithContext is the same as CreatePreset with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePreset 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 *ElasticTranscoder) CreatePresetWithContext(ctx aws.Context, input *CreatePresetInput, opts ...request.Option) (*CreatePresetOutput, error) { - req, out := c.CreatePresetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePipeline = "DeletePipeline" - -// DeletePipelineRequest generates a "aws/request.Request" representing the -// client's request for the DeletePipeline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePipeline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePipeline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePipelineRequest method. -// req, resp := client.DeletePipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) DeletePipelineRequest(input *DeletePipelineInput) (req *request.Request, output *DeletePipelineOutput) { - op := &request.Operation{ - Name: opDeletePipeline, - HTTPMethod: "DELETE", - HTTPPath: "/2012-09-25/pipelines/{Id}", - } - - if input == nil { - input = &DeletePipelineInput{} - } - - output = &DeletePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeletePipeline API operation for Amazon Elastic Transcoder. -// -// The DeletePipeline operation removes a pipeline. -// -// You can only delete a pipeline that has never been used or that is not currently -// in use (doesn't contain any active jobs). If the pipeline is currently in -// use, DeletePipeline returns an error. -// -// 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 Amazon Elastic Transcoder's -// API operation DeletePipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource you are attempting to change is in use. For example, you are -// attempting to delete a pipeline that is currently in use. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) DeletePipeline(input *DeletePipelineInput) (*DeletePipelineOutput, error) { - req, out := c.DeletePipelineRequest(input) - return out, req.Send() -} - -// DeletePipelineWithContext is the same as DeletePipeline with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePipeline 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 *ElasticTranscoder) DeletePipelineWithContext(ctx aws.Context, input *DeletePipelineInput, opts ...request.Option) (*DeletePipelineOutput, error) { - req, out := c.DeletePipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePreset = "DeletePreset" - -// DeletePresetRequest generates a "aws/request.Request" representing the -// client's request for the DeletePreset operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeletePreset for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeletePreset method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeletePresetRequest method. -// req, resp := client.DeletePresetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) DeletePresetRequest(input *DeletePresetInput) (req *request.Request, output *DeletePresetOutput) { - op := &request.Operation{ - Name: opDeletePreset, - HTTPMethod: "DELETE", - HTTPPath: "/2012-09-25/presets/{Id}", - } - - if input == nil { - input = &DeletePresetInput{} - } - - output = &DeletePresetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeletePreset API operation for Amazon Elastic Transcoder. -// -// The DeletePreset operation removes a preset that you've added in an AWS region. -// -// You can't delete the default presets that are included with Elastic Transcoder. -// -// 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 Amazon Elastic Transcoder's -// API operation DeletePreset for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) DeletePreset(input *DeletePresetInput) (*DeletePresetOutput, error) { - req, out := c.DeletePresetRequest(input) - return out, req.Send() -} - -// DeletePresetWithContext is the same as DeletePreset with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePreset 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 *ElasticTranscoder) DeletePresetWithContext(ctx aws.Context, input *DeletePresetInput, opts ...request.Option) (*DeletePresetOutput, error) { - req, out := c.DeletePresetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListJobsByPipeline = "ListJobsByPipeline" - -// ListJobsByPipelineRequest generates a "aws/request.Request" representing the -// client's request for the ListJobsByPipeline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListJobsByPipeline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListJobsByPipeline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListJobsByPipelineRequest method. -// req, resp := client.ListJobsByPipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) ListJobsByPipelineRequest(input *ListJobsByPipelineInput) (req *request.Request, output *ListJobsByPipelineOutput) { - op := &request.Operation{ - Name: opListJobsByPipeline, - HTTPMethod: "GET", - HTTPPath: "/2012-09-25/jobsByPipeline/{PipelineId}", - Paginator: &request.Paginator{ - InputTokens: []string{"PageToken"}, - OutputTokens: []string{"NextPageToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListJobsByPipelineInput{} - } - - output = &ListJobsByPipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListJobsByPipeline API operation for Amazon Elastic Transcoder. -// -// The ListJobsByPipeline operation gets a list of the jobs currently in a pipeline. -// -// Elastic Transcoder returns all of the jobs currently in the specified pipeline. -// The response body contains one element for each job that satisfies the search -// criteria. -// -// 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 Amazon Elastic Transcoder's -// API operation ListJobsByPipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) ListJobsByPipeline(input *ListJobsByPipelineInput) (*ListJobsByPipelineOutput, error) { - req, out := c.ListJobsByPipelineRequest(input) - return out, req.Send() -} - -// ListJobsByPipelineWithContext is the same as ListJobsByPipeline with the addition of -// the ability to pass a context and additional request options. -// -// See ListJobsByPipeline 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 *ElasticTranscoder) ListJobsByPipelineWithContext(ctx aws.Context, input *ListJobsByPipelineInput, opts ...request.Option) (*ListJobsByPipelineOutput, error) { - req, out := c.ListJobsByPipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListJobsByPipelinePages iterates over the pages of a ListJobsByPipeline operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobsByPipeline method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListJobsByPipeline operation. -// pageNum := 0 -// err := client.ListJobsByPipelinePages(params, -// func(page *ListJobsByPipelineOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticTranscoder) ListJobsByPipelinePages(input *ListJobsByPipelineInput, fn func(*ListJobsByPipelineOutput, bool) bool) error { - return c.ListJobsByPipelinePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsByPipelinePagesWithContext same as ListJobsByPipelinePages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ElasticTranscoder) ListJobsByPipelinePagesWithContext(ctx aws.Context, input *ListJobsByPipelineInput, fn func(*ListJobsByPipelineOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListJobsByPipelineInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListJobsByPipelineRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsByPipelineOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListJobsByStatus = "ListJobsByStatus" - -// ListJobsByStatusRequest generates a "aws/request.Request" representing the -// client's request for the ListJobsByStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListJobsByStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListJobsByStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListJobsByStatusRequest method. -// req, resp := client.ListJobsByStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) ListJobsByStatusRequest(input *ListJobsByStatusInput) (req *request.Request, output *ListJobsByStatusOutput) { - op := &request.Operation{ - Name: opListJobsByStatus, - HTTPMethod: "GET", - HTTPPath: "/2012-09-25/jobsByStatus/{Status}", - Paginator: &request.Paginator{ - InputTokens: []string{"PageToken"}, - OutputTokens: []string{"NextPageToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListJobsByStatusInput{} - } - - output = &ListJobsByStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListJobsByStatus API operation for Amazon Elastic Transcoder. -// -// The ListJobsByStatus operation gets a list of jobs that have a specified -// status. The response body contains one element for each job that satisfies -// the search criteria. -// -// 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 Amazon Elastic Transcoder's -// API operation ListJobsByStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) ListJobsByStatus(input *ListJobsByStatusInput) (*ListJobsByStatusOutput, error) { - req, out := c.ListJobsByStatusRequest(input) - return out, req.Send() -} - -// ListJobsByStatusWithContext is the same as ListJobsByStatus with the addition of -// the ability to pass a context and additional request options. -// -// See ListJobsByStatus 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 *ElasticTranscoder) ListJobsByStatusWithContext(ctx aws.Context, input *ListJobsByStatusInput, opts ...request.Option) (*ListJobsByStatusOutput, error) { - req, out := c.ListJobsByStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListJobsByStatusPages iterates over the pages of a ListJobsByStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListJobsByStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListJobsByStatus operation. -// pageNum := 0 -// err := client.ListJobsByStatusPages(params, -// func(page *ListJobsByStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticTranscoder) ListJobsByStatusPages(input *ListJobsByStatusInput, fn func(*ListJobsByStatusOutput, bool) bool) error { - return c.ListJobsByStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsByStatusPagesWithContext same as ListJobsByStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ElasticTranscoder) ListJobsByStatusPagesWithContext(ctx aws.Context, input *ListJobsByStatusInput, fn func(*ListJobsByStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListJobsByStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListJobsByStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsByStatusOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListPipelines = "ListPipelines" - -// ListPipelinesRequest generates a "aws/request.Request" representing the -// client's request for the ListPipelines operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPipelines for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPipelines method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPipelinesRequest method. -// req, resp := client.ListPipelinesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) ListPipelinesRequest(input *ListPipelinesInput) (req *request.Request, output *ListPipelinesOutput) { - op := &request.Operation{ - Name: opListPipelines, - HTTPMethod: "GET", - HTTPPath: "/2012-09-25/pipelines", - Paginator: &request.Paginator{ - InputTokens: []string{"PageToken"}, - OutputTokens: []string{"NextPageToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPipelinesInput{} - } - - output = &ListPipelinesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPipelines API operation for Amazon Elastic Transcoder. -// -// The ListPipelines operation gets a list of the pipelines associated with -// the current AWS account. -// -// 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 Amazon Elastic Transcoder's -// API operation ListPipelines for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) ListPipelines(input *ListPipelinesInput) (*ListPipelinesOutput, error) { - req, out := c.ListPipelinesRequest(input) - return out, req.Send() -} - -// ListPipelinesWithContext is the same as ListPipelines with the addition of -// the ability to pass a context and additional request options. -// -// See ListPipelines 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 *ElasticTranscoder) ListPipelinesWithContext(ctx aws.Context, input *ListPipelinesInput, opts ...request.Option) (*ListPipelinesOutput, error) { - req, out := c.ListPipelinesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPipelinesPages iterates over the pages of a ListPipelines operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPipelines method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPipelines operation. -// pageNum := 0 -// err := client.ListPipelinesPages(params, -// func(page *ListPipelinesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticTranscoder) ListPipelinesPages(input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool) error { - return c.ListPipelinesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPipelinesPagesWithContext same as ListPipelinesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ElasticTranscoder) ListPipelinesPagesWithContext(ctx aws.Context, input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPipelinesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPipelinesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListPresets = "ListPresets" - -// ListPresetsRequest generates a "aws/request.Request" representing the -// client's request for the ListPresets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListPresets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListPresets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPresetsRequest method. -// req, resp := client.ListPresetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) ListPresetsRequest(input *ListPresetsInput) (req *request.Request, output *ListPresetsOutput) { - op := &request.Operation{ - Name: opListPresets, - HTTPMethod: "GET", - HTTPPath: "/2012-09-25/presets", - Paginator: &request.Paginator{ - InputTokens: []string{"PageToken"}, - OutputTokens: []string{"NextPageToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPresetsInput{} - } - - output = &ListPresetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPresets API operation for Amazon Elastic Transcoder. -// -// The ListPresets operation gets a list of the default presets included with -// Elastic Transcoder and the presets that you've added in an AWS region. -// -// 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 Amazon Elastic Transcoder's -// API operation ListPresets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) ListPresets(input *ListPresetsInput) (*ListPresetsOutput, error) { - req, out := c.ListPresetsRequest(input) - return out, req.Send() -} - -// ListPresetsWithContext is the same as ListPresets with the addition of -// the ability to pass a context and additional request options. -// -// See ListPresets 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 *ElasticTranscoder) ListPresetsWithContext(ctx aws.Context, input *ListPresetsInput, opts ...request.Option) (*ListPresetsOutput, error) { - req, out := c.ListPresetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPresetsPages iterates over the pages of a ListPresets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPresets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPresets operation. -// pageNum := 0 -// err := client.ListPresetsPages(params, -// func(page *ListPresetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ElasticTranscoder) ListPresetsPages(input *ListPresetsInput, fn func(*ListPresetsOutput, bool) bool) error { - return c.ListPresetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPresetsPagesWithContext same as ListPresetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ElasticTranscoder) ListPresetsPagesWithContext(ctx aws.Context, input *ListPresetsInput, fn func(*ListPresetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPresetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPresetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPresetsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opReadJob = "ReadJob" - -// ReadJobRequest generates a "aws/request.Request" representing the -// client's request for the ReadJob operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReadJob for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReadJob method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReadJobRequest method. -// req, resp := client.ReadJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) ReadJobRequest(input *ReadJobInput) (req *request.Request, output *ReadJobOutput) { - op := &request.Operation{ - Name: opReadJob, - HTTPMethod: "GET", - HTTPPath: "/2012-09-25/jobs/{Id}", - } - - if input == nil { - input = &ReadJobInput{} - } - - output = &ReadJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReadJob API operation for Amazon Elastic Transcoder. -// -// The ReadJob operation returns detailed information about a job. -// -// 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 Amazon Elastic Transcoder's -// API operation ReadJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) ReadJob(input *ReadJobInput) (*ReadJobOutput, error) { - req, out := c.ReadJobRequest(input) - return out, req.Send() -} - -// ReadJobWithContext is the same as ReadJob with the addition of -// the ability to pass a context and additional request options. -// -// See ReadJob 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 *ElasticTranscoder) ReadJobWithContext(ctx aws.Context, input *ReadJobInput, opts ...request.Option) (*ReadJobOutput, error) { - req, out := c.ReadJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReadPipeline = "ReadPipeline" - -// ReadPipelineRequest generates a "aws/request.Request" representing the -// client's request for the ReadPipeline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReadPipeline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReadPipeline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReadPipelineRequest method. -// req, resp := client.ReadPipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) ReadPipelineRequest(input *ReadPipelineInput) (req *request.Request, output *ReadPipelineOutput) { - op := &request.Operation{ - Name: opReadPipeline, - HTTPMethod: "GET", - HTTPPath: "/2012-09-25/pipelines/{Id}", - } - - if input == nil { - input = &ReadPipelineInput{} - } - - output = &ReadPipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReadPipeline API operation for Amazon Elastic Transcoder. -// -// The ReadPipeline operation gets detailed information about a pipeline. -// -// 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 Amazon Elastic Transcoder's -// API operation ReadPipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) ReadPipeline(input *ReadPipelineInput) (*ReadPipelineOutput, error) { - req, out := c.ReadPipelineRequest(input) - return out, req.Send() -} - -// ReadPipelineWithContext is the same as ReadPipeline with the addition of -// the ability to pass a context and additional request options. -// -// See ReadPipeline 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 *ElasticTranscoder) ReadPipelineWithContext(ctx aws.Context, input *ReadPipelineInput, opts ...request.Option) (*ReadPipelineOutput, error) { - req, out := c.ReadPipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReadPreset = "ReadPreset" - -// ReadPresetRequest generates a "aws/request.Request" representing the -// client's request for the ReadPreset operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReadPreset for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReadPreset method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReadPresetRequest method. -// req, resp := client.ReadPresetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) ReadPresetRequest(input *ReadPresetInput) (req *request.Request, output *ReadPresetOutput) { - op := &request.Operation{ - Name: opReadPreset, - HTTPMethod: "GET", - HTTPPath: "/2012-09-25/presets/{Id}", - } - - if input == nil { - input = &ReadPresetInput{} - } - - output = &ReadPresetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReadPreset API operation for Amazon Elastic Transcoder. -// -// The ReadPreset operation gets detailed information about a preset. -// -// 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 Amazon Elastic Transcoder's -// API operation ReadPreset for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) ReadPreset(input *ReadPresetInput) (*ReadPresetOutput, error) { - req, out := c.ReadPresetRequest(input) - return out, req.Send() -} - -// ReadPresetWithContext is the same as ReadPreset with the addition of -// the ability to pass a context and additional request options. -// -// See ReadPreset 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 *ElasticTranscoder) ReadPresetWithContext(ctx aws.Context, input *ReadPresetInput, opts ...request.Option) (*ReadPresetOutput, error) { - req, out := c.ReadPresetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTestRole = "TestRole" - -// TestRoleRequest generates a "aws/request.Request" representing the -// client's request for the TestRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestRole for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestRole method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestRoleRequest method. -// req, resp := client.TestRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) TestRoleRequest(input *TestRoleInput) (req *request.Request, output *TestRoleOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, TestRole, has been deprecated") - } - op := &request.Operation{ - Name: opTestRole, - HTTPMethod: "POST", - HTTPPath: "/2012-09-25/roleTests", - } - - if input == nil { - input = &TestRoleInput{} - } - - output = &TestRoleOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestRole API operation for Amazon Elastic Transcoder. -// -// The TestRole operation tests the IAM role used to create the pipeline. -// -// The TestRole action lets you determine whether the IAM role you are using -// has sufficient permissions to let Elastic Transcoder perform tasks associated -// with the transcoding process. The action attempts to assume the specified -// IAM role, checks read access to the input and output buckets, and tries to -// send a test notification to Amazon SNS topics that you specify. -// -// 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 Amazon Elastic Transcoder's -// API operation TestRole for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) TestRole(input *TestRoleInput) (*TestRoleOutput, error) { - req, out := c.TestRoleRequest(input) - return out, req.Send() -} - -// TestRoleWithContext is the same as TestRole with the addition of -// the ability to pass a context and additional request options. -// -// See TestRole 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 *ElasticTranscoder) TestRoleWithContext(ctx aws.Context, input *TestRoleInput, opts ...request.Option) (*TestRoleOutput, error) { - req, out := c.TestRoleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePipeline = "UpdatePipeline" - -// UpdatePipelineRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePipeline operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdatePipeline for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdatePipeline method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdatePipelineRequest method. -// req, resp := client.UpdatePipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) UpdatePipelineRequest(input *UpdatePipelineInput) (req *request.Request, output *UpdatePipelineOutput) { - op := &request.Operation{ - Name: opUpdatePipeline, - HTTPMethod: "PUT", - HTTPPath: "/2012-09-25/pipelines/{Id}", - } - - if input == nil { - input = &UpdatePipelineInput{} - } - - output = &UpdatePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePipeline API operation for Amazon Elastic Transcoder. -// -// Use the UpdatePipeline operation to update settings for a pipeline. -// -// When you change pipeline settings, your changes take effect immediately. -// Jobs that you have already submitted and that Elastic Transcoder has not -// started to process are affected in addition to jobs that you submit after -// you change settings. -// -// 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 Amazon Elastic Transcoder's -// API operation UpdatePipeline for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource you are attempting to change is in use. For example, you are -// attempting to delete a pipeline that is currently in use. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) UpdatePipeline(input *UpdatePipelineInput) (*UpdatePipelineOutput, error) { - req, out := c.UpdatePipelineRequest(input) - return out, req.Send() -} - -// UpdatePipelineWithContext is the same as UpdatePipeline with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePipeline 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 *ElasticTranscoder) UpdatePipelineWithContext(ctx aws.Context, input *UpdatePipelineInput, opts ...request.Option) (*UpdatePipelineOutput, error) { - req, out := c.UpdatePipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePipelineNotifications = "UpdatePipelineNotifications" - -// UpdatePipelineNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePipelineNotifications operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdatePipelineNotifications for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdatePipelineNotifications method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdatePipelineNotificationsRequest method. -// req, resp := client.UpdatePipelineNotificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) UpdatePipelineNotificationsRequest(input *UpdatePipelineNotificationsInput) (req *request.Request, output *UpdatePipelineNotificationsOutput) { - op := &request.Operation{ - Name: opUpdatePipelineNotifications, - HTTPMethod: "POST", - HTTPPath: "/2012-09-25/pipelines/{Id}/notifications", - } - - if input == nil { - input = &UpdatePipelineNotificationsInput{} - } - - output = &UpdatePipelineNotificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePipelineNotifications API operation for Amazon Elastic Transcoder. -// -// With the UpdatePipelineNotifications operation, you can update Amazon Simple -// Notification Service (Amazon SNS) notifications for a pipeline. -// -// When you update notifications for a pipeline, Elastic Transcoder returns -// the values that you specified in the request. -// -// 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 Amazon Elastic Transcoder's -// API operation UpdatePipelineNotifications for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource you are attempting to change is in use. For example, you are -// attempting to delete a pipeline that is currently in use. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) UpdatePipelineNotifications(input *UpdatePipelineNotificationsInput) (*UpdatePipelineNotificationsOutput, error) { - req, out := c.UpdatePipelineNotificationsRequest(input) - return out, req.Send() -} - -// UpdatePipelineNotificationsWithContext is the same as UpdatePipelineNotifications with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePipelineNotifications 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 *ElasticTranscoder) UpdatePipelineNotificationsWithContext(ctx aws.Context, input *UpdatePipelineNotificationsInput, opts ...request.Option) (*UpdatePipelineNotificationsOutput, error) { - req, out := c.UpdatePipelineNotificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePipelineStatus = "UpdatePipelineStatus" - -// UpdatePipelineStatusRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePipelineStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdatePipelineStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdatePipelineStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdatePipelineStatusRequest method. -// req, resp := client.UpdatePipelineStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ElasticTranscoder) UpdatePipelineStatusRequest(input *UpdatePipelineStatusInput) (req *request.Request, output *UpdatePipelineStatusOutput) { - op := &request.Operation{ - Name: opUpdatePipelineStatus, - HTTPMethod: "POST", - HTTPPath: "/2012-09-25/pipelines/{Id}/status", - } - - if input == nil { - input = &UpdatePipelineStatusInput{} - } - - output = &UpdatePipelineStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePipelineStatus API operation for Amazon Elastic Transcoder. -// -// The UpdatePipelineStatus operation pauses or reactivates a pipeline, so that -// the pipeline stops or restarts the processing of jobs. -// -// Changing the pipeline status is useful if you want to cancel one or more -// jobs. You can't cancel jobs after Elastic Transcoder has started processing -// them; if you pause the pipeline to which you submitted the jobs, you have -// more time to get the job IDs for the jobs that you want to cancel, and to -// send a CancelJob request. -// -// 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 Amazon Elastic Transcoder's -// API operation UpdatePipelineStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// One or more required parameter values were not provided in the request. -// -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource does not exist or is not available. For example, the -// pipeline to which you're trying to add a job doesn't exist or is still being -// created. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource you are attempting to change is in use. For example, you are -// attempting to delete a pipeline that is currently in use. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// General authentication failure. The request was not signed correctly. -// -// * ErrCodeInternalServiceException "InternalServiceException" -// Elastic Transcoder encountered an unexpected exception while trying to fulfill -// the request. -// -func (c *ElasticTranscoder) UpdatePipelineStatus(input *UpdatePipelineStatusInput) (*UpdatePipelineStatusOutput, error) { - req, out := c.UpdatePipelineStatusRequest(input) - return out, req.Send() -} - -// UpdatePipelineStatusWithContext is the same as UpdatePipelineStatus with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePipelineStatus 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 *ElasticTranscoder) UpdatePipelineStatusWithContext(ctx aws.Context, input *UpdatePipelineStatusInput, opts ...request.Option) (*UpdatePipelineStatusOutput, error) { - req, out := c.UpdatePipelineStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// The file to be used as album art. There can be multiple artworks associated -// with an audio file, to a maximum of 20. -// -// To remove artwork or leave the artwork empty, you can either set Artwork -// to null, or set the Merge Policy to "Replace" and use an empty Artwork array. -// -// To pass through existing artwork unchanged, set the Merge Policy to "Prepend", -// "Append", or "Fallback", and use an empty Artwork array. -type Artwork struct { - _ struct{} `type:"structure"` - - // The format of album art, if any. Valid formats are .jpg and .png. - AlbumArtFormat *string `type:"string"` - - // The encryption settings, if any, that you want Elastic Transcoder to apply - // to your artwork. - Encryption *Encryption `type:"structure"` - - // The name of the file to be used as album art. To determine which Amazon S3 - // bucket contains the specified file, Elastic Transcoder checks the pipeline - // specified by PipelineId; the InputBucket object in that pipeline identifies - // the bucket. - // - // If the file name includes a prefix, for example, cooking/pie.jpg, include - // the prefix in the key. If the file isn't in the specified bucket, Elastic - // Transcoder returns an error. - InputKey *string `min:"1" type:"string"` - - // The maximum height of the output album art in pixels. If you specify auto, - // Elastic Transcoder uses 600 as the default value. If you specify a numeric - // value, enter an even integer between 32 and 3072, inclusive. - MaxHeight *string `type:"string"` - - // The maximum width of the output album art in pixels. If you specify auto, - // Elastic Transcoder uses 600 as the default value. If you specify a numeric - // value, enter an even integer between 32 and 4096, inclusive. - MaxWidth *string `type:"string"` - - // When you set PaddingPolicy to Pad, Elastic Transcoder may add white bars - // to the top and bottom and/or left and right sides of the output album art - // to make the total size of the output art match the values that you specified - // for MaxWidth and MaxHeight. - PaddingPolicy *string `type:"string"` - - // Specify one of the following values to control scaling of the output album - // art: - // - // * Fit: Elastic Transcoder scales the output art so it matches the value - // that you specified in either MaxWidth or MaxHeight without exceeding the - // other value. - // - // * Fill: Elastic Transcoder scales the output art so it matches the value - // that you specified in either MaxWidth or MaxHeight and matches or exceeds - // the other value. Elastic Transcoder centers the output art and then crops - // it in the dimension (if any) that exceeds the maximum value. - // - // * Stretch: Elastic Transcoder stretches the output art to match the values - // that you specified for MaxWidth and MaxHeight. If the relative proportions - // of the input art and the output art are different, the output art will - // be distorted. - // - // * Keep: Elastic Transcoder does not scale the output art. If either dimension - // of the input art exceeds the values that you specified for MaxWidth and - // MaxHeight, Elastic Transcoder crops the output art. - // - // * ShrinkToFit: Elastic Transcoder scales the output art down so that its - // dimensions match the values that you specified for at least one of MaxWidth - // and MaxHeight without exceeding either value. If you specify this option, - // Elastic Transcoder does not scale the art up. - // - // * ShrinkToFill Elastic Transcoder scales the output art down so that its - // dimensions match the values that you specified for at least one of MaxWidth - // and MaxHeight without dropping below either value. If you specify this - // option, Elastic Transcoder does not scale the art up. - SizingPolicy *string `type:"string"` -} - -// String returns the string representation -func (s Artwork) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Artwork) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Artwork) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Artwork"} - if s.InputKey != nil && len(*s.InputKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputKey", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlbumArtFormat sets the AlbumArtFormat field's value. -func (s *Artwork) SetAlbumArtFormat(v string) *Artwork { - s.AlbumArtFormat = &v - return s -} - -// SetEncryption sets the Encryption field's value. -func (s *Artwork) SetEncryption(v *Encryption) *Artwork { - s.Encryption = v - return s -} - -// SetInputKey sets the InputKey field's value. -func (s *Artwork) SetInputKey(v string) *Artwork { - s.InputKey = &v - return s -} - -// SetMaxHeight sets the MaxHeight field's value. -func (s *Artwork) SetMaxHeight(v string) *Artwork { - s.MaxHeight = &v - return s -} - -// SetMaxWidth sets the MaxWidth field's value. -func (s *Artwork) SetMaxWidth(v string) *Artwork { - s.MaxWidth = &v - return s -} - -// SetPaddingPolicy sets the PaddingPolicy field's value. -func (s *Artwork) SetPaddingPolicy(v string) *Artwork { - s.PaddingPolicy = &v - return s -} - -// SetSizingPolicy sets the SizingPolicy field's value. -func (s *Artwork) SetSizingPolicy(v string) *Artwork { - s.SizingPolicy = &v - return s -} - -// Options associated with your audio codec. -type AudioCodecOptions struct { - _ struct{} `type:"structure"` - - // You can only choose an audio bit depth when you specify flac or pcm for the - // value of Audio:Codec. - // - // The bit depth of a sample is how many bits of information are included in - // the audio samples. The higher the bit depth, the better the audio, but the - // larger the file. - // - // Valid values are 16 and 24. - // - // The most common bit depth is 24. - BitDepth *string `type:"string"` - - // You can only choose an audio bit order when you specify pcm for the value - // of Audio:Codec. - // - // The order the bits of a PCM sample are stored in. - // - // The supported value is LittleEndian. - BitOrder *string `type:"string"` - - // You can only choose an audio profile when you specify AAC for the value of - // Audio:Codec. - // - // Specify the AAC profile for the output file. Elastic Transcoder supports - // the following profiles: - // - // * auto: If you specify auto, Elastic Transcoder selects the profile based - // on the bit rate selected for the output file. - // - // * AAC-LC: The most common AAC profile. Use for bit rates larger than 64 - // kbps. - // - // * HE-AAC: Not supported on some older players and devices. Use for bit - // rates between 40 and 80 kbps. - // - // * HE-AACv2: Not supported on some players and devices. Use for bit rates - // less than 48 kbps. - // - // All outputs in a Smooth playlist must have the same value for Profile. - // - // If you created any presets before AAC profiles were added, Elastic Transcoder - // automatically updated your presets to use AAC-LC. You can change the value - // as required. - Profile *string `type:"string"` - - // You can only choose whether an audio sample is signed when you specify pcm - // for the value of Audio:Codec. - // - // Whether audio samples are represented with negative and positive numbers - // (signed) or only positive numbers (unsigned). - // - // The supported value is Signed. - Signed *string `type:"string"` -} - -// String returns the string representation -func (s AudioCodecOptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AudioCodecOptions) GoString() string { - return s.String() -} - -// SetBitDepth sets the BitDepth field's value. -func (s *AudioCodecOptions) SetBitDepth(v string) *AudioCodecOptions { - s.BitDepth = &v - return s -} - -// SetBitOrder sets the BitOrder field's value. -func (s *AudioCodecOptions) SetBitOrder(v string) *AudioCodecOptions { - s.BitOrder = &v - return s -} - -// SetProfile sets the Profile field's value. -func (s *AudioCodecOptions) SetProfile(v string) *AudioCodecOptions { - s.Profile = &v - return s -} - -// SetSigned sets the Signed field's value. -func (s *AudioCodecOptions) SetSigned(v string) *AudioCodecOptions { - s.Signed = &v - return s -} - -// Parameters required for transcoding audio. -type AudioParameters struct { - _ struct{} `type:"structure"` - - // The method of organizing audio channels and tracks. Use Audio:Channels to - // specify the number of channels in your output, and Audio:AudioPackingMode - // to specify the number of tracks and their relation to the channels. If you - // do not specify an Audio:AudioPackingMode, Elastic Transcoder uses SingleTrack. - // - // The following values are valid: - // - // SingleTrack, OneChannelPerTrack, and OneChannelPerTrackWithMosTo8Tracks - // - // When you specify SingleTrack, Elastic Transcoder creates a single track for - // your output. The track can have up to eight channels. Use SingleTrack for - // all non-mxf containers. - // - // The outputs of SingleTrack for a specific channel value and inputs are as - // follows: - // - // * 0 channels with any input: Audio omitted from the output - // - // * 1, 2, or auto channels with no audio input: Audio omitted from the output - // - // * 1 channel with any input with audio: One track with one channel, downmixed - // if necessary - // - // * 2 channels with one track with one channel: One track with two identical - // channels - // - // * 2 or auto channels with two tracks with one channel each: One track - // with two channels - // - // * 2 or auto channels with one track with two channels: One track with - // two channels - // - // * 2 channels with one track with multiple channels: One track with two - // channels - // - // * auto channels with one track with one channel: One track with one channel - // - // * auto channels with one track with multiple channels: One track with - // multiple channels - // - // When you specify OneChannelPerTrack, Elastic Transcoder creates a new track - // for every channel in your output. Your output can have up to eight single-channel - // tracks. - // - // The outputs of OneChannelPerTrack for a specific channel value and inputs - // are as follows: - // - // * 0 channels with any input: Audio omitted from the output - // - // * 1, 2, or auto channels with no audio input: Audio omitted from the output - // - // * 1 channel with any input with audio: One track with one channel, downmixed - // if necessary - // - // * 2 channels with one track with one channel: Two tracks with one identical - // channel each - // - // * 2 or auto channels with two tracks with one channel each: Two tracks - // with one channel each - // - // * 2 or auto channels with one track with two channels: Two tracks with - // one channel each - // - // * 2 channels with one track with multiple channels: Two tracks with one - // channel each - // - // * auto channels with one track with one channel: One track with one channel - // - // * auto channels with one track with multiple channels: Up to eight tracks - // with one channel each - // - // When you specify OneChannelPerTrackWithMosTo8Tracks, Elastic Transcoder creates - // eight single-channel tracks for your output. All tracks that do not contain - // audio data from an input channel are MOS, or Mit Out Sound, tracks. - // - // The outputs of OneChannelPerTrackWithMosTo8Tracks for a specific channel - // value and inputs are as follows: - // - // * 0 channels with any input: Audio omitted from the output - // - // * 1, 2, or auto channels with no audio input: Audio omitted from the output - // - // * 1 channel with any input with audio: One track with one channel, downmixed - // if necessary, plus six MOS tracks - // - // * 2 channels with one track with one channel: Two tracks with one identical - // channel each, plus six MOS tracks - // - // * 2 or auto channels with two tracks with one channel each: Two tracks - // with one channel each, plus six MOS tracks - // - // * 2 or auto channels with one track with two channels: Two tracks with - // one channel each, plus six MOS tracks - // - // * 2 channels with one track with multiple channels: Two tracks with one - // channel each, plus six MOS tracks - // - // * auto channels with one track with one channel: One track with one channel, - // plus seven MOS tracks - // - // * auto channels with one track with multiple channels: Up to eight tracks - // with one channel each, plus MOS tracks until there are eight tracks in - // all - AudioPackingMode *string `type:"string"` - - // The bit rate of the audio stream in the output file, in kilobits/second. - // Enter an integer between 64 and 320, inclusive. - BitRate *string `type:"string"` - - // The number of audio channels in the output file. The following values are - // valid: - // - // auto, 0, 1, 2 - // - // One channel carries the information played by a single speaker. For example, - // a stereo track with two channels sends one channel to the left speaker, and - // the other channel to the right speaker. The output channels are organized - // into tracks. If you want Elastic Transcoder to automatically detect the number - // of audio channels in the input file and use that value for the output file, - // select auto. - // - // The output of a specific channel value and inputs are as follows: - // - // * auto channel specified, with any input: Pass through up to eight input - // channels. - // - // * 0 channels specified, with any input: Audio omitted from the output. - // - // * 1 channel specified, with at least one input channel: Mono sound. - // - // * 2 channels specified, with any input: Two identical mono channels or - // stereo. For more information about tracks, see Audio:AudioPackingMode. - // - // For more information about how Elastic Transcoder organizes channels and - // tracks, see Audio:AudioPackingMode. - Channels *string `type:"string"` - - // The audio codec for the output file. Valid values include aac, flac, mp2, - // mp3, pcm, and vorbis. - Codec *string `type:"string"` - - // If you specified AAC for Audio:Codec, this is the AAC compression profile - // to use. Valid values include: - // - // auto, AAC-LC, HE-AAC, HE-AACv2 - // - // If you specify auto, Elastic Transcoder chooses a profile based on the bit - // rate of the output file. - CodecOptions *AudioCodecOptions `type:"structure"` - - // The sample rate of the audio stream in the output file, in Hertz. Valid values - // include: - // - // auto, 22050, 32000, 44100, 48000, 96000 - // - // If you specify auto, Elastic Transcoder automatically detects the sample - // rate. - SampleRate *string `type:"string"` -} - -// String returns the string representation -func (s AudioParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AudioParameters) GoString() string { - return s.String() -} - -// SetAudioPackingMode sets the AudioPackingMode field's value. -func (s *AudioParameters) SetAudioPackingMode(v string) *AudioParameters { - s.AudioPackingMode = &v - return s -} - -// SetBitRate sets the BitRate field's value. -func (s *AudioParameters) SetBitRate(v string) *AudioParameters { - s.BitRate = &v - return s -} - -// SetChannels sets the Channels field's value. -func (s *AudioParameters) SetChannels(v string) *AudioParameters { - s.Channels = &v - return s -} - -// SetCodec sets the Codec field's value. -func (s *AudioParameters) SetCodec(v string) *AudioParameters { - s.Codec = &v - return s -} - -// SetCodecOptions sets the CodecOptions field's value. -func (s *AudioParameters) SetCodecOptions(v *AudioCodecOptions) *AudioParameters { - s.CodecOptions = v - return s -} - -// SetSampleRate sets the SampleRate field's value. -func (s *AudioParameters) SetSampleRate(v string) *AudioParameters { - s.SampleRate = &v - return s -} - -// The CancelJobRequest structure. -type CancelJobInput struct { - _ struct{} `type:"structure"` - - // The identifier of the job that you want to cancel. - // - // To get a list of the jobs (including their jobId) that have a status of Submitted, - // use the ListJobsByStatus API action. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s CancelJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *CancelJobInput) SetId(v string) *CancelJobInput { - s.Id = &v - return s -} - -// The response body contains a JSON object. If the job is successfully canceled, -// the value of Success is true. -type CancelJobOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CancelJobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CancelJobOutput) GoString() string { - return s.String() -} - -// The file format of the output captions. If you leave this value blank, Elastic -// Transcoder returns an error. -type CaptionFormat struct { - _ struct{} `type:"structure"` - - // The encryption settings, if any, that you want Elastic Transcoder to apply - // to your caption formats. - Encryption *Encryption `type:"structure"` - - // The format you specify determines whether Elastic Transcoder generates an - // embedded or sidecar caption for this output. - // - // * Valid Embedded Caption Formats: - // - // for FLAC: None - // - // For MP3: None - // - // For MP4: mov-text - // - // For MPEG-TS: None - // - // For ogg: None - // - // For webm: None - // - // * Valid Sidecar Caption Formats: Elastic Transcoder supports dfxp (first - // div element only), scc, srt, and webvtt. If you want ttml or smpte-tt - // compatible captions, specify dfxp as your output format. - // - // For FMP4: dfxp - // - // Non-FMP4 outputs: All sidecar types - // - // fmp4 captions have an extension of .ismt - Format *string `type:"string"` - - // The prefix for caption filenames, in the form description-{language}, where: - // - // * description is a description of the video. - // - // * {language} is a literal value that Elastic Transcoder replaces with - // the two- or three-letter code for the language of the caption in the output - // file names. - // - // If you don't include {language} in the file name pattern, Elastic Transcoder - // automatically appends "{language}" to the value that you specify for the - // description. In addition, Elastic Transcoder automatically appends the count - // to the end of the segment files. - // - // For example, suppose you're transcoding into srt format. When you enter "Sydney-{language}-sunrise", - // and the language of the captions is English (en), the name of the first caption - // file is be Sydney-en-sunrise00000.srt. - Pattern *string `type:"string"` -} - -// String returns the string representation -func (s CaptionFormat) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CaptionFormat) GoString() string { - return s.String() -} - -// SetEncryption sets the Encryption field's value. -func (s *CaptionFormat) SetEncryption(v *Encryption) *CaptionFormat { - s.Encryption = v - return s -} - -// SetFormat sets the Format field's value. -func (s *CaptionFormat) SetFormat(v string) *CaptionFormat { - s.Format = &v - return s -} - -// SetPattern sets the Pattern field's value. -func (s *CaptionFormat) SetPattern(v string) *CaptionFormat { - s.Pattern = &v - return s -} - -// A source file for the input sidecar captions used during the transcoding -// process. -type CaptionSource struct { - _ struct{} `type:"structure"` - - // The encryption settings, if any, that Elastic Transcoder needs to decyrpt - // your caption sources, or that you want Elastic Transcoder to apply to your - // caption sources. - Encryption *Encryption `type:"structure"` - - // The name of the sidecar caption file that you want Elastic Transcoder to - // include in the output file. - Key *string `min:"1" type:"string"` - - // The label of the caption shown in the player when choosing a language. We - // recommend that you put the caption language name here, in the language of - // the captions. - Label *string `min:"1" type:"string"` - - // A string that specifies the language of the caption. If you specified multiple - // inputs with captions, the caption language must match in order to be included - // in the output. Specify this as one of: - // - // * 2-character ISO 639-1 code - // - // * 3-character ISO 639-2 code - // - // For more information on ISO language codes and language names, see the List - // of ISO 639-1 codes. - Language *string `min:"1" type:"string"` - - // For clip generation or captions that do not start at the same time as the - // associated video file, the TimeOffset tells Elastic Transcoder how much of - // the video to encode before including captions. - // - // Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss. - TimeOffset *string `type:"string"` -} - -// String returns the string representation -func (s CaptionSource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CaptionSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CaptionSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptionSource"} - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Label != nil && len(*s.Label) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Label", 1)) - } - if s.Language != nil && len(*s.Language) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Language", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryption sets the Encryption field's value. -func (s *CaptionSource) SetEncryption(v *Encryption) *CaptionSource { - s.Encryption = v - return s -} - -// SetKey sets the Key field's value. -func (s *CaptionSource) SetKey(v string) *CaptionSource { - s.Key = &v - return s -} - -// SetLabel sets the Label field's value. -func (s *CaptionSource) SetLabel(v string) *CaptionSource { - s.Label = &v - return s -} - -// SetLanguage sets the Language field's value. -func (s *CaptionSource) SetLanguage(v string) *CaptionSource { - s.Language = &v - return s -} - -// SetTimeOffset sets the TimeOffset field's value. -func (s *CaptionSource) SetTimeOffset(v string) *CaptionSource { - s.TimeOffset = &v - return s -} - -// The captions to be created, if any. -type Captions struct { - _ struct{} `type:"structure"` - - // The array of file formats for the output captions. If you leave this value - // blank, Elastic Transcoder returns an error. - CaptionFormats []*CaptionFormat `type:"list"` - - // Source files for the input sidecar captions used during the transcoding process. - // To omit all sidecar captions, leave CaptionSources blank. - CaptionSources []*CaptionSource `deprecated:"true" type:"list"` - - // A policy that determines how Elastic Transcoder handles the existence of - // multiple captions. - // - // * MergeOverride: Elastic Transcoder transcodes both embedded and sidecar - // captions into outputs. If captions for a language are embedded in the - // input file and also appear in a sidecar file, Elastic Transcoder uses - // the sidecar captions and ignores the embedded captions for that language. - // - // * MergeRetain: Elastic Transcoder transcodes both embedded and sidecar - // captions into outputs. If captions for a language are embedded in the - // input file and also appear in a sidecar file, Elastic Transcoder uses - // the embedded captions and ignores the sidecar captions for that language. - // If CaptionSources is empty, Elastic Transcoder omits all sidecar captions - // from the output files. - // - // * Override: Elastic Transcoder transcodes only the sidecar captions that - // you specify in CaptionSources. - // - // MergePolicy cannot be null. - MergePolicy *string `deprecated:"true" type:"string"` -} - -// String returns the string representation -func (s Captions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Captions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Captions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Captions"} - if s.CaptionSources != nil { - for i, v := range s.CaptionSources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionSources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaptionFormats sets the CaptionFormats field's value. -func (s *Captions) SetCaptionFormats(v []*CaptionFormat) *Captions { - s.CaptionFormats = v - return s -} - -// SetCaptionSources sets the CaptionSources field's value. -func (s *Captions) SetCaptionSources(v []*CaptionSource) *Captions { - s.CaptionSources = v - return s -} - -// SetMergePolicy sets the MergePolicy field's value. -func (s *Captions) SetMergePolicy(v string) *Captions { - s.MergePolicy = &v - return s -} - -// Settings for one clip in a composition. All jobs in a playlist must have -// the same clip settings. -type Clip struct { - _ struct{} `deprecated:"true" type:"structure"` - - // Settings that determine when a clip begins and how long it lasts. - TimeSpan *TimeSpan `type:"structure"` -} - -// String returns the string representation -func (s Clip) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Clip) GoString() string { - return s.String() -} - -// SetTimeSpan sets the TimeSpan field's value. -func (s *Clip) SetTimeSpan(v *TimeSpan) *Clip { - s.TimeSpan = v - return s -} - -// The CreateJobRequest structure. -type CreateJobInput struct { - _ struct{} `type:"structure"` - - // A section of the request body that provides information about the file that - // is being transcoded. - Input *JobInput `type:"structure"` - - // A section of the request body that provides information about the files that - // are being transcoded. - Inputs []*JobInput `type:"list"` - - // A section of the request body that provides information about the transcoded - // (target) file. We strongly recommend that you use the Outputs syntax instead - // of the Output syntax. - Output *CreateJobOutput `type:"structure"` - - // The value, if any, that you want Elastic Transcoder to prepend to the names - // of all files that this job creates, including output files, thumbnails, and - // playlists. - OutputKeyPrefix *string `min:"1" type:"string"` - - // A section of the request body that provides information about the transcoded - // (target) files. We recommend that you use the Outputs syntax instead of the - // Output syntax. - Outputs []*CreateJobOutput `type:"list"` - - // The Id of the pipeline that you want Elastic Transcoder to use for transcoding. - // The pipeline determines several settings, including the Amazon S3 bucket - // from which Elastic Transcoder gets the files to transcode and the bucket - // into which Elastic Transcoder puts the transcoded files. - // - // PipelineId is a required field - PipelineId *string `type:"string" required:"true"` - - // If you specify a preset in PresetId for which the value of Container is fmp4 - // (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the - // master playlists that you want Elastic Transcoder to create. - // - // The maximum number of master playlists in a job is 30. - Playlists []*CreateJobPlaylist `type:"list"` - - // User-defined metadata that you want to associate with an Elastic Transcoder - // job. You specify metadata in key/value pairs, and you can add up to 10 key/value - // pairs per job. Elastic Transcoder does not guarantee that key/value pairs - // are returned in the same order in which you specify them. - UserMetadata map[string]*string `type:"map"` -} - -// String returns the string representation -func (s CreateJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateJobInput"} - if s.OutputKeyPrefix != nil && len(*s.OutputKeyPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputKeyPrefix", 1)) - } - if s.PipelineId == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineId")) - } - if s.Input != nil { - if err := s.Input.Validate(); err != nil { - invalidParams.AddNested("Input", err.(request.ErrInvalidParams)) - } - } - if s.Inputs != nil { - for i, v := range s.Inputs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Inputs", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Output != nil { - if err := s.Output.Validate(); err != nil { - invalidParams.AddNested("Output", err.(request.ErrInvalidParams)) - } - } - if s.Outputs != nil { - for i, v := range s.Outputs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Outputs", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Playlists != nil { - for i, v := range s.Playlists { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Playlists", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInput sets the Input field's value. -func (s *CreateJobInput) SetInput(v *JobInput) *CreateJobInput { - s.Input = v - return s -} - -// SetInputs sets the Inputs field's value. -func (s *CreateJobInput) SetInputs(v []*JobInput) *CreateJobInput { - s.Inputs = v - return s -} - -// SetOutput sets the Output field's value. -func (s *CreateJobInput) SetOutput(v *CreateJobOutput) *CreateJobInput { - s.Output = v - return s -} - -// SetOutputKeyPrefix sets the OutputKeyPrefix field's value. -func (s *CreateJobInput) SetOutputKeyPrefix(v string) *CreateJobInput { - s.OutputKeyPrefix = &v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *CreateJobInput) SetOutputs(v []*CreateJobOutput) *CreateJobInput { - s.Outputs = v - return s -} - -// SetPipelineId sets the PipelineId field's value. -func (s *CreateJobInput) SetPipelineId(v string) *CreateJobInput { - s.PipelineId = &v - return s -} - -// SetPlaylists sets the Playlists field's value. -func (s *CreateJobInput) SetPlaylists(v []*CreateJobPlaylist) *CreateJobInput { - s.Playlists = v - return s -} - -// SetUserMetadata sets the UserMetadata field's value. -func (s *CreateJobInput) SetUserMetadata(v map[string]*string) *CreateJobInput { - s.UserMetadata = v - return s -} - -// The CreateJobOutput structure. -type CreateJobOutput struct { - _ struct{} `type:"structure"` - - // Information about the album art that you want Elastic Transcoder to add to - // the file during transcoding. You can specify up to twenty album artworks - // for each output. Settings for each artwork must be defined in the job for - // the current output. - AlbumArt *JobAlbumArt `type:"structure"` - - // You can configure Elastic Transcoder to transcode captions, or subtitles, - // from one format to another. All captions must be in UTF-8. Elastic Transcoder - // supports two types of captions: - // - // * Embedded: Embedded captions are included in the same file as the audio - // and video. Elastic Transcoder supports only one embedded caption per language, - // to a maximum of 300 embedded captions per file. - // - // Valid input values include: CEA-608 (EIA-608, first non-empty channel only), - // CEA-708 (EIA-708, first non-empty channel only), and mov-text - // - // Valid outputs include: mov-text - // - // Elastic Transcoder supports a maximum of one embedded format per output. - // - // * Sidecar: Sidecar captions are kept in a separate metadata file from - // the audio and video data. Sidecar captions require a player that is capable - // of understanding the relationship between the video file and the sidecar - // file. Elastic Transcoder supports only one sidecar caption per language, - // to a maximum of 20 sidecar captions per file. - // - // Valid input values include: dfxp (first div element only), ebu-tt, scc, smpt, - // srt, ttml (first div element only), and webvtt - // - // Valid outputs include: dfxp (first div element only), scc, srt, and webvtt. - // - // If you want ttml or smpte-tt compatible captions, specify dfxp as your output - // format. - // - // Elastic Transcoder does not support OCR (Optical Character Recognition), - // does not accept pictures as a valid input for captions, and is not available - // for audio-only transcoding. Elastic Transcoder does not preserve text formatting - // (for example, italics) during the transcoding process. - // - // To remove captions or leave the captions empty, set Captions to null. To - // pass through existing captions unchanged, set the MergePolicy to MergeRetain, - // and pass in a null CaptionSources array. - // - // For more information on embedded files, see the Subtitles Wikipedia page. - // - // For more information on sidecar files, see the Extensible Metadata Platform - // and Sidecar file Wikipedia pages. - Captions *Captions `type:"structure"` - - // You can create an output file that contains an excerpt from the input file. - // This excerpt, called a clip, can come from the beginning, middle, or end - // of the file. The Composition object contains settings for the clips that - // make up an output file. For the current release, you can only specify settings - // for a single clip per output file. The Composition object cannot be null. - Composition []*Clip `deprecated:"true" type:"list"` - - // You can specify encryption settings for any output files that you want to - // use for a transcoding job. This includes the output file and any watermarks, - // thumbnails, album art, or captions that you want to use. You must specify - // encryption settings for each file individually. - Encryption *Encryption `type:"structure"` - - // The name to assign to the transcoded file. Elastic Transcoder saves the file - // in the Amazon S3 bucket specified by the OutputBucket object in the pipeline - // that is specified by the pipeline ID. If a file with the specified name already - // exists in the output bucket, the job fails. - Key *string `min:"1" type:"string"` - - // The Id of the preset to use for this job. The preset determines the audio, - // video, and thumbnail settings that Elastic Transcoder uses for transcoding. - PresetId *string `type:"string"` - - // The number of degrees clockwise by which you want Elastic Transcoder to rotate - // the output relative to the input. Enter one of the following values: auto, - // 0, 90, 180, 270. The value auto generally works only if the file that you're - // transcoding contains rotation metadata. - Rotate *string `type:"string"` - - // (Outputs in Fragmented MP4 or MPEG-TS format only. - // - // If you specify a preset in PresetId for which the value of Container is fmp4 - // (Fragmented MP4) or ts (MPEG-TS), SegmentDuration is the target maximum duration - // of each segment in seconds. For HLSv3 format playlists, each media segment - // is stored in a separate .ts file. For HLSv4 and Smooth playlists, all media - // segments for an output are stored in a single file. Each segment is approximately - // the length of the SegmentDuration, though individual segments might be shorter - // or longer. - // - // The range of valid values is 1 to 60 seconds. If the duration of the video - // is not evenly divisible by SegmentDuration, the duration of the last segment - // is the remainder of total length/SegmentDuration. - // - // Elastic Transcoder creates an output-specific playlist for each output HLS - // output that you specify in OutputKeys. To add an output to the master playlist - // for this job, include it in the OutputKeys of the associated playlist. - SegmentDuration *string `type:"string"` - - // The encryption settings, if any, that you want Elastic Transcoder to apply - // to your thumbnail. - ThumbnailEncryption *Encryption `type:"structure"` - - // Whether you want Elastic Transcoder to create thumbnails for your videos - // and, if so, how you want Elastic Transcoder to name the files. - // - // If you don't want Elastic Transcoder to create thumbnails, specify "". - // - // If you do want Elastic Transcoder to create thumbnails, specify the information - // that you want to include in the file name for each thumbnail. You can specify - // the following values in any sequence: - // - // * {count} (Required): If you want to create thumbnails, you must include - // {count} in the ThumbnailPattern object. Wherever you specify {count}, - // Elastic Transcoder adds a five-digit sequence number (beginning with 00001) - // to thumbnail file names. The number indicates where a given thumbnail - // appears in the sequence of thumbnails for a transcoded file. - // - // If you specify a literal value and/or {resolution} but you omit {count}, - // Elastic Transcoder returns a validation error and does not create the - // job. - // - // * Literal values (Optional): You can specify literal values anywhere in - // the ThumbnailPattern object. For example, you can include them as a file - // name prefix or as a delimiter between {resolution} and {count}. - // - // * {resolution} (Optional): If you want Elastic Transcoder to include the - // resolution in the file name, include {resolution} in the ThumbnailPattern - // object. - // - // When creating thumbnails, Elastic Transcoder automatically saves the files - // in the format (.jpg or .png) that appears in the preset that you specified - // in the PresetID value of CreateJobOutput. Elastic Transcoder also appends - // the applicable file name extension. - ThumbnailPattern *string `type:"string"` - - // Information about the watermarks that you want Elastic Transcoder to add - // to the video during transcoding. You can specify up to four watermarks for - // each output. Settings for each watermark must be defined in the preset for - // the current output. - Watermarks []*JobWatermark `type:"list"` -} - -// String returns the string representation -func (s CreateJobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateJobOutput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateJobOutput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateJobOutput"} - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.AlbumArt != nil { - if err := s.AlbumArt.Validate(); err != nil { - invalidParams.AddNested("AlbumArt", err.(request.ErrInvalidParams)) - } - } - if s.Captions != nil { - if err := s.Captions.Validate(); err != nil { - invalidParams.AddNested("Captions", err.(request.ErrInvalidParams)) - } - } - if s.Watermarks != nil { - for i, v := range s.Watermarks { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Watermarks", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlbumArt sets the AlbumArt field's value. -func (s *CreateJobOutput) SetAlbumArt(v *JobAlbumArt) *CreateJobOutput { - s.AlbumArt = v - return s -} - -// SetCaptions sets the Captions field's value. -func (s *CreateJobOutput) SetCaptions(v *Captions) *CreateJobOutput { - s.Captions = v - return s -} - -// SetComposition sets the Composition field's value. -func (s *CreateJobOutput) SetComposition(v []*Clip) *CreateJobOutput { - s.Composition = v - return s -} - -// SetEncryption sets the Encryption field's value. -func (s *CreateJobOutput) SetEncryption(v *Encryption) *CreateJobOutput { - s.Encryption = v - return s -} - -// SetKey sets the Key field's value. -func (s *CreateJobOutput) SetKey(v string) *CreateJobOutput { - s.Key = &v - return s -} - -// SetPresetId sets the PresetId field's value. -func (s *CreateJobOutput) SetPresetId(v string) *CreateJobOutput { - s.PresetId = &v - return s -} - -// SetRotate sets the Rotate field's value. -func (s *CreateJobOutput) SetRotate(v string) *CreateJobOutput { - s.Rotate = &v - return s -} - -// SetSegmentDuration sets the SegmentDuration field's value. -func (s *CreateJobOutput) SetSegmentDuration(v string) *CreateJobOutput { - s.SegmentDuration = &v - return s -} - -// SetThumbnailEncryption sets the ThumbnailEncryption field's value. -func (s *CreateJobOutput) SetThumbnailEncryption(v *Encryption) *CreateJobOutput { - s.ThumbnailEncryption = v - return s -} - -// SetThumbnailPattern sets the ThumbnailPattern field's value. -func (s *CreateJobOutput) SetThumbnailPattern(v string) *CreateJobOutput { - s.ThumbnailPattern = &v - return s -} - -// SetWatermarks sets the Watermarks field's value. -func (s *CreateJobOutput) SetWatermarks(v []*JobWatermark) *CreateJobOutput { - s.Watermarks = v - return s -} - -// Information about the master playlist. -type CreateJobPlaylist struct { - _ struct{} `type:"structure"` - - // The format of the output playlist. Valid formats include HLSv3, HLSv4, and - // Smooth. - Format *string `type:"string"` - - // The HLS content protection settings, if any, that you want Elastic Transcoder - // to apply to the output files associated with this playlist. - HlsContentProtection *HlsContentProtection `type:"structure"` - - // The name that you want Elastic Transcoder to assign to the master playlist, - // for example, nyc-vacation.m3u8. If the name includes a / character, the section - // of the name before the last / must be identical for all Name objects. If - // you create more than one master playlist, the values of all Name objects - // must be unique. - // - // Elastic Transcoder automatically appends the relevant file extension to the - // file name (.m3u8 for HLSv3 and HLSv4 playlists, and .ism and .ismc for Smooth - // playlists). If you include a file extension in Name, the file name will have - // two extensions. - Name *string `min:"1" type:"string"` - - // For each output in this job that you want to include in a master playlist, - // the value of the Outputs:Key object. - // - // * If your output is not HLS or does not have a segment duration set, the - // name of the output file is a concatenation of OutputKeyPrefix and Outputs:Key: - // - // OutputKeyPrefixOutputs:Key - // - // * If your output is HLSv3 and has a segment duration set, or is not included - // in a playlist, Elastic Transcoder creates an output playlist file with - // a file extension of .m3u8, and a series of .ts files that include a five-digit - // sequential counter beginning with 00000: - // - // OutputKeyPrefixOutputs:Key.m3u8 - // - // OutputKeyPrefixOutputs:Key00000.ts - // - // * If your output is HLSv4, has a segment duration set, and is included - // in an HLSv4 playlist, Elastic Transcoder creates an output playlist file - // with a file extension of _v4.m3u8. If the output is video, Elastic Transcoder - // also creates an output file with an extension of _iframe.m3u8: - // - // OutputKeyPrefixOutputs:Key_v4.m3u8 - // - // OutputKeyPrefixOutputs:Key_iframe.m3u8 - // - // OutputKeyPrefixOutputs:Key.ts - // - // Elastic Transcoder automatically appends the relevant file extension to the - // file name. If you include a file extension in Output Key, the file name will - // have two extensions. - // - // If you include more than one output in a playlist, any segment duration settings, - // clip settings, or caption settings must be the same for all outputs in the - // playlist. For Smooth playlists, the Audio:Profile, Video:Profile, and Video:FrameRate - // to Video:KeyframesMaxDist ratio must be the same for all outputs. - OutputKeys []*string `type:"list"` - - // The DRM settings, if any, that you want Elastic Transcoder to apply to the - // output files associated with this playlist. - PlayReadyDrm *PlayReadyDrm `type:"structure"` -} - -// String returns the string representation -func (s CreateJobPlaylist) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateJobPlaylist) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateJobPlaylist) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateJobPlaylist"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.PlayReadyDrm != nil { - if err := s.PlayReadyDrm.Validate(); err != nil { - invalidParams.AddNested("PlayReadyDrm", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFormat sets the Format field's value. -func (s *CreateJobPlaylist) SetFormat(v string) *CreateJobPlaylist { - s.Format = &v - return s -} - -// SetHlsContentProtection sets the HlsContentProtection field's value. -func (s *CreateJobPlaylist) SetHlsContentProtection(v *HlsContentProtection) *CreateJobPlaylist { - s.HlsContentProtection = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateJobPlaylist) SetName(v string) *CreateJobPlaylist { - s.Name = &v - return s -} - -// SetOutputKeys sets the OutputKeys field's value. -func (s *CreateJobPlaylist) SetOutputKeys(v []*string) *CreateJobPlaylist { - s.OutputKeys = v - return s -} - -// SetPlayReadyDrm sets the PlayReadyDrm field's value. -func (s *CreateJobPlaylist) SetPlayReadyDrm(v *PlayReadyDrm) *CreateJobPlaylist { - s.PlayReadyDrm = v - return s -} - -// The CreateJobResponse structure. -type CreateJobResponse struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the job that - // is created. - Job *Job `type:"structure"` -} - -// String returns the string representation -func (s CreateJobResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateJobResponse) GoString() string { - return s.String() -} - -// SetJob sets the Job field's value. -func (s *CreateJobResponse) SetJob(v *Job) *CreateJobResponse { - s.Job = v - return s -} - -// The CreatePipelineRequest structure. -type CreatePipelineInput struct { - _ struct{} `type:"structure"` - - // The AWS Key Management Service (AWS KMS) key that you want to use with this - // pipeline. - // - // If you use either S3 or S3-AWS-KMS as your Encryption:Mode, you don't need - // to provide a key with your job because a default key, known as an AWS-KMS - // key, is created for you automatically. You need to provide an AWS-KMS key - // only if you want to use a non-default AWS-KMS key, or if you are using an - // Encryption:Mode of AES-PKCS7, AES-CTR, or AES-GCM. - AwsKmsKeyArn *string `type:"string"` - - // The optional ContentConfig object specifies information about the Amazon - // S3 bucket in which you want Elastic Transcoder to save transcoded files and - // playlists: which bucket to use, which users you want to have access to the - // files, the type of access you want users to have, and the storage class that - // you want to assign to the files. - // - // If you specify values for ContentConfig, you must also specify values for - // ThumbnailConfig. - // - // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket - // object. - // - // * Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to - // save transcoded files and playlists. - // - // * Permissions (Optional): The Permissions object specifies which users - // you want to have access to transcoded files and the type of access you - // want them to have. You can grant permissions to a maximum of 30 users - // and/or predefined Amazon S3 groups. - // - // * Grantee Type: Specify the type of value that appears in the Grantee - // object: - // - // Canonical: The value in the Grantee object is either the canonical user ID - // for an AWS account or an origin access identity for an Amazon CloudFront - // distribution. For more information about canonical user IDs, see Access - // Control List (ACL) Overview in the Amazon Simple Storage Service Developer - // Guide. For more information about using CloudFront origin access identities - // to require that users use CloudFront URLs instead of Amazon S3 URLs, see - // Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content. - // - // A canonical user ID is not the same as an AWS account number. - // - // Email: The value in the Grantee object is the registered email address of - // an AWS account. - // - // Group: The value in the Grantee object is one of the following predefined - // Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. - // - // * Grantee: The AWS user or group that you want to have access to transcoded - // files and playlists. To identify the user or group, you can specify the - // canonical user ID for an AWS account, an origin access identity for a - // CloudFront distribution, the registered email address of an AWS account, - // or a predefined Amazon S3 group - // - // * Access: The permission that you want to give to the AWS user that you - // specified in Grantee. Permissions are granted on the files that Elastic - // Transcoder adds to the bucket, including playlists and video files. Valid - // values include: - // - // READ: The grantee can read the objects and metadata for objects that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // READ_ACP: The grantee can read the object ACL for objects that Elastic Transcoder - // adds to the Amazon S3 bucket. - // - // WRITE_ACP: The grantee can write the ACL for the objects that Elastic Transcoder - // adds to the Amazon S3 bucket. - // - // FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for - // the objects that Elastic Transcoder adds to the Amazon S3 bucket. - // - // * StorageClass: The Amazon S3 storage class, Standard or ReducedRedundancy, - // that you want Elastic Transcoder to assign to the video files and playlists - // that it stores in your Amazon S3 bucket. - ContentConfig *PipelineOutputConfig `type:"structure"` - - // The Amazon S3 bucket in which you saved the media files that you want to - // transcode. - // - // InputBucket is a required field - InputBucket *string `type:"string" required:"true"` - - // The name of the pipeline. We recommend that the name be unique within the - // AWS account, but uniqueness is not enforced. - // - // Constraints: Maximum 40 characters. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The Amazon Simple Notification Service (Amazon SNS) topic that you want to - // notify to report job status. - // - // To receive notifications, you must also subscribe to the new topic in the - // Amazon SNS console. - // - // * Progressing: The topic ARN for the Amazon Simple Notification Service - // (Amazon SNS) topic that you want to notify when Elastic Transcoder has - // started to process a job in this pipeline. This is the ARN that Amazon - // SNS returned when you created the topic. For more information, see Create - // a Topic in the Amazon Simple Notification Service Developer Guide. - // - // * Completed: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder has finished processing a job in this pipeline. - // This is the ARN that Amazon SNS returned when you created the topic. - // - // * Warning: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder encounters a warning condition while processing - // a job in this pipeline. This is the ARN that Amazon SNS returned when - // you created the topic. - // - // * Error: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder encounters an error condition while processing - // a job in this pipeline. This is the ARN that Amazon SNS returned when - // you created the topic. - Notifications *Notifications `type:"structure"` - - // The Amazon S3 bucket in which you want Elastic Transcoder to save the transcoded - // files. (Use this, or use ContentConfig:Bucket plus ThumbnailConfig:Bucket.) - // - // Specify this value when all of the following are true: - // - // * You want to save transcoded files, thumbnails (if any), and playlists - // (if any) together in one bucket. - // - // * You do not want to specify the users or groups who have access to the - // transcoded files, thumbnails, and playlists. - // - // * You do not want to specify the permissions that Elastic Transcoder grants - // to the files. - // - // When Elastic Transcoder saves files in OutputBucket, it grants full control - // over the files only to the AWS account that owns the role that is specified - // by Role. - // - // * You want to associate the transcoded files and thumbnails with the Amazon - // S3 Standard storage class. - // - // If you want to save transcoded files and playlists in one bucket and thumbnails - // in another bucket, specify which users can access the transcoded files or - // the permissions the users have, or change the Amazon S3 storage class, omit - // OutputBucket and specify values for ContentConfig and ThumbnailConfig instead. - OutputBucket *string `type:"string"` - - // The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder - // to use to create the pipeline. - // - // Role is a required field - Role *string `type:"string" required:"true"` - - // The ThumbnailConfig object specifies several values, including the Amazon - // S3 bucket in which you want Elastic Transcoder to save thumbnail files, which - // users you want to have access to the files, the type of access you want users - // to have, and the storage class that you want to assign to the files. - // - // If you specify values for ContentConfig, you must also specify values for - // ThumbnailConfig even if you don't want to create thumbnails. - // - // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket - // object. - // - // * Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to - // save thumbnail files. - // - // * Permissions (Optional): The Permissions object specifies which users - // and/or predefined Amazon S3 groups you want to have access to thumbnail - // files, and the type of access you want them to have. You can grant permissions - // to a maximum of 30 users and/or predefined Amazon S3 groups. - // - // * GranteeType: Specify the type of value that appears in the Grantee object: - // - // - // Canonical: The value in the Grantee object is either the canonical user ID - // for an AWS account or an origin access identity for an Amazon CloudFront - // distribution. - // - // A canonical user ID is not the same as an AWS account number. - // - // Email: The value in the Grantee object is the registered email address of - // an AWS account. - // - // Group: The value in the Grantee object is one of the following predefined - // Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. - // - // * Grantee: The AWS user or group that you want to have access to thumbnail - // files. To identify the user or group, you can specify the canonical user - // ID for an AWS account, an origin access identity for a CloudFront distribution, - // the registered email address of an AWS account, or a predefined Amazon - // S3 group. - // - // * Access: The permission that you want to give to the AWS user that you - // specified in Grantee. Permissions are granted on the thumbnail files that - // Elastic Transcoder adds to the bucket. Valid values include: - // - // READ: The grantee can read the thumbnails and metadata for objects that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // READ_ACP: The grantee can read the object ACL for thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for - // the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. - // - // * StorageClass: The Amazon S3 storage class, Standard or ReducedRedundancy, - // that you want Elastic Transcoder to assign to the thumbnails that it stores - // in your Amazon S3 bucket. - ThumbnailConfig *PipelineOutputConfig `type:"structure"` -} - -// String returns the string representation -func (s CreatePipelineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePipelineInput"} - if s.InputBucket == nil { - invalidParams.Add(request.NewErrParamRequired("InputBucket")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Role == nil { - invalidParams.Add(request.NewErrParamRequired("Role")) - } - if s.ContentConfig != nil { - if err := s.ContentConfig.Validate(); err != nil { - invalidParams.AddNested("ContentConfig", err.(request.ErrInvalidParams)) - } - } - if s.ThumbnailConfig != nil { - if err := s.ThumbnailConfig.Validate(); err != nil { - invalidParams.AddNested("ThumbnailConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsKmsKeyArn sets the AwsKmsKeyArn field's value. -func (s *CreatePipelineInput) SetAwsKmsKeyArn(v string) *CreatePipelineInput { - s.AwsKmsKeyArn = &v - return s -} - -// SetContentConfig sets the ContentConfig field's value. -func (s *CreatePipelineInput) SetContentConfig(v *PipelineOutputConfig) *CreatePipelineInput { - s.ContentConfig = v - return s -} - -// SetInputBucket sets the InputBucket field's value. -func (s *CreatePipelineInput) SetInputBucket(v string) *CreatePipelineInput { - s.InputBucket = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePipelineInput) SetName(v string) *CreatePipelineInput { - s.Name = &v - return s -} - -// SetNotifications sets the Notifications field's value. -func (s *CreatePipelineInput) SetNotifications(v *Notifications) *CreatePipelineInput { - s.Notifications = v - return s -} - -// SetOutputBucket sets the OutputBucket field's value. -func (s *CreatePipelineInput) SetOutputBucket(v string) *CreatePipelineInput { - s.OutputBucket = &v - return s -} - -// SetRole sets the Role field's value. -func (s *CreatePipelineInput) SetRole(v string) *CreatePipelineInput { - s.Role = &v - return s -} - -// SetThumbnailConfig sets the ThumbnailConfig field's value. -func (s *CreatePipelineInput) SetThumbnailConfig(v *PipelineOutputConfig) *CreatePipelineInput { - s.ThumbnailConfig = v - return s -} - -// When you create a pipeline, Elastic Transcoder returns the values that you -// specified in the request. -type CreatePipelineOutput struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the pipeline - // that is created. - Pipeline *Pipeline `type:"structure"` - - // Elastic Transcoder returns a warning if the resources used by your pipeline - // are not in the same region as the pipeline. - // - // Using resources in the same region, such as your Amazon S3 buckets, Amazon - // SNS notification topics, and AWS KMS key, reduces processing time and prevents - // cross-regional charges. - Warnings []*Warning `type:"list"` -} - -// String returns the string representation -func (s CreatePipelineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *CreatePipelineOutput) SetPipeline(v *Pipeline) *CreatePipelineOutput { - s.Pipeline = v - return s -} - -// SetWarnings sets the Warnings field's value. -func (s *CreatePipelineOutput) SetWarnings(v []*Warning) *CreatePipelineOutput { - s.Warnings = v - return s -} - -// The CreatePresetRequest structure. -type CreatePresetInput struct { - _ struct{} `type:"structure"` - - // A section of the request body that specifies the audio parameters. - Audio *AudioParameters `type:"structure"` - - // The container type for the output file. Valid values include flac, flv, fmp4, - // gif, mp3, mp4, mpg, mxf, oga, ogg, ts, and webm. - // - // Container is a required field - Container *string `type:"string" required:"true"` - - // A description of the preset. - Description *string `type:"string"` - - // The name of the preset. We recommend that the name be unique within the AWS - // account, but uniqueness is not enforced. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A section of the request body that specifies the thumbnail parameters, if - // any. - Thumbnails *Thumbnails `type:"structure"` - - // A section of the request body that specifies the video parameters. - Video *VideoParameters `type:"structure"` -} - -// String returns the string representation -func (s CreatePresetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePresetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePresetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePresetInput"} - if s.Container == nil { - invalidParams.Add(request.NewErrParamRequired("Container")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Video != nil { - if err := s.Video.Validate(); err != nil { - invalidParams.AddNested("Video", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAudio sets the Audio field's value. -func (s *CreatePresetInput) SetAudio(v *AudioParameters) *CreatePresetInput { - s.Audio = v - return s -} - -// SetContainer sets the Container field's value. -func (s *CreatePresetInput) SetContainer(v string) *CreatePresetInput { - s.Container = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreatePresetInput) SetDescription(v string) *CreatePresetInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePresetInput) SetName(v string) *CreatePresetInput { - s.Name = &v - return s -} - -// SetThumbnails sets the Thumbnails field's value. -func (s *CreatePresetInput) SetThumbnails(v *Thumbnails) *CreatePresetInput { - s.Thumbnails = v - return s -} - -// SetVideo sets the Video field's value. -func (s *CreatePresetInput) SetVideo(v *VideoParameters) *CreatePresetInput { - s.Video = v - return s -} - -// The CreatePresetResponse structure. -type CreatePresetOutput struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the preset - // that is created. - Preset *Preset `type:"structure"` - - // If the preset settings don't comply with the standards for the video codec - // but Elastic Transcoder created the preset, this message explains the reason - // the preset settings don't meet the standard. Elastic Transcoder created the - // preset because the settings might produce acceptable output. - Warning *string `type:"string"` -} - -// String returns the string representation -func (s CreatePresetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreatePresetOutput) GoString() string { - return s.String() -} - -// SetPreset sets the Preset field's value. -func (s *CreatePresetOutput) SetPreset(v *Preset) *CreatePresetOutput { - s.Preset = v - return s -} - -// SetWarning sets the Warning field's value. -func (s *CreatePresetOutput) SetWarning(v string) *CreatePresetOutput { - s.Warning = &v - return s -} - -// The DeletePipelineRequest structure. -type DeletePipelineInput struct { - _ struct{} `type:"structure"` - - // The identifier of the pipeline that you want to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePipelineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePipelineInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeletePipelineInput) SetId(v string) *DeletePipelineInput { - s.Id = &v - return s -} - -// The DeletePipelineResponse structure. -type DeletePipelineOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePipelineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePipelineOutput) GoString() string { - return s.String() -} - -// The DeletePresetRequest structure. -type DeletePresetInput struct { - _ struct{} `type:"structure"` - - // The identifier of the preset for which you want to get detailed information. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeletePresetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePresetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePresetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePresetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeletePresetInput) SetId(v string) *DeletePresetInput { - s.Id = &v - return s -} - -// The DeletePresetResponse structure. -type DeletePresetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeletePresetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletePresetOutput) GoString() string { - return s.String() -} - -// The detected properties of the input file. Elastic Transcoder identifies -// these values from the input file. -type DetectedProperties struct { - _ struct{} `type:"structure"` - - // The detected duration of the input file, in milliseconds. - DurationMillis *int64 `type:"long"` - - // The detected file size of the input file, in bytes. - FileSize *int64 `type:"long"` - - // The detected frame rate of the input file, in frames per second. - FrameRate *string `type:"string"` - - // The detected height of the input file, in pixels. - Height *int64 `type:"integer"` - - // The detected width of the input file, in pixels. - Width *int64 `type:"integer"` -} - -// String returns the string representation -func (s DetectedProperties) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetectedProperties) GoString() string { - return s.String() -} - -// SetDurationMillis sets the DurationMillis field's value. -func (s *DetectedProperties) SetDurationMillis(v int64) *DetectedProperties { - s.DurationMillis = &v - return s -} - -// SetFileSize sets the FileSize field's value. -func (s *DetectedProperties) SetFileSize(v int64) *DetectedProperties { - s.FileSize = &v - return s -} - -// SetFrameRate sets the FrameRate field's value. -func (s *DetectedProperties) SetFrameRate(v string) *DetectedProperties { - s.FrameRate = &v - return s -} - -// SetHeight sets the Height field's value. -func (s *DetectedProperties) SetHeight(v int64) *DetectedProperties { - s.Height = &v - return s -} - -// SetWidth sets the Width field's value. -func (s *DetectedProperties) SetWidth(v int64) *DetectedProperties { - s.Width = &v - return s -} - -// The encryption settings, if any, that are used for decrypting your input -// files or encrypting your output files. If your input file is encrypted, you -// must specify the mode that Elastic Transcoder uses to decrypt your file, -// otherwise you must specify the mode you want Elastic Transcoder to use to -// encrypt your output files. -type Encryption struct { - _ struct{} `type:"structure"` - - // The series of random bits created by a random bit generator, unique for every - // encryption operation, that you used to encrypt your input files or that you - // want Elastic Transcoder to use to encrypt your output files. The initialization - // vector must be base64-encoded, and it must be exactly 16 bytes long before - // being base64-encoded. - InitializationVector *string `type:"string"` - - // The data encryption key that you want Elastic Transcoder to use to encrypt - // your output file, or that was used to encrypt your input file. The key must - // be base64-encoded and it must be one of the following bit lengths before - // being base64-encoded: - // - // 128, 192, or 256. - // - // The key must also be encrypted by using the Amazon Key Management Service. - Key *string `type:"string"` - - // The MD5 digest of the key that you used to encrypt your input file, or that - // you want Elastic Transcoder to use to encrypt your output file. Elastic Transcoder - // uses the key digest as a checksum to make sure your key was not corrupted - // in transit. The key MD5 must be base64-encoded, and it must be exactly 16 - // bytes long before being base64-encoded. - KeyMd5 *string `type:"string"` - - // The specific server-side encryption mode that you want Elastic Transcoder - // to use when decrypting your input files or encrypting your output files. - // Elastic Transcoder supports the following options: - // - // * S3: Amazon S3 creates and manages the keys used for encrypting your - // files. - // - // * S3-AWS-KMS: Amazon S3 calls the Amazon Key Management Service, which - // creates and manages the keys that are used for encrypting your files. - // If you specify S3-AWS-KMS and you don't want to use the default key, you - // must add the AWS-KMS key that you want to use to your pipeline. - // - // * AES-CBC-PKCS7: A padded cipher-block mode of operation originally used - // for HLS files. - // - // * AES-CTR: AES Counter Mode. - // - // * AES-GCM: AES Galois Counter Mode, a mode of operation that is an authenticated - // encryption format, meaning that a file, key, or initialization vector - // that has been tampered with fails the decryption process. - // - // For all three AES options, you must provide the following settings, which - // must be base64-encoded: - // - // * Key - // - // * Key MD5 - // - // * Initialization Vector - // - // For the AES modes, your private encryption keys and your unencrypted data - // are never stored by AWS; therefore, it is important that you safely manage - // your encryption keys. If you lose them, you won't be able to unencrypt your - // data. - Mode *string `type:"string"` -} - -// String returns the string representation -func (s Encryption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Encryption) GoString() string { - return s.String() -} - -// SetInitializationVector sets the InitializationVector field's value. -func (s *Encryption) SetInitializationVector(v string) *Encryption { - s.InitializationVector = &v - return s -} - -// SetKey sets the Key field's value. -func (s *Encryption) SetKey(v string) *Encryption { - s.Key = &v - return s -} - -// SetKeyMd5 sets the KeyMd5 field's value. -func (s *Encryption) SetKeyMd5(v string) *Encryption { - s.KeyMd5 = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *Encryption) SetMode(v string) *Encryption { - s.Mode = &v - return s -} - -// The HLS content protection settings, if any, that you want Elastic Transcoder -// to apply to your output files. -type HlsContentProtection struct { - _ struct{} `type:"structure"` - - // If Elastic Transcoder is generating your key for you, you must leave this - // field blank. - // - // The series of random bits created by a random bit generator, unique for every - // encryption operation, that you want Elastic Transcoder to use to encrypt - // your output files. The initialization vector must be base64-encoded, and - // it must be exactly 16 bytes before being base64-encoded. - InitializationVector *string `type:"string"` - - // If you want Elastic Transcoder to generate a key for you, leave this field - // blank. - // - // If you choose to supply your own key, you must encrypt the key by using AWS - // KMS. The key must be base64-encoded, and it must be one of the following - // bit lengths before being base64-encoded: - // - // 128, 192, or 256. - Key *string `type:"string"` - - // If Elastic Transcoder is generating your key for you, you must leave this - // field blank. - // - // The MD5 digest of the key that you want Elastic Transcoder to use to encrypt - // your output file, and that you want Elastic Transcoder to use as a checksum - // to make sure your key was not corrupted in transit. The key MD5 must be base64-encoded, - // and it must be exactly 16 bytes before being base64- encoded. - KeyMd5 *string `type:"string"` - - // Specify whether you want Elastic Transcoder to write your HLS license key - // to an Amazon S3 bucket. If you choose WithVariantPlaylists, LicenseAcquisitionUrl - // must be left blank and Elastic Transcoder writes your data key into the same - // bucket as the associated playlist. - KeyStoragePolicy *string `type:"string"` - - // The location of the license key required to decrypt your HLS playlist. The - // URL must be an absolute path, and is referenced in the URI attribute of the - // EXT-X-KEY metadata tag in the playlist file. - LicenseAcquisitionUrl *string `type:"string"` - - // The content protection method for your output. The only valid value is: aes-128. - // - // This value is written into the method attribute of the EXT-X-KEY metadata - // tag in the output playlist. - Method *string `type:"string"` -} - -// String returns the string representation -func (s HlsContentProtection) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HlsContentProtection) GoString() string { - return s.String() -} - -// SetInitializationVector sets the InitializationVector field's value. -func (s *HlsContentProtection) SetInitializationVector(v string) *HlsContentProtection { - s.InitializationVector = &v - return s -} - -// SetKey sets the Key field's value. -func (s *HlsContentProtection) SetKey(v string) *HlsContentProtection { - s.Key = &v - return s -} - -// SetKeyMd5 sets the KeyMd5 field's value. -func (s *HlsContentProtection) SetKeyMd5(v string) *HlsContentProtection { - s.KeyMd5 = &v - return s -} - -// SetKeyStoragePolicy sets the KeyStoragePolicy field's value. -func (s *HlsContentProtection) SetKeyStoragePolicy(v string) *HlsContentProtection { - s.KeyStoragePolicy = &v - return s -} - -// SetLicenseAcquisitionUrl sets the LicenseAcquisitionUrl field's value. -func (s *HlsContentProtection) SetLicenseAcquisitionUrl(v string) *HlsContentProtection { - s.LicenseAcquisitionUrl = &v - return s -} - -// SetMethod sets the Method field's value. -func (s *HlsContentProtection) SetMethod(v string) *HlsContentProtection { - s.Method = &v - return s -} - -// The captions to be created, if any. -type InputCaptions struct { - _ struct{} `type:"structure"` - - // Source files for the input sidecar captions used during the transcoding process. - // To omit all sidecar captions, leave CaptionSources blank. - CaptionSources []*CaptionSource `type:"list"` - - // A policy that determines how Elastic Transcoder handles the existence of - // multiple captions. - // - // * MergeOverride: Elastic Transcoder transcodes both embedded and sidecar - // captions into outputs. If captions for a language are embedded in the - // input file and also appear in a sidecar file, Elastic Transcoder uses - // the sidecar captions and ignores the embedded captions for that language. - // - // * MergeRetain: Elastic Transcoder transcodes both embedded and sidecar - // captions into outputs. If captions for a language are embedded in the - // input file and also appear in a sidecar file, Elastic Transcoder uses - // the embedded captions and ignores the sidecar captions for that language. - // If CaptionSources is empty, Elastic Transcoder omits all sidecar captions - // from the output files. - // - // * Override: Elastic Transcoder transcodes only the sidecar captions that - // you specify in CaptionSources. - // - // MergePolicy cannot be null. - MergePolicy *string `type:"string"` -} - -// String returns the string representation -func (s InputCaptions) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InputCaptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputCaptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputCaptions"} - if s.CaptionSources != nil { - for i, v := range s.CaptionSources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionSources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaptionSources sets the CaptionSources field's value. -func (s *InputCaptions) SetCaptionSources(v []*CaptionSource) *InputCaptions { - s.CaptionSources = v - return s -} - -// SetMergePolicy sets the MergePolicy field's value. -func (s *InputCaptions) SetMergePolicy(v string) *InputCaptions { - s.MergePolicy = &v - return s -} - -// A section of the response body that provides information about the job that -// is created. -type Job struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the job. - Arn *string `type:"string"` - - // The identifier that Elastic Transcoder assigned to the job. You use this - // value to get settings for the job or to delete the job. - Id *string `type:"string"` - - // A section of the request or response body that provides information about - // the file that is being transcoded. - Input *JobInput `type:"structure"` - - // Information about the files that you're transcoding. If you specified multiple - // files for this job, Elastic Transcoder stitches the files together to make - // one output. - Inputs []*JobInput `type:"list"` - - // If you specified one output for a job, information about that output. If - // you specified multiple outputs for a job, the Output object lists information - // about the first output. This duplicates the information that is listed for - // the first output in the Outputs object. - // - // Outputs recommended instead. - // - // A section of the request or response body that provides information about - // the transcoded (target) file. - Output *JobOutput `type:"structure"` - - // The value, if any, that you want Elastic Transcoder to prepend to the names - // of all files that this job creates, including output files, thumbnails, and - // playlists. We recommend that you add a / or some other delimiter to the end - // of the OutputKeyPrefix. - OutputKeyPrefix *string `min:"1" type:"string"` - - // Information about the output files. We recommend that you use the Outputs - // syntax for all jobs, even when you want Elastic Transcoder to transcode a - // file into only one format. Do not use both the Outputs and Output syntaxes - // in the same request. You can create a maximum of 30 outputs per job. - // - // If you specify more than one output for a job, Elastic Transcoder creates - // the files for each output in the order in which you specify them in the job. - Outputs []*JobOutput `type:"list"` - - // The Id of the pipeline that you want Elastic Transcoder to use for transcoding. - // The pipeline determines several settings, including the Amazon S3 bucket - // from which Elastic Transcoder gets the files to transcode and the bucket - // into which Elastic Transcoder puts the transcoded files. - PipelineId *string `type:"string"` - - // Outputs in Fragmented MP4 or MPEG-TS format only. - // - // If you specify a preset in PresetId for which the value of Container is fmp4 - // (Fragmented MP4) or ts (MPEG-TS), Playlists contains information about the - // master playlists that you want Elastic Transcoder to create. - // - // The maximum number of master playlists in a job is 30. - Playlists []*Playlist `type:"list"` - - // The status of the job: Submitted, Progressing, Complete, Canceled, or Error. - Status *string `type:"string"` - - // Details about the timing of a job. - Timing *Timing `type:"structure"` - - // User-defined metadata that you want to associate with an Elastic Transcoder - // job. You specify metadata in key/value pairs, and you can add up to 10 key/value - // pairs per job. Elastic Transcoder does not guarantee that key/value pairs - // are returned in the same order in which you specify them. - // - // Metadata keys and values must use characters from the following list: - // - // * 0-9 - // - // * A-Z and a-z - // - // * Space - // - // * The following symbols: _.:/=+-%@ - UserMetadata map[string]*string `type:"map"` -} - -// String returns the string representation -func (s Job) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Job) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Job) SetArn(v string) *Job { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *Job) SetId(v string) *Job { - s.Id = &v - return s -} - -// SetInput sets the Input field's value. -func (s *Job) SetInput(v *JobInput) *Job { - s.Input = v - return s -} - -// SetInputs sets the Inputs field's value. -func (s *Job) SetInputs(v []*JobInput) *Job { - s.Inputs = v - return s -} - -// SetOutput sets the Output field's value. -func (s *Job) SetOutput(v *JobOutput) *Job { - s.Output = v - return s -} - -// SetOutputKeyPrefix sets the OutputKeyPrefix field's value. -func (s *Job) SetOutputKeyPrefix(v string) *Job { - s.OutputKeyPrefix = &v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *Job) SetOutputs(v []*JobOutput) *Job { - s.Outputs = v - return s -} - -// SetPipelineId sets the PipelineId field's value. -func (s *Job) SetPipelineId(v string) *Job { - s.PipelineId = &v - return s -} - -// SetPlaylists sets the Playlists field's value. -func (s *Job) SetPlaylists(v []*Playlist) *Job { - s.Playlists = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Job) SetStatus(v string) *Job { - s.Status = &v - return s -} - -// SetTiming sets the Timing field's value. -func (s *Job) SetTiming(v *Timing) *Job { - s.Timing = v - return s -} - -// SetUserMetadata sets the UserMetadata field's value. -func (s *Job) SetUserMetadata(v map[string]*string) *Job { - s.UserMetadata = v - return s -} - -// The .jpg or .png file associated with an audio file. -type JobAlbumArt struct { - _ struct{} `type:"structure"` - - // The file to be used as album art. There can be multiple artworks associated - // with an audio file, to a maximum of 20. Valid formats are .jpg and .png - Artwork []*Artwork `type:"list"` - - // A policy that determines how Elastic Transcoder handles the existence of - // multiple album artwork files. - // - // * Replace: The specified album art replaces any existing album art. - // - // * Prepend: The specified album art is placed in front of any existing - // album art. - // - // * Append: The specified album art is placed after any existing album art. - // - // * Fallback: If the original input file contains artwork, Elastic Transcoder - // uses that artwork for the output. If the original input does not contain - // artwork, Elastic Transcoder uses the specified album art file. - MergePolicy *string `type:"string"` -} - -// String returns the string representation -func (s JobAlbumArt) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobAlbumArt) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *JobAlbumArt) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "JobAlbumArt"} - if s.Artwork != nil { - for i, v := range s.Artwork { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Artwork", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArtwork sets the Artwork field's value. -func (s *JobAlbumArt) SetArtwork(v []*Artwork) *JobAlbumArt { - s.Artwork = v - return s -} - -// SetMergePolicy sets the MergePolicy field's value. -func (s *JobAlbumArt) SetMergePolicy(v string) *JobAlbumArt { - s.MergePolicy = &v - return s -} - -// Information about the file that you're transcoding. -type JobInput struct { - _ struct{} `type:"structure"` - - // The aspect ratio of the input file. If you want Elastic Transcoder to automatically - // detect the aspect ratio of the input file, specify auto. If you want to specify - // the aspect ratio for the output file, enter one of the following values: - // - // 1:1, 4:3, 3:2, 16:9 - // - // If you specify a value other than auto, Elastic Transcoder disables automatic - // detection of the aspect ratio. - AspectRatio *string `type:"string"` - - // The container type for the input file. If you want Elastic Transcoder to - // automatically detect the container type of the input file, specify auto. - // If you want to specify the container type for the input file, enter one of - // the following values: - // - // 3gp, aac, asf, avi, divx, flv, m4a, mkv, mov, mp3, mp4, mpeg, mpeg-ps, mpeg-ts, - // mxf, ogg, vob, wav, webm - Container *string `type:"string"` - - // The detected properties of the input file. - DetectedProperties *DetectedProperties `type:"structure"` - - // The encryption settings, if any, that are used for decrypting your input - // files. If your input file is encrypted, you must specify the mode that Elastic - // Transcoder uses to decrypt your file. - Encryption *Encryption `type:"structure"` - - // The frame rate of the input file. If you want Elastic Transcoder to automatically - // detect the frame rate of the input file, specify auto. If you want to specify - // the frame rate for the input file, enter one of the following values: - // - // 10, 15, 23.97, 24, 25, 29.97, 30, 60 - // - // If you specify a value other than auto, Elastic Transcoder disables automatic - // detection of the frame rate. - FrameRate *string `type:"string"` - - // You can configure Elastic Transcoder to transcode captions, or subtitles, - // from one format to another. All captions must be in UTF-8. Elastic Transcoder - // supports two types of captions: - // - // * Embedded: Embedded captions are included in the same file as the audio - // and video. Elastic Transcoder supports only one embedded caption per language, - // to a maximum of 300 embedded captions per file. - // - // Valid input values include: CEA-608 (EIA-608, first non-empty channel only), - // CEA-708 (EIA-708, first non-empty channel only), and mov-text - // - // Valid outputs include: mov-text - // - // Elastic Transcoder supports a maximum of one embedded format per output. - // - // * Sidecar: Sidecar captions are kept in a separate metadata file from - // the audio and video data. Sidecar captions require a player that is capable - // of understanding the relationship between the video file and the sidecar - // file. Elastic Transcoder supports only one sidecar caption per language, - // to a maximum of 20 sidecar captions per file. - // - // Valid input values include: dfxp (first div element only), ebu-tt, scc, smpt, - // srt, ttml (first div element only), and webvtt - // - // Valid outputs include: dfxp (first div element only), scc, srt, and webvtt. - // - // If you want ttml or smpte-tt compatible captions, specify dfxp as your output - // format. - // - // Elastic Transcoder does not support OCR (Optical Character Recognition), - // does not accept pictures as a valid input for captions, and is not available - // for audio-only transcoding. Elastic Transcoder does not preserve text formatting - // (for example, italics) during the transcoding process. - // - // To remove captions or leave the captions empty, set Captions to null. To - // pass through existing captions unchanged, set the MergePolicy to MergeRetain, - // and pass in a null CaptionSources array. - // - // For more information on embedded files, see the Subtitles Wikipedia page. - // - // For more information on sidecar files, see the Extensible Metadata Platform - // and Sidecar file Wikipedia pages. - InputCaptions *InputCaptions `type:"structure"` - - // Whether the input file is interlaced. If you want Elastic Transcoder to automatically - // detect whether the input file is interlaced, specify auto. If you want to - // specify whether the input file is interlaced, enter one of the following - // values: - // - // true, false - // - // If you specify a value other than auto, Elastic Transcoder disables automatic - // detection of interlacing. - Interlaced *string `type:"string"` - - // The name of the file to transcode. Elsewhere in the body of the JSON block - // is the the ID of the pipeline to use for processing the job. The InputBucket - // object in that pipeline tells Elastic Transcoder which Amazon S3 bucket to - // get the file from. - // - // If the file name includes a prefix, such as cooking/lasagna.mpg, include - // the prefix in the key. If the file isn't in the specified bucket, Elastic - // Transcoder returns an error. - Key *string `min:"1" type:"string"` - - // This value must be auto, which causes Elastic Transcoder to automatically - // detect the resolution of the input file. - Resolution *string `type:"string"` - - // Settings for clipping an input. Each input can have different clip settings. - TimeSpan *TimeSpan `type:"structure"` -} - -// String returns the string representation -func (s JobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *JobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "JobInput"} - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.InputCaptions != nil { - if err := s.InputCaptions.Validate(); err != nil { - invalidParams.AddNested("InputCaptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAspectRatio sets the AspectRatio field's value. -func (s *JobInput) SetAspectRatio(v string) *JobInput { - s.AspectRatio = &v - return s -} - -// SetContainer sets the Container field's value. -func (s *JobInput) SetContainer(v string) *JobInput { - s.Container = &v - return s -} - -// SetDetectedProperties sets the DetectedProperties field's value. -func (s *JobInput) SetDetectedProperties(v *DetectedProperties) *JobInput { - s.DetectedProperties = v - return s -} - -// SetEncryption sets the Encryption field's value. -func (s *JobInput) SetEncryption(v *Encryption) *JobInput { - s.Encryption = v - return s -} - -// SetFrameRate sets the FrameRate field's value. -func (s *JobInput) SetFrameRate(v string) *JobInput { - s.FrameRate = &v - return s -} - -// SetInputCaptions sets the InputCaptions field's value. -func (s *JobInput) SetInputCaptions(v *InputCaptions) *JobInput { - s.InputCaptions = v - return s -} - -// SetInterlaced sets the Interlaced field's value. -func (s *JobInput) SetInterlaced(v string) *JobInput { - s.Interlaced = &v - return s -} - -// SetKey sets the Key field's value. -func (s *JobInput) SetKey(v string) *JobInput { - s.Key = &v - return s -} - -// SetResolution sets the Resolution field's value. -func (s *JobInput) SetResolution(v string) *JobInput { - s.Resolution = &v - return s -} - -// SetTimeSpan sets the TimeSpan field's value. -func (s *JobInput) SetTimeSpan(v *TimeSpan) *JobInput { - s.TimeSpan = v - return s -} - -// Outputs recommended instead. -// -// If you specified one output for a job, information about that output. If -// you specified multiple outputs for a job, the Output object lists information -// about the first output. This duplicates the information that is listed for -// the first output in the Outputs object. -type JobOutput struct { - _ struct{} `type:"structure"` - - // The album art to be associated with the output file, if any. - AlbumArt *JobAlbumArt `type:"structure"` - - // If Elastic Transcoder used a preset with a ColorSpaceConversionMode to transcode - // the output file, the AppliedColorSpaceConversion parameter shows the conversion - // used. If no ColorSpaceConversionMode was defined in the preset, this parameter - // is not be included in the job response. - AppliedColorSpaceConversion *string `type:"string"` - - // You can configure Elastic Transcoder to transcode captions, or subtitles, - // from one format to another. All captions must be in UTF-8. Elastic Transcoder - // supports two types of captions: - // - // * Embedded: Embedded captions are included in the same file as the audio - // and video. Elastic Transcoder supports only one embedded caption per language, - // to a maximum of 300 embedded captions per file. - // - // Valid input values include: CEA-608 (EIA-608, first non-empty channel only), - // CEA-708 (EIA-708, first non-empty channel only), and mov-text - // - // Valid outputs include: mov-text - // - // Elastic Transcoder supports a maximum of one embedded format per output. - // - // * Sidecar: Sidecar captions are kept in a separate metadata file from - // the audio and video data. Sidecar captions require a player that is capable - // of understanding the relationship between the video file and the sidecar - // file. Elastic Transcoder supports only one sidecar caption per language, - // to a maximum of 20 sidecar captions per file. - // - // Valid input values include: dfxp (first div element only), ebu-tt, scc, smpt, - // srt, ttml (first div element only), and webvtt - // - // Valid outputs include: dfxp (first div element only), scc, srt, and webvtt. - // - // If you want ttml or smpte-tt compatible captions, specify dfxp as your output - // format. - // - // Elastic Transcoder does not support OCR (Optical Character Recognition), - // does not accept pictures as a valid input for captions, and is not available - // for audio-only transcoding. Elastic Transcoder does not preserve text formatting - // (for example, italics) during the transcoding process. - // - // To remove captions or leave the captions empty, set Captions to null. To - // pass through existing captions unchanged, set the MergePolicy to MergeRetain, - // and pass in a null CaptionSources array. - // - // For more information on embedded files, see the Subtitles Wikipedia page. - // - // For more information on sidecar files, see the Extensible Metadata Platform - // and Sidecar file Wikipedia pages. - Captions *Captions `type:"structure"` - - // You can create an output file that contains an excerpt from the input file. - // This excerpt, called a clip, can come from the beginning, middle, or end - // of the file. The Composition object contains settings for the clips that - // make up an output file. For the current release, you can only specify settings - // for a single clip per output file. The Composition object cannot be null. - Composition []*Clip `deprecated:"true" type:"list"` - - // Duration of the output file, in seconds. - Duration *int64 `type:"long"` - - // Duration of the output file, in milliseconds. - DurationMillis *int64 `type:"long"` - - // The encryption settings, if any, that you want Elastic Transcoder to apply - // to your output files. If you choose to use encryption, you must specify a - // mode to use. If you choose not to use encryption, Elastic Transcoder writes - // an unencrypted file to your Amazon S3 bucket. - Encryption *Encryption `type:"structure"` - - // File size of the output file, in bytes. - FileSize *int64 `type:"long"` - - // Frame rate of the output file, in frames per second. - FrameRate *string `type:"string"` - - // Height of the output file, in pixels. - Height *int64 `type:"integer"` - - // A sequential counter, starting with 1, that identifies an output among the - // outputs from the current job. In the Output syntax, this value is always - // 1. - Id *string `type:"string"` - - // The name to assign to the transcoded file. Elastic Transcoder saves the file - // in the Amazon S3 bucket specified by the OutputBucket object in the pipeline - // that is specified by the pipeline ID. - Key *string `min:"1" type:"string"` - - // The value of the Id object for the preset that you want to use for this job. - // The preset determines the audio, video, and thumbnail settings that Elastic - // Transcoder uses for transcoding. To use a preset that you created, specify - // the preset ID that Elastic Transcoder returned in the response when you created - // the preset. You can also use the Elastic Transcoder system presets, which - // you can get with ListPresets. - PresetId *string `type:"string"` - - // The number of degrees clockwise by which you want Elastic Transcoder to rotate - // the output relative to the input. Enter one of the following values: - // - // auto, 0, 90, 180, 270 - // - // The value auto generally works only if the file that you're transcoding contains - // rotation metadata. - Rotate *string `type:"string"` - - // (Outputs in Fragmented MP4 or MPEG-TS format only. - // - // If you specify a preset in PresetId for which the value of Container is fmp4 - // (Fragmented MP4) or ts (MPEG-TS), SegmentDuration is the target maximum duration - // of each segment in seconds. For HLSv3 format playlists, each media segment - // is stored in a separate .ts file. For HLSv4, MPEG-DASH, and Smooth playlists, - // all media segments for an output are stored in a single file. Each segment - // is approximately the length of the SegmentDuration, though individual segments - // might be shorter or longer. - // - // The range of valid values is 1 to 60 seconds. If the duration of the video - // is not evenly divisible by SegmentDuration, the duration of the last segment - // is the remainder of total length/SegmentDuration. - // - // Elastic Transcoder creates an output-specific playlist for each output HLS - // output that you specify in OutputKeys. To add an output to the master playlist - // for this job, include it in the OutputKeys of the associated playlist. - SegmentDuration *string `type:"string"` - - // The status of one output in a job. If you specified only one output for the - // job, Outputs:Status is always the same as Job:Status. If you specified more - // than one output: - // - // * Job:Status and Outputs:Status for all of the outputs is Submitted until - // Elastic Transcoder starts to process the first output. - // - // * When Elastic Transcoder starts to process the first output, Outputs:Status - // for that output and Job:Status both change to Progressing. For each output, - // the value of Outputs:Status remains Submitted until Elastic Transcoder - // starts to process the output. - // - // * Job:Status remains Progressing until all of the outputs reach a terminal - // status, either Complete or Error. - // - // * When all of the outputs reach a terminal status, Job:Status changes - // to Complete only if Outputs:Status for all of the outputs is Complete. - // If Outputs:Status for one or more outputs is Error, the terminal status - // for Job:Status is also Error. - // - // The value of Status is one of the following: Submitted, Progressing, Complete, - // Canceled, or Error. - Status *string `type:"string"` - - // Information that further explains Status. - StatusDetail *string `type:"string"` - - // The encryption settings, if any, that you want Elastic Transcoder to apply - // to your thumbnail. - ThumbnailEncryption *Encryption `type:"structure"` - - // Whether you want Elastic Transcoder to create thumbnails for your videos - // and, if so, how you want Elastic Transcoder to name the files. - // - // If you don't want Elastic Transcoder to create thumbnails, specify "". - // - // If you do want Elastic Transcoder to create thumbnails, specify the information - // that you want to include in the file name for each thumbnail. You can specify - // the following values in any sequence: - // - // * {count} (Required): If you want to create thumbnails, you must include - // {count} in the ThumbnailPattern object. Wherever you specify {count}, - // Elastic Transcoder adds a five-digit sequence number (beginning with 00001) - // to thumbnail file names. The number indicates where a given thumbnail - // appears in the sequence of thumbnails for a transcoded file. - // - // If you specify a literal value and/or {resolution} but you omit {count}, - // Elastic Transcoder returns a validation error and does not create the - // job. - // - // * Literal values (Optional): You can specify literal values anywhere in - // the ThumbnailPattern object. For example, you can include them as a file - // name prefix or as a delimiter between {resolution} and {count}. - // - // * {resolution} (Optional): If you want Elastic Transcoder to include the - // resolution in the file name, include {resolution} in the ThumbnailPattern - // object. - // - // When creating thumbnails, Elastic Transcoder automatically saves the files - // in the format (.jpg or .png) that appears in the preset that you specified - // in the PresetID value of CreateJobOutput. Elastic Transcoder also appends - // the applicable file name extension. - ThumbnailPattern *string `type:"string"` - - // Information about the watermarks that you want Elastic Transcoder to add - // to the video during transcoding. You can specify up to four watermarks for - // each output. Settings for each watermark must be defined in the preset that - // you specify in Preset for the current output. - // - // Watermarks are added to the output video in the sequence in which you list - // them in the job output—the first watermark in the list is added to the output - // video first, the second watermark in the list is added next, and so on. As - // a result, if the settings in a preset cause Elastic Transcoder to place all - // watermarks in the same location, the second watermark that you add covers - // the first one, the third one covers the second, and the fourth one covers - // the third. - Watermarks []*JobWatermark `type:"list"` - - // Specifies the width of the output file in pixels. - Width *int64 `type:"integer"` -} - -// String returns the string representation -func (s JobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobOutput) GoString() string { - return s.String() -} - -// SetAlbumArt sets the AlbumArt field's value. -func (s *JobOutput) SetAlbumArt(v *JobAlbumArt) *JobOutput { - s.AlbumArt = v - return s -} - -// SetAppliedColorSpaceConversion sets the AppliedColorSpaceConversion field's value. -func (s *JobOutput) SetAppliedColorSpaceConversion(v string) *JobOutput { - s.AppliedColorSpaceConversion = &v - return s -} - -// SetCaptions sets the Captions field's value. -func (s *JobOutput) SetCaptions(v *Captions) *JobOutput { - s.Captions = v - return s -} - -// SetComposition sets the Composition field's value. -func (s *JobOutput) SetComposition(v []*Clip) *JobOutput { - s.Composition = v - return s -} - -// SetDuration sets the Duration field's value. -func (s *JobOutput) SetDuration(v int64) *JobOutput { - s.Duration = &v - return s -} - -// SetDurationMillis sets the DurationMillis field's value. -func (s *JobOutput) SetDurationMillis(v int64) *JobOutput { - s.DurationMillis = &v - return s -} - -// SetEncryption sets the Encryption field's value. -func (s *JobOutput) SetEncryption(v *Encryption) *JobOutput { - s.Encryption = v - return s -} - -// SetFileSize sets the FileSize field's value. -func (s *JobOutput) SetFileSize(v int64) *JobOutput { - s.FileSize = &v - return s -} - -// SetFrameRate sets the FrameRate field's value. -func (s *JobOutput) SetFrameRate(v string) *JobOutput { - s.FrameRate = &v - return s -} - -// SetHeight sets the Height field's value. -func (s *JobOutput) SetHeight(v int64) *JobOutput { - s.Height = &v - return s -} - -// SetId sets the Id field's value. -func (s *JobOutput) SetId(v string) *JobOutput { - s.Id = &v - return s -} - -// SetKey sets the Key field's value. -func (s *JobOutput) SetKey(v string) *JobOutput { - s.Key = &v - return s -} - -// SetPresetId sets the PresetId field's value. -func (s *JobOutput) SetPresetId(v string) *JobOutput { - s.PresetId = &v - return s -} - -// SetRotate sets the Rotate field's value. -func (s *JobOutput) SetRotate(v string) *JobOutput { - s.Rotate = &v - return s -} - -// SetSegmentDuration sets the SegmentDuration field's value. -func (s *JobOutput) SetSegmentDuration(v string) *JobOutput { - s.SegmentDuration = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *JobOutput) SetStatus(v string) *JobOutput { - s.Status = &v - return s -} - -// SetStatusDetail sets the StatusDetail field's value. -func (s *JobOutput) SetStatusDetail(v string) *JobOutput { - s.StatusDetail = &v - return s -} - -// SetThumbnailEncryption sets the ThumbnailEncryption field's value. -func (s *JobOutput) SetThumbnailEncryption(v *Encryption) *JobOutput { - s.ThumbnailEncryption = v - return s -} - -// SetThumbnailPattern sets the ThumbnailPattern field's value. -func (s *JobOutput) SetThumbnailPattern(v string) *JobOutput { - s.ThumbnailPattern = &v - return s -} - -// SetWatermarks sets the Watermarks field's value. -func (s *JobOutput) SetWatermarks(v []*JobWatermark) *JobOutput { - s.Watermarks = v - return s -} - -// SetWidth sets the Width field's value. -func (s *JobOutput) SetWidth(v int64) *JobOutput { - s.Width = &v - return s -} - -// Watermarks can be in .png or .jpg format. If you want to display a watermark -// that is not rectangular, use the .png format, which supports transparency. -type JobWatermark struct { - _ struct{} `type:"structure"` - - // The encryption settings, if any, that you want Elastic Transcoder to apply - // to your watermarks. - Encryption *Encryption `type:"structure"` - - // The name of the .png or .jpg file that you want to use for the watermark. - // To determine which Amazon S3 bucket contains the specified file, Elastic - // Transcoder checks the pipeline specified by Pipeline; the Input Bucket object - // in that pipeline identifies the bucket. - // - // If the file name includes a prefix, for example, logos/128x64.png, include - // the prefix in the key. If the file isn't in the specified bucket, Elastic - // Transcoder returns an error. - InputKey *string `min:"1" type:"string"` - - // The ID of the watermark settings that Elastic Transcoder uses to add watermarks - // to the video during transcoding. The settings are in the preset specified - // by Preset for the current output. In that preset, the value of Watermarks - // Id tells Elastic Transcoder which settings to use. - PresetWatermarkId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s JobWatermark) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s JobWatermark) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *JobWatermark) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "JobWatermark"} - if s.InputKey != nil && len(*s.InputKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputKey", 1)) - } - if s.PresetWatermarkId != nil && len(*s.PresetWatermarkId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PresetWatermarkId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryption sets the Encryption field's value. -func (s *JobWatermark) SetEncryption(v *Encryption) *JobWatermark { - s.Encryption = v - return s -} - -// SetInputKey sets the InputKey field's value. -func (s *JobWatermark) SetInputKey(v string) *JobWatermark { - s.InputKey = &v - return s -} - -// SetPresetWatermarkId sets the PresetWatermarkId field's value. -func (s *JobWatermark) SetPresetWatermarkId(v string) *JobWatermark { - s.PresetWatermarkId = &v - return s -} - -// The ListJobsByPipelineRequest structure. -type ListJobsByPipelineInput struct { - _ struct{} `type:"structure"` - - // To list jobs in chronological order by the date and time that they were submitted, - // enter true. To list jobs in reverse chronological order, enter false. - Ascending *string `location:"querystring" locationName:"Ascending" type:"string"` - - // When Elastic Transcoder returns more than one page of results, use pageToken - // in subsequent GET requests to get each successive page of results. - PageToken *string `location:"querystring" locationName:"PageToken" type:"string"` - - // The ID of the pipeline for which you want to get job information. - // - // PipelineId is a required field - PipelineId *string `location:"uri" locationName:"PipelineId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListJobsByPipelineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListJobsByPipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListJobsByPipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListJobsByPipelineInput"} - if s.PipelineId == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAscending sets the Ascending field's value. -func (s *ListJobsByPipelineInput) SetAscending(v string) *ListJobsByPipelineInput { - s.Ascending = &v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *ListJobsByPipelineInput) SetPageToken(v string) *ListJobsByPipelineInput { - s.PageToken = &v - return s -} - -// SetPipelineId sets the PipelineId field's value. -func (s *ListJobsByPipelineInput) SetPipelineId(v string) *ListJobsByPipelineInput { - s.PipelineId = &v - return s -} - -// The ListJobsByPipelineResponse structure. -type ListJobsByPipelineOutput struct { - _ struct{} `type:"structure"` - - // An array of Job objects that are in the specified pipeline. - Jobs []*Job `type:"list"` - - // A value that you use to access the second and subsequent pages of results, - // if any. When the jobs in the specified pipeline fit on one page or when you've - // reached the last page of results, the value of NextPageToken is null. - NextPageToken *string `type:"string"` -} - -// String returns the string representation -func (s ListJobsByPipelineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListJobsByPipelineOutput) GoString() string { - return s.String() -} - -// SetJobs sets the Jobs field's value. -func (s *ListJobsByPipelineOutput) SetJobs(v []*Job) *ListJobsByPipelineOutput { - s.Jobs = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *ListJobsByPipelineOutput) SetNextPageToken(v string) *ListJobsByPipelineOutput { - s.NextPageToken = &v - return s -} - -// The ListJobsByStatusRequest structure. -type ListJobsByStatusInput struct { - _ struct{} `type:"structure"` - - // To list jobs in chronological order by the date and time that they were submitted, - // enter true. To list jobs in reverse chronological order, enter false. - Ascending *string `location:"querystring" locationName:"Ascending" type:"string"` - - // When Elastic Transcoder returns more than one page of results, use pageToken - // in subsequent GET requests to get each successive page of results. - PageToken *string `location:"querystring" locationName:"PageToken" type:"string"` - - // To get information about all of the jobs associated with the current AWS - // account that have a given status, specify the following status: Submitted, - // Progressing, Complete, Canceled, or Error. - // - // Status is a required field - Status *string `location:"uri" locationName:"Status" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListJobsByStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListJobsByStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListJobsByStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListJobsByStatusInput"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAscending sets the Ascending field's value. -func (s *ListJobsByStatusInput) SetAscending(v string) *ListJobsByStatusInput { - s.Ascending = &v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *ListJobsByStatusInput) SetPageToken(v string) *ListJobsByStatusInput { - s.PageToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListJobsByStatusInput) SetStatus(v string) *ListJobsByStatusInput { - s.Status = &v - return s -} - -// The ListJobsByStatusResponse structure. -type ListJobsByStatusOutput struct { - _ struct{} `type:"structure"` - - // An array of Job objects that have the specified status. - Jobs []*Job `type:"list"` - - // A value that you use to access the second and subsequent pages of results, - // if any. When the jobs in the specified pipeline fit on one page or when you've - // reached the last page of results, the value of NextPageToken is null. - NextPageToken *string `type:"string"` -} - -// String returns the string representation -func (s ListJobsByStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListJobsByStatusOutput) GoString() string { - return s.String() -} - -// SetJobs sets the Jobs field's value. -func (s *ListJobsByStatusOutput) SetJobs(v []*Job) *ListJobsByStatusOutput { - s.Jobs = v - return s -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *ListJobsByStatusOutput) SetNextPageToken(v string) *ListJobsByStatusOutput { - s.NextPageToken = &v - return s -} - -// The ListPipelineRequest structure. -type ListPipelinesInput struct { - _ struct{} `type:"structure"` - - // To list pipelines in chronological order by the date and time that they were - // created, enter true. To list pipelines in reverse chronological order, enter - // false. - Ascending *string `location:"querystring" locationName:"Ascending" type:"string"` - - // When Elastic Transcoder returns more than one page of results, use pageToken - // in subsequent GET requests to get each successive page of results. - PageToken *string `location:"querystring" locationName:"PageToken" type:"string"` -} - -// String returns the string representation -func (s ListPipelinesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPipelinesInput) GoString() string { - return s.String() -} - -// SetAscending sets the Ascending field's value. -func (s *ListPipelinesInput) SetAscending(v string) *ListPipelinesInput { - s.Ascending = &v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *ListPipelinesInput) SetPageToken(v string) *ListPipelinesInput { - s.PageToken = &v - return s -} - -// A list of the pipelines associated with the current AWS account. -type ListPipelinesOutput struct { - _ struct{} `type:"structure"` - - // A value that you use to access the second and subsequent pages of results, - // if any. When the pipelines fit on one page or when you've reached the last - // page of results, the value of NextPageToken is null. - NextPageToken *string `type:"string"` - - // An array of Pipeline objects. - Pipelines []*Pipeline `type:"list"` -} - -// String returns the string representation -func (s ListPipelinesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPipelinesOutput) GoString() string { - return s.String() -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *ListPipelinesOutput) SetNextPageToken(v string) *ListPipelinesOutput { - s.NextPageToken = &v - return s -} - -// SetPipelines sets the Pipelines field's value. -func (s *ListPipelinesOutput) SetPipelines(v []*Pipeline) *ListPipelinesOutput { - s.Pipelines = v - return s -} - -// The ListPresetsRequest structure. -type ListPresetsInput struct { - _ struct{} `type:"structure"` - - // To list presets in chronological order by the date and time that they were - // created, enter true. To list presets in reverse chronological order, enter - // false. - Ascending *string `location:"querystring" locationName:"Ascending" type:"string"` - - // When Elastic Transcoder returns more than one page of results, use pageToken - // in subsequent GET requests to get each successive page of results. - PageToken *string `location:"querystring" locationName:"PageToken" type:"string"` -} - -// String returns the string representation -func (s ListPresetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPresetsInput) GoString() string { - return s.String() -} - -// SetAscending sets the Ascending field's value. -func (s *ListPresetsInput) SetAscending(v string) *ListPresetsInput { - s.Ascending = &v - return s -} - -// SetPageToken sets the PageToken field's value. -func (s *ListPresetsInput) SetPageToken(v string) *ListPresetsInput { - s.PageToken = &v - return s -} - -// The ListPresetsResponse structure. -type ListPresetsOutput struct { - _ struct{} `type:"structure"` - - // A value that you use to access the second and subsequent pages of results, - // if any. When the presets fit on one page or when you've reached the last - // page of results, the value of NextPageToken is null. - NextPageToken *string `type:"string"` - - // An array of Preset objects. - Presets []*Preset `type:"list"` -} - -// String returns the string representation -func (s ListPresetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPresetsOutput) GoString() string { - return s.String() -} - -// SetNextPageToken sets the NextPageToken field's value. -func (s *ListPresetsOutput) SetNextPageToken(v string) *ListPresetsOutput { - s.NextPageToken = &v - return s -} - -// SetPresets sets the Presets field's value. -func (s *ListPresetsOutput) SetPresets(v []*Preset) *ListPresetsOutput { - s.Presets = v - return s -} - -// The Amazon Simple Notification Service (Amazon SNS) topic or topics to notify -// in order to report job status. -// -// To receive notifications, you must also subscribe to the new topic in the -// Amazon SNS console. -type Notifications struct { - _ struct{} `type:"structure"` - - // The Amazon SNS topic that you want to notify when Elastic Transcoder has - // finished processing the job. - Completed *string `type:"string"` - - // The Amazon SNS topic that you want to notify when Elastic Transcoder encounters - // an error condition. - Error *string `type:"string"` - - // The Amazon Simple Notification Service (Amazon SNS) topic that you want to - // notify when Elastic Transcoder has started to process the job. - Progressing *string `type:"string"` - - // The Amazon SNS topic that you want to notify when Elastic Transcoder encounters - // a warning condition. - Warning *string `type:"string"` -} - -// String returns the string representation -func (s Notifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Notifications) GoString() string { - return s.String() -} - -// SetCompleted sets the Completed field's value. -func (s *Notifications) SetCompleted(v string) *Notifications { - s.Completed = &v - return s -} - -// SetError sets the Error field's value. -func (s *Notifications) SetError(v string) *Notifications { - s.Error = &v - return s -} - -// SetProgressing sets the Progressing field's value. -func (s *Notifications) SetProgressing(v string) *Notifications { - s.Progressing = &v - return s -} - -// SetWarning sets the Warning field's value. -func (s *Notifications) SetWarning(v string) *Notifications { - s.Warning = &v - return s -} - -// The Permission structure. -type Permission struct { - _ struct{} `type:"structure"` - - // The permission that you want to give to the AWS user that is listed in Grantee. - // Valid values include: - // - // * READ: The grantee can read the thumbnails and metadata for thumbnails - // that Elastic Transcoder adds to the Amazon S3 bucket. - // - // * READ_ACP: The grantee can read the object ACL for thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // * WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // * FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions - // for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. - Access []*string `type:"list"` - - // The AWS user or group that you want to have access to transcoded files and - // playlists. To identify the user or group, you can specify the canonical user - // ID for an AWS account, an origin access identity for a CloudFront distribution, - // the registered email address of an AWS account, or a predefined Amazon S3 - // group. - Grantee *string `min:"1" type:"string"` - - // The type of value that appears in the Grantee object: - // - // * Canonical: Either the canonical user ID for an AWS account or an origin - // access identity for an Amazon CloudFront distribution. - // - // A canonical user ID is not the same as an AWS account number. - // - // * Email: The registered email address of an AWS account. - // - // * Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, - // or LogDelivery. - GranteeType *string `type:"string"` -} - -// String returns the string representation -func (s Permission) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Permission) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Permission) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Permission"} - if s.Grantee != nil && len(*s.Grantee) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Grantee", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccess sets the Access field's value. -func (s *Permission) SetAccess(v []*string) *Permission { - s.Access = v - return s -} - -// SetGrantee sets the Grantee field's value. -func (s *Permission) SetGrantee(v string) *Permission { - s.Grantee = &v - return s -} - -// SetGranteeType sets the GranteeType field's value. -func (s *Permission) SetGranteeType(v string) *Permission { - s.GranteeType = &v - return s -} - -// The pipeline (queue) that is used to manage jobs. -type Pipeline struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the pipeline. - Arn *string `type:"string"` - - // The AWS Key Management Service (AWS KMS) key that you want to use with this - // pipeline. - // - // If you use either S3 or S3-AWS-KMS as your Encryption:Mode, you don't need - // to provide a key with your job because a default key, known as an AWS-KMS - // key, is created for you automatically. You need to provide an AWS-KMS key - // only if you want to use a non-default AWS-KMS key, or if you are using an - // Encryption:Mode of AES-PKCS7, AES-CTR, or AES-GCM. - AwsKmsKeyArn *string `type:"string"` - - // Information about the Amazon S3 bucket in which you want Elastic Transcoder - // to save transcoded files and playlists. Either you specify both ContentConfig - // and ThumbnailConfig, or you specify OutputBucket. - // - // * Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to - // save transcoded files and playlists. - // - // * Permissions: A list of the users and/or predefined Amazon S3 groups - // you want to have access to transcoded files and playlists, and the type - // of access that you want them to have. - // - // GranteeType: The type of value that appears in the Grantee object: - // - // Canonical: Either the canonical user ID for an AWS account or an origin access - // identity for an Amazon CloudFront distribution. - // - // Email: The registered email address of an AWS account. - // - // Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, - // or LogDelivery. - // - // Grantee: The AWS user or group that you want to have access to transcoded - // files and playlists. - // - // Access: The permission that you want to give to the AWS user that is listed - // in Grantee. Valid values include: - // - // READ: The grantee can read the objects and metadata for objects that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // READ_ACP: The grantee can read the object ACL for objects that Elastic Transcoder - // adds to the Amazon S3 bucket. - // - // WRITE_ACP: The grantee can write the ACL for the objects that Elastic Transcoder - // adds to the Amazon S3 bucket. - // - // FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for - // the objects that Elastic Transcoder adds to the Amazon S3 bucket. - // - // * StorageClass: The Amazon S3 storage class, Standard or ReducedRedundancy, - // that you want Elastic Transcoder to assign to the video files and playlists - // that it stores in your Amazon S3 bucket. - ContentConfig *PipelineOutputConfig `type:"structure"` - - // The identifier for the pipeline. You use this value to identify the pipeline - // in which you want to perform a variety of operations, such as creating a - // job or a preset. - Id *string `type:"string"` - - // The Amazon S3 bucket from which Elastic Transcoder gets media files for transcoding - // and the graphics files, if any, that you want to use for watermarks. - InputBucket *string `type:"string"` - - // The name of the pipeline. We recommend that the name be unique within the - // AWS account, but uniqueness is not enforced. - // - // Constraints: Maximum 40 characters - Name *string `min:"1" type:"string"` - - // The Amazon Simple Notification Service (Amazon SNS) topic that you want to - // notify to report job status. - // - // To receive notifications, you must also subscribe to the new topic in the - // Amazon SNS console. - // - // * Progressing (optional): The Amazon Simple Notification Service (Amazon - // SNS) topic that you want to notify when Elastic Transcoder has started - // to process the job. - // - // * Completed (optional): The Amazon SNS topic that you want to notify when - // Elastic Transcoder has finished processing the job. - // - // * Warning (optional): The Amazon SNS topic that you want to notify when - // Elastic Transcoder encounters a warning condition. - // - // * Error (optional): The Amazon SNS topic that you want to notify when - // Elastic Transcoder encounters an error condition. - Notifications *Notifications `type:"structure"` - - // The Amazon S3 bucket in which you want Elastic Transcoder to save transcoded - // files, thumbnails, and playlists. Either you specify this value, or you specify - // both ContentConfig and ThumbnailConfig. - OutputBucket *string `type:"string"` - - // The IAM Amazon Resource Name (ARN) for the role that Elastic Transcoder uses - // to transcode jobs for this pipeline. - Role *string `type:"string"` - - // The current status of the pipeline: - // - // * Active: The pipeline is processing jobs. - // - // * Paused: The pipeline is not currently processing jobs. - Status *string `type:"string"` - - // Information about the Amazon S3 bucket in which you want Elastic Transcoder - // to save thumbnail files. Either you specify both ContentConfig and ThumbnailConfig, - // or you specify OutputBucket. - // - // * Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to - // save thumbnail files. - // - // * Permissions: A list of the users and/or predefined Amazon S3 groups - // you want to have access to thumbnail files, and the type of access that - // you want them to have. - // - // GranteeType: The type of value that appears in the Grantee object: - // - // Canonical: Either the canonical user ID for an AWS account or an origin access - // identity for an Amazon CloudFront distribution. - // - // A canonical user ID is not the same as an AWS account number. - // - // Email: The registered email address of an AWS account. - // - // Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, - // or LogDelivery. - // - // Grantee: The AWS user or group that you want to have access to thumbnail - // files. - // - // Access: The permission that you want to give to the AWS user that is listed - // in Grantee. Valid values include: - // - // READ: The grantee can read the thumbnails and metadata for thumbnails that - // Elastic Transcoder adds to the Amazon S3 bucket. - // - // READ_ACP: The grantee can read the object ACL for thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for - // the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. - // - // * StorageClass: The Amazon S3 storage class, Standard or ReducedRedundancy, - // that you want Elastic Transcoder to assign to the thumbnails that it stores - // in your Amazon S3 bucket. - ThumbnailConfig *PipelineOutputConfig `type:"structure"` -} - -// String returns the string representation -func (s Pipeline) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Pipeline) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Pipeline) SetArn(v string) *Pipeline { - s.Arn = &v - return s -} - -// SetAwsKmsKeyArn sets the AwsKmsKeyArn field's value. -func (s *Pipeline) SetAwsKmsKeyArn(v string) *Pipeline { - s.AwsKmsKeyArn = &v - return s -} - -// SetContentConfig sets the ContentConfig field's value. -func (s *Pipeline) SetContentConfig(v *PipelineOutputConfig) *Pipeline { - s.ContentConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *Pipeline) SetId(v string) *Pipeline { - s.Id = &v - return s -} - -// SetInputBucket sets the InputBucket field's value. -func (s *Pipeline) SetInputBucket(v string) *Pipeline { - s.InputBucket = &v - return s -} - -// SetName sets the Name field's value. -func (s *Pipeline) SetName(v string) *Pipeline { - s.Name = &v - return s -} - -// SetNotifications sets the Notifications field's value. -func (s *Pipeline) SetNotifications(v *Notifications) *Pipeline { - s.Notifications = v - return s -} - -// SetOutputBucket sets the OutputBucket field's value. -func (s *Pipeline) SetOutputBucket(v string) *Pipeline { - s.OutputBucket = &v - return s -} - -// SetRole sets the Role field's value. -func (s *Pipeline) SetRole(v string) *Pipeline { - s.Role = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Pipeline) SetStatus(v string) *Pipeline { - s.Status = &v - return s -} - -// SetThumbnailConfig sets the ThumbnailConfig field's value. -func (s *Pipeline) SetThumbnailConfig(v *PipelineOutputConfig) *Pipeline { - s.ThumbnailConfig = v - return s -} - -// The PipelineOutputConfig structure. -type PipelineOutputConfig struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket in which you want Elastic Transcoder to save the transcoded - // files. Specify this value when all of the following are true: - // - // * You want to save transcoded files, thumbnails (if any), and playlists - // (if any) together in one bucket. - // - // * You do not want to specify the users or groups who have access to the - // transcoded files, thumbnails, and playlists. - // - // * You do not want to specify the permissions that Elastic Transcoder grants - // to the files. - // - // * You want to associate the transcoded files and thumbnails with the Amazon - // S3 Standard storage class. - // - // If you want to save transcoded files and playlists in one bucket and thumbnails - // in another bucket, specify which users can access the transcoded files or - // the permissions the users have, or change the Amazon S3 storage class, omit - // OutputBucket and specify values for ContentConfig and ThumbnailConfig instead. - Bucket *string `type:"string"` - - // Optional. The Permissions object specifies which users and/or predefined - // Amazon S3 groups you want to have access to transcoded files and playlists, - // and the type of access you want them to have. You can grant permissions to - // a maximum of 30 users and/or predefined Amazon S3 groups. - // - // If you include Permissions, Elastic Transcoder grants only the permissions - // that you specify. It does not grant full permissions to the owner of the - // role specified by Role. If you want that user to have full control, you must - // explicitly grant full control to the user. - // - // If you omit Permissions, Elastic Transcoder grants full control over the - // transcoded files and playlists to the owner of the role specified by Role, - // and grants no other permissions to any other user or group. - Permissions []*Permission `type:"list"` - - // The Amazon S3 storage class, Standard or ReducedRedundancy, that you want - // Elastic Transcoder to assign to the video files and playlists that it stores - // in your Amazon S3 bucket. - StorageClass *string `type:"string"` -} - -// String returns the string representation -func (s PipelineOutputConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PipelineOutputConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipelineOutputConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipelineOutputConfig"} - if s.Permissions != nil { - for i, v := range s.Permissions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Permissions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PipelineOutputConfig) SetBucket(v string) *PipelineOutputConfig { - s.Bucket = &v - return s -} - -// SetPermissions sets the Permissions field's value. -func (s *PipelineOutputConfig) SetPermissions(v []*Permission) *PipelineOutputConfig { - s.Permissions = v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *PipelineOutputConfig) SetStorageClass(v string) *PipelineOutputConfig { - s.StorageClass = &v - return s -} - -// The PlayReady DRM settings, if any, that you want Elastic Transcoder to apply -// to the output files associated with this playlist. -// -// PlayReady DRM encrypts your media files using AES-CTR encryption. -// -// If you use DRM for an HLSv3 playlist, your outputs must have a master playlist. -type PlayReadyDrm struct { - _ struct{} `type:"structure"` - - // The type of DRM, if any, that you want Elastic Transcoder to apply to the - // output files associated with this playlist. - Format *string `type:"string"` - - // The series of random bits created by a random bit generator, unique for every - // encryption operation, that you want Elastic Transcoder to use to encrypt - // your files. The initialization vector must be base64-encoded, and it must - // be exactly 8 bytes long before being base64-encoded. If no initialization - // vector is provided, Elastic Transcoder generates one for you. - InitializationVector *string `type:"string"` - - // The DRM key for your file, provided by your DRM license provider. The key - // must be base64-encoded, and it must be one of the following bit lengths before - // being base64-encoded: - // - // 128, 192, or 256. - // - // The key must also be encrypted by using AWS KMS. - Key *string `type:"string"` - - // The ID for your DRM key, so that your DRM license provider knows which key - // to provide. - // - // The key ID must be provided in big endian, and Elastic Transcoder converts - // it to little endian before inserting it into the PlayReady DRM headers. If - // you are unsure whether your license server provides your key ID in big or - // little endian, check with your DRM provider. - KeyId *string `type:"string"` - - // The MD5 digest of the key used for DRM on your file, and that you want Elastic - // Transcoder to use as a checksum to make sure your key was not corrupted in - // transit. The key MD5 must be base64-encoded, and it must be exactly 16 bytes - // before being base64-encoded. - KeyMd5 *string `type:"string"` - - // The location of the license key required to play DRM content. The URL must - // be an absolute path, and is referenced by the PlayReady header. The PlayReady - // header is referenced in the protection header of the client manifest for - // Smooth Streaming outputs, and in the EXT-X-DXDRM and EXT-XDXDRMINFO metadata - // tags for HLS playlist outputs. An example URL looks like this: https://www.example.com/exampleKey/ - LicenseAcquisitionUrl *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PlayReadyDrm) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PlayReadyDrm) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PlayReadyDrm) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PlayReadyDrm"} - if s.LicenseAcquisitionUrl != nil && len(*s.LicenseAcquisitionUrl) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LicenseAcquisitionUrl", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFormat sets the Format field's value. -func (s *PlayReadyDrm) SetFormat(v string) *PlayReadyDrm { - s.Format = &v - return s -} - -// SetInitializationVector sets the InitializationVector field's value. -func (s *PlayReadyDrm) SetInitializationVector(v string) *PlayReadyDrm { - s.InitializationVector = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PlayReadyDrm) SetKey(v string) *PlayReadyDrm { - s.Key = &v - return s -} - -// SetKeyId sets the KeyId field's value. -func (s *PlayReadyDrm) SetKeyId(v string) *PlayReadyDrm { - s.KeyId = &v - return s -} - -// SetKeyMd5 sets the KeyMd5 field's value. -func (s *PlayReadyDrm) SetKeyMd5(v string) *PlayReadyDrm { - s.KeyMd5 = &v - return s -} - -// SetLicenseAcquisitionUrl sets the LicenseAcquisitionUrl field's value. -func (s *PlayReadyDrm) SetLicenseAcquisitionUrl(v string) *PlayReadyDrm { - s.LicenseAcquisitionUrl = &v - return s -} - -// Use Only for Fragmented MP4 or MPEG-TS Outputs. If you specify a preset for -// which the value of Container is fmp4 (Fragmented MP4) or ts (MPEG-TS), Playlists -// contains information about the master playlists that you want Elastic Transcoder -// to create. We recommend that you create only one master playlist per output -// format. The maximum number of master playlists in a job is 30. -type Playlist struct { - _ struct{} `type:"structure"` - - // The format of the output playlist. Valid formats include HLSv3, HLSv4, and - // Smooth. - Format *string `type:"string"` - - // The HLS content protection settings, if any, that you want Elastic Transcoder - // to apply to the output files associated with this playlist. - HlsContentProtection *HlsContentProtection `type:"structure"` - - // The name that you want Elastic Transcoder to assign to the master playlist, - // for example, nyc-vacation.m3u8. If the name includes a / character, the section - // of the name before the last / must be identical for all Name objects. If - // you create more than one master playlist, the values of all Name objects - // must be unique. - // - // Elastic Transcoder automatically appends the relevant file extension to the - // file name (.m3u8 for HLSv3 and HLSv4 playlists, and .ism and .ismc for Smooth - // playlists). If you include a file extension in Name, the file name will have - // two extensions. - Name *string `min:"1" type:"string"` - - // For each output in this job that you want to include in a master playlist, - // the value of the Outputs:Key object. - // - // * If your output is not HLS or does not have a segment duration set, the - // name of the output file is a concatenation of OutputKeyPrefix and Outputs:Key: - // - // OutputKeyPrefixOutputs:Key - // - // * If your output is HLSv3 and has a segment duration set, or is not included - // in a playlist, Elastic Transcoder creates an output playlist file with - // a file extension of .m3u8, and a series of .ts files that include a five-digit - // sequential counter beginning with 00000: - // - // OutputKeyPrefixOutputs:Key.m3u8 - // - // OutputKeyPrefixOutputs:Key00000.ts - // - // * If your output is HLSv4, has a segment duration set, and is included - // in an HLSv4 playlist, Elastic Transcoder creates an output playlist file - // with a file extension of _v4.m3u8. If the output is video, Elastic Transcoder - // also creates an output file with an extension of _iframe.m3u8: - // - // OutputKeyPrefixOutputs:Key_v4.m3u8 - // - // OutputKeyPrefixOutputs:Key_iframe.m3u8 - // - // OutputKeyPrefixOutputs:Key.ts - // - // Elastic Transcoder automatically appends the relevant file extension to the - // file name. If you include a file extension in Output Key, the file name will - // have two extensions. - // - // If you include more than one output in a playlist, any segment duration settings, - // clip settings, or caption settings must be the same for all outputs in the - // playlist. For Smooth playlists, the Audio:Profile, Video:Profile, and Video:FrameRate - // to Video:KeyframesMaxDist ratio must be the same for all outputs. - OutputKeys []*string `type:"list"` - - // The DRM settings, if any, that you want Elastic Transcoder to apply to the - // output files associated with this playlist. - PlayReadyDrm *PlayReadyDrm `type:"structure"` - - // The status of the job with which the playlist is associated. - Status *string `type:"string"` - - // Information that further explains the status. - StatusDetail *string `type:"string"` -} - -// String returns the string representation -func (s Playlist) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Playlist) GoString() string { - return s.String() -} - -// SetFormat sets the Format field's value. -func (s *Playlist) SetFormat(v string) *Playlist { - s.Format = &v - return s -} - -// SetHlsContentProtection sets the HlsContentProtection field's value. -func (s *Playlist) SetHlsContentProtection(v *HlsContentProtection) *Playlist { - s.HlsContentProtection = v - return s -} - -// SetName sets the Name field's value. -func (s *Playlist) SetName(v string) *Playlist { - s.Name = &v - return s -} - -// SetOutputKeys sets the OutputKeys field's value. -func (s *Playlist) SetOutputKeys(v []*string) *Playlist { - s.OutputKeys = v - return s -} - -// SetPlayReadyDrm sets the PlayReadyDrm field's value. -func (s *Playlist) SetPlayReadyDrm(v *PlayReadyDrm) *Playlist { - s.PlayReadyDrm = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Playlist) SetStatus(v string) *Playlist { - s.Status = &v - return s -} - -// SetStatusDetail sets the StatusDetail field's value. -func (s *Playlist) SetStatusDetail(v string) *Playlist { - s.StatusDetail = &v - return s -} - -// Presets are templates that contain most of the settings for transcoding media -// files from one format to another. Elastic Transcoder includes some default -// presets for common formats, for example, several iPod and iPhone versions. -// You can also create your own presets for formats that aren't included among -// the default presets. You specify which preset you want to use when you create -// a job. -type Preset struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the preset. - Arn *string `type:"string"` - - // A section of the response body that provides information about the audio - // preset values. - Audio *AudioParameters `type:"structure"` - - // The container type for the output file. Valid values include flac, flv, fmp4, - // gif, mp3, mp4, mpg, mxf, oga, ogg, ts, and webm. - Container *string `type:"string"` - - // A description of the preset. - Description *string `type:"string"` - - // Identifier for the new preset. You use this value to get settings for the - // preset or to delete it. - Id *string `type:"string"` - - // The name of the preset. - Name *string `min:"1" type:"string"` - - // A section of the response body that provides information about the thumbnail - // preset values, if any. - Thumbnails *Thumbnails `type:"structure"` - - // Whether the preset is a default preset provided by Elastic Transcoder (System) - // or a preset that you have defined (Custom). - Type *string `type:"string"` - - // A section of the response body that provides information about the video - // preset values. - Video *VideoParameters `type:"structure"` -} - -// String returns the string representation -func (s Preset) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Preset) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Preset) SetArn(v string) *Preset { - s.Arn = &v - return s -} - -// SetAudio sets the Audio field's value. -func (s *Preset) SetAudio(v *AudioParameters) *Preset { - s.Audio = v - return s -} - -// SetContainer sets the Container field's value. -func (s *Preset) SetContainer(v string) *Preset { - s.Container = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Preset) SetDescription(v string) *Preset { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *Preset) SetId(v string) *Preset { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *Preset) SetName(v string) *Preset { - s.Name = &v - return s -} - -// SetThumbnails sets the Thumbnails field's value. -func (s *Preset) SetThumbnails(v *Thumbnails) *Preset { - s.Thumbnails = v - return s -} - -// SetType sets the Type field's value. -func (s *Preset) SetType(v string) *Preset { - s.Type = &v - return s -} - -// SetVideo sets the Video field's value. -func (s *Preset) SetVideo(v *VideoParameters) *Preset { - s.Video = v - return s -} - -// Settings for the size, location, and opacity of graphics that you want Elastic -// Transcoder to overlay over videos that are transcoded using this preset. -// You can specify settings for up to four watermarks. Watermarks appear in -// the specified size and location, and with the specified opacity for the duration -// of the transcoded video. -// -// Watermarks can be in .png or .jpg format. If you want to display a watermark -// that is not rectangular, use the .png format, which supports transparency. -// -// When you create a job that uses this preset, you specify the .png or .jpg -// graphics that you want Elastic Transcoder to include in the transcoded videos. -// You can specify fewer graphics in the job than you specify watermark settings -// in the preset, which allows you to use the same preset for up to four watermarks -// that have different dimensions. -type PresetWatermark struct { - _ struct{} `type:"structure"` - - // The horizontal position of the watermark unless you specify a non-zero value - // for HorizontalOffset: - // - // * Left: The left edge of the watermark is aligned with the left border - // of the video. - // - // * Right: The right edge of the watermark is aligned with the right border - // of the video. - // - // * Center: The watermark is centered between the left and right borders. - HorizontalAlign *string `type:"string"` - - // The amount by which you want the horizontal position of the watermark to - // be offset from the position specified by HorizontalAlign: - // - // * number of pixels (px): The minimum value is 0 pixels, and the maximum - // value is the value of MaxWidth. - // - // * integer percentage (%): The range of valid values is 0 to 100. - // - // For example, if you specify Left for HorizontalAlign and 5px for HorizontalOffset, - // the left side of the watermark appears 5 pixels from the left border of the - // output video. - // - // HorizontalOffset is only valid when the value of HorizontalAlign is Left - // or Right. If you specify an offset that causes the watermark to extend beyond - // the left or right border and Elastic Transcoder has not added black bars, - // the watermark is cropped. If Elastic Transcoder has added black bars, the - // watermark extends into the black bars. If the watermark extends beyond the - // black bars, it is cropped. - // - // Use the value of Target to specify whether you want to include the black - // bars that are added by Elastic Transcoder, if any, in the offset calculation. - HorizontalOffset *string `type:"string"` - - // A unique identifier for the settings for one watermark. The value of Id can - // be up to 40 characters long. - Id *string `min:"1" type:"string"` - - // The maximum height of the watermark in one of the following formats: - // - // * number of pixels (px): The minimum value is 16 pixels, and the maximum - // value is the value of MaxHeight. - // - // * integer percentage (%): The range of valid values is 0 to 100. Use the - // value of Target to specify whether you want Elastic Transcoder to include - // the black bars that are added by Elastic Transcoder, if any, in the calculation. - // - // If you specify the value in pixels, it must be less than or equal to the - // value of MaxHeight. - MaxHeight *string `type:"string"` - - // The maximum width of the watermark in one of the following formats: - // - // * number of pixels (px): The minimum value is 16 pixels, and the maximum - // value is the value of MaxWidth. - // - // * integer percentage (%): The range of valid values is 0 to 100. Use the - // value of Target to specify whether you want Elastic Transcoder to include - // the black bars that are added by Elastic Transcoder, if any, in the calculation. - // - // If you specify the value in pixels, it must be less than or equal to the - // value of MaxWidth. - MaxWidth *string `type:"string"` - - // A percentage that indicates how much you want a watermark to obscure the - // video in the location where it appears. Valid values are 0 (the watermark - // is invisible) to 100 (the watermark completely obscures the video in the - // specified location). The datatype of Opacity is float. - // - // Elastic Transcoder supports transparent .png graphics. If you use a transparent - // .png, the transparent portion of the video appears as if you had specified - // a value of 0 for Opacity. The .jpg file format doesn't support transparency. - Opacity *string `type:"string"` - - // A value that controls scaling of the watermark: - // - // * Fit: Elastic Transcoder scales the watermark so it matches the value - // that you specified in either MaxWidth or MaxHeight without exceeding the - // other value. - // - // * Stretch: Elastic Transcoder stretches the watermark to match the values - // that you specified for MaxWidth and MaxHeight. If the relative proportions - // of the watermark and the values of MaxWidth and MaxHeight are different, - // the watermark will be distorted. - // - // * ShrinkToFit: Elastic Transcoder scales the watermark down so that its - // dimensions match the values that you specified for at least one of MaxWidth - // and MaxHeight without exceeding either value. If you specify this option, - // Elastic Transcoder does not scale the watermark up. - SizingPolicy *string `type:"string"` - - // A value that determines how Elastic Transcoder interprets values that you - // specified for HorizontalOffset, VerticalOffset, MaxWidth, and MaxHeight: - // - // * Content: HorizontalOffset and VerticalOffset values are calculated based - // on the borders of the video excluding black bars added by Elastic Transcoder, - // if any. In addition, MaxWidth and MaxHeight, if specified as a percentage, - // are calculated based on the borders of the video excluding black bars - // added by Elastic Transcoder, if any. - // - // * Frame: HorizontalOffset and VerticalOffset values are calculated based - // on the borders of the video including black bars added by Elastic Transcoder, - // if any. In addition, MaxWidth and MaxHeight, if specified as a percentage, - // are calculated based on the borders of the video including black bars - // added by Elastic Transcoder, if any. - Target *string `type:"string"` - - // The vertical position of the watermark unless you specify a non-zero value - // for VerticalOffset: - // - // * Top: The top edge of the watermark is aligned with the top border of - // the video. - // - // * Bottom: The bottom edge of the watermark is aligned with the bottom - // border of the video. - // - // * Center: The watermark is centered between the top and bottom borders. - VerticalAlign *string `type:"string"` - - // VerticalOffset - // - // The amount by which you want the vertical position of the watermark to be - // offset from the position specified by VerticalAlign: - // - // * number of pixels (px): The minimum value is 0 pixels, and the maximum - // value is the value of MaxHeight. - // - // * integer percentage (%): The range of valid values is 0 to 100. - // - // For example, if you specify Top for VerticalAlign and 5px for VerticalOffset, - // the top of the watermark appears 5 pixels from the top border of the output - // video. - // - // VerticalOffset is only valid when the value of VerticalAlign is Top or Bottom. - // - // If you specify an offset that causes the watermark to extend beyond the top - // or bottom border and Elastic Transcoder has not added black bars, the watermark - // is cropped. If Elastic Transcoder has added black bars, the watermark extends - // into the black bars. If the watermark extends beyond the black bars, it is - // cropped. - // - // Use the value of Target to specify whether you want Elastic Transcoder to - // include the black bars that are added by Elastic Transcoder, if any, in the - // offset calculation. - VerticalOffset *string `type:"string"` -} - -// String returns the string representation -func (s PresetWatermark) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PresetWatermark) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PresetWatermark) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PresetWatermark"} - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHorizontalAlign sets the HorizontalAlign field's value. -func (s *PresetWatermark) SetHorizontalAlign(v string) *PresetWatermark { - s.HorizontalAlign = &v - return s -} - -// SetHorizontalOffset sets the HorizontalOffset field's value. -func (s *PresetWatermark) SetHorizontalOffset(v string) *PresetWatermark { - s.HorizontalOffset = &v - return s -} - -// SetId sets the Id field's value. -func (s *PresetWatermark) SetId(v string) *PresetWatermark { - s.Id = &v - return s -} - -// SetMaxHeight sets the MaxHeight field's value. -func (s *PresetWatermark) SetMaxHeight(v string) *PresetWatermark { - s.MaxHeight = &v - return s -} - -// SetMaxWidth sets the MaxWidth field's value. -func (s *PresetWatermark) SetMaxWidth(v string) *PresetWatermark { - s.MaxWidth = &v - return s -} - -// SetOpacity sets the Opacity field's value. -func (s *PresetWatermark) SetOpacity(v string) *PresetWatermark { - s.Opacity = &v - return s -} - -// SetSizingPolicy sets the SizingPolicy field's value. -func (s *PresetWatermark) SetSizingPolicy(v string) *PresetWatermark { - s.SizingPolicy = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *PresetWatermark) SetTarget(v string) *PresetWatermark { - s.Target = &v - return s -} - -// SetVerticalAlign sets the VerticalAlign field's value. -func (s *PresetWatermark) SetVerticalAlign(v string) *PresetWatermark { - s.VerticalAlign = &v - return s -} - -// SetVerticalOffset sets the VerticalOffset field's value. -func (s *PresetWatermark) SetVerticalOffset(v string) *PresetWatermark { - s.VerticalOffset = &v - return s -} - -// The ReadJobRequest structure. -type ReadJobInput struct { - _ struct{} `type:"structure"` - - // The identifier of the job for which you want to get detailed information. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReadJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReadJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReadJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReadJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *ReadJobInput) SetId(v string) *ReadJobInput { - s.Id = &v - return s -} - -// The ReadJobResponse structure. -type ReadJobOutput struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the job. - Job *Job `type:"structure"` -} - -// String returns the string representation -func (s ReadJobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReadJobOutput) GoString() string { - return s.String() -} - -// SetJob sets the Job field's value. -func (s *ReadJobOutput) SetJob(v *Job) *ReadJobOutput { - s.Job = v - return s -} - -// The ReadPipelineRequest structure. -type ReadPipelineInput struct { - _ struct{} `type:"structure"` - - // The identifier of the pipeline to read. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReadPipelineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReadPipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReadPipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReadPipelineInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *ReadPipelineInput) SetId(v string) *ReadPipelineInput { - s.Id = &v - return s -} - -// The ReadPipelineResponse structure. -type ReadPipelineOutput struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the pipeline. - Pipeline *Pipeline `type:"structure"` - - // Elastic Transcoder returns a warning if the resources used by your pipeline - // are not in the same region as the pipeline. - // - // Using resources in the same region, such as your Amazon S3 buckets, Amazon - // SNS notification topics, and AWS KMS key, reduces processing time and prevents - // cross-regional charges. - Warnings []*Warning `type:"list"` -} - -// String returns the string representation -func (s ReadPipelineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReadPipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *ReadPipelineOutput) SetPipeline(v *Pipeline) *ReadPipelineOutput { - s.Pipeline = v - return s -} - -// SetWarnings sets the Warnings field's value. -func (s *ReadPipelineOutput) SetWarnings(v []*Warning) *ReadPipelineOutput { - s.Warnings = v - return s -} - -// The ReadPresetRequest structure. -type ReadPresetInput struct { - _ struct{} `type:"structure"` - - // The identifier of the preset for which you want to get detailed information. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s ReadPresetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReadPresetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReadPresetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReadPresetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *ReadPresetInput) SetId(v string) *ReadPresetInput { - s.Id = &v - return s -} - -// The ReadPresetResponse structure. -type ReadPresetOutput struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the preset. - Preset *Preset `type:"structure"` -} - -// String returns the string representation -func (s ReadPresetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReadPresetOutput) GoString() string { - return s.String() -} - -// SetPreset sets the Preset field's value. -func (s *ReadPresetOutput) SetPreset(v *Preset) *ReadPresetOutput { - s.Preset = v - return s -} - -// The TestRoleRequest structure. -type TestRoleInput struct { - _ struct{} `deprecated:"true" type:"structure"` - - // The Amazon S3 bucket that contains media files to be transcoded. The action - // attempts to read from this bucket. - // - // InputBucket is a required field - InputBucket *string `type:"string" required:"true"` - - // The Amazon S3 bucket that Elastic Transcoder writes transcoded media files - // to. The action attempts to read from this bucket. - // - // OutputBucket is a required field - OutputBucket *string `type:"string" required:"true"` - - // The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder - // to test. - // - // Role is a required field - Role *string `type:"string" required:"true"` - - // The ARNs of one or more Amazon Simple Notification Service (Amazon SNS) topics - // that you want the action to send a test notification to. - // - // Topics is a required field - Topics []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s TestRoleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestRoleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestRoleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestRoleInput"} - if s.InputBucket == nil { - invalidParams.Add(request.NewErrParamRequired("InputBucket")) - } - if s.OutputBucket == nil { - invalidParams.Add(request.NewErrParamRequired("OutputBucket")) - } - if s.Role == nil { - invalidParams.Add(request.NewErrParamRequired("Role")) - } - if s.Topics == nil { - invalidParams.Add(request.NewErrParamRequired("Topics")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInputBucket sets the InputBucket field's value. -func (s *TestRoleInput) SetInputBucket(v string) *TestRoleInput { - s.InputBucket = &v - return s -} - -// SetOutputBucket sets the OutputBucket field's value. -func (s *TestRoleInput) SetOutputBucket(v string) *TestRoleInput { - s.OutputBucket = &v - return s -} - -// SetRole sets the Role field's value. -func (s *TestRoleInput) SetRole(v string) *TestRoleInput { - s.Role = &v - return s -} - -// SetTopics sets the Topics field's value. -func (s *TestRoleInput) SetTopics(v []*string) *TestRoleInput { - s.Topics = v - return s -} - -// The TestRoleResponse structure. -type TestRoleOutput struct { - _ struct{} `deprecated:"true" type:"structure"` - - // If the Success element contains false, this value is an array of one or more - // error messages that were generated during the test process. - Messages []*string `type:"list"` - - // If the operation is successful, this value is true; otherwise, the value - // is false. - Success *string `type:"string"` -} - -// String returns the string representation -func (s TestRoleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestRoleOutput) GoString() string { - return s.String() -} - -// SetMessages sets the Messages field's value. -func (s *TestRoleOutput) SetMessages(v []*string) *TestRoleOutput { - s.Messages = v - return s -} - -// SetSuccess sets the Success field's value. -func (s *TestRoleOutput) SetSuccess(v string) *TestRoleOutput { - s.Success = &v - return s -} - -// Thumbnails for videos. -type Thumbnails struct { - _ struct{} `type:"structure"` - - // To better control resolution and aspect ratio of thumbnails, we recommend - // that you use the values MaxWidth, MaxHeight, SizingPolicy, and PaddingPolicy - // instead of Resolution and AspectRatio. The two groups of settings are mutually - // exclusive. Do not use them together. - // - // The aspect ratio of thumbnails. Valid values include: - // - // auto, 1:1, 4:3, 3:2, 16:9 - // - // If you specify auto, Elastic Transcoder tries to preserve the aspect ratio - // of the video in the output file. - AspectRatio *string `type:"string"` - - // The format of thumbnails, if any. Valid values are jpg and png. - // - // You specify whether you want Elastic Transcoder to create thumbnails when - // you create a job. - Format *string `type:"string"` - - // The approximate number of seconds between thumbnails. Specify an integer - // value. - Interval *string `type:"string"` - - // The maximum height of thumbnails in pixels. If you specify auto, Elastic - // Transcoder uses 1080 (Full HD) as the default value. If you specify a numeric - // value, enter an even integer between 32 and 3072. - MaxHeight *string `type:"string"` - - // The maximum width of thumbnails in pixels. If you specify auto, Elastic Transcoder - // uses 1920 (Full HD) as the default value. If you specify a numeric value, - // enter an even integer between 32 and 4096. - MaxWidth *string `type:"string"` - - // When you set PaddingPolicy to Pad, Elastic Transcoder may add black bars - // to the top and bottom and/or left and right sides of thumbnails to make the - // total size of the thumbnails match the values that you specified for thumbnail - // MaxWidth and MaxHeight settings. - PaddingPolicy *string `type:"string"` - - // To better control resolution and aspect ratio of thumbnails, we recommend - // that you use the values MaxWidth, MaxHeight, SizingPolicy, and PaddingPolicy - // instead of Resolution and AspectRatio. The two groups of settings are mutually - // exclusive. Do not use them together. - // - // The width and height of thumbnail files in pixels. Specify a value in the - // format width x height where both values are even integers. The values cannot - // exceed the width and height that you specified in the Video:Resolution object. - Resolution *string `type:"string"` - - // Specify one of the following values to control scaling of thumbnails: - // - // * Fit: Elastic Transcoder scales thumbnails so they match the value that - // you specified in thumbnail MaxWidth or MaxHeight settings without exceeding - // the other value. - // - // * Fill: Elastic Transcoder scales thumbnails so they match the value that - // you specified in thumbnail MaxWidth or MaxHeight settings and matches - // or exceeds the other value. Elastic Transcoder centers the image in thumbnails - // and then crops in the dimension (if any) that exceeds the maximum value. - // - // * Stretch: Elastic Transcoder stretches thumbnails to match the values - // that you specified for thumbnail MaxWidth and MaxHeight settings. If the - // relative proportions of the input video and thumbnails are different, - // the thumbnails will be distorted. - // - // * Keep: Elastic Transcoder does not scale thumbnails. If either dimension - // of the input video exceeds the values that you specified for thumbnail - // MaxWidth and MaxHeight settings, Elastic Transcoder crops the thumbnails. - // - // * ShrinkToFit: Elastic Transcoder scales thumbnails down so that their - // dimensions match the values that you specified for at least one of thumbnail - // MaxWidth and MaxHeight without exceeding either value. If you specify - // this option, Elastic Transcoder does not scale thumbnails up. - // - // * ShrinkToFill: Elastic Transcoder scales thumbnails down so that their - // dimensions match the values that you specified for at least one of MaxWidth - // and MaxHeight without dropping below either value. If you specify this - // option, Elastic Transcoder does not scale thumbnails up. - SizingPolicy *string `type:"string"` -} - -// String returns the string representation -func (s Thumbnails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Thumbnails) GoString() string { - return s.String() -} - -// SetAspectRatio sets the AspectRatio field's value. -func (s *Thumbnails) SetAspectRatio(v string) *Thumbnails { - s.AspectRatio = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *Thumbnails) SetFormat(v string) *Thumbnails { - s.Format = &v - return s -} - -// SetInterval sets the Interval field's value. -func (s *Thumbnails) SetInterval(v string) *Thumbnails { - s.Interval = &v - return s -} - -// SetMaxHeight sets the MaxHeight field's value. -func (s *Thumbnails) SetMaxHeight(v string) *Thumbnails { - s.MaxHeight = &v - return s -} - -// SetMaxWidth sets the MaxWidth field's value. -func (s *Thumbnails) SetMaxWidth(v string) *Thumbnails { - s.MaxWidth = &v - return s -} - -// SetPaddingPolicy sets the PaddingPolicy field's value. -func (s *Thumbnails) SetPaddingPolicy(v string) *Thumbnails { - s.PaddingPolicy = &v - return s -} - -// SetResolution sets the Resolution field's value. -func (s *Thumbnails) SetResolution(v string) *Thumbnails { - s.Resolution = &v - return s -} - -// SetSizingPolicy sets the SizingPolicy field's value. -func (s *Thumbnails) SetSizingPolicy(v string) *Thumbnails { - s.SizingPolicy = &v - return s -} - -// Settings that determine when a clip begins and how long it lasts. -type TimeSpan struct { - _ struct{} `type:"structure"` - - // The duration of the clip. The format can be either HH:mm:ss.SSS (maximum - // value: 23:59:59.999; SSS is thousandths of a second) or sssss.SSS (maximum - // value: 86399.999). If you don't specify a value, Elastic Transcoder creates - // an output file from StartTime to the end of the file. - // - // If you specify a value longer than the duration of the input file, Elastic - // Transcoder transcodes the file and returns a warning message. - Duration *string `type:"string"` - - // The place in the input file where you want a clip to start. The format can - // be either HH:mm:ss.SSS (maximum value: 23:59:59.999; SSS is thousandths of - // a second) or sssss.SSS (maximum value: 86399.999). If you don't specify a - // value, Elastic Transcoder starts at the beginning of the input file. - StartTime *string `type:"string"` -} - -// String returns the string representation -func (s TimeSpan) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TimeSpan) GoString() string { - return s.String() -} - -// SetDuration sets the Duration field's value. -func (s *TimeSpan) SetDuration(v string) *TimeSpan { - s.Duration = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *TimeSpan) SetStartTime(v string) *TimeSpan { - s.StartTime = &v - return s -} - -// Details about the timing of a job. -type Timing struct { - _ struct{} `type:"structure"` - - // The time the job finished transcoding, in epoch milliseconds. - FinishTimeMillis *int64 `type:"long"` - - // The time the job began transcoding, in epoch milliseconds. - StartTimeMillis *int64 `type:"long"` - - // The time the job was submitted to Elastic Transcoder, in epoch milliseconds. - SubmitTimeMillis *int64 `type:"long"` -} - -// String returns the string representation -func (s Timing) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Timing) GoString() string { - return s.String() -} - -// SetFinishTimeMillis sets the FinishTimeMillis field's value. -func (s *Timing) SetFinishTimeMillis(v int64) *Timing { - s.FinishTimeMillis = &v - return s -} - -// SetStartTimeMillis sets the StartTimeMillis field's value. -func (s *Timing) SetStartTimeMillis(v int64) *Timing { - s.StartTimeMillis = &v - return s -} - -// SetSubmitTimeMillis sets the SubmitTimeMillis field's value. -func (s *Timing) SetSubmitTimeMillis(v int64) *Timing { - s.SubmitTimeMillis = &v - return s -} - -// The UpdatePipelineRequest structure. -type UpdatePipelineInput struct { - _ struct{} `type:"structure"` - - // The AWS Key Management Service (AWS KMS) key that you want to use with this - // pipeline. - // - // If you use either S3 or S3-AWS-KMS as your Encryption:Mode, you don't need - // to provide a key with your job because a default key, known as an AWS-KMS - // key, is created for you automatically. You need to provide an AWS-KMS key - // only if you want to use a non-default AWS-KMS key, or if you are using an - // Encryption:Mode of AES-PKCS7, AES-CTR, or AES-GCM. - AwsKmsKeyArn *string `type:"string"` - - // The optional ContentConfig object specifies information about the Amazon - // S3 bucket in which you want Elastic Transcoder to save transcoded files and - // playlists: which bucket to use, which users you want to have access to the - // files, the type of access you want users to have, and the storage class that - // you want to assign to the files. - // - // If you specify values for ContentConfig, you must also specify values for - // ThumbnailConfig. - // - // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket - // object. - // - // * Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to - // save transcoded files and playlists. - // - // * Permissions (Optional): The Permissions object specifies which users - // you want to have access to transcoded files and the type of access you - // want them to have. You can grant permissions to a maximum of 30 users - // and/or predefined Amazon S3 groups. - // - // * Grantee Type: Specify the type of value that appears in the Grantee - // object: - // - // Canonical: The value in the Grantee object is either the canonical user ID - // for an AWS account or an origin access identity for an Amazon CloudFront - // distribution. For more information about canonical user IDs, see Access - // Control List (ACL) Overview in the Amazon Simple Storage Service Developer - // Guide. For more information about using CloudFront origin access identities - // to require that users use CloudFront URLs instead of Amazon S3 URLs, see - // Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content. - // - // A canonical user ID is not the same as an AWS account number. - // - // Email: The value in the Grantee object is the registered email address of - // an AWS account. - // - // Group: The value in the Grantee object is one of the following predefined - // Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. - // - // * Grantee: The AWS user or group that you want to have access to transcoded - // files and playlists. To identify the user or group, you can specify the - // canonical user ID for an AWS account, an origin access identity for a - // CloudFront distribution, the registered email address of an AWS account, - // or a predefined Amazon S3 group - // - // * Access: The permission that you want to give to the AWS user that you - // specified in Grantee. Permissions are granted on the files that Elastic - // Transcoder adds to the bucket, including playlists and video files. Valid - // values include: - // - // READ: The grantee can read the objects and metadata for objects that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // READ_ACP: The grantee can read the object ACL for objects that Elastic Transcoder - // adds to the Amazon S3 bucket. - // - // WRITE_ACP: The grantee can write the ACL for the objects that Elastic Transcoder - // adds to the Amazon S3 bucket. - // - // FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for - // the objects that Elastic Transcoder adds to the Amazon S3 bucket. - // - // * StorageClass: The Amazon S3 storage class, Standard or ReducedRedundancy, - // that you want Elastic Transcoder to assign to the video files and playlists - // that it stores in your Amazon S3 bucket. - ContentConfig *PipelineOutputConfig `type:"structure"` - - // The ID of the pipeline that you want to update. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The Amazon S3 bucket in which you saved the media files that you want to - // transcode and the graphics that you want to use as watermarks. - InputBucket *string `type:"string"` - - // The name of the pipeline. We recommend that the name be unique within the - // AWS account, but uniqueness is not enforced. - // - // Constraints: Maximum 40 characters - Name *string `min:"1" type:"string"` - - // The topic ARN for the Amazon Simple Notification Service (Amazon SNS) topic - // that you want to notify to report job status. - // - // To receive notifications, you must also subscribe to the new topic in the - // Amazon SNS console. - // - // * Progressing: The topic ARN for the Amazon Simple Notification Service - // (Amazon SNS) topic that you want to notify when Elastic Transcoder has - // started to process jobs that are added to this pipeline. This is the ARN - // that Amazon SNS returned when you created the topic. - // - // * Completed: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder has finished processing a job. This is the ARN - // that Amazon SNS returned when you created the topic. - // - // * Warning: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder encounters a warning condition. This is the ARN - // that Amazon SNS returned when you created the topic. - // - // * Error: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder encounters an error condition. This is the ARN - // that Amazon SNS returned when you created the topic. - Notifications *Notifications `type:"structure"` - - // The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder - // to use to transcode jobs for this pipeline. - Role *string `type:"string"` - - // The ThumbnailConfig object specifies several values, including the Amazon - // S3 bucket in which you want Elastic Transcoder to save thumbnail files, which - // users you want to have access to the files, the type of access you want users - // to have, and the storage class that you want to assign to the files. - // - // If you specify values for ContentConfig, you must also specify values for - // ThumbnailConfig even if you don't want to create thumbnails. - // - // If you specify values for ContentConfig and ThumbnailConfig, omit the OutputBucket - // object. - // - // * Bucket: The Amazon S3 bucket in which you want Elastic Transcoder to - // save thumbnail files. - // - // * Permissions (Optional): The Permissions object specifies which users - // and/or predefined Amazon S3 groups you want to have access to thumbnail - // files, and the type of access you want them to have. You can grant permissions - // to a maximum of 30 users and/or predefined Amazon S3 groups. - // - // * GranteeType: Specify the type of value that appears in the Grantee object: - // - // Canonical: The value in the Grantee object is either the canonical user ID - // for an AWS account or an origin access identity for an Amazon CloudFront - // distribution. - // - // A canonical user ID is not the same as an AWS account number. - // - // Email: The value in the Grantee object is the registered email address of - // an AWS account. - // - // Group: The value in the Grantee object is one of the following predefined - // Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery. - // - // * Grantee: The AWS user or group that you want to have access to thumbnail - // files. To identify the user or group, you can specify the canonical user - // ID for an AWS account, an origin access identity for a CloudFront distribution, - // the registered email address of an AWS account, or a predefined Amazon - // S3 group. - // - // * Access: The permission that you want to give to the AWS user that you - // specified in Grantee. Permissions are granted on the thumbnail files that - // Elastic Transcoder adds to the bucket. Valid values include: - // - // READ: The grantee can read the thumbnails and metadata for objects that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // READ_ACP: The grantee can read the object ACL for thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic - // Transcoder adds to the Amazon S3 bucket. - // - // FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for - // the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket. - // - // * StorageClass: The Amazon S3 storage class, Standard or ReducedRedundancy, - // that you want Elastic Transcoder to assign to the thumbnails that it stores - // in your Amazon S3 bucket. - ThumbnailConfig *PipelineOutputConfig `type:"structure"` -} - -// String returns the string representation -func (s UpdatePipelineInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipelineInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ContentConfig != nil { - if err := s.ContentConfig.Validate(); err != nil { - invalidParams.AddNested("ContentConfig", err.(request.ErrInvalidParams)) - } - } - if s.ThumbnailConfig != nil { - if err := s.ThumbnailConfig.Validate(); err != nil { - invalidParams.AddNested("ThumbnailConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsKmsKeyArn sets the AwsKmsKeyArn field's value. -func (s *UpdatePipelineInput) SetAwsKmsKeyArn(v string) *UpdatePipelineInput { - s.AwsKmsKeyArn = &v - return s -} - -// SetContentConfig sets the ContentConfig field's value. -func (s *UpdatePipelineInput) SetContentConfig(v *PipelineOutputConfig) *UpdatePipelineInput { - s.ContentConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdatePipelineInput) SetId(v string) *UpdatePipelineInput { - s.Id = &v - return s -} - -// SetInputBucket sets the InputBucket field's value. -func (s *UpdatePipelineInput) SetInputBucket(v string) *UpdatePipelineInput { - s.InputBucket = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePipelineInput) SetName(v string) *UpdatePipelineInput { - s.Name = &v - return s -} - -// SetNotifications sets the Notifications field's value. -func (s *UpdatePipelineInput) SetNotifications(v *Notifications) *UpdatePipelineInput { - s.Notifications = v - return s -} - -// SetRole sets the Role field's value. -func (s *UpdatePipelineInput) SetRole(v string) *UpdatePipelineInput { - s.Role = &v - return s -} - -// SetThumbnailConfig sets the ThumbnailConfig field's value. -func (s *UpdatePipelineInput) SetThumbnailConfig(v *PipelineOutputConfig) *UpdatePipelineInput { - s.ThumbnailConfig = v - return s -} - -// The UpdatePipelineNotificationsRequest structure. -type UpdatePipelineNotificationsInput struct { - _ struct{} `type:"structure"` - - // The identifier of the pipeline for which you want to change notification - // settings. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The topic ARN for the Amazon Simple Notification Service (Amazon SNS) topic - // that you want to notify to report job status. - // - // To receive notifications, you must also subscribe to the new topic in the - // Amazon SNS console. - // - // * Progressing: The topic ARN for the Amazon Simple Notification Service - // (Amazon SNS) topic that you want to notify when Elastic Transcoder has - // started to process jobs that are added to this pipeline. This is the ARN - // that Amazon SNS returned when you created the topic. - // - // * Completed: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder has finished processing a job. This is the ARN - // that Amazon SNS returned when you created the topic. - // - // * Warning: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder encounters a warning condition. This is the ARN - // that Amazon SNS returned when you created the topic. - // - // * Error: The topic ARN for the Amazon SNS topic that you want to notify - // when Elastic Transcoder encounters an error condition. This is the ARN - // that Amazon SNS returned when you created the topic. - // - // Notifications is a required field - Notifications *Notifications `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdatePipelineNotificationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePipelineNotificationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipelineNotificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipelineNotificationsInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Notifications == nil { - invalidParams.Add(request.NewErrParamRequired("Notifications")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *UpdatePipelineNotificationsInput) SetId(v string) *UpdatePipelineNotificationsInput { - s.Id = &v - return s -} - -// SetNotifications sets the Notifications field's value. -func (s *UpdatePipelineNotificationsInput) SetNotifications(v *Notifications) *UpdatePipelineNotificationsInput { - s.Notifications = v - return s -} - -// The UpdatePipelineNotificationsResponse structure. -type UpdatePipelineNotificationsOutput struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the pipeline - // associated with this notification. - Pipeline *Pipeline `type:"structure"` -} - -// String returns the string representation -func (s UpdatePipelineNotificationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePipelineNotificationsOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *UpdatePipelineNotificationsOutput) SetPipeline(v *Pipeline) *UpdatePipelineNotificationsOutput { - s.Pipeline = v - return s -} - -// When you update a pipeline, Elastic Transcoder returns the values that you -// specified in the request. -type UpdatePipelineOutput struct { - _ struct{} `type:"structure"` - - // The pipeline updated by this UpdatePipelineResponse call. - Pipeline *Pipeline `type:"structure"` - - // Elastic Transcoder returns a warning if the resources used by your pipeline - // are not in the same region as the pipeline. - // - // Using resources in the same region, such as your Amazon S3 buckets, Amazon - // SNS notification topics, and AWS KMS key, reduces processing time and prevents - // cross-regional charges. - Warnings []*Warning `type:"list"` -} - -// String returns the string representation -func (s UpdatePipelineOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *UpdatePipelineOutput) SetPipeline(v *Pipeline) *UpdatePipelineOutput { - s.Pipeline = v - return s -} - -// SetWarnings sets the Warnings field's value. -func (s *UpdatePipelineOutput) SetWarnings(v []*Warning) *UpdatePipelineOutput { - s.Warnings = v - return s -} - -// The UpdatePipelineStatusRequest structure. -type UpdatePipelineStatusInput struct { - _ struct{} `type:"structure"` - - // The identifier of the pipeline to update. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // The desired status of the pipeline: - // - // * Active: The pipeline is processing jobs. - // - // * Paused: The pipeline is not currently processing jobs. - // - // Status is a required field - Status *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdatePipelineStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePipelineStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipelineStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipelineStatusInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *UpdatePipelineStatusInput) SetId(v string) *UpdatePipelineStatusInput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdatePipelineStatusInput) SetStatus(v string) *UpdatePipelineStatusInput { - s.Status = &v - return s -} - -// When you update status for a pipeline, Elastic Transcoder returns the values -// that you specified in the request. -type UpdatePipelineStatusOutput struct { - _ struct{} `type:"structure"` - - // A section of the response body that provides information about the pipeline. - Pipeline *Pipeline `type:"structure"` -} - -// String returns the string representation -func (s UpdatePipelineStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdatePipelineStatusOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *UpdatePipelineStatusOutput) SetPipeline(v *Pipeline) *UpdatePipelineStatusOutput { - s.Pipeline = v - return s -} - -// The VideoParameters structure. -type VideoParameters struct { - _ struct{} `type:"structure"` - - // To better control resolution and aspect ratio of output videos, we recommend - // that you use the values MaxWidth, MaxHeight, SizingPolicy, PaddingPolicy, - // and DisplayAspectRatio instead of Resolution and AspectRatio. The two groups - // of settings are mutually exclusive. Do not use them together. - // - // The display aspect ratio of the video in the output file. Valid values include: - // - // auto, 1:1, 4:3, 3:2, 16:9 - // - // If you specify auto, Elastic Transcoder tries to preserve the aspect ratio - // of the input file. - // - // If you specify an aspect ratio for the output file that differs from aspect - // ratio of the input file, Elastic Transcoder adds pillarboxing (black bars - // on the sides) or letterboxing (black bars on the top and bottom) to maintain - // the aspect ratio of the active region of the video. - AspectRatio *string `type:"string"` - - // The bit rate of the video stream in the output file, in kilobits/second. - // Valid values depend on the values of Level and Profile. If you specify auto, - // Elastic Transcoder uses the detected bit rate of the input source. If you - // specify a value other than auto, we recommend that you specify a value less - // than or equal to the maximum H.264-compliant value listed for your level - // and profile: - // - // Level - Maximum video bit rate in kilobits/second (baseline and main Profile) - // : maximum video bit rate in kilobits/second (high Profile) - // - // * 1 - 64 : 80 - // - // * 1b - 128 : 160 - // - // * 1.1 - 192 : 240 - // - // * 1.2 - 384 : 480 - // - // * 1.3 - 768 : 960 - // - // * 2 - 2000 : 2500 - // - // * 3 - 10000 : 12500 - // - // * 3.1 - 14000 : 17500 - // - // * 3.2 - 20000 : 25000 - // - // * 4 - 20000 : 25000 - // - // * 4.1 - 50000 : 62500 - BitRate *string `type:"string"` - - // The video codec for the output file. Valid values include gif, H.264, mpeg2, - // vp8, and vp9. You can only specify vp8 and vp9 when the container type is - // webm, gif when the container type is gif, and mpeg2 when the container type - // is mpg. - Codec *string `type:"string"` - - // Profile (H.264/VP8/VP9 Only) - // - // The H.264 profile that you want to use for the output file. Elastic Transcoder - // supports the following profiles: - // - // * baseline: The profile most commonly used for videoconferencing and for - // mobile applications. - // - // * main: The profile used for standard-definition digital TV broadcasts. - // - // * high: The profile used for high-definition digital TV broadcasts and - // for Blu-ray discs. - // - // Level (H.264 Only) - // - // The H.264 level that you want to use for the output file. Elastic Transcoder - // supports the following levels: - // - // 1, 1b, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1 - // - // MaxReferenceFrames (H.264 Only) - // - // Applicable only when the value of Video:Codec is H.264. The maximum number - // of previously decoded frames to use as a reference for decoding future frames. - // Valid values are integers 0 through 16, but we recommend that you not use - // a value greater than the following: - // - // Min(Floor(Maximum decoded picture buffer in macroblocks * 256 / (Width in - // pixels * Height in pixels)), 16) - // - // where Width in pixels and Height in pixels represent either MaxWidth and - // MaxHeight, or Resolution. Maximum decoded picture buffer in macroblocks depends - // on the value of the Level object. See the list below. (A macroblock is a - // block of pixels measuring 16x16.) - // - // * 1 - 396 - // - // * 1b - 396 - // - // * 1.1 - 900 - // - // * 1.2 - 2376 - // - // * 1.3 - 2376 - // - // * 2 - 2376 - // - // * 2.1 - 4752 - // - // * 2.2 - 8100 - // - // * 3 - 8100 - // - // * 3.1 - 18000 - // - // * 3.2 - 20480 - // - // * 4 - 32768 - // - // * 4.1 - 32768 - // - // MaxBitRate (Optional, H.264/MPEG2/VP8/VP9 only) - // - // The maximum number of bits per second in a video buffer; the size of the - // buffer is specified by BufferSize. Specify a value between 16 and 62,500. - // You can reduce the bandwidth required to stream a video by reducing the maximum - // bit rate, but this also reduces the quality of the video. - // - // BufferSize (Optional, H.264/MPEG2/VP8/VP9 only) - // - // The maximum number of bits in any x seconds of the output video. This window - // is commonly 10 seconds, the standard segment duration when you're using FMP4 - // or MPEG-TS for the container type of the output video. Specify an integer - // greater than 0. If you specify MaxBitRate and omit BufferSize, Elastic Transcoder - // sets BufferSize to 10 times the value of MaxBitRate. - // - // InterlacedMode (Optional, H.264/MPEG2 Only) - // - // The interlace mode for the output video. - // - // Interlaced video is used to double the perceived frame rate for a video by - // interlacing two fields (one field on every other line, the other field on - // the other lines) so that the human eye registers multiple pictures per frame. - // Interlacing reduces the bandwidth required for transmitting a video, but - // can result in blurred images and flickering. - // - // Valid values include Progressive (no interlacing, top to bottom), TopFirst - // (top field first), BottomFirst (bottom field first), and Auto. - // - // If InterlaceMode is not specified, Elastic Transcoder uses Progressive for - // the output. If Auto is specified, Elastic Transcoder interlaces the output. - // - // ColorSpaceConversionMode (Optional, H.264/MPEG2 Only) - // - // The color space conversion Elastic Transcoder applies to the output video. - // Color spaces are the algorithms used by the computer to store information - // about how to render color. Bt.601 is the standard for standard definition - // video, while Bt.709 is the standard for high definition video. - // - // Valid values include None, Bt709toBt601, Bt601toBt709, and Auto. - // - // If you chose Auto for ColorSpaceConversionMode and your output is interlaced, - // your frame rate is one of 23.97, 24, 25, 29.97, 50, or 60, your SegmentDuration - // is null, and you are using one of the resolution changes from the list below, - // Elastic Transcoder applies the following color space conversions: - // - // * Standard to HD, 720x480 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709 - // - // * Standard to HD, 720x576 to 1920x1080 - Elastic Transcoder applies Bt601ToBt709 - // - // * HD to Standard, 1920x1080 to 720x480 - Elastic Transcoder applies Bt709ToBt601 - // - // * HD to Standard, 1920x1080 to 720x576 - Elastic Transcoder applies Bt709ToBt601 - // - // Elastic Transcoder may change the behavior of the ColorspaceConversionModeAuto - // mode in the future. All outputs in a playlist must use the same ColorSpaceConversionMode. - // - // If you do not specify a ColorSpaceConversionMode, Elastic Transcoder does - // not change the color space of a file. If you are unsure what ColorSpaceConversionMode - // was applied to your output file, you can check the AppliedColorSpaceConversion - // parameter included in your job response. If your job does not have an AppliedColorSpaceConversion - // in its response, no ColorSpaceConversionMode was applied. - // - // ChromaSubsampling - // - // The sampling pattern for the chroma (color) channels of the output video. - // Valid values include yuv420p and yuv422p. - // - // yuv420p samples the chroma information of every other horizontal and every - // other vertical line, yuv422p samples the color information of every horizontal - // line and every other vertical line. - // - // LoopCount (Gif Only) - // - // The number of times you want the output gif to loop. Valid values include - // Infinite and integers between 0 and 100, inclusive. - CodecOptions map[string]*string `type:"map"` - - // The value that Elastic Transcoder adds to the metadata in the output file. - DisplayAspectRatio *string `type:"string"` - - // Applicable only when the value of Video:Codec is one of H.264, MPEG2, or - // VP8. - // - // Whether to use a fixed value for FixedGOP. Valid values are true and false: - // - // * true: Elastic Transcoder uses the value of KeyframesMaxDist for the - // distance between key frames (the number of frames in a group of pictures, - // or GOP). - // - // * false: The distance between key frames can vary. - // - // FixedGOP must be set to true for fmp4 containers. - FixedGOP *string `type:"string"` - - // The frames per second for the video stream in the output file. Valid values - // include: - // - // auto, 10, 15, 23.97, 24, 25, 29.97, 30, 60 - // - // If you specify auto, Elastic Transcoder uses the detected frame rate of the - // input source. If you specify a frame rate, we recommend that you perform - // the following calculation: - // - // Frame rate = maximum recommended decoding speed in luma samples/second / - // (width in pixels * height in pixels) - // - // where: - // - // * width in pixels and height in pixels represent the Resolution of the - // output video. - // - // * maximum recommended decoding speed in Luma samples/second is less than - // or equal to the maximum value listed in the following table, based on - // the value that you specified for Level. - // - // The maximum recommended decoding speed in Luma samples/second for each level - // is described in the following list (Level - Decoding speed): - // - // * 1 - 380160 - // - // * 1b - 380160 - // - // * 1.1 - 76800 - // - // * 1.2 - 1536000 - // - // * 1.3 - 3041280 - // - // * 2 - 3041280 - // - // * 2.1 - 5068800 - // - // * 2.2 - 5184000 - // - // * 3 - 10368000 - // - // * 3.1 - 27648000 - // - // * 3.2 - 55296000 - // - // * 4 - 62914560 - // - // * 4.1 - 62914560 - FrameRate *string `type:"string"` - - // Applicable only when the value of Video:Codec is one of H.264, MPEG2, or - // VP8. - // - // The maximum number of frames between key frames. Key frames are fully encoded - // frames; the frames between key frames are encoded based, in part, on the - // content of the key frames. The value is an integer formatted as a string; - // valid values are between 1 (every frame is a key frame) and 100000, inclusive. - // A higher value results in higher compression but may also discernibly decrease - // video quality. - // - // For Smooth outputs, the FrameRate must have a constant ratio to the KeyframesMaxDist. - // This allows Smooth playlists to switch between different quality levels while - // the file is being played. - // - // For example, an input file can have a FrameRate of 30 with a KeyframesMaxDist - // of 90. The output file then needs to have a ratio of 1:3. Valid outputs would - // have FrameRate of 30, 25, and 10, and KeyframesMaxDist of 90, 75, and 30, - // respectively. - // - // Alternately, this can be achieved by setting FrameRate to auto and having - // the same values for MaxFrameRate and KeyframesMaxDist. - KeyframesMaxDist *string `type:"string"` - - // If you specify auto for FrameRate, Elastic Transcoder uses the frame rate - // of the input video for the frame rate of the output video. Specify the maximum - // frame rate that you want Elastic Transcoder to use when the frame rate of - // the input video is greater than the desired maximum frame rate of the output - // video. Valid values include: 10, 15, 23.97, 24, 25, 29.97, 30, 60. - MaxFrameRate *string `type:"string"` - - // The maximum height of the output video in pixels. If you specify auto, Elastic - // Transcoder uses 1080 (Full HD) as the default value. If you specify a numeric - // value, enter an even integer between 96 and 3072. - MaxHeight *string `type:"string"` - - // The maximum width of the output video in pixels. If you specify auto, Elastic - // Transcoder uses 1920 (Full HD) as the default value. If you specify a numeric - // value, enter an even integer between 128 and 4096. - MaxWidth *string `type:"string"` - - // When you set PaddingPolicy to Pad, Elastic Transcoder may add black bars - // to the top and bottom and/or left and right sides of the output video to - // make the total size of the output video match the values that you specified - // for MaxWidth and MaxHeight. - PaddingPolicy *string `type:"string"` - - // To better control resolution and aspect ratio of output videos, we recommend - // that you use the values MaxWidth, MaxHeight, SizingPolicy, PaddingPolicy, - // and DisplayAspectRatio instead of Resolution and AspectRatio. The two groups - // of settings are mutually exclusive. Do not use them together. - // - // The width and height of the video in the output file, in pixels. Valid values - // are auto and width x height: - // - // * auto: Elastic Transcoder attempts to preserve the width and height of - // the input file, subject to the following rules. - // - // * width x height: The width and height of the output video in pixels. - // - // Note the following about specifying the width and height: - // - // * The width must be an even integer between 128 and 4096, inclusive. - // - // * The height must be an even integer between 96 and 3072, inclusive. - // - // * If you specify a resolution that is less than the resolution of the - // input file, Elastic Transcoder rescales the output file to the lower resolution. - // - // * If you specify a resolution that is greater than the resolution of the - // input file, Elastic Transcoder rescales the output to the higher resolution. - // - // * We recommend that you specify a resolution for which the product of - // width and height is less than or equal to the applicable value in the - // following list (List - Max width x height value): - // - // 1 - 25344 - // - // 1b - 25344 - // - // 1.1 - 101376 - // - // 1.2 - 101376 - // - // 1.3 - 101376 - // - // 2 - 101376 - // - // 2.1 - 202752 - // - // 2.2 - 404720 - // - // 3 - 404720 - // - // 3.1 - 921600 - // - // 3.2 - 1310720 - // - // 4 - 2097152 - // - // 4.1 - 2097152 - Resolution *string `type:"string"` - - // Specify one of the following values to control scaling of the output video: - // - // * Fit: Elastic Transcoder scales the output video so it matches the value - // that you specified in either MaxWidth or MaxHeight without exceeding the - // other value. - // - // * Fill: Elastic Transcoder scales the output video so it matches the value - // that you specified in either MaxWidth or MaxHeight and matches or exceeds - // the other value. Elastic Transcoder centers the output video and then - // crops it in the dimension (if any) that exceeds the maximum value. - // - // * Stretch: Elastic Transcoder stretches the output video to match the - // values that you specified for MaxWidth and MaxHeight. If the relative - // proportions of the input video and the output video are different, the - // output video will be distorted. - // - // * Keep: Elastic Transcoder does not scale the output video. If either - // dimension of the input video exceeds the values that you specified for - // MaxWidth and MaxHeight, Elastic Transcoder crops the output video. - // - // * ShrinkToFit: Elastic Transcoder scales the output video down so that - // its dimensions match the values that you specified for at least one of - // MaxWidth and MaxHeight without exceeding either value. If you specify - // this option, Elastic Transcoder does not scale the video up. - // - // * ShrinkToFill: Elastic Transcoder scales the output video down so that - // its dimensions match the values that you specified for at least one of - // MaxWidth and MaxHeight without dropping below either value. If you specify - // this option, Elastic Transcoder does not scale the video up. - SizingPolicy *string `type:"string"` - - // Settings for the size, location, and opacity of graphics that you want Elastic - // Transcoder to overlay over videos that are transcoded using this preset. - // You can specify settings for up to four watermarks. Watermarks appear in - // the specified size and location, and with the specified opacity for the duration - // of the transcoded video. - // - // Watermarks can be in .png or .jpg format. If you want to display a watermark - // that is not rectangular, use the .png format, which supports transparency. - // - // When you create a job that uses this preset, you specify the .png or .jpg - // graphics that you want Elastic Transcoder to include in the transcoded videos. - // You can specify fewer graphics in the job than you specify watermark settings - // in the preset, which allows you to use the same preset for up to four watermarks - // that have different dimensions. - Watermarks []*PresetWatermark `type:"list"` -} - -// String returns the string representation -func (s VideoParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VideoParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VideoParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VideoParameters"} - if s.Watermarks != nil { - for i, v := range s.Watermarks { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Watermarks", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAspectRatio sets the AspectRatio field's value. -func (s *VideoParameters) SetAspectRatio(v string) *VideoParameters { - s.AspectRatio = &v - return s -} - -// SetBitRate sets the BitRate field's value. -func (s *VideoParameters) SetBitRate(v string) *VideoParameters { - s.BitRate = &v - return s -} - -// SetCodec sets the Codec field's value. -func (s *VideoParameters) SetCodec(v string) *VideoParameters { - s.Codec = &v - return s -} - -// SetCodecOptions sets the CodecOptions field's value. -func (s *VideoParameters) SetCodecOptions(v map[string]*string) *VideoParameters { - s.CodecOptions = v - return s -} - -// SetDisplayAspectRatio sets the DisplayAspectRatio field's value. -func (s *VideoParameters) SetDisplayAspectRatio(v string) *VideoParameters { - s.DisplayAspectRatio = &v - return s -} - -// SetFixedGOP sets the FixedGOP field's value. -func (s *VideoParameters) SetFixedGOP(v string) *VideoParameters { - s.FixedGOP = &v - return s -} - -// SetFrameRate sets the FrameRate field's value. -func (s *VideoParameters) SetFrameRate(v string) *VideoParameters { - s.FrameRate = &v - return s -} - -// SetKeyframesMaxDist sets the KeyframesMaxDist field's value. -func (s *VideoParameters) SetKeyframesMaxDist(v string) *VideoParameters { - s.KeyframesMaxDist = &v - return s -} - -// SetMaxFrameRate sets the MaxFrameRate field's value. -func (s *VideoParameters) SetMaxFrameRate(v string) *VideoParameters { - s.MaxFrameRate = &v - return s -} - -// SetMaxHeight sets the MaxHeight field's value. -func (s *VideoParameters) SetMaxHeight(v string) *VideoParameters { - s.MaxHeight = &v - return s -} - -// SetMaxWidth sets the MaxWidth field's value. -func (s *VideoParameters) SetMaxWidth(v string) *VideoParameters { - s.MaxWidth = &v - return s -} - -// SetPaddingPolicy sets the PaddingPolicy field's value. -func (s *VideoParameters) SetPaddingPolicy(v string) *VideoParameters { - s.PaddingPolicy = &v - return s -} - -// SetResolution sets the Resolution field's value. -func (s *VideoParameters) SetResolution(v string) *VideoParameters { - s.Resolution = &v - return s -} - -// SetSizingPolicy sets the SizingPolicy field's value. -func (s *VideoParameters) SetSizingPolicy(v string) *VideoParameters { - s.SizingPolicy = &v - return s -} - -// SetWatermarks sets the Watermarks field's value. -func (s *VideoParameters) SetWatermarks(v []*PresetWatermark) *VideoParameters { - s.Watermarks = v - return s -} - -// Elastic Transcoder returns a warning if the resources used by your pipeline -// are not in the same region as the pipeline. -// -// Using resources in the same region, such as your Amazon S3 buckets, Amazon -// SNS notification topics, and AWS KMS key, reduces processing time and prevents -// cross-regional charges. -type Warning struct { - _ struct{} `type:"structure"` - - // The code of the cross-regional warning. - Code *string `type:"string"` - - // The message explaining what resources are in a different region from the - // pipeline. - // - // AWS KMS keys must be in the same region as the pipeline. - Message *string `type:"string"` -} - -// String returns the string representation -func (s Warning) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Warning) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *Warning) SetCode(v string) *Warning { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *Warning) SetMessage(v string) *Warning { - s.Message = &v - return s -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go deleted file mode 100644 index 7c67078..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package elastictranscoder - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // General authentication failure. The request was not signed correctly. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeIncompatibleVersionException for service response error code - // "IncompatibleVersionException". - ErrCodeIncompatibleVersionException = "IncompatibleVersionException" - - // ErrCodeInternalServiceException for service response error code - // "InternalServiceException". - // - // Elastic Transcoder encountered an unexpected exception while trying to fulfill - // the request. - ErrCodeInternalServiceException = "InternalServiceException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // Too many operations for a given AWS account. For example, the number of pipelines - // exceeds the maximum allowed. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // The resource you are attempting to change is in use. For example, you are - // attempting to delete a pipeline that is currently in use. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The requested resource does not exist or is not available. For example, the - // pipeline to which you're trying to add a job doesn't exist or is still being - // created. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // One or more required parameter values were not provided in the request. - ErrCodeValidationException = "ValidationException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/examples_test.go deleted file mode 100644 index 309b9df..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/examples_test.go +++ /dev/null @@ -1,839 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package elastictranscoder_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/elastictranscoder" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleElasticTranscoder_CancelJob() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.CancelJobInput{ - Id: aws.String("Id"), // Required - } - resp, err := svc.CancelJob(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_CreateJob() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.CreateJobInput{ - PipelineId: aws.String("Id"), // Required - Input: &elastictranscoder.JobInput{ - AspectRatio: aws.String("AspectRatio"), - Container: aws.String("JobContainer"), - DetectedProperties: &elastictranscoder.DetectedProperties{ - DurationMillis: aws.Int64(1), - FileSize: aws.Int64(1), - FrameRate: aws.String("FloatString"), - Height: aws.Int64(1), - Width: aws.Int64(1), - }, - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - FrameRate: aws.String("FrameRate"), - InputCaptions: &elastictranscoder.InputCaptions{ - CaptionSources: []*elastictranscoder.CaptionSource{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("LongKey"), - Label: aws.String("Name"), - Language: aws.String("Key"), - TimeOffset: aws.String("TimeOffset"), - }, - // More values... - }, - MergePolicy: aws.String("CaptionMergePolicy"), - }, - Interlaced: aws.String("Interlaced"), - Key: aws.String("LongKey"), - Resolution: aws.String("Resolution"), - TimeSpan: &elastictranscoder.TimeSpan{ - Duration: aws.String("Time"), - StartTime: aws.String("Time"), - }, - }, - Inputs: []*elastictranscoder.JobInput{ - { // Required - AspectRatio: aws.String("AspectRatio"), - Container: aws.String("JobContainer"), - DetectedProperties: &elastictranscoder.DetectedProperties{ - DurationMillis: aws.Int64(1), - FileSize: aws.Int64(1), - FrameRate: aws.String("FloatString"), - Height: aws.Int64(1), - Width: aws.Int64(1), - }, - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - FrameRate: aws.String("FrameRate"), - InputCaptions: &elastictranscoder.InputCaptions{ - CaptionSources: []*elastictranscoder.CaptionSource{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("LongKey"), - Label: aws.String("Name"), - Language: aws.String("Key"), - TimeOffset: aws.String("TimeOffset"), - }, - // More values... - }, - MergePolicy: aws.String("CaptionMergePolicy"), - }, - Interlaced: aws.String("Interlaced"), - Key: aws.String("LongKey"), - Resolution: aws.String("Resolution"), - TimeSpan: &elastictranscoder.TimeSpan{ - Duration: aws.String("Time"), - StartTime: aws.String("Time"), - }, - }, - // More values... - }, - Output: &elastictranscoder.CreateJobOutput{ - AlbumArt: &elastictranscoder.JobAlbumArt{ - Artwork: []*elastictranscoder.Artwork{ - { // Required - AlbumArtFormat: aws.String("JpgOrPng"), - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - MaxHeight: aws.String("DigitsOrAuto"), - MaxWidth: aws.String("DigitsOrAuto"), - PaddingPolicy: aws.String("PaddingPolicy"), - SizingPolicy: aws.String("SizingPolicy"), - }, - // More values... - }, - MergePolicy: aws.String("MergePolicy"), - }, - Captions: &elastictranscoder.Captions{ - CaptionFormats: []*elastictranscoder.CaptionFormat{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Format: aws.String("CaptionFormatFormat"), - Pattern: aws.String("CaptionFormatPattern"), - }, - // More values... - }, - CaptionSources: []*elastictranscoder.CaptionSource{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("LongKey"), - Label: aws.String("Name"), - Language: aws.String("Key"), - TimeOffset: aws.String("TimeOffset"), - }, - // More values... - }, - MergePolicy: aws.String("CaptionMergePolicy"), - }, - Composition: []*elastictranscoder.Clip{ - { // Required - TimeSpan: &elastictranscoder.TimeSpan{ - Duration: aws.String("Time"), - StartTime: aws.String("Time"), - }, - }, - // More values... - }, - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("Key"), - PresetId: aws.String("Id"), - Rotate: aws.String("Rotate"), - SegmentDuration: aws.String("FloatString"), - ThumbnailEncryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - ThumbnailPattern: aws.String("ThumbnailPattern"), - Watermarks: []*elastictranscoder.JobWatermark{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - PresetWatermarkId: aws.String("PresetWatermarkId"), - }, - // More values... - }, - }, - OutputKeyPrefix: aws.String("Key"), - Outputs: []*elastictranscoder.CreateJobOutput{ - { // Required - AlbumArt: &elastictranscoder.JobAlbumArt{ - Artwork: []*elastictranscoder.Artwork{ - { // Required - AlbumArtFormat: aws.String("JpgOrPng"), - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - MaxHeight: aws.String("DigitsOrAuto"), - MaxWidth: aws.String("DigitsOrAuto"), - PaddingPolicy: aws.String("PaddingPolicy"), - SizingPolicy: aws.String("SizingPolicy"), - }, - // More values... - }, - MergePolicy: aws.String("MergePolicy"), - }, - Captions: &elastictranscoder.Captions{ - CaptionFormats: []*elastictranscoder.CaptionFormat{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Format: aws.String("CaptionFormatFormat"), - Pattern: aws.String("CaptionFormatPattern"), - }, - // More values... - }, - CaptionSources: []*elastictranscoder.CaptionSource{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("LongKey"), - Label: aws.String("Name"), - Language: aws.String("Key"), - TimeOffset: aws.String("TimeOffset"), - }, - // More values... - }, - MergePolicy: aws.String("CaptionMergePolicy"), - }, - Composition: []*elastictranscoder.Clip{ - { // Required - TimeSpan: &elastictranscoder.TimeSpan{ - Duration: aws.String("Time"), - StartTime: aws.String("Time"), - }, - }, - // More values... - }, - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - Key: aws.String("Key"), - PresetId: aws.String("Id"), - Rotate: aws.String("Rotate"), - SegmentDuration: aws.String("FloatString"), - ThumbnailEncryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - ThumbnailPattern: aws.String("ThumbnailPattern"), - Watermarks: []*elastictranscoder.JobWatermark{ - { // Required - Encryption: &elastictranscoder.Encryption{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - Mode: aws.String("EncryptionMode"), - }, - InputKey: aws.String("WatermarkKey"), - PresetWatermarkId: aws.String("PresetWatermarkId"), - }, - // More values... - }, - }, - // More values... - }, - Playlists: []*elastictranscoder.CreateJobPlaylist{ - { // Required - Format: aws.String("PlaylistFormat"), - HlsContentProtection: &elastictranscoder.HlsContentProtection{ - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("Base64EncodedString"), - KeyMd5: aws.String("Base64EncodedString"), - KeyStoragePolicy: aws.String("KeyStoragePolicy"), - LicenseAcquisitionUrl: aws.String("ZeroTo512String"), - Method: aws.String("HlsContentProtectionMethod"), - }, - Name: aws.String("Filename"), - OutputKeys: []*string{ - aws.String("Key"), // Required - // More values... - }, - PlayReadyDrm: &elastictranscoder.PlayReadyDrm{ - Format: aws.String("PlayReadyDrmFormatString"), - InitializationVector: aws.String("ZeroTo255String"), - Key: aws.String("NonEmptyBase64EncodedString"), - KeyId: aws.String("KeyIdGuid"), - KeyMd5: aws.String("NonEmptyBase64EncodedString"), - LicenseAcquisitionUrl: aws.String("OneTo512String"), - }, - }, - // More values... - }, - UserMetadata: map[string]*string{ - "Key": aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.CreateJob(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_CreatePipeline() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.CreatePipelineInput{ - InputBucket: aws.String("BucketName"), // Required - Name: aws.String("Name"), // Required - Role: aws.String("Role"), // Required - AwsKmsKeyArn: aws.String("KeyArn"), - ContentConfig: &elastictranscoder.PipelineOutputConfig{ - Bucket: aws.String("BucketName"), - Permissions: []*elastictranscoder.Permission{ - { // Required - Access: []*string{ - aws.String("AccessControl"), // Required - // More values... - }, - Grantee: aws.String("Grantee"), - GranteeType: aws.String("GranteeType"), - }, - // More values... - }, - StorageClass: aws.String("StorageClass"), - }, - Notifications: &elastictranscoder.Notifications{ - Completed: aws.String("SnsTopic"), - Error: aws.String("SnsTopic"), - Progressing: aws.String("SnsTopic"), - Warning: aws.String("SnsTopic"), - }, - OutputBucket: aws.String("BucketName"), - ThumbnailConfig: &elastictranscoder.PipelineOutputConfig{ - Bucket: aws.String("BucketName"), - Permissions: []*elastictranscoder.Permission{ - { // Required - Access: []*string{ - aws.String("AccessControl"), // Required - // More values... - }, - Grantee: aws.String("Grantee"), - GranteeType: aws.String("GranteeType"), - }, - // More values... - }, - StorageClass: aws.String("StorageClass"), - }, - } - resp, err := svc.CreatePipeline(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_CreatePreset() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.CreatePresetInput{ - Container: aws.String("PresetContainer"), // Required - Name: aws.String("Name"), // Required - Audio: &elastictranscoder.AudioParameters{ - AudioPackingMode: aws.String("AudioPackingMode"), - BitRate: aws.String("AudioBitRate"), - Channels: aws.String("AudioChannels"), - Codec: aws.String("AudioCodec"), - CodecOptions: &elastictranscoder.AudioCodecOptions{ - BitDepth: aws.String("AudioBitDepth"), - BitOrder: aws.String("AudioBitOrder"), - Profile: aws.String("AudioCodecProfile"), - Signed: aws.String("AudioSigned"), - }, - SampleRate: aws.String("AudioSampleRate"), - }, - Description: aws.String("Description"), - Thumbnails: &elastictranscoder.Thumbnails{ - AspectRatio: aws.String("AspectRatio"), - Format: aws.String("JpgOrPng"), - Interval: aws.String("Digits"), - MaxHeight: aws.String("DigitsOrAuto"), - MaxWidth: aws.String("DigitsOrAuto"), - PaddingPolicy: aws.String("PaddingPolicy"), - Resolution: aws.String("ThumbnailResolution"), - SizingPolicy: aws.String("SizingPolicy"), - }, - Video: &elastictranscoder.VideoParameters{ - AspectRatio: aws.String("AspectRatio"), - BitRate: aws.String("VideoBitRate"), - Codec: aws.String("VideoCodec"), - CodecOptions: map[string]*string{ - "Key": aws.String("CodecOption"), // Required - // More values... - }, - DisplayAspectRatio: aws.String("AspectRatio"), - FixedGOP: aws.String("FixedGOP"), - FrameRate: aws.String("FrameRate"), - KeyframesMaxDist: aws.String("KeyframesMaxDist"), - MaxFrameRate: aws.String("MaxFrameRate"), - MaxHeight: aws.String("DigitsOrAuto"), - MaxWidth: aws.String("DigitsOrAuto"), - PaddingPolicy: aws.String("PaddingPolicy"), - Resolution: aws.String("Resolution"), - SizingPolicy: aws.String("SizingPolicy"), - Watermarks: []*elastictranscoder.PresetWatermark{ - { // Required - HorizontalAlign: aws.String("HorizontalAlign"), - HorizontalOffset: aws.String("PixelsOrPercent"), - Id: aws.String("PresetWatermarkId"), - MaxHeight: aws.String("PixelsOrPercent"), - MaxWidth: aws.String("PixelsOrPercent"), - Opacity: aws.String("Opacity"), - SizingPolicy: aws.String("WatermarkSizingPolicy"), - Target: aws.String("Target"), - VerticalAlign: aws.String("VerticalAlign"), - VerticalOffset: aws.String("PixelsOrPercent"), - }, - // More values... - }, - }, - } - resp, err := svc.CreatePreset(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_DeletePipeline() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.DeletePipelineInput{ - Id: aws.String("Id"), // Required - } - resp, err := svc.DeletePipeline(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_DeletePreset() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.DeletePresetInput{ - Id: aws.String("Id"), // Required - } - resp, err := svc.DeletePreset(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_ListJobsByPipeline() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.ListJobsByPipelineInput{ - PipelineId: aws.String("Id"), // Required - Ascending: aws.String("Ascending"), - PageToken: aws.String("Id"), - } - resp, err := svc.ListJobsByPipeline(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_ListJobsByStatus() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.ListJobsByStatusInput{ - Status: aws.String("JobStatus"), // Required - Ascending: aws.String("Ascending"), - PageToken: aws.String("Id"), - } - resp, err := svc.ListJobsByStatus(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_ListPipelines() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.ListPipelinesInput{ - Ascending: aws.String("Ascending"), - PageToken: aws.String("Id"), - } - resp, err := svc.ListPipelines(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_ListPresets() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.ListPresetsInput{ - Ascending: aws.String("Ascending"), - PageToken: aws.String("Id"), - } - resp, err := svc.ListPresets(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_ReadJob() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.ReadJobInput{ - Id: aws.String("Id"), // Required - } - resp, err := svc.ReadJob(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_ReadPipeline() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.ReadPipelineInput{ - Id: aws.String("Id"), // Required - } - resp, err := svc.ReadPipeline(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_ReadPreset() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.ReadPresetInput{ - Id: aws.String("Id"), // Required - } - resp, err := svc.ReadPreset(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_TestRole() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.TestRoleInput{ - InputBucket: aws.String("BucketName"), // Required - OutputBucket: aws.String("BucketName"), // Required - Role: aws.String("Role"), // Required - Topics: []*string{ // Required - aws.String("SnsTopic"), // Required - // More values... - }, - } - resp, err := svc.TestRole(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_UpdatePipeline() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.UpdatePipelineInput{ - Id: aws.String("Id"), // Required - AwsKmsKeyArn: aws.String("KeyArn"), - ContentConfig: &elastictranscoder.PipelineOutputConfig{ - Bucket: aws.String("BucketName"), - Permissions: []*elastictranscoder.Permission{ - { // Required - Access: []*string{ - aws.String("AccessControl"), // Required - // More values... - }, - Grantee: aws.String("Grantee"), - GranteeType: aws.String("GranteeType"), - }, - // More values... - }, - StorageClass: aws.String("StorageClass"), - }, - InputBucket: aws.String("BucketName"), - Name: aws.String("Name"), - Notifications: &elastictranscoder.Notifications{ - Completed: aws.String("SnsTopic"), - Error: aws.String("SnsTopic"), - Progressing: aws.String("SnsTopic"), - Warning: aws.String("SnsTopic"), - }, - Role: aws.String("Role"), - ThumbnailConfig: &elastictranscoder.PipelineOutputConfig{ - Bucket: aws.String("BucketName"), - Permissions: []*elastictranscoder.Permission{ - { // Required - Access: []*string{ - aws.String("AccessControl"), // Required - // More values... - }, - Grantee: aws.String("Grantee"), - GranteeType: aws.String("GranteeType"), - }, - // More values... - }, - StorageClass: aws.String("StorageClass"), - }, - } - resp, err := svc.UpdatePipeline(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_UpdatePipelineNotifications() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.UpdatePipelineNotificationsInput{ - Id: aws.String("Id"), // Required - Notifications: &elastictranscoder.Notifications{ // Required - Completed: aws.String("SnsTopic"), - Error: aws.String("SnsTopic"), - Progressing: aws.String("SnsTopic"), - Warning: aws.String("SnsTopic"), - }, - } - resp, err := svc.UpdatePipelineNotifications(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleElasticTranscoder_UpdatePipelineStatus() { - sess := session.Must(session.NewSession()) - - svc := elastictranscoder.New(sess) - - params := &elastictranscoder.UpdatePipelineStatusInput{ - Id: aws.String("Id"), // Required - Status: aws.String("PipelineStatus"), // Required - } - resp, err := svc.UpdatePipelineStatus(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go deleted file mode 100644 index 7060799..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package elastictranscoder - -import ( - "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/private/protocol/restjson" -) - -// The AWS Elastic Transcoder Service. -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -type ElasticTranscoder struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "elastictranscoder" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the ElasticTranscoder 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: -// // Create a ElasticTranscoder client from just a session. -// svc := elastictranscoder.New(mySession) -// -// // Create a ElasticTranscoder client with additional configuration -// svc := elastictranscoder.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ElasticTranscoder { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ElasticTranscoder { - svc := &ElasticTranscoder{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2012-09-25", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ElasticTranscoder operation and runs any -// custom request initialization. -func (c *ElasticTranscoder) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go deleted file mode 100644 index d4e2bf2..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/waiters.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package elastictranscoder - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilJobComplete uses the Amazon Elastic Transcoder API operation -// ReadJob to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *ElasticTranscoder) WaitUntilJobComplete(input *ReadJobInput) error { - return c.WaitUntilJobCompleteWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilJobCompleteWithContext is an extended version of WaitUntilJobComplete. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *ElasticTranscoder) WaitUntilJobCompleteWithContext(ctx aws.Context, input *ReadJobInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilJobComplete", - MaxAttempts: 120, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "Job.Status", - Expected: "Complete", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "Job.Status", - Expected: "Canceled", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "Job.Status", - Expected: "Error", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *ReadJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ReadJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go deleted file mode 100644 index e0b42ad..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go +++ /dev/null @@ -1,4689 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package kinesis provides a client for Amazon Kinesis. -package kinesis - -import ( - "fmt" - "time" - - "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/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opAddTagsToStream = "AddTagsToStream" - -// AddTagsToStreamRequest generates a "aws/request.Request" representing the -// client's request for the AddTagsToStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddTagsToStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddTagsToStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddTagsToStreamRequest method. -// req, resp := client.AddTagsToStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/AddTagsToStream -func (c *Kinesis) AddTagsToStreamRequest(input *AddTagsToStreamInput) (req *request.Request, output *AddTagsToStreamOutput) { - op := &request.Operation{ - Name: opAddTagsToStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsToStreamInput{} - } - - output = &AddTagsToStreamOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddTagsToStream API operation for Amazon Kinesis. -// -// Adds or updates tags for the specified Amazon Kinesis stream. Each stream -// can have up to 10 tags. -// -// If tags have already been assigned to the stream, AddTagsToStream overwrites -// any existing tags that correspond to the specified tag keys. -// -// 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 Amazon Kinesis's -// API operation AddTagsToStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/AddTagsToStream -func (c *Kinesis) AddTagsToStream(input *AddTagsToStreamInput) (*AddTagsToStreamOutput, error) { - req, out := c.AddTagsToStreamRequest(input) - return out, req.Send() -} - -// AddTagsToStreamWithContext is the same as AddTagsToStream with the addition of -// the ability to pass a context and additional request options. -// -// See AddTagsToStream 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 *Kinesis) AddTagsToStreamWithContext(ctx aws.Context, input *AddTagsToStreamInput, opts ...request.Option) (*AddTagsToStreamOutput, error) { - req, out := c.AddTagsToStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateStream = "CreateStream" - -// CreateStreamRequest generates a "aws/request.Request" representing the -// client's request for the CreateStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateStreamRequest method. -// req, resp := client.CreateStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/CreateStream -func (c *Kinesis) CreateStreamRequest(input *CreateStreamInput) (req *request.Request, output *CreateStreamOutput) { - op := &request.Operation{ - Name: opCreateStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateStreamInput{} - } - - output = &CreateStreamOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateStream API operation for Amazon Kinesis. -// -// Creates an Amazon Kinesis stream. A stream captures and transports data records -// that are continuously emitted from different data sources or producers. Scale-out -// within a stream is explicitly supported by means of shards, which are uniquely -// identified groups of data records in a stream. -// -// You specify and control the number of shards that a stream is composed of. -// Each shard can support reads up to 5 transactions per second, up to a maximum -// data read total of 2 MB per second. Each shard can support writes up to 1,000 -// records per second, up to a maximum data write total of 1 MB per second. -// You can add shards to a stream if the amount of data input increases and -// you can remove shards if the amount of data input decreases. -// -// The stream name identifies the stream. The name is scoped to the AWS account -// used by the application. It is also scoped by region. That is, two streams -// in two different accounts can have the same name, and two streams in the -// same account, but in two different regions, can have the same name. -// -// CreateStream is an asynchronous operation. Upon receiving a CreateStream -// request, Amazon Kinesis immediately returns and sets the stream status to -// CREATING. After the stream is created, Amazon Kinesis sets the stream status -// to ACTIVE. You should perform read and write operations only on an ACTIVE -// stream. -// -// You receive a LimitExceededException when making a CreateStream request if -// you try to do one of the following: -// -// * Have more than five streams in the CREATING state at any point in time. -// -// * Create more shards than are authorized for your account. -// -// For the default shard limit for an AWS account, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide. If you need to increase this -// limit, contact AWS Support (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html). -// -// You can use DescribeStream to check the stream status, which is returned -// in StreamStatus. -// -// CreateStream has a limit of 5 transactions per second per account. -// -// 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 Amazon Kinesis's -// API operation CreateStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/CreateStream -func (c *Kinesis) CreateStream(input *CreateStreamInput) (*CreateStreamOutput, error) { - req, out := c.CreateStreamRequest(input) - return out, req.Send() -} - -// CreateStreamWithContext is the same as CreateStream with the addition of -// the ability to pass a context and additional request options. -// -// See CreateStream 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 *Kinesis) CreateStreamWithContext(ctx aws.Context, input *CreateStreamInput, opts ...request.Option) (*CreateStreamOutput, error) { - req, out := c.CreateStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDecreaseStreamRetentionPeriod = "DecreaseStreamRetentionPeriod" - -// DecreaseStreamRetentionPeriodRequest generates a "aws/request.Request" representing the -// client's request for the DecreaseStreamRetentionPeriod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DecreaseStreamRetentionPeriod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DecreaseStreamRetentionPeriod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DecreaseStreamRetentionPeriodRequest method. -// req, resp := client.DecreaseStreamRetentionPeriodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DecreaseStreamRetentionPeriod -func (c *Kinesis) DecreaseStreamRetentionPeriodRequest(input *DecreaseStreamRetentionPeriodInput) (req *request.Request, output *DecreaseStreamRetentionPeriodOutput) { - op := &request.Operation{ - Name: opDecreaseStreamRetentionPeriod, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DecreaseStreamRetentionPeriodInput{} - } - - output = &DecreaseStreamRetentionPeriodOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DecreaseStreamRetentionPeriod API operation for Amazon Kinesis. -// -// Decreases the Amazon Kinesis stream's retention period, which is the length -// of time data records are accessible after they are added to the stream. The -// minimum value of a stream's retention period is 24 hours. -// -// This operation may result in lost data. For example, if the stream's retention -// period is 48 hours and is decreased to 24 hours, any data already in the -// stream that is older than 24 hours is inaccessible. -// -// 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 Amazon Kinesis's -// API operation DecreaseStreamRetentionPeriod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DecreaseStreamRetentionPeriod -func (c *Kinesis) DecreaseStreamRetentionPeriod(input *DecreaseStreamRetentionPeriodInput) (*DecreaseStreamRetentionPeriodOutput, error) { - req, out := c.DecreaseStreamRetentionPeriodRequest(input) - return out, req.Send() -} - -// DecreaseStreamRetentionPeriodWithContext is the same as DecreaseStreamRetentionPeriod with the addition of -// the ability to pass a context and additional request options. -// -// See DecreaseStreamRetentionPeriod 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 *Kinesis) DecreaseStreamRetentionPeriodWithContext(ctx aws.Context, input *DecreaseStreamRetentionPeriodInput, opts ...request.Option) (*DecreaseStreamRetentionPeriodOutput, error) { - req, out := c.DecreaseStreamRetentionPeriodRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteStream = "DeleteStream" - -// DeleteStreamRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteStreamRequest method. -// req, resp := client.DeleteStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DeleteStream -func (c *Kinesis) DeleteStreamRequest(input *DeleteStreamInput) (req *request.Request, output *DeleteStreamOutput) { - op := &request.Operation{ - Name: opDeleteStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteStreamInput{} - } - - output = &DeleteStreamOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteStream API operation for Amazon Kinesis. -// -// Deletes an Amazon Kinesis stream and all its shards and data. You must shut -// down any applications that are operating on the stream before you delete -// the stream. If an application attempts to operate on a deleted stream, it -// will receive the exception ResourceNotFoundException. -// -// If the stream is in the ACTIVE state, you can delete it. After a DeleteStream -// request, the specified stream is in the DELETING state until Amazon Kinesis -// completes the deletion. -// -// Note: Amazon Kinesis might continue to accept data read and write operations, -// such as PutRecord, PutRecords, and GetRecords, on a stream in the DELETING -// state until the stream deletion is complete. -// -// When you delete a stream, any shards in that stream are also deleted, and -// any tags are dissociated from the stream. -// -// You can use the DescribeStream operation to check the state of the stream, -// which is returned in StreamStatus. -// -// DeleteStream has a limit of 5 transactions per second per account. -// -// 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 Amazon Kinesis's -// API operation DeleteStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DeleteStream -func (c *Kinesis) DeleteStream(input *DeleteStreamInput) (*DeleteStreamOutput, error) { - req, out := c.DeleteStreamRequest(input) - return out, req.Send() -} - -// DeleteStreamWithContext is the same as DeleteStream with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteStream 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 *Kinesis) DeleteStreamWithContext(ctx aws.Context, input *DeleteStreamInput, opts ...request.Option) (*DeleteStreamOutput, error) { - req, out := c.DeleteStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeLimits = "DescribeLimits" - -// DescribeLimitsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLimits operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeLimits for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeLimits method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeLimitsRequest method. -// req, resp := client.DescribeLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeLimits -func (c *Kinesis) DescribeLimitsRequest(input *DescribeLimitsInput) (req *request.Request, output *DescribeLimitsOutput) { - op := &request.Operation{ - Name: opDescribeLimits, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLimitsInput{} - } - - output = &DescribeLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeLimits API operation for Amazon Kinesis. -// -// Describes the shard limits and usage for the account. -// -// If you update your account limits, the old limits might be returned for a -// few minutes. -// -// This operation has a limit of 1 transaction per second per account. -// -// 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 Amazon Kinesis's -// API operation DescribeLimits for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeLimits -func (c *Kinesis) DescribeLimits(input *DescribeLimitsInput) (*DescribeLimitsOutput, error) { - req, out := c.DescribeLimitsRequest(input) - return out, req.Send() -} - -// DescribeLimitsWithContext is the same as DescribeLimits with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLimits 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 *Kinesis) DescribeLimitsWithContext(ctx aws.Context, input *DescribeLimitsInput, opts ...request.Option) (*DescribeLimitsOutput, error) { - req, out := c.DescribeLimitsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeStream = "DescribeStream" - -// DescribeStreamRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DescribeStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DescribeStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DescribeStreamRequest method. -// req, resp := client.DescribeStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeStream -func (c *Kinesis) DescribeStreamRequest(input *DescribeStreamInput) (req *request.Request, output *DescribeStreamOutput) { - op := &request.Operation{ - Name: opDescribeStream, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartShardId"}, - OutputTokens: []string{"StreamDescription.Shards[-1].ShardId"}, - LimitToken: "Limit", - TruncationToken: "StreamDescription.HasMoreShards", - }, - } - - if input == nil { - input = &DescribeStreamInput{} - } - - output = &DescribeStreamOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeStream API operation for Amazon Kinesis. -// -// Describes the specified Amazon Kinesis stream. -// -// The information returned includes the stream name, Amazon Resource Name (ARN), -// creation time, enhanced metric configuration, and shard map. The shard map -// is an array of shard objects. For each shard object, there is the hash key -// and sequence number ranges that the shard spans, and the IDs of any earlier -// shards that played in a role in creating the shard. Every record ingested -// in the stream is identified by a sequence number, which is assigned when -// the record is put into the stream. -// -// You can limit the number of shards returned by each call. For more information, -// see Retrieving Shards from a Stream (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-retrieve-shards.html) -// in the Amazon Kinesis Streams Developer Guide. -// -// There are no guarantees about the chronological order shards returned. To -// process shards in chronological order, use the ID of the parent shard to -// track the lineage to the oldest shard. -// -// This operation has a limit of 10 transactions per second per account. -// -// 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 Amazon Kinesis's -// API operation DescribeStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeStream -func (c *Kinesis) DescribeStream(input *DescribeStreamInput) (*DescribeStreamOutput, error) { - req, out := c.DescribeStreamRequest(input) - return out, req.Send() -} - -// DescribeStreamWithContext is the same as DescribeStream with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeStream 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 *Kinesis) DescribeStreamWithContext(ctx aws.Context, input *DescribeStreamInput, opts ...request.Option) (*DescribeStreamOutput, error) { - req, out := c.DescribeStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// DescribeStreamPages iterates over the pages of a DescribeStream operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeStream method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a DescribeStream operation. -// pageNum := 0 -// err := client.DescribeStreamPages(params, -// func(page *DescribeStreamOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Kinesis) DescribeStreamPages(input *DescribeStreamInput, fn func(*DescribeStreamOutput, bool) bool) error { - return c.DescribeStreamPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeStreamPagesWithContext same as DescribeStreamPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Kinesis) DescribeStreamPagesWithContext(ctx aws.Context, input *DescribeStreamInput, fn func(*DescribeStreamOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeStreamInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeStreamRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStreamOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDisableEnhancedMonitoring = "DisableEnhancedMonitoring" - -// DisableEnhancedMonitoringRequest generates a "aws/request.Request" representing the -// client's request for the DisableEnhancedMonitoring operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisableEnhancedMonitoring for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisableEnhancedMonitoring method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisableEnhancedMonitoringRequest method. -// req, resp := client.DisableEnhancedMonitoringRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DisableEnhancedMonitoring -func (c *Kinesis) DisableEnhancedMonitoringRequest(input *DisableEnhancedMonitoringInput) (req *request.Request, output *EnhancedMonitoringOutput) { - op := &request.Operation{ - Name: opDisableEnhancedMonitoring, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableEnhancedMonitoringInput{} - } - - output = &EnhancedMonitoringOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableEnhancedMonitoring API operation for Amazon Kinesis. -// -// Disables enhanced monitoring. -// -// 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 Amazon Kinesis's -// API operation DisableEnhancedMonitoring for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DisableEnhancedMonitoring -func (c *Kinesis) DisableEnhancedMonitoring(input *DisableEnhancedMonitoringInput) (*EnhancedMonitoringOutput, error) { - req, out := c.DisableEnhancedMonitoringRequest(input) - return out, req.Send() -} - -// DisableEnhancedMonitoringWithContext is the same as DisableEnhancedMonitoring with the addition of -// the ability to pass a context and additional request options. -// -// See DisableEnhancedMonitoring 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 *Kinesis) DisableEnhancedMonitoringWithContext(ctx aws.Context, input *DisableEnhancedMonitoringInput, opts ...request.Option) (*EnhancedMonitoringOutput, error) { - req, out := c.DisableEnhancedMonitoringRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableEnhancedMonitoring = "EnableEnhancedMonitoring" - -// EnableEnhancedMonitoringRequest generates a "aws/request.Request" representing the -// client's request for the EnableEnhancedMonitoring operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See EnableEnhancedMonitoring for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the EnableEnhancedMonitoring method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the EnableEnhancedMonitoringRequest method. -// req, resp := client.EnableEnhancedMonitoringRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/EnableEnhancedMonitoring -func (c *Kinesis) EnableEnhancedMonitoringRequest(input *EnableEnhancedMonitoringInput) (req *request.Request, output *EnhancedMonitoringOutput) { - op := &request.Operation{ - Name: opEnableEnhancedMonitoring, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableEnhancedMonitoringInput{} - } - - output = &EnhancedMonitoringOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableEnhancedMonitoring API operation for Amazon Kinesis. -// -// Enables enhanced Amazon Kinesis stream monitoring for shard-level metrics. -// -// 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 Amazon Kinesis's -// API operation EnableEnhancedMonitoring for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/EnableEnhancedMonitoring -func (c *Kinesis) EnableEnhancedMonitoring(input *EnableEnhancedMonitoringInput) (*EnhancedMonitoringOutput, error) { - req, out := c.EnableEnhancedMonitoringRequest(input) - return out, req.Send() -} - -// EnableEnhancedMonitoringWithContext is the same as EnableEnhancedMonitoring with the addition of -// the ability to pass a context and additional request options. -// -// See EnableEnhancedMonitoring 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 *Kinesis) EnableEnhancedMonitoringWithContext(ctx aws.Context, input *EnableEnhancedMonitoringInput, opts ...request.Option) (*EnhancedMonitoringOutput, error) { - req, out := c.EnableEnhancedMonitoringRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRecords = "GetRecords" - -// GetRecordsRequest generates a "aws/request.Request" representing the -// client's request for the GetRecords operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetRecords for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetRecords method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetRecordsRequest method. -// req, resp := client.GetRecordsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetRecords -func (c *Kinesis) GetRecordsRequest(input *GetRecordsInput) (req *request.Request, output *GetRecordsOutput) { - op := &request.Operation{ - Name: opGetRecords, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRecordsInput{} - } - - output = &GetRecordsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRecords API operation for Amazon Kinesis. -// -// Gets data records from an Amazon Kinesis stream's shard. -// -// Specify a shard iterator using the ShardIterator parameter. The shard iterator -// specifies the position in the shard from which you want to start reading -// data records sequentially. If there are no records available in the portion -// of the shard that the iterator points to, GetRecords returns an empty list. -// Note that it might take multiple calls to get to a portion of the shard that -// contains records. -// -// You can scale by provisioning multiple shards per stream while considering -// service limits (for more information, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide). Your application should have -// one thread per shard, each reading continuously from its stream. To read -// from a stream continually, call GetRecords in a loop. Use GetShardIterator -// to get the shard iterator to specify in the first GetRecords call. GetRecords -// returns a new shard iterator in NextShardIterator. Specify the shard iterator -// returned in NextShardIterator in subsequent calls to GetRecords. Note that -// if the shard has been closed, the shard iterator can't return more data and -// GetRecords returns null in NextShardIterator. You can terminate the loop -// when the shard is closed, or when the shard iterator reaches the record with -// the sequence number or other attribute that marks it as the last record to -// process. -// -// Each data record can be up to 1 MB in size, and each shard can read up to -// 2 MB per second. You can ensure that your calls don't exceed the maximum -// supported size or throughput by using the Limit parameter to specify the -// maximum number of records that GetRecords can return. Consider your average -// record size when determining this limit. -// -// The size of the data returned by GetRecords varies depending on the utilization -// of the shard. The maximum size of data that GetRecords can return is 10 MB. -// If a call returns this amount of data, subsequent calls made within the next -// 5 seconds throw ProvisionedThroughputExceededException. If there is insufficient -// provisioned throughput on the shard, subsequent calls made within the next -// 1 second throw ProvisionedThroughputExceededException. Note that GetRecords -// won't return any data when it throws an exception. For this reason, we recommend -// that you wait one second between calls to GetRecords; however, it's possible -// that the application will get exceptions for longer than 1 second. -// -// To detect whether the application is falling behind in processing, you can -// use the MillisBehindLatest response attribute. You can also monitor the stream -// using CloudWatch metrics and other mechanisms (see Monitoring (http://docs.aws.amazon.com/kinesis/latest/dev/monitoring.html) -// in the Amazon Kinesis Streams Developer Guide). -// -// Each Amazon Kinesis record includes a value, ApproximateArrivalTimestamp, -// that is set when a stream successfully receives and stores a record. This -// is commonly referred to as a server-side timestamp, whereas a client-side -// timestamp is set when a data producer creates or sends the record to a stream -// (a data producer is any data source putting data records into a stream, for -// example with PutRecords). The timestamp has millisecond precision. There -// are no guarantees about the timestamp accuracy, or that the timestamp is -// always increasing. For example, records in a shard or across a stream might -// have timestamps that are out of order. -// -// 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 Amazon Kinesis's -// API operation GetRecords for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// The request rate for the stream is too high, or the requested data is too -// large for the available throughput. Reduce the frequency or size of your -// requests. For more information, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide, and Error Retries and Exponential -// Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) -// in the AWS General Reference. -// -// * ErrCodeExpiredIteratorException "ExpiredIteratorException" -// The provided iterator exceeds the maximum age allowed. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetRecords -func (c *Kinesis) GetRecords(input *GetRecordsInput) (*GetRecordsOutput, error) { - req, out := c.GetRecordsRequest(input) - return out, req.Send() -} - -// GetRecordsWithContext is the same as GetRecords with the addition of -// the ability to pass a context and additional request options. -// -// See GetRecords 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 *Kinesis) GetRecordsWithContext(ctx aws.Context, input *GetRecordsInput, opts ...request.Option) (*GetRecordsOutput, error) { - req, out := c.GetRecordsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetShardIterator = "GetShardIterator" - -// GetShardIteratorRequest generates a "aws/request.Request" representing the -// client's request for the GetShardIterator operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetShardIterator for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetShardIterator method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetShardIteratorRequest method. -// req, resp := client.GetShardIteratorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetShardIterator -func (c *Kinesis) GetShardIteratorRequest(input *GetShardIteratorInput) (req *request.Request, output *GetShardIteratorOutput) { - op := &request.Operation{ - Name: opGetShardIterator, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetShardIteratorInput{} - } - - output = &GetShardIteratorOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetShardIterator API operation for Amazon Kinesis. -// -// Gets an Amazon Kinesis shard iterator. A shard iterator expires five minutes -// after it is returned to the requester. -// -// A shard iterator specifies the shard position from which to start reading -// data records sequentially. The position is specified using the sequence number -// of a data record in a shard. A sequence number is the identifier associated -// with every record ingested in the stream, and is assigned when a record is -// put into the stream. Each stream has one or more shards. -// -// You must specify the shard iterator type. For example, you can set the ShardIteratorType -// parameter to read exactly from the position denoted by a specific sequence -// number by using the AT_SEQUENCE_NUMBER shard iterator type, or right after -// the sequence number by using the AFTER_SEQUENCE_NUMBER shard iterator type, -// using sequence numbers returned by earlier calls to PutRecord, PutRecords, -// GetRecords, or DescribeStream. In the request, you can specify the shard -// iterator type AT_TIMESTAMP to read records from an arbitrary point in time, -// TRIM_HORIZON to cause ShardIterator to point to the last untrimmed record -// in the shard in the system (the oldest data record in the shard), or LATEST -// so that you always read the most recent data in the shard. -// -// When you read repeatedly from a stream, use a GetShardIterator request to -// get the first shard iterator for use in your first GetRecords request and -// for subsequent reads use the shard iterator returned by the GetRecords request -// in NextShardIterator. A new shard iterator is returned by every GetRecords -// request in NextShardIterator, which you use in the ShardIterator parameter -// of the next GetRecords request. -// -// If a GetShardIterator request is made too often, you receive a ProvisionedThroughputExceededException. -// For more information about throughput limits, see GetRecords, and Streams -// Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide. -// -// If the shard is closed, GetShardIterator returns a valid iterator for the -// last sequence number of the shard. Note that a shard can be closed as a result -// of using SplitShard or MergeShards. -// -// GetShardIterator has a limit of 5 transactions per second per account per -// open shard. -// -// 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 Amazon Kinesis's -// API operation GetShardIterator for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// The request rate for the stream is too high, or the requested data is too -// large for the available throughput. Reduce the frequency or size of your -// requests. For more information, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide, and Error Retries and Exponential -// Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) -// in the AWS General Reference. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetShardIterator -func (c *Kinesis) GetShardIterator(input *GetShardIteratorInput) (*GetShardIteratorOutput, error) { - req, out := c.GetShardIteratorRequest(input) - return out, req.Send() -} - -// GetShardIteratorWithContext is the same as GetShardIterator with the addition of -// the ability to pass a context and additional request options. -// -// See GetShardIterator 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 *Kinesis) GetShardIteratorWithContext(ctx aws.Context, input *GetShardIteratorInput, opts ...request.Option) (*GetShardIteratorOutput, error) { - req, out := c.GetShardIteratorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opIncreaseStreamRetentionPeriod = "IncreaseStreamRetentionPeriod" - -// IncreaseStreamRetentionPeriodRequest generates a "aws/request.Request" representing the -// client's request for the IncreaseStreamRetentionPeriod operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See IncreaseStreamRetentionPeriod for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the IncreaseStreamRetentionPeriod method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the IncreaseStreamRetentionPeriodRequest method. -// req, resp := client.IncreaseStreamRetentionPeriodRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/IncreaseStreamRetentionPeriod -func (c *Kinesis) IncreaseStreamRetentionPeriodRequest(input *IncreaseStreamRetentionPeriodInput) (req *request.Request, output *IncreaseStreamRetentionPeriodOutput) { - op := &request.Operation{ - Name: opIncreaseStreamRetentionPeriod, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &IncreaseStreamRetentionPeriodInput{} - } - - output = &IncreaseStreamRetentionPeriodOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// IncreaseStreamRetentionPeriod API operation for Amazon Kinesis. -// -// Increases the Amazon Kinesis stream's retention period, which is the length -// of time data records are accessible after they are added to the stream. The -// maximum value of a stream's retention period is 168 hours (7 days). -// -// Upon choosing a longer stream retention period, this operation will increase -// the time period records are accessible that have not yet expired. However, -// it will not make previous data that has expired (older than the stream's -// previous retention period) accessible after the operation has been called. -// For example, if a stream's retention period is set to 24 hours and is increased -// to 168 hours, any data that is older than 24 hours will remain inaccessible -// to consumer applications. -// -// 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 Amazon Kinesis's -// API operation IncreaseStreamRetentionPeriod for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/IncreaseStreamRetentionPeriod -func (c *Kinesis) IncreaseStreamRetentionPeriod(input *IncreaseStreamRetentionPeriodInput) (*IncreaseStreamRetentionPeriodOutput, error) { - req, out := c.IncreaseStreamRetentionPeriodRequest(input) - return out, req.Send() -} - -// IncreaseStreamRetentionPeriodWithContext is the same as IncreaseStreamRetentionPeriod with the addition of -// the ability to pass a context and additional request options. -// -// See IncreaseStreamRetentionPeriod 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 *Kinesis) IncreaseStreamRetentionPeriodWithContext(ctx aws.Context, input *IncreaseStreamRetentionPeriodInput, opts ...request.Option) (*IncreaseStreamRetentionPeriodOutput, error) { - req, out := c.IncreaseStreamRetentionPeriodRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListStreams = "ListStreams" - -// ListStreamsRequest generates a "aws/request.Request" representing the -// client's request for the ListStreams operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListStreams for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListStreams method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListStreamsRequest method. -// req, resp := client.ListStreamsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListStreams -func (c *Kinesis) ListStreamsRequest(input *ListStreamsInput) (req *request.Request, output *ListStreamsOutput) { - op := &request.Operation{ - Name: opListStreams, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"ExclusiveStartStreamName"}, - OutputTokens: []string{"StreamNames[-1]"}, - LimitToken: "Limit", - TruncationToken: "HasMoreStreams", - }, - } - - if input == nil { - input = &ListStreamsInput{} - } - - output = &ListStreamsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStreams API operation for Amazon Kinesis. -// -// Lists your Amazon Kinesis streams. -// -// The number of streams may be too large to return from a single call to ListStreams. -// You can limit the number of returned streams using the Limit parameter. If -// you do not specify a value for the Limit parameter, Amazon Kinesis uses the -// default limit, which is currently 10. -// -// You can detect if there are more streams available to list by using the HasMoreStreams -// flag from the returned output. If there are more streams available, you can -// request more streams by using the name of the last stream returned by the -// ListStreams request in the ExclusiveStartStreamName parameter in a subsequent -// request to ListStreams. The group of stream names returned by the subsequent -// request is then added to the list. You can continue this process until all -// the stream names have been collected in the list. -// -// ListStreams has a limit of 5 transactions per second per account. -// -// 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 Amazon Kinesis's -// API operation ListStreams for usage and error information. -// -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListStreams -func (c *Kinesis) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, error) { - req, out := c.ListStreamsRequest(input) - return out, req.Send() -} - -// ListStreamsWithContext is the same as ListStreams with the addition of -// the ability to pass a context and additional request options. -// -// See ListStreams 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 *Kinesis) ListStreamsWithContext(ctx aws.Context, input *ListStreamsInput, opts ...request.Option) (*ListStreamsOutput, error) { - req, out := c.ListStreamsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListStreamsPages iterates over the pages of a ListStreams operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStreams method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListStreams operation. -// pageNum := 0 -// err := client.ListStreamsPages(params, -// func(page *ListStreamsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Kinesis) ListStreamsPages(input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool) error { - return c.ListStreamsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStreamsPagesWithContext same as ListStreamsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Kinesis) ListStreamsPagesWithContext(ctx aws.Context, input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListStreamsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListStreamsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTagsForStream = "ListTagsForStream" - -// ListTagsForStreamRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsForStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsForStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsForStreamRequest method. -// req, resp := client.ListTagsForStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListTagsForStream -func (c *Kinesis) ListTagsForStreamRequest(input *ListTagsForStreamInput) (req *request.Request, output *ListTagsForStreamOutput) { - op := &request.Operation{ - Name: opListTagsForStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForStreamInput{} - } - - output = &ListTagsForStreamOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForStream API operation for Amazon Kinesis. -// -// Lists the tags for the specified Amazon Kinesis stream. -// -// 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 Amazon Kinesis's -// API operation ListTagsForStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListTagsForStream -func (c *Kinesis) ListTagsForStream(input *ListTagsForStreamInput) (*ListTagsForStreamOutput, error) { - req, out := c.ListTagsForStreamRequest(input) - return out, req.Send() -} - -// ListTagsForStreamWithContext is the same as ListTagsForStream with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForStream 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 *Kinesis) ListTagsForStreamWithContext(ctx aws.Context, input *ListTagsForStreamInput, opts ...request.Option) (*ListTagsForStreamOutput, error) { - req, out := c.ListTagsForStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opMergeShards = "MergeShards" - -// MergeShardsRequest generates a "aws/request.Request" representing the -// client's request for the MergeShards operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See MergeShards for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the MergeShards method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the MergeShardsRequest method. -// req, resp := client.MergeShardsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/MergeShards -func (c *Kinesis) MergeShardsRequest(input *MergeShardsInput) (req *request.Request, output *MergeShardsOutput) { - op := &request.Operation{ - Name: opMergeShards, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &MergeShardsInput{} - } - - output = &MergeShardsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// MergeShards API operation for Amazon Kinesis. -// -// Merges two adjacent shards in an Amazon Kinesis stream and combines them -// into a single shard to reduce the stream's capacity to ingest and transport -// data. Two shards are considered adjacent if the union of the hash key ranges -// for the two shards form a contiguous set with no gaps. For example, if you -// have two shards, one with a hash key range of 276...381 and the other with -// a hash key range of 382...454, then you could merge these two shards into -// a single shard that would have a hash key range of 276...454. After the merge, -// the single child shard receives data for all hash key values covered by the -// two parent shards. -// -// MergeShards is called when there is a need to reduce the overall capacity -// of a stream because of excess capacity that is not being used. You must specify -// the shard to be merged and the adjacent shard for a stream. For more information -// about merging shards, see Merge Two Shards (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-merge.html) -// in the Amazon Kinesis Streams Developer Guide. -// -// If the stream is in the ACTIVE state, you can call MergeShards. If a stream -// is in the CREATING, UPDATING, or DELETING state, MergeShards returns a ResourceInUseException. -// If the specified stream does not exist, MergeShards returns a ResourceNotFoundException. -// -// You can use DescribeStream to check the state of the stream, which is returned -// in StreamStatus. -// -// MergeShards is an asynchronous operation. Upon receiving a MergeShards request, -// Amazon Kinesis immediately returns a response and sets the StreamStatus to -// UPDATING. After the operation is completed, Amazon Kinesis sets the StreamStatus -// to ACTIVE. Read and write operations continue to work while the stream is -// in the UPDATING state. -// -// You use DescribeStream to determine the shard IDs that are specified in the -// MergeShards request. -// -// If you try to operate on too many streams in parallel using CreateStream, -// DeleteStream, MergeShards or SplitShard, you will receive a LimitExceededException. -// -// MergeShards has limit of 5 transactions per second per account. -// -// 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 Amazon Kinesis's -// API operation MergeShards for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/MergeShards -func (c *Kinesis) MergeShards(input *MergeShardsInput) (*MergeShardsOutput, error) { - req, out := c.MergeShardsRequest(input) - return out, req.Send() -} - -// MergeShardsWithContext is the same as MergeShards with the addition of -// the ability to pass a context and additional request options. -// -// See MergeShards 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 *Kinesis) MergeShardsWithContext(ctx aws.Context, input *MergeShardsInput, opts ...request.Option) (*MergeShardsOutput, error) { - req, out := c.MergeShardsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutRecord = "PutRecord" - -// PutRecordRequest generates a "aws/request.Request" representing the -// client's request for the PutRecord operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRecord for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRecord method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRecordRequest method. -// req, resp := client.PutRecordRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecord -func (c *Kinesis) PutRecordRequest(input *PutRecordInput) (req *request.Request, output *PutRecordOutput) { - op := &request.Operation{ - Name: opPutRecord, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutRecordInput{} - } - - output = &PutRecordOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutRecord API operation for Amazon Kinesis. -// -// Writes a single data record into an Amazon Kinesis stream. Call PutRecord -// to send data into the stream for real-time ingestion and subsequent processing, -// one record at a time. Each shard can support writes up to 1,000 records per -// second, up to a maximum data write total of 1 MB per second. -// -// You must specify the name of the stream that captures, stores, and transports -// the data; a partition key; and the data blob itself. -// -// The data blob can be any type of data; for example, a segment from a log -// file, geographic/location data, website clickstream data, and so on. -// -// The partition key is used by Amazon Kinesis to distribute data across shards. -// Amazon Kinesis segregates the data records that belong to a stream into multiple -// shards, using the partition key associated with each data record to determine -// which shard a given data record belongs to. -// -// Partition keys are Unicode strings, with a maximum length limit of 256 characters -// for each key. An MD5 hash function is used to map partition keys to 128-bit -// integer values and to map associated data records to shards using the hash -// key ranges of the shards. You can override hashing the partition key to determine -// the shard by explicitly specifying a hash value using the ExplicitHashKey -// parameter. For more information, see Adding Data to a Stream (http://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream) -// in the Amazon Kinesis Streams Developer Guide. -// -// PutRecord returns the shard ID of where the data record was placed and the -// sequence number that was assigned to the data record. -// -// Sequence numbers increase over time and are specific to a shard within a -// stream, not across all shards within a stream. To guarantee strictly increasing -// ordering, write serially to a shard and use the SequenceNumberForOrdering -// parameter. For more information, see Adding Data to a Stream (http://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream) -// in the Amazon Kinesis Streams Developer Guide. -// -// If a PutRecord request cannot be processed because of insufficient provisioned -// throughput on the shard involved in the request, PutRecord throws ProvisionedThroughputExceededException. -// -// Data records are accessible for only 24 hours from the time that they are -// added to a stream. -// -// 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 Amazon Kinesis's -// API operation PutRecord for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// The request rate for the stream is too high, or the requested data is too -// large for the available throughput. Reduce the frequency or size of your -// requests. For more information, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide, and Error Retries and Exponential -// Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) -// in the AWS General Reference. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecord -func (c *Kinesis) PutRecord(input *PutRecordInput) (*PutRecordOutput, error) { - req, out := c.PutRecordRequest(input) - return out, req.Send() -} - -// PutRecordWithContext is the same as PutRecord with the addition of -// the ability to pass a context and additional request options. -// -// See PutRecord 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 *Kinesis) PutRecordWithContext(ctx aws.Context, input *PutRecordInput, opts ...request.Option) (*PutRecordOutput, error) { - req, out := c.PutRecordRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutRecords = "PutRecords" - -// PutRecordsRequest generates a "aws/request.Request" representing the -// client's request for the PutRecords operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutRecords for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutRecords method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutRecordsRequest method. -// req, resp := client.PutRecordsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecords -func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) (req *request.Request, output *PutRecordsOutput) { - op := &request.Operation{ - Name: opPutRecords, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutRecordsInput{} - } - - output = &PutRecordsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutRecords API operation for Amazon Kinesis. -// -// Writes multiple data records into an Amazon Kinesis stream in a single call -// (also referred to as a PutRecords request). Use this operation to send data -// into the stream for data ingestion and processing. -// -// Each PutRecords request can support up to 500 records. Each record in the -// request can be as large as 1 MB, up to a limit of 5 MB for the entire request, -// including partition keys. Each shard can support writes up to 1,000 records -// per second, up to a maximum data write total of 1 MB per second. -// -// You must specify the name of the stream that captures, stores, and transports -// the data; and an array of request Records, with each record in the array -// requiring a partition key and data blob. The record size limit applies to -// the total size of the partition key and data blob. -// -// The data blob can be any type of data; for example, a segment from a log -// file, geographic/location data, website clickstream data, and so on. -// -// The partition key is used by Amazon Kinesis as input to a hash function that -// maps the partition key and associated data to a specific shard. An MD5 hash -// function is used to map partition keys to 128-bit integer values and to map -// associated data records to shards. As a result of this hashing mechanism, -// all data records with the same partition key map to the same shard within -// the stream. For more information, see Adding Data to a Stream (http://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream) -// in the Amazon Kinesis Streams Developer Guide. -// -// Each record in the Records array may include an optional parameter, ExplicitHashKey, -// which overrides the partition key to shard mapping. This parameter allows -// a data producer to determine explicitly the shard where the record is stored. -// For more information, see Adding Multiple Records with PutRecords (http://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-putrecords) -// in the Amazon Kinesis Streams Developer Guide. -// -// The PutRecords response includes an array of response Records. Each record -// in the response array directly correlates with a record in the request array -// using natural ordering, from the top to the bottom of the request and response. -// The response Records array always includes the same number of records as -// the request array. -// -// The response Records array includes both successfully and unsuccessfully -// processed records. Amazon Kinesis attempts to process all records in each -// PutRecords request. A single record failure does not stop the processing -// of subsequent records. -// -// A successfully-processed record includes ShardId and SequenceNumber values. -// The ShardId parameter identifies the shard in the stream where the record -// is stored. The SequenceNumber parameter is an identifier assigned to the -// put record, unique to all records in the stream. -// -// An unsuccessfully-processed record includes ErrorCode and ErrorMessage values. -// ErrorCode reflects the type of error and can be one of the following values: -// ProvisionedThroughputExceededException or InternalFailure. ErrorMessage provides -// more detailed information about the ProvisionedThroughputExceededException -// exception including the account ID, stream name, and shard ID of the record -// that was throttled. For more information about partially successful responses, -// see Adding Multiple Records with PutRecords (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html#kinesis-using-sdk-java-putrecords) -// in the Amazon Kinesis Streams Developer Guide. -// -// By default, data records are accessible for only 24 hours from the time that -// they are added to an Amazon Kinesis stream. This retention period can be -// modified using the DecreaseStreamRetentionPeriod and IncreaseStreamRetentionPeriod -// operations. -// -// 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 Amazon Kinesis's -// API operation PutRecords for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" -// The request rate for the stream is too high, or the requested data is too -// large for the available throughput. Reduce the frequency or size of your -// requests. For more information, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide, and Error Retries and Exponential -// Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) -// in the AWS General Reference. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecords -func (c *Kinesis) PutRecords(input *PutRecordsInput) (*PutRecordsOutput, error) { - req, out := c.PutRecordsRequest(input) - return out, req.Send() -} - -// PutRecordsWithContext is the same as PutRecords with the addition of -// the ability to pass a context and additional request options. -// -// See PutRecords 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 *Kinesis) PutRecordsWithContext(ctx aws.Context, input *PutRecordsInput, opts ...request.Option) (*PutRecordsOutput, error) { - req, out := c.PutRecordsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRemoveTagsFromStream = "RemoveTagsFromStream" - -// RemoveTagsFromStreamRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTagsFromStream operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemoveTagsFromStream for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemoveTagsFromStream method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemoveTagsFromStreamRequest method. -// req, resp := client.RemoveTagsFromStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/RemoveTagsFromStream -func (c *Kinesis) RemoveTagsFromStreamRequest(input *RemoveTagsFromStreamInput) (req *request.Request, output *RemoveTagsFromStreamOutput) { - op := &request.Operation{ - Name: opRemoveTagsFromStream, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsFromStreamInput{} - } - - output = &RemoveTagsFromStreamOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveTagsFromStream API operation for Amazon Kinesis. -// -// Removes tags from the specified Amazon Kinesis stream. Removed tags are deleted -// and cannot be recovered after this operation successfully completes. -// -// If you specify a tag that does not exist, it is ignored. -// -// 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 Amazon Kinesis's -// API operation RemoveTagsFromStream for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/RemoveTagsFromStream -func (c *Kinesis) RemoveTagsFromStream(input *RemoveTagsFromStreamInput) (*RemoveTagsFromStreamOutput, error) { - req, out := c.RemoveTagsFromStreamRequest(input) - return out, req.Send() -} - -// RemoveTagsFromStreamWithContext is the same as RemoveTagsFromStream with the addition of -// the ability to pass a context and additional request options. -// -// See RemoveTagsFromStream 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 *Kinesis) RemoveTagsFromStreamWithContext(ctx aws.Context, input *RemoveTagsFromStreamInput, opts ...request.Option) (*RemoveTagsFromStreamOutput, error) { - req, out := c.RemoveTagsFromStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSplitShard = "SplitShard" - -// SplitShardRequest generates a "aws/request.Request" representing the -// client's request for the SplitShard operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SplitShard for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SplitShard method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SplitShardRequest method. -// req, resp := client.SplitShardRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/SplitShard -func (c *Kinesis) SplitShardRequest(input *SplitShardInput) (req *request.Request, output *SplitShardOutput) { - op := &request.Operation{ - Name: opSplitShard, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SplitShardInput{} - } - - output = &SplitShardOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SplitShard API operation for Amazon Kinesis. -// -// Splits a shard into two new shards in the Amazon Kinesis stream to increase -// the stream's capacity to ingest and transport data. SplitShard is called -// when there is a need to increase the overall capacity of a stream because -// of an expected increase in the volume of data records being ingested. -// -// You can also use SplitShard when a shard appears to be approaching its maximum -// utilization; for example, the producers sending data into the specific shard -// are suddenly sending more than previously anticipated. You can also call -// SplitShard to increase stream capacity, so that more Amazon Kinesis applications -// can simultaneously read data from the stream for real-time processing. -// -// You must specify the shard to be split and the new hash key, which is the -// position in the shard where the shard gets split in two. In many cases, the -// new hash key might simply be the average of the beginning and ending hash -// key, but it can be any hash key value in the range being mapped into the -// shard. For more information about splitting shards, see Split a Shard (http://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-split.html) -// in the Amazon Kinesis Streams Developer Guide. -// -// You can use DescribeStream to determine the shard ID and hash key values -// for the ShardToSplit and NewStartingHashKey parameters that are specified -// in the SplitShard request. -// -// SplitShard is an asynchronous operation. Upon receiving a SplitShard request, -// Amazon Kinesis immediately returns a response and sets the stream status -// to UPDATING. After the operation is completed, Amazon Kinesis sets the stream -// status to ACTIVE. Read and write operations continue to work while the stream -// is in the UPDATING state. -// -// You can use DescribeStream to check the status of the stream, which is returned -// in StreamStatus. If the stream is in the ACTIVE state, you can call SplitShard. -// If a stream is in CREATING or UPDATING or DELETING states, DescribeStream -// returns a ResourceInUseException. -// -// If the specified stream does not exist, DescribeStream returns a ResourceNotFoundException. -// If you try to create more shards than are authorized for your account, you -// receive a LimitExceededException. -// -// For the default shard limit for an AWS account, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide. If you need to increase this -// limit, contact AWS Support (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html). -// -// If you try to operate on too many streams simultaneously using CreateStream, -// DeleteStream, MergeShards, and/or SplitShard, you receive a LimitExceededException. -// -// SplitShard has limit of 5 transactions per second per account. -// -// 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 Amazon Kinesis's -// API operation SplitShard for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/SplitShard -func (c *Kinesis) SplitShard(input *SplitShardInput) (*SplitShardOutput, error) { - req, out := c.SplitShardRequest(input) - return out, req.Send() -} - -// SplitShardWithContext is the same as SplitShard with the addition of -// the ability to pass a context and additional request options. -// -// See SplitShard 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 *Kinesis) SplitShardWithContext(ctx aws.Context, input *SplitShardInput, opts ...request.Option) (*SplitShardOutput, error) { - req, out := c.SplitShardRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateShardCount = "UpdateShardCount" - -// UpdateShardCountRequest generates a "aws/request.Request" representing the -// client's request for the UpdateShardCount operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateShardCount for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateShardCount method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateShardCountRequest method. -// req, resp := client.UpdateShardCountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/UpdateShardCount -func (c *Kinesis) UpdateShardCountRequest(input *UpdateShardCountInput) (req *request.Request, output *UpdateShardCountOutput) { - op := &request.Operation{ - Name: opUpdateShardCount, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateShardCountInput{} - } - - output = &UpdateShardCountOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateShardCount API operation for Amazon Kinesis. -// -// Updates the shard count of the specified stream to the specified number of -// shards. -// -// Updating the shard count is an asynchronous operation. Upon receiving the -// request, Amazon Kinesis returns immediately and sets the status of the stream -// to UPDATING. After the update is complete, Amazon Kinesis sets the status -// of the stream back to ACTIVE. Depending on the size of the stream, the scaling -// action could take a few minutes to complete. You can continue to read and -// write data to your stream while its status is UPDATING. -// -// To update the shard count, Amazon Kinesis performs splits and merges and -// individual shards. This can cause short-lived shards to be created, in addition -// to the final shards. We recommend that you double or halve the shard count, -// as this results in the fewest number of splits or merges. -// -// This operation has a rate limit of twice per rolling 24 hour period. You -// cannot scale above double your current shard count, scale below half your -// current shard count, or exceed the shard limits for your account. -// -// For the default limits for an AWS account, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) -// in the Amazon Kinesis Streams Developer Guide. If you need to increase a -// limit, contact AWS Support (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html). -// -// 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 Amazon Kinesis's -// API operation UpdateShardCount for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// A specified parameter exceeds its restrictions, is not supported, or can't -// be used. For more information, see the returned message. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// The requested resource exceeds the maximum number allowed, or the number -// of concurrent stream requests exceeds the maximum number allowed (5). -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is not available for this operation. For successful operation, -// the resource needs to be in the ACTIVE state. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The requested resource could not be found. The stream might not be specified -// correctly. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/UpdateShardCount -func (c *Kinesis) UpdateShardCount(input *UpdateShardCountInput) (*UpdateShardCountOutput, error) { - req, out := c.UpdateShardCountRequest(input) - return out, req.Send() -} - -// UpdateShardCountWithContext is the same as UpdateShardCount with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateShardCount 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 *Kinesis) UpdateShardCountWithContext(ctx aws.Context, input *UpdateShardCountInput, opts ...request.Option) (*UpdateShardCountOutput, error) { - req, out := c.UpdateShardCountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Represents the input for AddTagsToStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/AddTagsToStreamInput -type AddTagsToStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the stream. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` - - // The set of key-value pairs to use to create the tags. - // - // Tags is a required field - Tags map[string]*string `min:"1" type:"map" required:"true"` -} - -// String returns the string representation -func (s AddTagsToStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsToStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsToStreamInput"} - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamName sets the StreamName field's value. -func (s *AddTagsToStreamInput) SetStreamName(v string) *AddTagsToStreamInput { - s.StreamName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AddTagsToStreamInput) SetTags(v map[string]*string) *AddTagsToStreamInput { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/AddTagsToStreamOutput -type AddTagsToStreamOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddTagsToStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddTagsToStreamOutput) GoString() string { - return s.String() -} - -// Represents the input for CreateStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/CreateStreamInput -type CreateStreamInput struct { - _ struct{} `type:"structure"` - - // The number of shards that the stream will use. The throughput of the stream - // is a function of the number of shards; more shards are required for greater - // provisioned throughput. - // - // DefaultShardLimit; - // - // ShardCount is a required field - ShardCount *int64 `min:"1" type:"integer" required:"true"` - - // A name to identify the stream. The stream name is scoped to the AWS account - // used by the application that creates the stream. It is also scoped by region. - // That is, two streams in two different AWS accounts can have the same name, - // and two streams in the same AWS account but in two different regions can - // have the same name. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStreamInput"} - if s.ShardCount == nil { - invalidParams.Add(request.NewErrParamRequired("ShardCount")) - } - if s.ShardCount != nil && *s.ShardCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("ShardCount", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetShardCount sets the ShardCount field's value. -func (s *CreateStreamInput) SetShardCount(v int64) *CreateStreamInput { - s.ShardCount = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *CreateStreamInput) SetStreamName(v string) *CreateStreamInput { - s.StreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/CreateStreamOutput -type CreateStreamOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s CreateStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateStreamOutput) GoString() string { - return s.String() -} - -// Represents the input for DecreaseStreamRetentionPeriod. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DecreaseStreamRetentionPeriodInput -type DecreaseStreamRetentionPeriodInput struct { - _ struct{} `type:"structure"` - - // The new retention period of the stream, in hours. Must be less than the current - // retention period. - // - // RetentionPeriodHours is a required field - RetentionPeriodHours *int64 `min:"1" type:"integer" required:"true"` - - // The name of the stream to modify. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DecreaseStreamRetentionPeriodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DecreaseStreamRetentionPeriodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DecreaseStreamRetentionPeriodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DecreaseStreamRetentionPeriodInput"} - if s.RetentionPeriodHours == nil { - invalidParams.Add(request.NewErrParamRequired("RetentionPeriodHours")) - } - if s.RetentionPeriodHours != nil && *s.RetentionPeriodHours < 1 { - invalidParams.Add(request.NewErrParamMinValue("RetentionPeriodHours", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRetentionPeriodHours sets the RetentionPeriodHours field's value. -func (s *DecreaseStreamRetentionPeriodInput) SetRetentionPeriodHours(v int64) *DecreaseStreamRetentionPeriodInput { - s.RetentionPeriodHours = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *DecreaseStreamRetentionPeriodInput) SetStreamName(v string) *DecreaseStreamRetentionPeriodInput { - s.StreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DecreaseStreamRetentionPeriodOutput -type DecreaseStreamRetentionPeriodOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DecreaseStreamRetentionPeriodOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DecreaseStreamRetentionPeriodOutput) GoString() string { - return s.String() -} - -// Represents the input for DeleteStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DeleteStreamInput -type DeleteStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the stream to delete. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStreamInput"} - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamName sets the StreamName field's value. -func (s *DeleteStreamInput) SetStreamName(v string) *DeleteStreamInput { - s.StreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DeleteStreamOutput -type DeleteStreamOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteStreamOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeLimitsInput -type DescribeLimitsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeLimitsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLimitsInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeLimitsOutput -type DescribeLimitsOutput struct { - _ struct{} `type:"structure"` - - // The number of open shards. - // - // OpenShardCount is a required field - OpenShardCount *int64 `type:"integer" required:"true"` - - // The maximum number of shards. - // - // ShardLimit is a required field - ShardLimit *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s DescribeLimitsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLimitsOutput) GoString() string { - return s.String() -} - -// SetOpenShardCount sets the OpenShardCount field's value. -func (s *DescribeLimitsOutput) SetOpenShardCount(v int64) *DescribeLimitsOutput { - s.OpenShardCount = &v - return s -} - -// SetShardLimit sets the ShardLimit field's value. -func (s *DescribeLimitsOutput) SetShardLimit(v int64) *DescribeLimitsOutput { - s.ShardLimit = &v - return s -} - -// Represents the input for DescribeStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeStreamInput -type DescribeStreamInput struct { - _ struct{} `type:"structure"` - - // The shard ID of the shard to start with. - ExclusiveStartShardId *string `min:"1" type:"string"` - - // The maximum number of shards to return in a single call. The default value - // is 100. If you specify a value greater than 100, at most 100 shards are returned. - Limit *int64 `min:"1" type:"integer"` - - // The name of the stream to describe. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStreamInput"} - if s.ExclusiveStartShardId != nil && len(*s.ExclusiveStartShardId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartShardId", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartShardId sets the ExclusiveStartShardId field's value. -func (s *DescribeStreamInput) SetExclusiveStartShardId(v string) *DescribeStreamInput { - s.ExclusiveStartShardId = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeStreamInput) SetLimit(v int64) *DescribeStreamInput { - s.Limit = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *DescribeStreamInput) SetStreamName(v string) *DescribeStreamInput { - s.StreamName = &v - return s -} - -// Represents the output for DescribeStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DescribeStreamOutput -type DescribeStreamOutput struct { - _ struct{} `type:"structure"` - - // The current status of the stream, the stream ARN, an array of shard objects - // that comprise the stream, and whether there are more shards available. - // - // StreamDescription is a required field - StreamDescription *StreamDescription `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DescribeStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeStreamOutput) GoString() string { - return s.String() -} - -// SetStreamDescription sets the StreamDescription field's value. -func (s *DescribeStreamOutput) SetStreamDescription(v *StreamDescription) *DescribeStreamOutput { - s.StreamDescription = v - return s -} - -// Represents the input for DisableEnhancedMonitoring. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/DisableEnhancedMonitoringInput -type DisableEnhancedMonitoringInput struct { - _ struct{} `type:"structure"` - - // List of shard-level metrics to disable. - // - // The following are the valid shard-level metrics. The value "ALL" disables - // every metric. - // - // * IncomingBytes - // - // * IncomingRecords - // - // * OutgoingBytes - // - // * OutgoingRecords - // - // * WriteProvisionedThroughputExceeded - // - // * ReadProvisionedThroughputExceeded - // - // * IteratorAgeMilliseconds - // - // * ALL - // - // For more information, see Monitoring the Amazon Kinesis Streams Service with - // Amazon CloudWatch (http://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html) - // in the Amazon Kinesis Streams Developer Guide. - // - // ShardLevelMetrics is a required field - ShardLevelMetrics []*string `min:"1" type:"list" required:"true"` - - // The name of the Amazon Kinesis stream for which to disable enhanced monitoring. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DisableEnhancedMonitoringInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableEnhancedMonitoringInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableEnhancedMonitoringInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableEnhancedMonitoringInput"} - if s.ShardLevelMetrics == nil { - invalidParams.Add(request.NewErrParamRequired("ShardLevelMetrics")) - } - if s.ShardLevelMetrics != nil && len(s.ShardLevelMetrics) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShardLevelMetrics", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetShardLevelMetrics sets the ShardLevelMetrics field's value. -func (s *DisableEnhancedMonitoringInput) SetShardLevelMetrics(v []*string) *DisableEnhancedMonitoringInput { - s.ShardLevelMetrics = v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *DisableEnhancedMonitoringInput) SetStreamName(v string) *DisableEnhancedMonitoringInput { - s.StreamName = &v - return s -} - -// Represents the input for EnableEnhancedMonitoring. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/EnableEnhancedMonitoringInput -type EnableEnhancedMonitoringInput struct { - _ struct{} `type:"structure"` - - // List of shard-level metrics to enable. - // - // The following are the valid shard-level metrics. The value "ALL" enables - // every metric. - // - // * IncomingBytes - // - // * IncomingRecords - // - // * OutgoingBytes - // - // * OutgoingRecords - // - // * WriteProvisionedThroughputExceeded - // - // * ReadProvisionedThroughputExceeded - // - // * IteratorAgeMilliseconds - // - // * ALL - // - // For more information, see Monitoring the Amazon Kinesis Streams Service with - // Amazon CloudWatch (http://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html) - // in the Amazon Kinesis Streams Developer Guide. - // - // ShardLevelMetrics is a required field - ShardLevelMetrics []*string `min:"1" type:"list" required:"true"` - - // The name of the stream for which to enable enhanced monitoring. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s EnableEnhancedMonitoringInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableEnhancedMonitoringInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableEnhancedMonitoringInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableEnhancedMonitoringInput"} - if s.ShardLevelMetrics == nil { - invalidParams.Add(request.NewErrParamRequired("ShardLevelMetrics")) - } - if s.ShardLevelMetrics != nil && len(s.ShardLevelMetrics) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShardLevelMetrics", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetShardLevelMetrics sets the ShardLevelMetrics field's value. -func (s *EnableEnhancedMonitoringInput) SetShardLevelMetrics(v []*string) *EnableEnhancedMonitoringInput { - s.ShardLevelMetrics = v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *EnableEnhancedMonitoringInput) SetStreamName(v string) *EnableEnhancedMonitoringInput { - s.StreamName = &v - return s -} - -// Represents enhanced metrics types. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/EnhancedMetrics -type EnhancedMetrics struct { - _ struct{} `type:"structure"` - - // List of shard-level metrics. - // - // The following are the valid shard-level metrics. The value "ALL" enhances - // every metric. - // - // * IncomingBytes - // - // * IncomingRecords - // - // * OutgoingBytes - // - // * OutgoingRecords - // - // * WriteProvisionedThroughputExceeded - // - // * ReadProvisionedThroughputExceeded - // - // * IteratorAgeMilliseconds - // - // * ALL - // - // For more information, see Monitoring the Amazon Kinesis Streams Service with - // Amazon CloudWatch (http://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html) - // in the Amazon Kinesis Streams Developer Guide. - ShardLevelMetrics []*string `min:"1" type:"list"` -} - -// String returns the string representation -func (s EnhancedMetrics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnhancedMetrics) GoString() string { - return s.String() -} - -// SetShardLevelMetrics sets the ShardLevelMetrics field's value. -func (s *EnhancedMetrics) SetShardLevelMetrics(v []*string) *EnhancedMetrics { - s.ShardLevelMetrics = v - return s -} - -// Represents the output for EnableEnhancedMonitoring and DisableEnhancedMonitoring. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/EnhancedMonitoringOutput -type EnhancedMonitoringOutput struct { - _ struct{} `type:"structure"` - - // Represents the current state of the metrics that are in the enhanced state - // before the operation. - CurrentShardLevelMetrics []*string `min:"1" type:"list"` - - // Represents the list of all the metrics that would be in the enhanced state - // after the operation. - DesiredShardLevelMetrics []*string `min:"1" type:"list"` - - // The name of the Amazon Kinesis stream. - StreamName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s EnhancedMonitoringOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnhancedMonitoringOutput) GoString() string { - return s.String() -} - -// SetCurrentShardLevelMetrics sets the CurrentShardLevelMetrics field's value. -func (s *EnhancedMonitoringOutput) SetCurrentShardLevelMetrics(v []*string) *EnhancedMonitoringOutput { - s.CurrentShardLevelMetrics = v - return s -} - -// SetDesiredShardLevelMetrics sets the DesiredShardLevelMetrics field's value. -func (s *EnhancedMonitoringOutput) SetDesiredShardLevelMetrics(v []*string) *EnhancedMonitoringOutput { - s.DesiredShardLevelMetrics = v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *EnhancedMonitoringOutput) SetStreamName(v string) *EnhancedMonitoringOutput { - s.StreamName = &v - return s -} - -// Represents the input for GetRecords. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetRecordsInput -type GetRecordsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of records to return. Specify a value of up to 10,000. - // If you specify a value that is greater than 10,000, GetRecords throws InvalidArgumentException. - Limit *int64 `min:"1" type:"integer"` - - // The position in the shard from which you want to start sequentially reading - // data records. A shard iterator specifies this position using the sequence - // number of a data record in the shard. - // - // ShardIterator is a required field - ShardIterator *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetRecordsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRecordsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRecordsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRecordsInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.ShardIterator == nil { - invalidParams.Add(request.NewErrParamRequired("ShardIterator")) - } - if s.ShardIterator != nil && len(*s.ShardIterator) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShardIterator", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLimit sets the Limit field's value. -func (s *GetRecordsInput) SetLimit(v int64) *GetRecordsInput { - s.Limit = &v - return s -} - -// SetShardIterator sets the ShardIterator field's value. -func (s *GetRecordsInput) SetShardIterator(v string) *GetRecordsInput { - s.ShardIterator = &v - return s -} - -// Represents the output for GetRecords. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetRecordsOutput -type GetRecordsOutput struct { - _ struct{} `type:"structure"` - - // The number of milliseconds the GetRecords response is from the tip of the - // stream, indicating how far behind current time the consumer is. A value of - // zero indicates record processing is caught up, and there are no new records - // to process at this moment. - MillisBehindLatest *int64 `type:"long"` - - // The next position in the shard from which to start sequentially reading data - // records. If set to null, the shard has been closed and the requested iterator - // will not return any more data. - NextShardIterator *string `min:"1" type:"string"` - - // The data records retrieved from the shard. - // - // Records is a required field - Records []*Record `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetRecordsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetRecordsOutput) GoString() string { - return s.String() -} - -// SetMillisBehindLatest sets the MillisBehindLatest field's value. -func (s *GetRecordsOutput) SetMillisBehindLatest(v int64) *GetRecordsOutput { - s.MillisBehindLatest = &v - return s -} - -// SetNextShardIterator sets the NextShardIterator field's value. -func (s *GetRecordsOutput) SetNextShardIterator(v string) *GetRecordsOutput { - s.NextShardIterator = &v - return s -} - -// SetRecords sets the Records field's value. -func (s *GetRecordsOutput) SetRecords(v []*Record) *GetRecordsOutput { - s.Records = v - return s -} - -// Represents the input for GetShardIterator. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetShardIteratorInput -type GetShardIteratorInput struct { - _ struct{} `type:"structure"` - - // The shard ID of the Amazon Kinesis shard to get the iterator for. - // - // ShardId is a required field - ShardId *string `min:"1" type:"string" required:"true"` - - // Determines how the shard iterator is used to start reading data records from - // the shard. - // - // The following are the valid Amazon Kinesis shard iterator types: - // - // * AT_SEQUENCE_NUMBER - Start reading from the position denoted by a specific - // sequence number, provided in the value StartingSequenceNumber. - // - // * AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted - // by a specific sequence number, provided in the value StartingSequenceNumber. - // - // * AT_TIMESTAMP - Start reading from the position denoted by a specific - // timestamp, provided in the value Timestamp. - // - // * TRIM_HORIZON - Start reading at the last untrimmed record in the shard - // in the system, which is the oldest data record in the shard. - // - // * LATEST - Start reading just after the most recent record in the shard, - // so that you always read the most recent data in the shard. - // - // ShardIteratorType is a required field - ShardIteratorType *string `type:"string" required:"true" enum:"ShardIteratorType"` - - // The sequence number of the data record in the shard from which to start reading. - // Used with shard iterator type AT_SEQUENCE_NUMBER and AFTER_SEQUENCE_NUMBER. - StartingSequenceNumber *string `type:"string"` - - // The name of the Amazon Kinesis stream. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` - - // The timestamp of the data record from which to start reading. Used with shard - // iterator type AT_TIMESTAMP. A timestamp is the Unix epoch date with precision - // in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480. - // If a record with this exact timestamp does not exist, the iterator returned - // is for the next (later) record. If the timestamp is older than the current - // trim horizon, the iterator returned is for the oldest untrimmed data record - // (TRIM_HORIZON). - Timestamp *time.Time `type:"timestamp" timestampFormat:"unix"` -} - -// String returns the string representation -func (s GetShardIteratorInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetShardIteratorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetShardIteratorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetShardIteratorInput"} - if s.ShardId == nil { - invalidParams.Add(request.NewErrParamRequired("ShardId")) - } - if s.ShardId != nil && len(*s.ShardId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShardId", 1)) - } - if s.ShardIteratorType == nil { - invalidParams.Add(request.NewErrParamRequired("ShardIteratorType")) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetShardId sets the ShardId field's value. -func (s *GetShardIteratorInput) SetShardId(v string) *GetShardIteratorInput { - s.ShardId = &v - return s -} - -// SetShardIteratorType sets the ShardIteratorType field's value. -func (s *GetShardIteratorInput) SetShardIteratorType(v string) *GetShardIteratorInput { - s.ShardIteratorType = &v - return s -} - -// SetStartingSequenceNumber sets the StartingSequenceNumber field's value. -func (s *GetShardIteratorInput) SetStartingSequenceNumber(v string) *GetShardIteratorInput { - s.StartingSequenceNumber = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *GetShardIteratorInput) SetStreamName(v string) *GetShardIteratorInput { - s.StreamName = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *GetShardIteratorInput) SetTimestamp(v time.Time) *GetShardIteratorInput { - s.Timestamp = &v - return s -} - -// Represents the output for GetShardIterator. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/GetShardIteratorOutput -type GetShardIteratorOutput struct { - _ struct{} `type:"structure"` - - // The position in the shard from which to start reading data records sequentially. - // A shard iterator specifies this position using the sequence number of a data - // record in a shard. - ShardIterator *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GetShardIteratorOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetShardIteratorOutput) GoString() string { - return s.String() -} - -// SetShardIterator sets the ShardIterator field's value. -func (s *GetShardIteratorOutput) SetShardIterator(v string) *GetShardIteratorOutput { - s.ShardIterator = &v - return s -} - -// The range of possible hash key values for the shard, which is a set of ordered -// contiguous positive integers. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/HashKeyRange -type HashKeyRange struct { - _ struct{} `type:"structure"` - - // The ending hash key of the hash key range. - // - // EndingHashKey is a required field - EndingHashKey *string `type:"string" required:"true"` - - // The starting hash key of the hash key range. - // - // StartingHashKey is a required field - StartingHashKey *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s HashKeyRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HashKeyRange) GoString() string { - return s.String() -} - -// SetEndingHashKey sets the EndingHashKey field's value. -func (s *HashKeyRange) SetEndingHashKey(v string) *HashKeyRange { - s.EndingHashKey = &v - return s -} - -// SetStartingHashKey sets the StartingHashKey field's value. -func (s *HashKeyRange) SetStartingHashKey(v string) *HashKeyRange { - s.StartingHashKey = &v - return s -} - -// Represents the input for IncreaseStreamRetentionPeriod. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/IncreaseStreamRetentionPeriodInput -type IncreaseStreamRetentionPeriodInput struct { - _ struct{} `type:"structure"` - - // The new retention period of the stream, in hours. Must be more than the current - // retention period. - // - // RetentionPeriodHours is a required field - RetentionPeriodHours *int64 `min:"1" type:"integer" required:"true"` - - // The name of the stream to modify. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s IncreaseStreamRetentionPeriodInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IncreaseStreamRetentionPeriodInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IncreaseStreamRetentionPeriodInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IncreaseStreamRetentionPeriodInput"} - if s.RetentionPeriodHours == nil { - invalidParams.Add(request.NewErrParamRequired("RetentionPeriodHours")) - } - if s.RetentionPeriodHours != nil && *s.RetentionPeriodHours < 1 { - invalidParams.Add(request.NewErrParamMinValue("RetentionPeriodHours", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRetentionPeriodHours sets the RetentionPeriodHours field's value. -func (s *IncreaseStreamRetentionPeriodInput) SetRetentionPeriodHours(v int64) *IncreaseStreamRetentionPeriodInput { - s.RetentionPeriodHours = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *IncreaseStreamRetentionPeriodInput) SetStreamName(v string) *IncreaseStreamRetentionPeriodInput { - s.StreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/IncreaseStreamRetentionPeriodOutput -type IncreaseStreamRetentionPeriodOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s IncreaseStreamRetentionPeriodOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IncreaseStreamRetentionPeriodOutput) GoString() string { - return s.String() -} - -// Represents the input for ListStreams. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListStreamsInput -type ListStreamsInput struct { - _ struct{} `type:"structure"` - - // The name of the stream to start the list with. - ExclusiveStartStreamName *string `min:"1" type:"string"` - - // The maximum number of streams to list. - Limit *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s ListStreamsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStreamsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStreamsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStreamsInput"} - if s.ExclusiveStartStreamName != nil && len(*s.ExclusiveStartStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartStreamName", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartStreamName sets the ExclusiveStartStreamName field's value. -func (s *ListStreamsInput) SetExclusiveStartStreamName(v string) *ListStreamsInput { - s.ExclusiveStartStreamName = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListStreamsInput) SetLimit(v int64) *ListStreamsInput { - s.Limit = &v - return s -} - -// Represents the output for ListStreams. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListStreamsOutput -type ListStreamsOutput struct { - _ struct{} `type:"structure"` - - // If set to true, there are more streams available to list. - // - // HasMoreStreams is a required field - HasMoreStreams *bool `type:"boolean" required:"true"` - - // The names of the streams that are associated with the AWS account making - // the ListStreams request. - // - // StreamNames is a required field - StreamNames []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListStreamsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListStreamsOutput) GoString() string { - return s.String() -} - -// SetHasMoreStreams sets the HasMoreStreams field's value. -func (s *ListStreamsOutput) SetHasMoreStreams(v bool) *ListStreamsOutput { - s.HasMoreStreams = &v - return s -} - -// SetStreamNames sets the StreamNames field's value. -func (s *ListStreamsOutput) SetStreamNames(v []*string) *ListStreamsOutput { - s.StreamNames = v - return s -} - -// Represents the input for ListTagsForStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListTagsForStreamInput -type ListTagsForStreamInput struct { - _ struct{} `type:"structure"` - - // The key to use as the starting point for the list of tags. If this parameter - // is set, ListTagsForStream gets all tags that occur after ExclusiveStartTagKey. - ExclusiveStartTagKey *string `min:"1" type:"string"` - - // The number of tags to return. If this number is less than the total number - // of tags associated with the stream, HasMoreTags is set to true. To list additional - // tags, set ExclusiveStartTagKey to the last key in the response. - Limit *int64 `min:"1" type:"integer"` - - // The name of the stream. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTagsForStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForStreamInput"} - if s.ExclusiveStartTagKey != nil && len(*s.ExclusiveStartTagKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartTagKey", 1)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExclusiveStartTagKey sets the ExclusiveStartTagKey field's value. -func (s *ListTagsForStreamInput) SetExclusiveStartTagKey(v string) *ListTagsForStreamInput { - s.ExclusiveStartTagKey = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListTagsForStreamInput) SetLimit(v int64) *ListTagsForStreamInput { - s.Limit = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *ListTagsForStreamInput) SetStreamName(v string) *ListTagsForStreamInput { - s.StreamName = &v - return s -} - -// Represents the output for ListTagsForStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/ListTagsForStreamOutput -type ListTagsForStreamOutput struct { - _ struct{} `type:"structure"` - - // If set to true, more tags are available. To request additional tags, set - // ExclusiveStartTagKey to the key of the last tag returned. - // - // HasMoreTags is a required field - HasMoreTags *bool `type:"boolean" required:"true"` - - // A list of tags associated with StreamName, starting with the first tag after - // ExclusiveStartTagKey and up to the specified Limit. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// String returns the string representation -func (s ListTagsForStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForStreamOutput) GoString() string { - return s.String() -} - -// SetHasMoreTags sets the HasMoreTags field's value. -func (s *ListTagsForStreamOutput) SetHasMoreTags(v bool) *ListTagsForStreamOutput { - s.HasMoreTags = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForStreamOutput) SetTags(v []*Tag) *ListTagsForStreamOutput { - s.Tags = v - return s -} - -// Represents the input for MergeShards. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/MergeShardsInput -type MergeShardsInput struct { - _ struct{} `type:"structure"` - - // The shard ID of the adjacent shard for the merge. - // - // AdjacentShardToMerge is a required field - AdjacentShardToMerge *string `min:"1" type:"string" required:"true"` - - // The shard ID of the shard to combine with the adjacent shard for the merge. - // - // ShardToMerge is a required field - ShardToMerge *string `min:"1" type:"string" required:"true"` - - // The name of the stream for the merge. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s MergeShardsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MergeShardsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MergeShardsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MergeShardsInput"} - if s.AdjacentShardToMerge == nil { - invalidParams.Add(request.NewErrParamRequired("AdjacentShardToMerge")) - } - if s.AdjacentShardToMerge != nil && len(*s.AdjacentShardToMerge) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdjacentShardToMerge", 1)) - } - if s.ShardToMerge == nil { - invalidParams.Add(request.NewErrParamRequired("ShardToMerge")) - } - if s.ShardToMerge != nil && len(*s.ShardToMerge) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShardToMerge", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdjacentShardToMerge sets the AdjacentShardToMerge field's value. -func (s *MergeShardsInput) SetAdjacentShardToMerge(v string) *MergeShardsInput { - s.AdjacentShardToMerge = &v - return s -} - -// SetShardToMerge sets the ShardToMerge field's value. -func (s *MergeShardsInput) SetShardToMerge(v string) *MergeShardsInput { - s.ShardToMerge = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *MergeShardsInput) SetStreamName(v string) *MergeShardsInput { - s.StreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/MergeShardsOutput -type MergeShardsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s MergeShardsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MergeShardsOutput) GoString() string { - return s.String() -} - -// Represents the input for PutRecord. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecordInput -type PutRecordInput struct { - _ struct{} `type:"structure"` - - // The data blob to put into the record, which is base64-encoded when the blob - // is serialized. When the data blob (the payload before base64-encoding) is - // added to the partition key size, the total size must not exceed the maximum - // record size (1 MB). - // - // Data is automatically base64 encoded/decoded by the SDK. - // - // Data is a required field - Data []byte `type:"blob" required:"true"` - - // The hash value used to explicitly determine the shard the data record is - // assigned to by overriding the partition key hash. - ExplicitHashKey *string `type:"string"` - - // Determines which shard in the stream the data record is assigned to. Partition - // keys are Unicode strings with a maximum length limit of 256 characters for - // each key. Amazon Kinesis uses the partition key as input to a hash function - // that maps the partition key and associated data to a specific shard. Specifically, - // an MD5 hash function is used to map partition keys to 128-bit integer values - // and to map associated data records to shards. As a result of this hashing - // mechanism, all data records with the same partition key map to the same shard - // within the stream. - // - // PartitionKey is a required field - PartitionKey *string `min:"1" type:"string" required:"true"` - - // Guarantees strictly increasing sequence numbers, for puts from the same client - // and to the same partition key. Usage: set the SequenceNumberForOrdering of - // record n to the sequence number of record n-1 (as returned in the result - // when putting record n-1). If this parameter is not set, records will be coarsely - // ordered based on arrival time. - SequenceNumberForOrdering *string `type:"string"` - - // The name of the stream to put the data record into. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutRecordInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRecordInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRecordInput"} - if s.Data == nil { - invalidParams.Add(request.NewErrParamRequired("Data")) - } - if s.PartitionKey == nil { - invalidParams.Add(request.NewErrParamRequired("PartitionKey")) - } - if s.PartitionKey != nil && len(*s.PartitionKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PartitionKey", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetData sets the Data field's value. -func (s *PutRecordInput) SetData(v []byte) *PutRecordInput { - s.Data = v - return s -} - -// SetExplicitHashKey sets the ExplicitHashKey field's value. -func (s *PutRecordInput) SetExplicitHashKey(v string) *PutRecordInput { - s.ExplicitHashKey = &v - return s -} - -// SetPartitionKey sets the PartitionKey field's value. -func (s *PutRecordInput) SetPartitionKey(v string) *PutRecordInput { - s.PartitionKey = &v - return s -} - -// SetSequenceNumberForOrdering sets the SequenceNumberForOrdering field's value. -func (s *PutRecordInput) SetSequenceNumberForOrdering(v string) *PutRecordInput { - s.SequenceNumberForOrdering = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *PutRecordInput) SetStreamName(v string) *PutRecordInput { - s.StreamName = &v - return s -} - -// Represents the output for PutRecord. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecordOutput -type PutRecordOutput struct { - _ struct{} `type:"structure"` - - // The sequence number identifier that was assigned to the put data record. - // The sequence number for the record is unique across all records in the stream. - // A sequence number is the identifier associated with every record put into - // the stream. - // - // SequenceNumber is a required field - SequenceNumber *string `type:"string" required:"true"` - - // The shard ID of the shard where the data record was placed. - // - // ShardId is a required field - ShardId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutRecordOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordOutput) GoString() string { - return s.String() -} - -// SetSequenceNumber sets the SequenceNumber field's value. -func (s *PutRecordOutput) SetSequenceNumber(v string) *PutRecordOutput { - s.SequenceNumber = &v - return s -} - -// SetShardId sets the ShardId field's value. -func (s *PutRecordOutput) SetShardId(v string) *PutRecordOutput { - s.ShardId = &v - return s -} - -// A PutRecords request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecordsInput -type PutRecordsInput struct { - _ struct{} `type:"structure"` - - // The records associated with the request. - // - // Records is a required field - Records []*PutRecordsRequestEntry `min:"1" type:"list" required:"true"` - - // The stream name associated with the request. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutRecordsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRecordsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRecordsInput"} - if s.Records == nil { - invalidParams.Add(request.NewErrParamRequired("Records")) - } - if s.Records != nil && len(s.Records) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Records", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - if s.Records != nil { - for i, v := range s.Records { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Records", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRecords sets the Records field's value. -func (s *PutRecordsInput) SetRecords(v []*PutRecordsRequestEntry) *PutRecordsInput { - s.Records = v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *PutRecordsInput) SetStreamName(v string) *PutRecordsInput { - s.StreamName = &v - return s -} - -// PutRecords results. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecordsOutput -type PutRecordsOutput struct { - _ struct{} `type:"structure"` - - // The number of unsuccessfully processed records in a PutRecords request. - FailedRecordCount *int64 `min:"1" type:"integer"` - - // An array of successfully and unsuccessfully processed record results, correlated - // with the request by natural ordering. A record that is successfully added - // to a stream includes SequenceNumber and ShardId in the result. A record that - // fails to be added to a stream includes ErrorCode and ErrorMessage in the - // result. - // - // Records is a required field - Records []*PutRecordsResultEntry `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s PutRecordsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordsOutput) GoString() string { - return s.String() -} - -// SetFailedRecordCount sets the FailedRecordCount field's value. -func (s *PutRecordsOutput) SetFailedRecordCount(v int64) *PutRecordsOutput { - s.FailedRecordCount = &v - return s -} - -// SetRecords sets the Records field's value. -func (s *PutRecordsOutput) SetRecords(v []*PutRecordsResultEntry) *PutRecordsOutput { - s.Records = v - return s -} - -// Represents the output for PutRecords. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecordsRequestEntry -type PutRecordsRequestEntry struct { - _ struct{} `type:"structure"` - - // The data blob to put into the record, which is base64-encoded when the blob - // is serialized. When the data blob (the payload before base64-encoding) is - // added to the partition key size, the total size must not exceed the maximum - // record size (1 MB). - // - // Data is automatically base64 encoded/decoded by the SDK. - // - // Data is a required field - Data []byte `type:"blob" required:"true"` - - // The hash value used to determine explicitly the shard that the data record - // is assigned to by overriding the partition key hash. - ExplicitHashKey *string `type:"string"` - - // Determines which shard in the stream the data record is assigned to. Partition - // keys are Unicode strings with a maximum length limit of 256 characters for - // each key. Amazon Kinesis uses the partition key as input to a hash function - // that maps the partition key and associated data to a specific shard. Specifically, - // an MD5 hash function is used to map partition keys to 128-bit integer values - // and to map associated data records to shards. As a result of this hashing - // mechanism, all data records with the same partition key map to the same shard - // within the stream. - // - // PartitionKey is a required field - PartitionKey *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutRecordsRequestEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordsRequestEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutRecordsRequestEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutRecordsRequestEntry"} - if s.Data == nil { - invalidParams.Add(request.NewErrParamRequired("Data")) - } - if s.PartitionKey == nil { - invalidParams.Add(request.NewErrParamRequired("PartitionKey")) - } - if s.PartitionKey != nil && len(*s.PartitionKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PartitionKey", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetData sets the Data field's value. -func (s *PutRecordsRequestEntry) SetData(v []byte) *PutRecordsRequestEntry { - s.Data = v - return s -} - -// SetExplicitHashKey sets the ExplicitHashKey field's value. -func (s *PutRecordsRequestEntry) SetExplicitHashKey(v string) *PutRecordsRequestEntry { - s.ExplicitHashKey = &v - return s -} - -// SetPartitionKey sets the PartitionKey field's value. -func (s *PutRecordsRequestEntry) SetPartitionKey(v string) *PutRecordsRequestEntry { - s.PartitionKey = &v - return s -} - -// Represents the result of an individual record from a PutRecords request. -// A record that is successfully added to a stream includes SequenceNumber and -// ShardId in the result. A record that fails to be added to the stream includes -// ErrorCode and ErrorMessage in the result. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/PutRecordsResultEntry -type PutRecordsResultEntry struct { - _ struct{} `type:"structure"` - - // The error code for an individual record result. ErrorCodes can be either - // ProvisionedThroughputExceededException or InternalFailure. - ErrorCode *string `type:"string"` - - // The error message for an individual record result. An ErrorCode value of - // ProvisionedThroughputExceededException has an error message that includes - // the account ID, stream name, and shard ID. An ErrorCode value of InternalFailure - // has the error message "Internal Service Failure". - ErrorMessage *string `type:"string"` - - // The sequence number for an individual record result. - SequenceNumber *string `type:"string"` - - // The shard ID for an individual record result. - ShardId *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s PutRecordsResultEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutRecordsResultEntry) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *PutRecordsResultEntry) SetErrorCode(v string) *PutRecordsResultEntry { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *PutRecordsResultEntry) SetErrorMessage(v string) *PutRecordsResultEntry { - s.ErrorMessage = &v - return s -} - -// SetSequenceNumber sets the SequenceNumber field's value. -func (s *PutRecordsResultEntry) SetSequenceNumber(v string) *PutRecordsResultEntry { - s.SequenceNumber = &v - return s -} - -// SetShardId sets the ShardId field's value. -func (s *PutRecordsResultEntry) SetShardId(v string) *PutRecordsResultEntry { - s.ShardId = &v - return s -} - -// The unit of data of the Amazon Kinesis stream, which is composed of a sequence -// number, a partition key, and a data blob. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/Record -type Record struct { - _ struct{} `type:"structure"` - - // The approximate time that the record was inserted into the stream. - ApproximateArrivalTimestamp *time.Time `type:"timestamp" timestampFormat:"unix"` - - // The data blob. The data in the blob is both opaque and immutable to the Amazon - // Kinesis service, which does not inspect, interpret, or change the data in - // the blob in any way. When the data blob (the payload before base64-encoding) - // is added to the partition key size, the total size must not exceed the maximum - // record size (1 MB). - // - // Data is automatically base64 encoded/decoded by the SDK. - // - // Data is a required field - Data []byte `type:"blob" required:"true"` - - // Identifies which shard in the stream the data record is assigned to. - // - // PartitionKey is a required field - PartitionKey *string `min:"1" type:"string" required:"true"` - - // The unique identifier of the record in the stream. - // - // SequenceNumber is a required field - SequenceNumber *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Record) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Record) GoString() string { - return s.String() -} - -// SetApproximateArrivalTimestamp sets the ApproximateArrivalTimestamp field's value. -func (s *Record) SetApproximateArrivalTimestamp(v time.Time) *Record { - s.ApproximateArrivalTimestamp = &v - return s -} - -// SetData sets the Data field's value. -func (s *Record) SetData(v []byte) *Record { - s.Data = v - return s -} - -// SetPartitionKey sets the PartitionKey field's value. -func (s *Record) SetPartitionKey(v string) *Record { - s.PartitionKey = &v - return s -} - -// SetSequenceNumber sets the SequenceNumber field's value. -func (s *Record) SetSequenceNumber(v string) *Record { - s.SequenceNumber = &v - return s -} - -// Represents the input for RemoveTagsFromStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/RemoveTagsFromStreamInput -type RemoveTagsFromStreamInput struct { - _ struct{} `type:"structure"` - - // The name of the stream. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` - - // A list of tag keys. Each corresponding tag is removed from the stream. - // - // TagKeys is a required field - TagKeys []*string `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s RemoveTagsFromStreamInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsFromStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsFromStreamInput"} - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamName sets the StreamName field's value. -func (s *RemoveTagsFromStreamInput) SetStreamName(v string) *RemoveTagsFromStreamInput { - s.StreamName = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *RemoveTagsFromStreamInput) SetTagKeys(v []*string) *RemoveTagsFromStreamInput { - s.TagKeys = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/RemoveTagsFromStreamOutput -type RemoveTagsFromStreamOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemoveTagsFromStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveTagsFromStreamOutput) GoString() string { - return s.String() -} - -// The range of possible sequence numbers for the shard. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/SequenceNumberRange -type SequenceNumberRange struct { - _ struct{} `type:"structure"` - - // The ending sequence number for the range. Shards that are in the OPEN state - // have an ending sequence number of null. - EndingSequenceNumber *string `type:"string"` - - // The starting sequence number for the range. - // - // StartingSequenceNumber is a required field - StartingSequenceNumber *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SequenceNumberRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SequenceNumberRange) GoString() string { - return s.String() -} - -// SetEndingSequenceNumber sets the EndingSequenceNumber field's value. -func (s *SequenceNumberRange) SetEndingSequenceNumber(v string) *SequenceNumberRange { - s.EndingSequenceNumber = &v - return s -} - -// SetStartingSequenceNumber sets the StartingSequenceNumber field's value. -func (s *SequenceNumberRange) SetStartingSequenceNumber(v string) *SequenceNumberRange { - s.StartingSequenceNumber = &v - return s -} - -// A uniquely identified group of data records in an Amazon Kinesis stream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/Shard -type Shard struct { - _ struct{} `type:"structure"` - - // The shard ID of the shard adjacent to the shard's parent. - AdjacentParentShardId *string `min:"1" type:"string"` - - // The range of possible hash key values for the shard, which is a set of ordered - // contiguous positive integers. - // - // HashKeyRange is a required field - HashKeyRange *HashKeyRange `type:"structure" required:"true"` - - // The shard ID of the shard's parent. - ParentShardId *string `min:"1" type:"string"` - - // The range of possible sequence numbers for the shard. - // - // SequenceNumberRange is a required field - SequenceNumberRange *SequenceNumberRange `type:"structure" required:"true"` - - // The unique identifier of the shard within the stream. - // - // ShardId is a required field - ShardId *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s Shard) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Shard) GoString() string { - return s.String() -} - -// SetAdjacentParentShardId sets the AdjacentParentShardId field's value. -func (s *Shard) SetAdjacentParentShardId(v string) *Shard { - s.AdjacentParentShardId = &v - return s -} - -// SetHashKeyRange sets the HashKeyRange field's value. -func (s *Shard) SetHashKeyRange(v *HashKeyRange) *Shard { - s.HashKeyRange = v - return s -} - -// SetParentShardId sets the ParentShardId field's value. -func (s *Shard) SetParentShardId(v string) *Shard { - s.ParentShardId = &v - return s -} - -// SetSequenceNumberRange sets the SequenceNumberRange field's value. -func (s *Shard) SetSequenceNumberRange(v *SequenceNumberRange) *Shard { - s.SequenceNumberRange = v - return s -} - -// SetShardId sets the ShardId field's value. -func (s *Shard) SetShardId(v string) *Shard { - s.ShardId = &v - return s -} - -// Represents the input for SplitShard. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/SplitShardInput -type SplitShardInput struct { - _ struct{} `type:"structure"` - - // A hash key value for the starting hash key of one of the child shards created - // by the split. The hash key range for a given shard constitutes a set of ordered - // contiguous positive integers. The value for NewStartingHashKey must be in - // the range of hash keys being mapped into the shard. The NewStartingHashKey - // hash key value and all higher hash key values in hash key range are distributed - // to one of the child shards. All the lower hash key values in the range are - // distributed to the other child shard. - // - // NewStartingHashKey is a required field - NewStartingHashKey *string `type:"string" required:"true"` - - // The shard ID of the shard to split. - // - // ShardToSplit is a required field - ShardToSplit *string `min:"1" type:"string" required:"true"` - - // The name of the stream for the shard split. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s SplitShardInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SplitShardInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SplitShardInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SplitShardInput"} - if s.NewStartingHashKey == nil { - invalidParams.Add(request.NewErrParamRequired("NewStartingHashKey")) - } - if s.ShardToSplit == nil { - invalidParams.Add(request.NewErrParamRequired("ShardToSplit")) - } - if s.ShardToSplit != nil && len(*s.ShardToSplit) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShardToSplit", 1)) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNewStartingHashKey sets the NewStartingHashKey field's value. -func (s *SplitShardInput) SetNewStartingHashKey(v string) *SplitShardInput { - s.NewStartingHashKey = &v - return s -} - -// SetShardToSplit sets the ShardToSplit field's value. -func (s *SplitShardInput) SetShardToSplit(v string) *SplitShardInput { - s.ShardToSplit = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *SplitShardInput) SetStreamName(v string) *SplitShardInput { - s.StreamName = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/SplitShardOutput -type SplitShardOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SplitShardOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SplitShardOutput) GoString() string { - return s.String() -} - -// Represents the output for DescribeStream. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/StreamDescription -type StreamDescription struct { - _ struct{} `type:"structure"` - - // Represents the current enhanced monitoring settings of the stream. - // - // EnhancedMonitoring is a required field - EnhancedMonitoring []*EnhancedMetrics `type:"list" required:"true"` - - // If set to true, more shards in the stream are available to describe. - // - // HasMoreShards is a required field - HasMoreShards *bool `type:"boolean" required:"true"` - - // The current retention period, in hours. - // - // RetentionPeriodHours is a required field - RetentionPeriodHours *int64 `min:"1" type:"integer" required:"true"` - - // The shards that comprise the stream. - // - // Shards is a required field - Shards []*Shard `type:"list" required:"true"` - - // The Amazon Resource Name (ARN) for the stream being described. - // - // StreamARN is a required field - StreamARN *string `type:"string" required:"true"` - - // The approximate time that the stream was created. - // - // StreamCreationTimestamp is a required field - StreamCreationTimestamp *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` - - // The name of the stream being described. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` - - // The current status of the stream being described. The stream status is one - // of the following states: - // - // * CREATING - The stream is being created. Amazon Kinesis immediately returns - // and sets StreamStatus to CREATING. - // - // * DELETING - The stream is being deleted. The specified stream is in the - // DELETING state until Amazon Kinesis completes the deletion. - // - // * ACTIVE - The stream exists and is ready for read and write operations - // or deletion. You should perform read and write operations only on an ACTIVE - // stream. - // - // * UPDATING - Shards in the stream are being merged or split. Read and - // write operations continue to work while the stream is in the UPDATING - // state. - // - // StreamStatus is a required field - StreamStatus *string `type:"string" required:"true" enum:"StreamStatus"` -} - -// String returns the string representation -func (s StreamDescription) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StreamDescription) GoString() string { - return s.String() -} - -// SetEnhancedMonitoring sets the EnhancedMonitoring field's value. -func (s *StreamDescription) SetEnhancedMonitoring(v []*EnhancedMetrics) *StreamDescription { - s.EnhancedMonitoring = v - return s -} - -// SetHasMoreShards sets the HasMoreShards field's value. -func (s *StreamDescription) SetHasMoreShards(v bool) *StreamDescription { - s.HasMoreShards = &v - return s -} - -// SetRetentionPeriodHours sets the RetentionPeriodHours field's value. -func (s *StreamDescription) SetRetentionPeriodHours(v int64) *StreamDescription { - s.RetentionPeriodHours = &v - return s -} - -// SetShards sets the Shards field's value. -func (s *StreamDescription) SetShards(v []*Shard) *StreamDescription { - s.Shards = v - return s -} - -// SetStreamARN sets the StreamARN field's value. -func (s *StreamDescription) SetStreamARN(v string) *StreamDescription { - s.StreamARN = &v - return s -} - -// SetStreamCreationTimestamp sets the StreamCreationTimestamp field's value. -func (s *StreamDescription) SetStreamCreationTimestamp(v time.Time) *StreamDescription { - s.StreamCreationTimestamp = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *StreamDescription) SetStreamName(v string) *StreamDescription { - s.StreamName = &v - return s -} - -// SetStreamStatus sets the StreamStatus field's value. -func (s *StreamDescription) SetStreamStatus(v string) *StreamDescription { - s.StreamStatus = &v - return s -} - -// Metadata assigned to the stream, consisting of a key-value pair. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // A unique identifier for the tag. Maximum length: 128 characters. Valid characters: - // Unicode letters, digits, white space, _ . / = + - % @ - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // An optional string, typically used to describe or define the tag. Maximum - // length: 256 characters. Valid characters: Unicode letters, digits, white - // space, _ . / = + - % @ - Value *string `type:"string"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/UpdateShardCountInput -type UpdateShardCountInput struct { - _ struct{} `type:"structure"` - - // The scaling type. Uniform scaling creates shards of equal size. - // - // ScalingType is a required field - ScalingType *string `type:"string" required:"true" enum:"ScalingType"` - - // The name of the stream. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` - - // The new number of shards. - // - // TargetShardCount is a required field - TargetShardCount *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s UpdateShardCountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateShardCountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateShardCountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateShardCountInput"} - if s.ScalingType == nil { - invalidParams.Add(request.NewErrParamRequired("ScalingType")) - } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) - } - if s.TargetShardCount == nil { - invalidParams.Add(request.NewErrParamRequired("TargetShardCount")) - } - if s.TargetShardCount != nil && *s.TargetShardCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("TargetShardCount", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetScalingType sets the ScalingType field's value. -func (s *UpdateShardCountInput) SetScalingType(v string) *UpdateShardCountInput { - s.ScalingType = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *UpdateShardCountInput) SetStreamName(v string) *UpdateShardCountInput { - s.StreamName = &v - return s -} - -// SetTargetShardCount sets the TargetShardCount field's value. -func (s *UpdateShardCountInput) SetTargetShardCount(v int64) *UpdateShardCountInput { - s.TargetShardCount = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/UpdateShardCountOutput -type UpdateShardCountOutput struct { - _ struct{} `type:"structure"` - - // The current number of shards. - CurrentShardCount *int64 `min:"1" type:"integer"` - - // The name of the stream. - StreamName *string `min:"1" type:"string"` - - // The updated number of shards. - TargetShardCount *int64 `min:"1" type:"integer"` -} - -// String returns the string representation -func (s UpdateShardCountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateShardCountOutput) GoString() string { - return s.String() -} - -// SetCurrentShardCount sets the CurrentShardCount field's value. -func (s *UpdateShardCountOutput) SetCurrentShardCount(v int64) *UpdateShardCountOutput { - s.CurrentShardCount = &v - return s -} - -// SetStreamName sets the StreamName field's value. -func (s *UpdateShardCountOutput) SetStreamName(v string) *UpdateShardCountOutput { - s.StreamName = &v - return s -} - -// SetTargetShardCount sets the TargetShardCount field's value. -func (s *UpdateShardCountOutput) SetTargetShardCount(v int64) *UpdateShardCountOutput { - s.TargetShardCount = &v - return s -} - -const ( - // MetricsNameIncomingBytes is a MetricsName enum value - MetricsNameIncomingBytes = "IncomingBytes" - - // MetricsNameIncomingRecords is a MetricsName enum value - MetricsNameIncomingRecords = "IncomingRecords" - - // MetricsNameOutgoingBytes is a MetricsName enum value - MetricsNameOutgoingBytes = "OutgoingBytes" - - // MetricsNameOutgoingRecords is a MetricsName enum value - MetricsNameOutgoingRecords = "OutgoingRecords" - - // MetricsNameWriteProvisionedThroughputExceeded is a MetricsName enum value - MetricsNameWriteProvisionedThroughputExceeded = "WriteProvisionedThroughputExceeded" - - // MetricsNameReadProvisionedThroughputExceeded is a MetricsName enum value - MetricsNameReadProvisionedThroughputExceeded = "ReadProvisionedThroughputExceeded" - - // MetricsNameIteratorAgeMilliseconds is a MetricsName enum value - MetricsNameIteratorAgeMilliseconds = "IteratorAgeMilliseconds" - - // MetricsNameAll is a MetricsName enum value - MetricsNameAll = "ALL" -) - -const ( - // ScalingTypeUniformScaling is a ScalingType enum value - ScalingTypeUniformScaling = "UNIFORM_SCALING" -) - -const ( - // ShardIteratorTypeAtSequenceNumber is a ShardIteratorType enum value - ShardIteratorTypeAtSequenceNumber = "AT_SEQUENCE_NUMBER" - - // ShardIteratorTypeAfterSequenceNumber is a ShardIteratorType enum value - ShardIteratorTypeAfterSequenceNumber = "AFTER_SEQUENCE_NUMBER" - - // ShardIteratorTypeTrimHorizon is a ShardIteratorType enum value - ShardIteratorTypeTrimHorizon = "TRIM_HORIZON" - - // ShardIteratorTypeLatest is a ShardIteratorType enum value - ShardIteratorTypeLatest = "LATEST" - - // ShardIteratorTypeAtTimestamp is a ShardIteratorType enum value - ShardIteratorTypeAtTimestamp = "AT_TIMESTAMP" -) - -const ( - // StreamStatusCreating is a StreamStatus enum value - StreamStatusCreating = "CREATING" - - // StreamStatusDeleting is a StreamStatus enum value - StreamStatusDeleting = "DELETING" - - // StreamStatusActive is a StreamStatus enum value - StreamStatusActive = "ACTIVE" - - // StreamStatusUpdating is a StreamStatus enum value - StreamStatusUpdating = "UPDATING" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go deleted file mode 100644 index 9c9beaf..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kinesis - -const ( - - // ErrCodeExpiredIteratorException for service response error code - // "ExpiredIteratorException". - // - // The provided iterator exceeds the maximum age allowed. - ErrCodeExpiredIteratorException = "ExpiredIteratorException" - - // ErrCodeInvalidArgumentException for service response error code - // "InvalidArgumentException". - // - // A specified parameter exceeds its restrictions, is not supported, or can't - // be used. For more information, see the returned message. - ErrCodeInvalidArgumentException = "InvalidArgumentException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The requested resource exceeds the maximum number allowed, or the number - // of concurrent stream requests exceeds the maximum number allowed (5). - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeProvisionedThroughputExceededException for service response error code - // "ProvisionedThroughputExceededException". - // - // The request rate for the stream is too high, or the requested data is too - // large for the available throughput. Reduce the frequency or size of your - // requests. For more information, see Streams Limits (http://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html) - // in the Amazon Kinesis Streams Developer Guide, and Error Retries and Exponential - // Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) - // in the AWS General Reference. - ErrCodeProvisionedThroughputExceededException = "ProvisionedThroughputExceededException" - - // ErrCodeResourceInUseException for service response error code - // "ResourceInUseException". - // - // The resource is not available for this operation. For successful operation, - // the resource needs to be in the ACTIVE state. - ErrCodeResourceInUseException = "ResourceInUseException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The requested resource could not be found. The stream might not be specified - // correctly. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/examples_test.go deleted file mode 100644 index 9464a36..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/examples_test.go +++ /dev/null @@ -1,460 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kinesis_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/kinesis" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleKinesis_AddTagsToStream() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.AddTagsToStreamInput{ - StreamName: aws.String("StreamName"), // Required - Tags: map[string]*string{ // Required - "Key": aws.String("TagValue"), // Required - // More values... - }, - } - resp, err := svc.AddTagsToStream(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_CreateStream() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.CreateStreamInput{ - ShardCount: aws.Int64(1), // Required - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.CreateStream(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_DecreaseStreamRetentionPeriod() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.DecreaseStreamRetentionPeriodInput{ - RetentionPeriodHours: aws.Int64(1), // Required - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.DecreaseStreamRetentionPeriod(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_DeleteStream() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.DeleteStreamInput{ - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.DeleteStream(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_DescribeLimits() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - var params *kinesis.DescribeLimitsInput - resp, err := svc.DescribeLimits(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_DescribeStream() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.DescribeStreamInput{ - StreamName: aws.String("StreamName"), // Required - ExclusiveStartShardId: aws.String("ShardId"), - Limit: aws.Int64(1), - } - resp, err := svc.DescribeStream(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_DisableEnhancedMonitoring() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.DisableEnhancedMonitoringInput{ - ShardLevelMetrics: []*string{ // Required - aws.String("MetricsName"), // Required - // More values... - }, - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.DisableEnhancedMonitoring(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_EnableEnhancedMonitoring() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.EnableEnhancedMonitoringInput{ - ShardLevelMetrics: []*string{ // Required - aws.String("MetricsName"), // Required - // More values... - }, - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.EnableEnhancedMonitoring(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_GetRecords() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.GetRecordsInput{ - ShardIterator: aws.String("ShardIterator"), // Required - Limit: aws.Int64(1), - } - resp, err := svc.GetRecords(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_GetShardIterator() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.GetShardIteratorInput{ - ShardId: aws.String("ShardId"), // Required - ShardIteratorType: aws.String("ShardIteratorType"), // Required - StreamName: aws.String("StreamName"), // Required - StartingSequenceNumber: aws.String("SequenceNumber"), - Timestamp: aws.Time(time.Now()), - } - resp, err := svc.GetShardIterator(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_IncreaseStreamRetentionPeriod() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.IncreaseStreamRetentionPeriodInput{ - RetentionPeriodHours: aws.Int64(1), // Required - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.IncreaseStreamRetentionPeriod(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_ListStreams() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.ListStreamsInput{ - ExclusiveStartStreamName: aws.String("StreamName"), - Limit: aws.Int64(1), - } - resp, err := svc.ListStreams(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_ListTagsForStream() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.ListTagsForStreamInput{ - StreamName: aws.String("StreamName"), // Required - ExclusiveStartTagKey: aws.String("TagKey"), - Limit: aws.Int64(1), - } - resp, err := svc.ListTagsForStream(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_MergeShards() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.MergeShardsInput{ - AdjacentShardToMerge: aws.String("ShardId"), // Required - ShardToMerge: aws.String("ShardId"), // Required - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.MergeShards(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_PutRecord() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.PutRecordInput{ - Data: []byte("PAYLOAD"), // Required - PartitionKey: aws.String("PartitionKey"), // Required - StreamName: aws.String("StreamName"), // Required - ExplicitHashKey: aws.String("HashKey"), - SequenceNumberForOrdering: aws.String("SequenceNumber"), - } - resp, err := svc.PutRecord(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_PutRecords() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.PutRecordsInput{ - Records: []*kinesis.PutRecordsRequestEntry{ // Required - { // Required - Data: []byte("PAYLOAD"), // Required - PartitionKey: aws.String("PartitionKey"), // Required - ExplicitHashKey: aws.String("HashKey"), - }, - // More values... - }, - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.PutRecords(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_RemoveTagsFromStream() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.RemoveTagsFromStreamInput{ - StreamName: aws.String("StreamName"), // Required - TagKeys: []*string{ // Required - aws.String("TagKey"), // Required - // More values... - }, - } - resp, err := svc.RemoveTagsFromStream(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_SplitShard() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.SplitShardInput{ - NewStartingHashKey: aws.String("HashKey"), // Required - ShardToSplit: aws.String("ShardId"), // Required - StreamName: aws.String("StreamName"), // Required - } - resp, err := svc.SplitShard(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleKinesis_UpdateShardCount() { - sess := session.Must(session.NewSession()) - - svc := kinesis.New(sess) - - params := &kinesis.UpdateShardCountInput{ - ScalingType: aws.String("ScalingType"), // Required - StreamName: aws.String("StreamName"), // Required - TargetShardCount: aws.Int64(1), // Required - } - resp, err := svc.UpdateShardCount(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go deleted file mode 100644 index 212a54c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kinesis - -import ( - "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/private/protocol/jsonrpc" -) - -// Amazon Kinesis Streams is a managed service that scales elastically for real -// time processing of streaming big data. -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02 -type Kinesis struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "kinesis" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Kinesis 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: -// // Create a Kinesis client from just a session. -// svc := kinesis.New(mySession) -// -// // Create a Kinesis client with additional configuration -// svc := kinesis.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Kinesis { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Kinesis { - svc := &Kinesis{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2013-12-02", - JSONVersion: "1.1", - TargetPrefix: "Kinesis_20131202", - }, - handlers, - ), - } - - // 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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Kinesis operation and runs any -// custom request initialization. -func (c *Kinesis) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go deleted file mode 100644 index 14e2ba9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/waiters.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kinesis - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilStreamExists uses the Kinesis API operation -// DescribeStream to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *Kinesis) WaitUntilStreamExists(input *DescribeStreamInput) error { - return c.WaitUntilStreamExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilStreamExistsWithContext is an extended version of WaitUntilStreamExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Kinesis) WaitUntilStreamExistsWithContext(ctx aws.Context, input *DescribeStreamInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilStreamExists", - MaxAttempts: 18, - Delay: request.ConstantWaiterDelay(10 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "StreamDescription.StreamStatus", - Expected: "ACTIVE", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeStreamInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeStreamRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go deleted file mode 100644 index d967d9b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go +++ /dev/null @@ -1,13698 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package route53 provides a client for Amazon Route 53. -package route53 - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -const opAssociateVPCWithHostedZone = "AssociateVPCWithHostedZone" - -// AssociateVPCWithHostedZoneRequest generates a "aws/request.Request" representing the -// client's request for the AssociateVPCWithHostedZone operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AssociateVPCWithHostedZone for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssociateVPCWithHostedZone method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AssociateVPCWithHostedZoneRequest method. -// req, resp := client.AssociateVPCWithHostedZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZone -func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHostedZoneInput) (req *request.Request, output *AssociateVPCWithHostedZoneOutput) { - op := &request.Operation{ - Name: opAssociateVPCWithHostedZone, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/hostedzone/{Id}/associatevpc", - } - - if input == nil { - input = &AssociateVPCWithHostedZoneInput{} - } - - output = &AssociateVPCWithHostedZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateVPCWithHostedZone API operation for Amazon Route 53. -// -// Associates an Amazon VPC with a private hosted zone. -// -// To perform the association, the VPC and the private hosted zone must already -// exist. You can't convert a public hosted zone into a private hosted zone. -// -// Send a POST request to the /2013-04-01/hostedzone/hosted zone ID/associatevpc -// resource. The request body must include a document with an AssociateVPCWithHostedZoneRequest -// element. The response contains a ChangeInfo data type that you can use to -// track the progress of the request. -// -// If you want to associate a VPC that was created by using one AWS account -// with a private hosted zone that was created by using a different account, -// the AWS account that created the private hosted zone must first submit a -// CreateVPCAssociationAuthorization request. Then the account that created -// the VPC must submit an AssociateVPCWithHostedZone request. -// -// 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 Amazon Route 53's -// API operation AssociateVPCWithHostedZone for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeNotAuthorizedException "NotAuthorizedException" -// Associating the specified VPC with the specified hosted zone has not been -// authorized. -// -// * ErrCodeInvalidVPCId "InvalidVPCId" -// The VPC ID that you specified either isn't a valid ID or the current account -// is not authorized to access this VPC. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodePublicZoneVPCAssociation "PublicZoneVPCAssociation" -// You're trying to associate a VPC with a public hosted zone. Amazon Route -// 53 doesn't support associating a VPC with a public hosted zone. -// -// * ErrCodeConflictingDomainExists "ConflictingDomainExists" -// You specified an Amazon VPC that you're already using for another hosted -// zone, and the domain that you specified for one of the hosted zones is a -// subdomain of the domain that you specified for the other hosted zone. For -// example, you can't use the same Amazon VPC for the hosted zones for example.com -// and test.example.com. -// -// * ErrCodeLimitsExceeded "LimitsExceeded" -// The limits specified for a resource have been exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZone -func (c *Route53) AssociateVPCWithHostedZone(input *AssociateVPCWithHostedZoneInput) (*AssociateVPCWithHostedZoneOutput, error) { - req, out := c.AssociateVPCWithHostedZoneRequest(input) - return out, req.Send() -} - -// AssociateVPCWithHostedZoneWithContext is the same as AssociateVPCWithHostedZone with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateVPCWithHostedZone 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 *Route53) AssociateVPCWithHostedZoneWithContext(ctx aws.Context, input *AssociateVPCWithHostedZoneInput, opts ...request.Option) (*AssociateVPCWithHostedZoneOutput, error) { - req, out := c.AssociateVPCWithHostedZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opChangeResourceRecordSets = "ChangeResourceRecordSets" - -// ChangeResourceRecordSetsRequest generates a "aws/request.Request" representing the -// client's request for the ChangeResourceRecordSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ChangeResourceRecordSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ChangeResourceRecordSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ChangeResourceRecordSetsRequest method. -// req, resp := client.ChangeResourceRecordSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSets -func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSetsInput) (req *request.Request, output *ChangeResourceRecordSetsOutput) { - op := &request.Operation{ - Name: opChangeResourceRecordSets, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/hostedzone/{Id}/rrset/", - } - - if input == nil { - input = &ChangeResourceRecordSetsInput{} - } - - output = &ChangeResourceRecordSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ChangeResourceRecordSets API operation for Amazon Route 53. -// -// Create, change, update, or delete authoritative DNS information on all Amazon -// Route 53 servers. Send a POST request to: -// -// /2013-04-01/hostedzone/Amazon Route 53 hosted Zone ID/rrset resource. -// -// Change Batches and Transactional Changes -// -// The request body must include a document with a ChangeResourceRecordSetsRequest -// element. The request body contains a list of change items, known as a change -// batch. Change batches are considered transactional changes. When using the -// Amazon Route 53 API to change resource record sets, Amazon Route 53 either -// makes all or none of the changes in a change batch request. This ensures -// that Amazon Route 53 never partially implements the intended changes to the -// resource record sets in a hosted zone. -// -// For example, a change batch request that deletes the CNAME record for www.example.com -// and creates an alias resource record set for www.example.com. Amazon Route -// 53 deletes the first resource record set and creates the second resource -// record set in a single operation. If either the DELETE or the CREATE action -// fails, then both changes (plus any other changes in the batch) fail, and -// the original CNAME record continues to exist. -// -// Due to the nature of transactional changes, you can't delete the same resource -// record set more than once in a single change batch. If you attempt to delete -// the same change batch more than once, Amazon Route 53 returns an InvalidChangeBatch -// error. -// -// Traffic Flow -// -// To create resource record sets for complex routing configurations, use either -// the traffic flow visual editor in the Amazon Route 53 console or the API -// actions for traffic policies and traffic policy instances. Save the configuration -// as a traffic policy, then associate the traffic policy with one or more domain -// names (such as example.com) or subdomain names (such as www.example.com), -// in the same hosted zone or in multiple hosted zones. You can roll back the -// updates if the new configuration isn't performing as expected. For more information, -// see Using Traffic Flow to Route DNS Traffic (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/traffic-flow.html) -// in the Amazon Route 53 Developer Guide. -// -// Create, Delete, and Upsert -// -// Use ChangeResourceRecordsSetsRequest to perform the following actions: -// -// * CREATE: Creates a resource record set that has the specified values. -// -// * DELETE: Deletes an existing resource record set that has the specified -// values. -// -// * UPSERT: If a resource record set does not already exist, AWS creates -// it. If a resource set does exist, Amazon Route 53 updates it with the -// values in the request. -// -// Syntaxes for Creating, Updating, and Deleting Resource Record Sets -// -// The syntax for a request depends on the type of resource record set that -// you want to create, delete, or update, such as weighted, alias, or failover. -// The XML elements in your request must appear in the order listed in the syntax. -// -// For an example for each type of resource record set, see "Examples." -// -// Don't refer to the syntax in the "Parameter Syntax" section, which includes -// all of the elements for every kind of resource record set that you can create, -// delete, or update by using ChangeResourceRecordSets. -// -// Change Propagation to Amazon Route 53 DNS Servers -// -// When you submit a ChangeResourceRecordSets request, Amazon Route 53 propagates -// your changes to all of the Amazon Route 53 authoritative DNS servers. While -// your changes are propagating, GetChange returns a status of PENDING. When -// propagation is complete, GetChange returns a status of INSYNC. Changes generally -// propagate to all Amazon Route 53 name servers in a few minutes. In rare circumstances, -// propagation can take up to 30 minutes. For more information, see GetChange. -// -// Limits on ChangeResourceRecordSets Requests -// -// For information about the limits on a ChangeResourceRecordSets request, see -// Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) -// in the Amazon Route 53 Developer Guide. -// -// 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 Amazon Route 53's -// API operation ChangeResourceRecordSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeInvalidChangeBatch "InvalidChangeBatch" -// This exception contains a list of messages that might contain one or more -// error messages. Each error message indicates one error in the change batch. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" -// If Amazon Route 53 can't process a request before the next request arrives, -// it will reject subsequent requests for the same hosted zone and return an -// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly -// for the same request, we recommend that you wait, in intervals of increasing -// duration, before you try the request again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSets -func (c *Route53) ChangeResourceRecordSets(input *ChangeResourceRecordSetsInput) (*ChangeResourceRecordSetsOutput, error) { - req, out := c.ChangeResourceRecordSetsRequest(input) - return out, req.Send() -} - -// ChangeResourceRecordSetsWithContext is the same as ChangeResourceRecordSets with the addition of -// the ability to pass a context and additional request options. -// -// See ChangeResourceRecordSets 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 *Route53) ChangeResourceRecordSetsWithContext(ctx aws.Context, input *ChangeResourceRecordSetsInput, opts ...request.Option) (*ChangeResourceRecordSetsOutput, error) { - req, out := c.ChangeResourceRecordSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opChangeTagsForResource = "ChangeTagsForResource" - -// ChangeTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ChangeTagsForResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ChangeTagsForResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ChangeTagsForResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ChangeTagsForResourceRequest method. -// req, resp := client.ChangeTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResource -func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput) (req *request.Request, output *ChangeTagsForResourceOutput) { - op := &request.Operation{ - Name: opChangeTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/tags/{ResourceType}/{ResourceId}", - } - - if input == nil { - input = &ChangeTagsForResourceInput{} - } - - output = &ChangeTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ChangeTagsForResource API operation for Amazon Route 53. -// -// Adds, edits, or deletes tags for a health check or a hosted zone. -// -// For information about using tags for cost allocation, see Using Cost Allocation -// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management User Guide. -// -// 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 Amazon Route 53's -// API operation ChangeTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" -// If Amazon Route 53 can't process a request before the next request arrives, -// it will reject subsequent requests for the same hosted zone and return an -// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly -// for the same request, we recommend that you wait, in intervals of increasing -// duration, before you try the request again. -// -// * ErrCodeThrottlingException "ThrottlingException" -// The limit on the number of requests per second was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResource -func (c *Route53) ChangeTagsForResource(input *ChangeTagsForResourceInput) (*ChangeTagsForResourceOutput, error) { - req, out := c.ChangeTagsForResourceRequest(input) - return out, req.Send() -} - -// ChangeTagsForResourceWithContext is the same as ChangeTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ChangeTagsForResource 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 *Route53) ChangeTagsForResourceWithContext(ctx aws.Context, input *ChangeTagsForResourceInput, opts ...request.Option) (*ChangeTagsForResourceOutput, error) { - req, out := c.ChangeTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateHealthCheck = "CreateHealthCheck" - -// CreateHealthCheckRequest generates a "aws/request.Request" representing the -// client's request for the CreateHealthCheck operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateHealthCheck for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateHealthCheck method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateHealthCheckRequest method. -// req, resp := client.CreateHealthCheckRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHealthCheck -func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) (req *request.Request, output *CreateHealthCheckOutput) { - op := &request.Operation{ - Name: opCreateHealthCheck, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/healthcheck", - } - - if input == nil { - input = &CreateHealthCheckInput{} - } - - output = &CreateHealthCheckOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateHealthCheck API operation for Amazon Route 53. -// -// Creates a new health check. -// -// To create a new health check, send a POST request to the /2013-04-01/healthcheck -// resource. The request body must include a document with a CreateHealthCheckRequest -// element. The response returns the CreateHealthCheckResponse element, containing -// the health check ID specified when adding health check to a resource record -// set. For information about adding health checks to resource record sets, -// see ResourceRecordSet$HealthCheckId in ChangeResourceRecordSets. -// -// If you're registering EC2 instances with an Elastic Load Balancing (ELB) -// load balancer, do not create Amazon Route 53 health checks for the EC2 instances. -// When you register an EC2 instance with a load balancer, you configure settings -// for an ELB health check, which performs a similar function to an Amazon Route -// 53 health check. -// -// You can associate health checks with failover resource record sets in a private -// hosted zone. Note the following: -// -// * Amazon Route 53 health checkers are outside the VPC. To check the health -// of an endpoint within a VPC by IP address, you must assign a public IP -// address to the instance in the VPC. -// -// * You can configure a health checker to check the health of an external -// resource that the instance relies on, such as a database server. -// -// * You can create a CloudWatch metric, associate an alarm with the metric, -// and then create a health check that is based on the state of the alarm. -// For example, you might create a CloudWatch metric that checks the status -// of the Amazon EC2 StatusCheckFailed metric, add an alarm to the metric, -// and then create a health check that is based on the state of the alarm. -// For information about creating CloudWatch metrics and alarms by using -// the CloudWatch console, see the Amazon CloudWatch User Guide (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/WhatIsCloudWatch.html). -// -// 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 Amazon Route 53's -// API operation CreateHealthCheck for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyHealthChecks "TooManyHealthChecks" -// You have reached the maximum number of active health checks for an AWS account. -// The default limit is 100. To request a higher limit, create a case (http://aws.amazon.com/route53-request) -// with the AWS Support Center. -// -// * ErrCodeHealthCheckAlreadyExists "HealthCheckAlreadyExists" -// The health check you're attempting to create already exists. Amazon Route -// 53 returns this error when a health check has already been created with the -// specified value for CallerReference. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHealthCheck -func (c *Route53) CreateHealthCheck(input *CreateHealthCheckInput) (*CreateHealthCheckOutput, error) { - req, out := c.CreateHealthCheckRequest(input) - return out, req.Send() -} - -// CreateHealthCheckWithContext is the same as CreateHealthCheck with the addition of -// the ability to pass a context and additional request options. -// -// See CreateHealthCheck 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 *Route53) CreateHealthCheckWithContext(ctx aws.Context, input *CreateHealthCheckInput, opts ...request.Option) (*CreateHealthCheckOutput, error) { - req, out := c.CreateHealthCheckRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateHostedZone = "CreateHostedZone" - -// CreateHostedZoneRequest generates a "aws/request.Request" representing the -// client's request for the CreateHostedZone operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateHostedZone for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateHostedZone method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateHostedZoneRequest method. -// req, resp := client.CreateHostedZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHostedZone -func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *request.Request, output *CreateHostedZoneOutput) { - op := &request.Operation{ - Name: opCreateHostedZone, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/hostedzone", - } - - if input == nil { - input = &CreateHostedZoneInput{} - } - - output = &CreateHostedZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateHostedZone API operation for Amazon Route 53. -// -// Creates a new public hosted zone, used to specify how the Domain Name System -// (DNS) routes traffic on the Internet for a domain, such as example.com, and -// its subdomains. -// -// Public hosted zones can't be converted to a private hosted zone or vice versa. -// Instead, create a new hosted zone with the same name and create new resource -// record sets. -// -// Send a POST request to the /2013-04-01/hostedzone resource. The request body -// must include a document with a CreateHostedZoneRequest element. The response -// returns the CreateHostedZoneResponse element containing metadata about the -// hosted zone. -// -// Fore more information about charges for hosted zones, see Amazon Route 53 -// Pricing (http://aws.amazon.com/route53/pricing/). -// -// Note the following: -// -// * You can't create a hosted zone for a top-level domain (TLD). -// -// * Amazon Route 53 automatically creates a default SOA record and four -// NS records for the zone. For more information about SOA and NS records, -// see NS and SOA Records that Amazon Route 53 Creates for a Hosted Zone -// (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/SOA-NSrecords.html) -// in the Amazon Route 53 Developer Guide. -// -// * If your domain is registered with a registrar other than Amazon Route -// 53, you must update the name servers with your registrar to make Amazon -// Route 53 your DNS service. For more information, see Configuring Amazon -// Route 53 as your DNS Service (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/creating-migrating.html) -// in the Amazon Route 53 Developer's Guide. -// -// After creating a zone, its initial status is PENDING. This means that it -// is not yet available on all DNS servers. The status of the zone changes to -// INSYNC when the NS and SOA records are available on all Amazon Route 53 DNS -// servers. -// -// When trying to create a hosted zone using a reusable delegation set, specify -// an optional DelegationSetId, and Amazon Route 53 would assign those 4 NS -// records for the zone, instead of allotting a new one. -// -// 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 Amazon Route 53's -// API operation CreateHostedZone for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidDomainName "InvalidDomainName" -// The specified domain name is not valid. -// -// * ErrCodeHostedZoneAlreadyExists "HostedZoneAlreadyExists" -// The hosted zone you're trying to create already exists. Amazon Route 53 returns -// this error when a hosted zone has already been created with the specified -// CallerReference. -// -// * ErrCodeTooManyHostedZones "TooManyHostedZones" -// This hosted zone can't be created because the hosted zone limit is exceeded. -// To request a limit increase, go to the Amazon Route 53 Contact Us (http://aws.amazon.com/route53-request/) -// page. -// -// * ErrCodeInvalidVPCId "InvalidVPCId" -// The VPC ID that you specified either isn't a valid ID or the current account -// is not authorized to access this VPC. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeDelegationSetNotAvailable "DelegationSetNotAvailable" -// You can create a hosted zone that has the same name as an existing hosted -// zone (example.com is common), but there is a limit to the number of hosted -// zones that have the same name. If you get this error, Amazon Route 53 has -// reached that limit. If you own the domain name and Amazon Route 53 generates -// this error, contact Customer Support. -// -// * ErrCodeConflictingDomainExists "ConflictingDomainExists" -// You specified an Amazon VPC that you're already using for another hosted -// zone, and the domain that you specified for one of the hosted zones is a -// subdomain of the domain that you specified for the other hosted zone. For -// example, you can't use the same Amazon VPC for the hosted zones for example.com -// and test.example.com. -// -// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" -// A reusable delegation set with the specified ID does not exist. -// -// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" -// A reusable delegation set with the specified ID does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHostedZone -func (c *Route53) CreateHostedZone(input *CreateHostedZoneInput) (*CreateHostedZoneOutput, error) { - req, out := c.CreateHostedZoneRequest(input) - return out, req.Send() -} - -// CreateHostedZoneWithContext is the same as CreateHostedZone with the addition of -// the ability to pass a context and additional request options. -// -// See CreateHostedZone 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 *Route53) CreateHostedZoneWithContext(ctx aws.Context, input *CreateHostedZoneInput, opts ...request.Option) (*CreateHostedZoneOutput, error) { - req, out := c.CreateHostedZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateReusableDelegationSet = "CreateReusableDelegationSet" - -// CreateReusableDelegationSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateReusableDelegationSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateReusableDelegationSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateReusableDelegationSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateReusableDelegationSetRequest method. -// req, resp := client.CreateReusableDelegationSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateReusableDelegationSet -func (c *Route53) CreateReusableDelegationSetRequest(input *CreateReusableDelegationSetInput) (req *request.Request, output *CreateReusableDelegationSetOutput) { - op := &request.Operation{ - Name: opCreateReusableDelegationSet, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/delegationset", - } - - if input == nil { - input = &CreateReusableDelegationSetInput{} - } - - output = &CreateReusableDelegationSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateReusableDelegationSet API operation for Amazon Route 53. -// -// Creates a delegation set (a group of four name servers) that can be reused -// by multiple hosted zones. If a hosted zoned ID is specified, CreateReusableDelegationSet -// marks the delegation set associated with that zone as reusable -// -// Send a POST request to the /2013-04-01/delegationset resource. The request -// body must include a document with a CreateReusableDelegationSetRequest element. -// -// A reusable delegation set can't be associated with a private hosted zone/ -// -// For more information, including a procedure on how to create and configure -// a reusable delegation set (also known as white label name servers), see Configuring -// White Label Name Servers (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/white-label-name-servers.html). -// -// 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 Amazon Route 53's -// API operation CreateReusableDelegationSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeDelegationSetAlreadyCreated "DelegationSetAlreadyCreated" -// A delegation set with the same owner and caller reference combination has -// already been created. -// -// * ErrCodeLimitsExceeded "LimitsExceeded" -// The limits specified for a resource have been exceeded. -// -// * ErrCodeHostedZoneNotFound "HostedZoneNotFound" -// The specified HostedZone can't be found. -// -// * ErrCodeInvalidArgument "InvalidArgument" -// Parameter name is invalid. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeDelegationSetNotAvailable "DelegationSetNotAvailable" -// You can create a hosted zone that has the same name as an existing hosted -// zone (example.com is common), but there is a limit to the number of hosted -// zones that have the same name. If you get this error, Amazon Route 53 has -// reached that limit. If you own the domain name and Amazon Route 53 generates -// this error, contact Customer Support. -// -// * ErrCodeDelegationSetAlreadyReusable "DelegationSetAlreadyReusable" -// The specified delegation set has already been marked as reusable. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateReusableDelegationSet -func (c *Route53) CreateReusableDelegationSet(input *CreateReusableDelegationSetInput) (*CreateReusableDelegationSetOutput, error) { - req, out := c.CreateReusableDelegationSetRequest(input) - return out, req.Send() -} - -// CreateReusableDelegationSetWithContext is the same as CreateReusableDelegationSet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateReusableDelegationSet 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 *Route53) CreateReusableDelegationSetWithContext(ctx aws.Context, input *CreateReusableDelegationSetInput, opts ...request.Option) (*CreateReusableDelegationSetOutput, error) { - req, out := c.CreateReusableDelegationSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTrafficPolicy = "CreateTrafficPolicy" - -// CreateTrafficPolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreateTrafficPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTrafficPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTrafficPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTrafficPolicyRequest method. -// req, resp := client.CreateTrafficPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicy -func (c *Route53) CreateTrafficPolicyRequest(input *CreateTrafficPolicyInput) (req *request.Request, output *CreateTrafficPolicyOutput) { - op := &request.Operation{ - Name: opCreateTrafficPolicy, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/trafficpolicy", - } - - if input == nil { - input = &CreateTrafficPolicyInput{} - } - - output = &CreateTrafficPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTrafficPolicy API operation for Amazon Route 53. -// -// Creates a traffic policy, which you use to create multiple DNS resource record -// sets for one domain name (such as example.com) or one subdomain name (such -// as www.example.com). -// -// Send a POST request to the /2013-04-01/trafficpolicy resource. The request -// body must include a document with a CreateTrafficPolicyRequest element. The -// response includes the CreateTrafficPolicyResponse element, which contains -// information about the new traffic policy. -// -// 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 Amazon Route 53's -// API operation CreateTrafficPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeTooManyTrafficPolicies "TooManyTrafficPolicies" -// You've created the maximum number of traffic policies that can be created -// for the current AWS account. You can request an increase to the limit on -// the Contact Us (http://aws.amazon.com/route53-request/) page. -// -// * ErrCodeTrafficPolicyAlreadyExists "TrafficPolicyAlreadyExists" -// A traffic policy that has the same value for Name already exists. -// -// * ErrCodeInvalidTrafficPolicyDocument "InvalidTrafficPolicyDocument" -// The format of the traffic policy document that you specified in the Document -// element is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicy -func (c *Route53) CreateTrafficPolicy(input *CreateTrafficPolicyInput) (*CreateTrafficPolicyOutput, error) { - req, out := c.CreateTrafficPolicyRequest(input) - return out, req.Send() -} - -// CreateTrafficPolicyWithContext is the same as CreateTrafficPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTrafficPolicy 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 *Route53) CreateTrafficPolicyWithContext(ctx aws.Context, input *CreateTrafficPolicyInput, opts ...request.Option) (*CreateTrafficPolicyOutput, error) { - req, out := c.CreateTrafficPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTrafficPolicyInstance = "CreateTrafficPolicyInstance" - -// CreateTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the -// client's request for the CreateTrafficPolicyInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTrafficPolicyInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTrafficPolicyInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTrafficPolicyInstanceRequest method. -// req, resp := client.CreateTrafficPolicyInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyInstance -func (c *Route53) CreateTrafficPolicyInstanceRequest(input *CreateTrafficPolicyInstanceInput) (req *request.Request, output *CreateTrafficPolicyInstanceOutput) { - op := &request.Operation{ - Name: opCreateTrafficPolicyInstance, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/trafficpolicyinstance", - } - - if input == nil { - input = &CreateTrafficPolicyInstanceInput{} - } - - output = &CreateTrafficPolicyInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTrafficPolicyInstance API operation for Amazon Route 53. -// -// Creates resource record sets in a specified hosted zone based on the settings -// in a specified traffic policy version. In addition, CreateTrafficPolicyInstance -// associates the resource record sets with a specified domain name (such as -// example.com) or subdomain name (such as www.example.com). Amazon Route 53 -// responds to DNS queries for the domain or subdomain name by using the resource -// record sets that CreateTrafficPolicyInstance created. -// -// Send a POST request to the /2013-04-01/trafficpolicyinstance resource. The -// request body must include a document with a CreateTrafficPolicyRequest element. -// The response returns the CreateTrafficPolicyInstanceResponse element, which -// contains information about the traffic policy instance. -// -// 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 Amazon Route 53's -// API operation CreateTrafficPolicyInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeTooManyTrafficPolicyInstances "TooManyTrafficPolicyInstances" -// You've created the maximum number of traffic policy instances that can be -// created for the current AWS account. You can request an increase to the limit -// on the Contact Us (http://aws.amazon.com/route53-request/) page. -// -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// * ErrCodeTrafficPolicyInstanceAlreadyExists "TrafficPolicyInstanceAlreadyExists" -// Traffic policy instance with given Id already exists. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyInstance -func (c *Route53) CreateTrafficPolicyInstance(input *CreateTrafficPolicyInstanceInput) (*CreateTrafficPolicyInstanceOutput, error) { - req, out := c.CreateTrafficPolicyInstanceRequest(input) - return out, req.Send() -} - -// CreateTrafficPolicyInstanceWithContext is the same as CreateTrafficPolicyInstance with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTrafficPolicyInstance 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 *Route53) CreateTrafficPolicyInstanceWithContext(ctx aws.Context, input *CreateTrafficPolicyInstanceInput, opts ...request.Option) (*CreateTrafficPolicyInstanceOutput, error) { - req, out := c.CreateTrafficPolicyInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTrafficPolicyVersion = "CreateTrafficPolicyVersion" - -// CreateTrafficPolicyVersionRequest generates a "aws/request.Request" representing the -// client's request for the CreateTrafficPolicyVersion operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateTrafficPolicyVersion for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateTrafficPolicyVersion method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateTrafficPolicyVersionRequest method. -// req, resp := client.CreateTrafficPolicyVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyVersion -func (c *Route53) CreateTrafficPolicyVersionRequest(input *CreateTrafficPolicyVersionInput) (req *request.Request, output *CreateTrafficPolicyVersionOutput) { - op := &request.Operation{ - Name: opCreateTrafficPolicyVersion, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/trafficpolicy/{Id}", - } - - if input == nil { - input = &CreateTrafficPolicyVersionInput{} - } - - output = &CreateTrafficPolicyVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTrafficPolicyVersion API operation for Amazon Route 53. -// -// Creates a new version of an existing traffic policy. When you create a new -// version of a traffic policy, you specify the ID of the traffic policy that -// you want to update and a JSON-formatted document that describes the new version. -// You use traffic policies to create multiple DNS resource record sets for -// one domain name (such as example.com) or one subdomain name (such as www.example.com). -// You can create a maximum of 1000 versions of a traffic policy. If you reach -// the limit and need to create another version, you'll need to start a new -// traffic policy. -// -// Send a POST request to the /2013-04-01/trafficpolicy/ resource. The request -// body includes a document with a CreateTrafficPolicyVersionRequest element. -// The response returns the CreateTrafficPolicyVersionResponse element, which -// contains information about the new version of the traffic policy. -// -// 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 Amazon Route 53's -// API operation CreateTrafficPolicyVersion for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeConcurrentModification "ConcurrentModification" -// Another user submitted a request to update the object at the same time that -// you did. Retry the request. -// -// * ErrCodeInvalidTrafficPolicyDocument "InvalidTrafficPolicyDocument" -// The format of the traffic policy document that you specified in the Document -// element is invalid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyVersion -func (c *Route53) CreateTrafficPolicyVersion(input *CreateTrafficPolicyVersionInput) (*CreateTrafficPolicyVersionOutput, error) { - req, out := c.CreateTrafficPolicyVersionRequest(input) - return out, req.Send() -} - -// CreateTrafficPolicyVersionWithContext is the same as CreateTrafficPolicyVersion with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTrafficPolicyVersion 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 *Route53) CreateTrafficPolicyVersionWithContext(ctx aws.Context, input *CreateTrafficPolicyVersionInput, opts ...request.Option) (*CreateTrafficPolicyVersionOutput, error) { - req, out := c.CreateTrafficPolicyVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVPCAssociationAuthorization = "CreateVPCAssociationAuthorization" - -// CreateVPCAssociationAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the CreateVPCAssociationAuthorization operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateVPCAssociationAuthorization for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateVPCAssociationAuthorization method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateVPCAssociationAuthorizationRequest method. -// req, resp := client.CreateVPCAssociationAuthorizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateVPCAssociationAuthorization -func (c *Route53) CreateVPCAssociationAuthorizationRequest(input *CreateVPCAssociationAuthorizationInput) (req *request.Request, output *CreateVPCAssociationAuthorizationOutput) { - op := &request.Operation{ - Name: opCreateVPCAssociationAuthorization, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/hostedzone/{Id}/authorizevpcassociation", - } - - if input == nil { - input = &CreateVPCAssociationAuthorizationInput{} - } - - output = &CreateVPCAssociationAuthorizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVPCAssociationAuthorization API operation for Amazon Route 53. -// -// Authorizes the AWS account that created a specified VPC to submit an AssociateVPCWithHostedZone -// request to associate the VPC with a specified hosted zone that was created -// by a different account. To submit a CreateVPCAssociationAuthorization request, -// you must use the account that created the hosted zone. After you authorize -// the association, use the account that created the VPC to submit an AssociateVPCWithHostedZone -// request. -// -// If you want to associate multiple VPCs that you created by using one account -// with a hosted zone that you created by using a different account, you must -// submit one authorization request for each VPC. -// -// Send a POST request to the /2013-04-01/hostedzone/hosted zone ID/authorizevpcassociation -// resource. The request body must include a document with a CreateVPCAssociationAuthorizationRequest -// element. The response contains information about the authorization. -// -// 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 Amazon Route 53's -// API operation CreateVPCAssociationAuthorization for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConcurrentModification "ConcurrentModification" -// Another user submitted a request to update the object at the same time that -// you did. Retry the request. -// -// * ErrCodeTooManyVPCAssociationAuthorizations "TooManyVPCAssociationAuthorizations" -// You've created the maximum number of authorizations that can be created for -// the specified hosted zone. To authorize another VPC to be associated with -// the hosted zone, submit a DeleteVPCAssociationAuthorization request to remove -// an existing authorization. To get a list of existing authorizations, submit -// a ListVPCAssociationAuthorizations request. -// -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidVPCId "InvalidVPCId" -// The VPC ID that you specified either isn't a valid ID or the current account -// is not authorized to access this VPC. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateVPCAssociationAuthorization -func (c *Route53) CreateVPCAssociationAuthorization(input *CreateVPCAssociationAuthorizationInput) (*CreateVPCAssociationAuthorizationOutput, error) { - req, out := c.CreateVPCAssociationAuthorizationRequest(input) - return out, req.Send() -} - -// CreateVPCAssociationAuthorizationWithContext is the same as CreateVPCAssociationAuthorization with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVPCAssociationAuthorization 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 *Route53) CreateVPCAssociationAuthorizationWithContext(ctx aws.Context, input *CreateVPCAssociationAuthorizationInput, opts ...request.Option) (*CreateVPCAssociationAuthorizationOutput, error) { - req, out := c.CreateVPCAssociationAuthorizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteHealthCheck = "DeleteHealthCheck" - -// DeleteHealthCheckRequest generates a "aws/request.Request" representing the -// client's request for the DeleteHealthCheck operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteHealthCheck for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteHealthCheck method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteHealthCheckRequest method. -// req, resp := client.DeleteHealthCheckRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHealthCheck -func (c *Route53) DeleteHealthCheckRequest(input *DeleteHealthCheckInput) (req *request.Request, output *DeleteHealthCheckOutput) { - op := &request.Operation{ - Name: opDeleteHealthCheck, - HTTPMethod: "DELETE", - HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}", - } - - if input == nil { - input = &DeleteHealthCheckInput{} - } - - output = &DeleteHealthCheckOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteHealthCheck API operation for Amazon Route 53. -// -// Deletes a health check. Send a DELETE request to the /2013-04-01/healthcheck/health -// check ID resource. -// -// Amazon Route 53 does not prevent you from deleting a health check even if -// the health check is associated with one or more resource record sets. If -// you delete a health check and you don't update the associated resource record -// sets, the future status of the health check can't be predicted and may change. -// This will affect the routing of DNS queries for your DNS failover configuration. -// For more information, see Replacing and Deleting Health Checks (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-creating-deleting.html#health-checks-deleting.html) -// in the Amazon Route 53 Developer Guide. -// -// 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 Amazon Route 53's -// API operation DeleteHealthCheck for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeHealthCheckInUse "HealthCheckInUse" -// The health check ID for this health check is referenced in the HealthCheckId -// element in one of the resource record sets in one of the hosted zones that -// are owned by the current AWS account. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHealthCheck -func (c *Route53) DeleteHealthCheck(input *DeleteHealthCheckInput) (*DeleteHealthCheckOutput, error) { - req, out := c.DeleteHealthCheckRequest(input) - return out, req.Send() -} - -// DeleteHealthCheckWithContext is the same as DeleteHealthCheck with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteHealthCheck 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 *Route53) DeleteHealthCheckWithContext(ctx aws.Context, input *DeleteHealthCheckInput, opts ...request.Option) (*DeleteHealthCheckOutput, error) { - req, out := c.DeleteHealthCheckRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteHostedZone = "DeleteHostedZone" - -// DeleteHostedZoneRequest generates a "aws/request.Request" representing the -// client's request for the DeleteHostedZone operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteHostedZone for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteHostedZone method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteHostedZoneRequest method. -// req, resp := client.DeleteHostedZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHostedZone -func (c *Route53) DeleteHostedZoneRequest(input *DeleteHostedZoneInput) (req *request.Request, output *DeleteHostedZoneOutput) { - op := &request.Operation{ - Name: opDeleteHostedZone, - HTTPMethod: "DELETE", - HTTPPath: "/2013-04-01/hostedzone/{Id}", - } - - if input == nil { - input = &DeleteHostedZoneInput{} - } - - output = &DeleteHostedZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteHostedZone API operation for Amazon Route 53. -// -// Deletes a hosted zone. Send a DELETE request to the /Amazon Route 53 API -// version/hostedzone/hosted zone ID resource. -// -// Delete a hosted zone only if there are no resource record sets other than -// the default SOA record and NS resource record sets. If the hosted zone contains -// other resource record sets, delete them before deleting the hosted zone. -// If you try to delete a hosted zone that contains other resource record sets, -// Amazon Route 53 denies your request with a HostedZoneNotEmpty error. For -// information about deleting records from your hosted zone, see ChangeResourceRecordSets. -// -// 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 Amazon Route 53's -// API operation DeleteHostedZone for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeHostedZoneNotEmpty "HostedZoneNotEmpty" -// The hosted zone contains resource records that are not SOA or NS records. -// -// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" -// If Amazon Route 53 can't process a request before the next request arrives, -// it will reject subsequent requests for the same hosted zone and return an -// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly -// for the same request, we recommend that you wait, in intervals of increasing -// duration, before you try the request again. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeInvalidDomainName "InvalidDomainName" -// The specified domain name is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHostedZone -func (c *Route53) DeleteHostedZone(input *DeleteHostedZoneInput) (*DeleteHostedZoneOutput, error) { - req, out := c.DeleteHostedZoneRequest(input) - return out, req.Send() -} - -// DeleteHostedZoneWithContext is the same as DeleteHostedZone with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteHostedZone 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 *Route53) DeleteHostedZoneWithContext(ctx aws.Context, input *DeleteHostedZoneInput, opts ...request.Option) (*DeleteHostedZoneOutput, error) { - req, out := c.DeleteHostedZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteReusableDelegationSet = "DeleteReusableDelegationSet" - -// DeleteReusableDelegationSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReusableDelegationSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteReusableDelegationSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteReusableDelegationSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteReusableDelegationSetRequest method. -// req, resp := client.DeleteReusableDelegationSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteReusableDelegationSet -func (c *Route53) DeleteReusableDelegationSetRequest(input *DeleteReusableDelegationSetInput) (req *request.Request, output *DeleteReusableDelegationSetOutput) { - op := &request.Operation{ - Name: opDeleteReusableDelegationSet, - HTTPMethod: "DELETE", - HTTPPath: "/2013-04-01/delegationset/{Id}", - } - - if input == nil { - input = &DeleteReusableDelegationSetInput{} - } - - output = &DeleteReusableDelegationSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteReusableDelegationSet API operation for Amazon Route 53. -// -// Deletes a reusable delegation set. Send a DELETE request to the /2013-04-01/delegationset/delegation -// set ID resource. -// -// You can delete a reusable delegation set only if there are no associated -// hosted zones. -// -// To verify that the reusable delegation set is not associated with any hosted -// zones, run the GetReusableDelegationSet action and specify the ID of the -// reusable delegation set that you want to delete. -// -// 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 Amazon Route 53's -// API operation DeleteReusableDelegationSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" -// A reusable delegation set with the specified ID does not exist. -// -// * ErrCodeDelegationSetInUse "DelegationSetInUse" -// The specified delegation contains associated hosted zones which must be deleted -// before the reusable delegation set can be deleted. -// -// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" -// A reusable delegation set with the specified ID does not exist. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteReusableDelegationSet -func (c *Route53) DeleteReusableDelegationSet(input *DeleteReusableDelegationSetInput) (*DeleteReusableDelegationSetOutput, error) { - req, out := c.DeleteReusableDelegationSetRequest(input) - return out, req.Send() -} - -// DeleteReusableDelegationSetWithContext is the same as DeleteReusableDelegationSet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteReusableDelegationSet 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 *Route53) DeleteReusableDelegationSetWithContext(ctx aws.Context, input *DeleteReusableDelegationSetInput, opts ...request.Option) (*DeleteReusableDelegationSetOutput, error) { - req, out := c.DeleteReusableDelegationSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTrafficPolicy = "DeleteTrafficPolicy" - -// DeleteTrafficPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTrafficPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTrafficPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTrafficPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTrafficPolicyRequest method. -// req, resp := client.DeleteTrafficPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicy -func (c *Route53) DeleteTrafficPolicyRequest(input *DeleteTrafficPolicyInput) (req *request.Request, output *DeleteTrafficPolicyOutput) { - op := &request.Operation{ - Name: opDeleteTrafficPolicy, - HTTPMethod: "DELETE", - HTTPPath: "/2013-04-01/trafficpolicy/{Id}/{Version}", - } - - if input == nil { - input = &DeleteTrafficPolicyInput{} - } - - output = &DeleteTrafficPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTrafficPolicy API operation for Amazon Route 53. -// -// Deletes a traffic policy. -// -// Send a DELETE request to the /Amazon Route 53 API version/trafficpolicy resource. -// -// 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 Amazon Route 53's -// API operation DeleteTrafficPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeTrafficPolicyInUse "TrafficPolicyInUse" -// One or more traffic policy instances were created by using the specified -// traffic policy. -// -// * ErrCodeConcurrentModification "ConcurrentModification" -// Another user submitted a request to update the object at the same time that -// you did. Retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicy -func (c *Route53) DeleteTrafficPolicy(input *DeleteTrafficPolicyInput) (*DeleteTrafficPolicyOutput, error) { - req, out := c.DeleteTrafficPolicyRequest(input) - return out, req.Send() -} - -// DeleteTrafficPolicyWithContext is the same as DeleteTrafficPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTrafficPolicy 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 *Route53) DeleteTrafficPolicyWithContext(ctx aws.Context, input *DeleteTrafficPolicyInput, opts ...request.Option) (*DeleteTrafficPolicyOutput, error) { - req, out := c.DeleteTrafficPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTrafficPolicyInstance = "DeleteTrafficPolicyInstance" - -// DeleteTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTrafficPolicyInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteTrafficPolicyInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteTrafficPolicyInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteTrafficPolicyInstanceRequest method. -// req, resp := client.DeleteTrafficPolicyInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstance -func (c *Route53) DeleteTrafficPolicyInstanceRequest(input *DeleteTrafficPolicyInstanceInput) (req *request.Request, output *DeleteTrafficPolicyInstanceOutput) { - op := &request.Operation{ - Name: opDeleteTrafficPolicyInstance, - HTTPMethod: "DELETE", - HTTPPath: "/2013-04-01/trafficpolicyinstance/{Id}", - } - - if input == nil { - input = &DeleteTrafficPolicyInstanceInput{} - } - - output = &DeleteTrafficPolicyInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTrafficPolicyInstance API operation for Amazon Route 53. -// -// Deletes a traffic policy instance and all of the resource record sets that -// Amazon Route 53 created when you created the instance. -// -// Send a DELETE request to the /Amazon Route 53 API version/trafficpolicy/traffic -// policy instance ID resource. -// -// In the Amazon Route 53 console, traffic policy instances are known as policy -// records. -// -// 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 Amazon Route 53's -// API operation DeleteTrafficPolicyInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" -// No traffic policy instance exists with the specified ID. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" -// If Amazon Route 53 can't process a request before the next request arrives, -// it will reject subsequent requests for the same hosted zone and return an -// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly -// for the same request, we recommend that you wait, in intervals of increasing -// duration, before you try the request again. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstance -func (c *Route53) DeleteTrafficPolicyInstance(input *DeleteTrafficPolicyInstanceInput) (*DeleteTrafficPolicyInstanceOutput, error) { - req, out := c.DeleteTrafficPolicyInstanceRequest(input) - return out, req.Send() -} - -// DeleteTrafficPolicyInstanceWithContext is the same as DeleteTrafficPolicyInstance with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTrafficPolicyInstance 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 *Route53) DeleteTrafficPolicyInstanceWithContext(ctx aws.Context, input *DeleteTrafficPolicyInstanceInput, opts ...request.Option) (*DeleteTrafficPolicyInstanceOutput, error) { - req, out := c.DeleteTrafficPolicyInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVPCAssociationAuthorization = "DeleteVPCAssociationAuthorization" - -// DeleteVPCAssociationAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVPCAssociationAuthorization operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteVPCAssociationAuthorization for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteVPCAssociationAuthorization method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteVPCAssociationAuthorizationRequest method. -// req, resp := client.DeleteVPCAssociationAuthorizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteVPCAssociationAuthorization -func (c *Route53) DeleteVPCAssociationAuthorizationRequest(input *DeleteVPCAssociationAuthorizationInput) (req *request.Request, output *DeleteVPCAssociationAuthorizationOutput) { - op := &request.Operation{ - Name: opDeleteVPCAssociationAuthorization, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/hostedzone/{Id}/deauthorizevpcassociation", - } - - if input == nil { - input = &DeleteVPCAssociationAuthorizationInput{} - } - - output = &DeleteVPCAssociationAuthorizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVPCAssociationAuthorization API operation for Amazon Route 53. -// -// Removes authorization to submit an AssociateVPCWithHostedZone request to -// associate a specified VPC with a hosted zone that was created by a different -// account. You must use the account that created the hosted zone to submit -// a DeleteVPCAssociationAuthorization request. -// -// Sending this request only prevents the AWS account that created the VPC from -// associating the VPC with the Amazon Route 53 hosted zone in the future. If -// the VPC is already associated with the hosted zone, DeleteVPCAssociationAuthorization -// won't disassociate the VPC from the hosted zone. If you want to delete an -// existing association, use DisassociateVPCFromHostedZone. -// -// Send a DELETE request to the /2013-04-01/hostedzone/hosted zone ID/deauthorizevpcassociation -// resource. The request body must include a document with a DeleteVPCAssociationAuthorizationRequest -// element. -// -// 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 Amazon Route 53's -// API operation DeleteVPCAssociationAuthorization for usage and error information. -// -// Returned Error Codes: -// * ErrCodeConcurrentModification "ConcurrentModification" -// Another user submitted a request to update the object at the same time that -// you did. Retry the request. -// -// * ErrCodeVPCAssociationAuthorizationNotFound "VPCAssociationAuthorizationNotFound" -// The VPC that you specified is not authorized to be associated with the hosted -// zone. -// -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidVPCId "InvalidVPCId" -// The VPC ID that you specified either isn't a valid ID or the current account -// is not authorized to access this VPC. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteVPCAssociationAuthorization -func (c *Route53) DeleteVPCAssociationAuthorization(input *DeleteVPCAssociationAuthorizationInput) (*DeleteVPCAssociationAuthorizationOutput, error) { - req, out := c.DeleteVPCAssociationAuthorizationRequest(input) - return out, req.Send() -} - -// DeleteVPCAssociationAuthorizationWithContext is the same as DeleteVPCAssociationAuthorization with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVPCAssociationAuthorization 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 *Route53) DeleteVPCAssociationAuthorizationWithContext(ctx aws.Context, input *DeleteVPCAssociationAuthorizationInput, opts ...request.Option) (*DeleteVPCAssociationAuthorizationOutput, error) { - req, out := c.DeleteVPCAssociationAuthorizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateVPCFromHostedZone = "DisassociateVPCFromHostedZone" - -// DisassociateVPCFromHostedZoneRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateVPCFromHostedZone operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DisassociateVPCFromHostedZone for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DisassociateVPCFromHostedZone method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DisassociateVPCFromHostedZoneRequest method. -// req, resp := client.DisassociateVPCFromHostedZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DisassociateVPCFromHostedZone -func (c *Route53) DisassociateVPCFromHostedZoneRequest(input *DisassociateVPCFromHostedZoneInput) (req *request.Request, output *DisassociateVPCFromHostedZoneOutput) { - op := &request.Operation{ - Name: opDisassociateVPCFromHostedZone, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/hostedzone/{Id}/disassociatevpc", - } - - if input == nil { - input = &DisassociateVPCFromHostedZoneInput{} - } - - output = &DisassociateVPCFromHostedZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateVPCFromHostedZone API operation for Amazon Route 53. -// -// Disassociates a VPC from a Amazon Route 53 private hosted zone. -// -// You can't disassociate the last VPC from a private hosted zone. -// -// Send a POST request to the /2013-04-01/hostedzone/hosted zone ID/disassociatevpc -// resource. The request body must include a document with a DisassociateVPCFromHostedZoneRequest -// element. The response includes a DisassociateVPCFromHostedZoneResponse element. -// -// You can't disassociate a VPC from a private hosted zone when only one VPC -// is associated with the hosted zone. You also can't convert a private hosted -// zone into a public hosted zone. -// -// 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 Amazon Route 53's -// API operation DisassociateVPCFromHostedZone for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidVPCId "InvalidVPCId" -// The VPC ID that you specified either isn't a valid ID or the current account -// is not authorized to access this VPC. -// -// * ErrCodeVPCAssociationNotFound "VPCAssociationNotFound" -// The specified VPC and hosted zone are not currently associated. -// -// * ErrCodeLastVPCAssociation "LastVPCAssociation" -// The VPC that you're trying to disassociate from the private hosted zone is -// the last VPC that is associated with the hosted zone. Amazon Route 53 doesn't -// support disassociating the last VPC from a hosted zone. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DisassociateVPCFromHostedZone -func (c *Route53) DisassociateVPCFromHostedZone(input *DisassociateVPCFromHostedZoneInput) (*DisassociateVPCFromHostedZoneOutput, error) { - req, out := c.DisassociateVPCFromHostedZoneRequest(input) - return out, req.Send() -} - -// DisassociateVPCFromHostedZoneWithContext is the same as DisassociateVPCFromHostedZone with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateVPCFromHostedZone 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 *Route53) DisassociateVPCFromHostedZoneWithContext(ctx aws.Context, input *DisassociateVPCFromHostedZoneInput, opts ...request.Option) (*DisassociateVPCFromHostedZoneOutput, error) { - req, out := c.DisassociateVPCFromHostedZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetChange = "GetChange" - -// GetChangeRequest generates a "aws/request.Request" representing the -// client's request for the GetChange operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetChange for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetChange method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetChangeRequest method. -// req, resp := client.GetChangeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetChange -func (c *Route53) GetChangeRequest(input *GetChangeInput) (req *request.Request, output *GetChangeOutput) { - op := &request.Operation{ - Name: opGetChange, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/change/{Id}", - } - - if input == nil { - input = &GetChangeInput{} - } - - output = &GetChangeOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChange API operation for Amazon Route 53. -// -// Returns the current status of a change batch request. The status is one of -// the following values: -// -// * PENDING indicates that the changes in this request have not replicated -// to all Amazon Route 53 DNS servers. This is the initial status of all -// change batch requests. -// -// * INSYNC indicates that the changes have replicated to all Amazon Route -// 53 DNS servers. -// -// 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 Amazon Route 53's -// API operation GetChange for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchChange "NoSuchChange" -// A change with the specified change ID does not exist. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetChange -func (c *Route53) GetChange(input *GetChangeInput) (*GetChangeOutput, error) { - req, out := c.GetChangeRequest(input) - return out, req.Send() -} - -// GetChangeWithContext is the same as GetChange with the addition of -// the ability to pass a context and additional request options. -// -// See GetChange 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 *Route53) GetChangeWithContext(ctx aws.Context, input *GetChangeInput, opts ...request.Option) (*GetChangeOutput, error) { - req, out := c.GetChangeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCheckerIpRanges = "GetCheckerIpRanges" - -// GetCheckerIpRangesRequest generates a "aws/request.Request" representing the -// client's request for the GetCheckerIpRanges operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetCheckerIpRanges for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCheckerIpRanges method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetCheckerIpRangesRequest method. -// req, resp := client.GetCheckerIpRangesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRanges -func (c *Route53) GetCheckerIpRangesRequest(input *GetCheckerIpRangesInput) (req *request.Request, output *GetCheckerIpRangesOutput) { - op := &request.Operation{ - Name: opGetCheckerIpRanges, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/checkeripranges", - } - - if input == nil { - input = &GetCheckerIpRangesInput{} - } - - output = &GetCheckerIpRangesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCheckerIpRanges API operation for Amazon Route 53. -// -// GetCheckerIpRanges still works, but we recommend that you download ip-ranges.json, -// which includes IP address ranges for all AWS services. For more information, -// see IP Address Ranges of Amazon Route 53 Servers (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/route-53-ip-addresses.html) -// in the Amazon Route 53 Developer Guide. -// -// 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 Amazon Route 53's -// API operation GetCheckerIpRanges for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRanges -func (c *Route53) GetCheckerIpRanges(input *GetCheckerIpRangesInput) (*GetCheckerIpRangesOutput, error) { - req, out := c.GetCheckerIpRangesRequest(input) - return out, req.Send() -} - -// GetCheckerIpRangesWithContext is the same as GetCheckerIpRanges with the addition of -// the ability to pass a context and additional request options. -// -// See GetCheckerIpRanges 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 *Route53) GetCheckerIpRangesWithContext(ctx aws.Context, input *GetCheckerIpRangesInput, opts ...request.Option) (*GetCheckerIpRangesOutput, error) { - req, out := c.GetCheckerIpRangesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGeoLocation = "GetGeoLocation" - -// GetGeoLocationRequest generates a "aws/request.Request" representing the -// client's request for the GetGeoLocation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetGeoLocation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetGeoLocation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetGeoLocationRequest method. -// req, resp := client.GetGeoLocationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetGeoLocation -func (c *Route53) GetGeoLocationRequest(input *GetGeoLocationInput) (req *request.Request, output *GetGeoLocationOutput) { - op := &request.Operation{ - Name: opGetGeoLocation, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/geolocation", - } - - if input == nil { - input = &GetGeoLocationInput{} - } - - output = &GetGeoLocationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGeoLocation API operation for Amazon Route 53. -// -// Retrieves a single geo location. Send a GET request to the /2013-04-01/geolocation -// resource with one of these options: continentcode | countrycode | countrycode -// and subdivisioncode. -// -// 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 Amazon Route 53's -// API operation GetGeoLocation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchGeoLocation "NoSuchGeoLocation" -// Amazon Route 53 doesn't support the specified geolocation. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetGeoLocation -func (c *Route53) GetGeoLocation(input *GetGeoLocationInput) (*GetGeoLocationOutput, error) { - req, out := c.GetGeoLocationRequest(input) - return out, req.Send() -} - -// GetGeoLocationWithContext is the same as GetGeoLocation with the addition of -// the ability to pass a context and additional request options. -// -// See GetGeoLocation 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 *Route53) GetGeoLocationWithContext(ctx aws.Context, input *GetGeoLocationInput, opts ...request.Option) (*GetGeoLocationOutput, error) { - req, out := c.GetGeoLocationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHealthCheck = "GetHealthCheck" - -// GetHealthCheckRequest generates a "aws/request.Request" representing the -// client's request for the GetHealthCheck operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHealthCheck for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHealthCheck method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHealthCheckRequest method. -// req, resp := client.GetHealthCheckRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheck -func (c *Route53) GetHealthCheckRequest(input *GetHealthCheckInput) (req *request.Request, output *GetHealthCheckOutput) { - op := &request.Operation{ - Name: opGetHealthCheck, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}", - } - - if input == nil { - input = &GetHealthCheckInput{} - } - - output = &GetHealthCheckOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHealthCheck API operation for Amazon Route 53. -// -// Gets information about a specified health check. Send a GET request to the -// /2013-04-01/healthcheck/health check ID resource. For more information about -// using the console to perform this operation, see Amazon Route 53 Health Checks -// and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) -// in the Amazon Route 53 Developer Guide. -// -// 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 Amazon Route 53's -// API operation GetHealthCheck for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeIncompatibleVersion "IncompatibleVersion" -// The resource you're trying to access is unsupported on this Amazon Route -// 53 endpoint. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheck -func (c *Route53) GetHealthCheck(input *GetHealthCheckInput) (*GetHealthCheckOutput, error) { - req, out := c.GetHealthCheckRequest(input) - return out, req.Send() -} - -// GetHealthCheckWithContext is the same as GetHealthCheck with the addition of -// the ability to pass a context and additional request options. -// -// See GetHealthCheck 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 *Route53) GetHealthCheckWithContext(ctx aws.Context, input *GetHealthCheckInput, opts ...request.Option) (*GetHealthCheckOutput, error) { - req, out := c.GetHealthCheckRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHealthCheckCount = "GetHealthCheckCount" - -// GetHealthCheckCountRequest generates a "aws/request.Request" representing the -// client's request for the GetHealthCheckCount operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHealthCheckCount for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHealthCheckCount method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHealthCheckCountRequest method. -// req, resp := client.GetHealthCheckCountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckCount -func (c *Route53) GetHealthCheckCountRequest(input *GetHealthCheckCountInput) (req *request.Request, output *GetHealthCheckCountOutput) { - op := &request.Operation{ - Name: opGetHealthCheckCount, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/healthcheckcount", - } - - if input == nil { - input = &GetHealthCheckCountInput{} - } - - output = &GetHealthCheckCountOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHealthCheckCount API operation for Amazon Route 53. -// -// To retrieve a count of all your health checks, send a GET request to the -// /2013-04-01/healthcheckcount resource. -// -// 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 Amazon Route 53's -// API operation GetHealthCheckCount for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckCount -func (c *Route53) GetHealthCheckCount(input *GetHealthCheckCountInput) (*GetHealthCheckCountOutput, error) { - req, out := c.GetHealthCheckCountRequest(input) - return out, req.Send() -} - -// GetHealthCheckCountWithContext is the same as GetHealthCheckCount with the addition of -// the ability to pass a context and additional request options. -// -// See GetHealthCheckCount 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 *Route53) GetHealthCheckCountWithContext(ctx aws.Context, input *GetHealthCheckCountInput, opts ...request.Option) (*GetHealthCheckCountOutput, error) { - req, out := c.GetHealthCheckCountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHealthCheckLastFailureReason = "GetHealthCheckLastFailureReason" - -// GetHealthCheckLastFailureReasonRequest generates a "aws/request.Request" representing the -// client's request for the GetHealthCheckLastFailureReason operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHealthCheckLastFailureReason for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHealthCheckLastFailureReason method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHealthCheckLastFailureReasonRequest method. -// req, resp := client.GetHealthCheckLastFailureReasonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckLastFailureReason -func (c *Route53) GetHealthCheckLastFailureReasonRequest(input *GetHealthCheckLastFailureReasonInput) (req *request.Request, output *GetHealthCheckLastFailureReasonOutput) { - op := &request.Operation{ - Name: opGetHealthCheckLastFailureReason, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}/lastfailurereason", - } - - if input == nil { - input = &GetHealthCheckLastFailureReasonInput{} - } - - output = &GetHealthCheckLastFailureReasonOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHealthCheckLastFailureReason API operation for Amazon Route 53. -// -// If you want to learn why a health check is currently failing or why it failed -// most recently (if at all), you can get the failure reason for the most recent -// failure. Send a GET request to the /Amazon Route 53 API version/healthcheck/health -// check ID/lastfailurereason resource. -// -// 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 Amazon Route 53's -// API operation GetHealthCheckLastFailureReason for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckLastFailureReason -func (c *Route53) GetHealthCheckLastFailureReason(input *GetHealthCheckLastFailureReasonInput) (*GetHealthCheckLastFailureReasonOutput, error) { - req, out := c.GetHealthCheckLastFailureReasonRequest(input) - return out, req.Send() -} - -// GetHealthCheckLastFailureReasonWithContext is the same as GetHealthCheckLastFailureReason with the addition of -// the ability to pass a context and additional request options. -// -// See GetHealthCheckLastFailureReason 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 *Route53) GetHealthCheckLastFailureReasonWithContext(ctx aws.Context, input *GetHealthCheckLastFailureReasonInput, opts ...request.Option) (*GetHealthCheckLastFailureReasonOutput, error) { - req, out := c.GetHealthCheckLastFailureReasonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHealthCheckStatus = "GetHealthCheckStatus" - -// GetHealthCheckStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetHealthCheckStatus operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHealthCheckStatus for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHealthCheckStatus method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHealthCheckStatusRequest method. -// req, resp := client.GetHealthCheckStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckStatus -func (c *Route53) GetHealthCheckStatusRequest(input *GetHealthCheckStatusInput) (req *request.Request, output *GetHealthCheckStatusOutput) { - op := &request.Operation{ - Name: opGetHealthCheckStatus, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}/status", - } - - if input == nil { - input = &GetHealthCheckStatusInput{} - } - - output = &GetHealthCheckStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHealthCheckStatus API operation for Amazon Route 53. -// -// Gets status of a specified health check. Send a GET request to the /2013-04-01/healthcheck/health -// check ID/status resource. You can use this call to get a health check's current -// status. -// -// 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 Amazon Route 53's -// API operation GetHealthCheckStatus for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckStatus -func (c *Route53) GetHealthCheckStatus(input *GetHealthCheckStatusInput) (*GetHealthCheckStatusOutput, error) { - req, out := c.GetHealthCheckStatusRequest(input) - return out, req.Send() -} - -// GetHealthCheckStatusWithContext is the same as GetHealthCheckStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetHealthCheckStatus 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 *Route53) GetHealthCheckStatusWithContext(ctx aws.Context, input *GetHealthCheckStatusInput, opts ...request.Option) (*GetHealthCheckStatusOutput, error) { - req, out := c.GetHealthCheckStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHostedZone = "GetHostedZone" - -// GetHostedZoneRequest generates a "aws/request.Request" representing the -// client's request for the GetHostedZone operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHostedZone for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHostedZone method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHostedZoneRequest method. -// req, resp := client.GetHostedZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZone -func (c *Route53) GetHostedZoneRequest(input *GetHostedZoneInput) (req *request.Request, output *GetHostedZoneOutput) { - op := &request.Operation{ - Name: opGetHostedZone, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/hostedzone/{Id}", - } - - if input == nil { - input = &GetHostedZoneInput{} - } - - output = &GetHostedZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHostedZone API operation for Amazon Route 53. -// -// Retrieves the delegation set for a hosted zone, including the four name servers -// assigned to the hosted zone. Send a GET request to the /Amazon Route 53 API -// version/hostedzone/hosted zone ID resource. -// -// 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 Amazon Route 53's -// API operation GetHostedZone for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZone -func (c *Route53) GetHostedZone(input *GetHostedZoneInput) (*GetHostedZoneOutput, error) { - req, out := c.GetHostedZoneRequest(input) - return out, req.Send() -} - -// GetHostedZoneWithContext is the same as GetHostedZone with the addition of -// the ability to pass a context and additional request options. -// -// See GetHostedZone 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 *Route53) GetHostedZoneWithContext(ctx aws.Context, input *GetHostedZoneInput, opts ...request.Option) (*GetHostedZoneOutput, error) { - req, out := c.GetHostedZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHostedZoneCount = "GetHostedZoneCount" - -// GetHostedZoneCountRequest generates a "aws/request.Request" representing the -// client's request for the GetHostedZoneCount operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetHostedZoneCount for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetHostedZoneCount method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetHostedZoneCountRequest method. -// req, resp := client.GetHostedZoneCountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneCount -func (c *Route53) GetHostedZoneCountRequest(input *GetHostedZoneCountInput) (req *request.Request, output *GetHostedZoneCountOutput) { - op := &request.Operation{ - Name: opGetHostedZoneCount, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/hostedzonecount", - } - - if input == nil { - input = &GetHostedZoneCountInput{} - } - - output = &GetHostedZoneCountOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHostedZoneCount API operation for Amazon Route 53. -// -// Retrieves a count of all your hosted zones. Send a GET request to the /2013-04-01/hostedzonecount -// resource. -// -// 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 Amazon Route 53's -// API operation GetHostedZoneCount for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneCount -func (c *Route53) GetHostedZoneCount(input *GetHostedZoneCountInput) (*GetHostedZoneCountOutput, error) { - req, out := c.GetHostedZoneCountRequest(input) - return out, req.Send() -} - -// GetHostedZoneCountWithContext is the same as GetHostedZoneCount with the addition of -// the ability to pass a context and additional request options. -// -// See GetHostedZoneCount 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 *Route53) GetHostedZoneCountWithContext(ctx aws.Context, input *GetHostedZoneCountInput, opts ...request.Option) (*GetHostedZoneCountOutput, error) { - req, out := c.GetHostedZoneCountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReusableDelegationSet = "GetReusableDelegationSet" - -// GetReusableDelegationSetRequest generates a "aws/request.Request" representing the -// client's request for the GetReusableDelegationSet operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetReusableDelegationSet for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetReusableDelegationSet method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetReusableDelegationSetRequest method. -// req, resp := client.GetReusableDelegationSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSet -func (c *Route53) GetReusableDelegationSetRequest(input *GetReusableDelegationSetInput) (req *request.Request, output *GetReusableDelegationSetOutput) { - op := &request.Operation{ - Name: opGetReusableDelegationSet, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/delegationset/{Id}", - } - - if input == nil { - input = &GetReusableDelegationSetInput{} - } - - output = &GetReusableDelegationSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetReusableDelegationSet API operation for Amazon Route 53. -// -// Retrieves the reusable delegation set. Send a GET request to the /2013-04-01/delegationset/delegation -// set ID resource. -// -// 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 Amazon Route 53's -// API operation GetReusableDelegationSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" -// A reusable delegation set with the specified ID does not exist. -// -// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" -// A reusable delegation set with the specified ID does not exist. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSet -func (c *Route53) GetReusableDelegationSet(input *GetReusableDelegationSetInput) (*GetReusableDelegationSetOutput, error) { - req, out := c.GetReusableDelegationSetRequest(input) - return out, req.Send() -} - -// GetReusableDelegationSetWithContext is the same as GetReusableDelegationSet with the addition of -// the ability to pass a context and additional request options. -// -// See GetReusableDelegationSet 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 *Route53) GetReusableDelegationSetWithContext(ctx aws.Context, input *GetReusableDelegationSetInput, opts ...request.Option) (*GetReusableDelegationSetOutput, error) { - req, out := c.GetReusableDelegationSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTrafficPolicy = "GetTrafficPolicy" - -// GetTrafficPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetTrafficPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTrafficPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTrafficPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTrafficPolicyRequest method. -// req, resp := client.GetTrafficPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicy -func (c *Route53) GetTrafficPolicyRequest(input *GetTrafficPolicyInput) (req *request.Request, output *GetTrafficPolicyOutput) { - op := &request.Operation{ - Name: opGetTrafficPolicy, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicy/{Id}/{Version}", - } - - if input == nil { - input = &GetTrafficPolicyInput{} - } - - output = &GetTrafficPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTrafficPolicy API operation for Amazon Route 53. -// -// Gets information about a specific traffic policy version. -// -// Send a GET request to the /Amazon Route 53 API version/trafficpolicy resource. -// -// 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 Amazon Route 53's -// API operation GetTrafficPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicy -func (c *Route53) GetTrafficPolicy(input *GetTrafficPolicyInput) (*GetTrafficPolicyOutput, error) { - req, out := c.GetTrafficPolicyRequest(input) - return out, req.Send() -} - -// GetTrafficPolicyWithContext is the same as GetTrafficPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetTrafficPolicy 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 *Route53) GetTrafficPolicyWithContext(ctx aws.Context, input *GetTrafficPolicyInput, opts ...request.Option) (*GetTrafficPolicyOutput, error) { - req, out := c.GetTrafficPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTrafficPolicyInstance = "GetTrafficPolicyInstance" - -// GetTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the -// client's request for the GetTrafficPolicyInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTrafficPolicyInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTrafficPolicyInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTrafficPolicyInstanceRequest method. -// req, resp := client.GetTrafficPolicyInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstance -func (c *Route53) GetTrafficPolicyInstanceRequest(input *GetTrafficPolicyInstanceInput) (req *request.Request, output *GetTrafficPolicyInstanceOutput) { - op := &request.Operation{ - Name: opGetTrafficPolicyInstance, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicyinstance/{Id}", - } - - if input == nil { - input = &GetTrafficPolicyInstanceInput{} - } - - output = &GetTrafficPolicyInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTrafficPolicyInstance API operation for Amazon Route 53. -// -// Gets information about a specified traffic policy instance. -// -// Send a GET request to the /Amazon Route 53 API version/trafficpolicyinstance -// resource. -// -// After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance -// request, there's a brief delay while Amazon Route 53 creates the resource -// record sets that are specified in the traffic policy definition. For more -// information, see the State response element. -// -// In the Amazon Route 53 console, traffic policy instances are known as policy -// records. -// -// 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 Amazon Route 53's -// API operation GetTrafficPolicyInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" -// No traffic policy instance exists with the specified ID. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstance -func (c *Route53) GetTrafficPolicyInstance(input *GetTrafficPolicyInstanceInput) (*GetTrafficPolicyInstanceOutput, error) { - req, out := c.GetTrafficPolicyInstanceRequest(input) - return out, req.Send() -} - -// GetTrafficPolicyInstanceWithContext is the same as GetTrafficPolicyInstance with the addition of -// the ability to pass a context and additional request options. -// -// See GetTrafficPolicyInstance 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 *Route53) GetTrafficPolicyInstanceWithContext(ctx aws.Context, input *GetTrafficPolicyInstanceInput, opts ...request.Option) (*GetTrafficPolicyInstanceOutput, error) { - req, out := c.GetTrafficPolicyInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTrafficPolicyInstanceCount = "GetTrafficPolicyInstanceCount" - -// GetTrafficPolicyInstanceCountRequest generates a "aws/request.Request" representing the -// client's request for the GetTrafficPolicyInstanceCount operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetTrafficPolicyInstanceCount for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetTrafficPolicyInstanceCount method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetTrafficPolicyInstanceCountRequest method. -// req, resp := client.GetTrafficPolicyInstanceCountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCount -func (c *Route53) GetTrafficPolicyInstanceCountRequest(input *GetTrafficPolicyInstanceCountInput) (req *request.Request, output *GetTrafficPolicyInstanceCountOutput) { - op := &request.Operation{ - Name: opGetTrafficPolicyInstanceCount, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicyinstancecount", - } - - if input == nil { - input = &GetTrafficPolicyInstanceCountInput{} - } - - output = &GetTrafficPolicyInstanceCountOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTrafficPolicyInstanceCount API operation for Amazon Route 53. -// -// Gets the number of traffic policy instances that are associated with the -// current AWS account. -// -// To get the number of traffic policy instances, send a GET request to the -// /2013-04-01/trafficpolicyinstancecount resource. -// -// 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 Amazon Route 53's -// API operation GetTrafficPolicyInstanceCount for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCount -func (c *Route53) GetTrafficPolicyInstanceCount(input *GetTrafficPolicyInstanceCountInput) (*GetTrafficPolicyInstanceCountOutput, error) { - req, out := c.GetTrafficPolicyInstanceCountRequest(input) - return out, req.Send() -} - -// GetTrafficPolicyInstanceCountWithContext is the same as GetTrafficPolicyInstanceCount with the addition of -// the ability to pass a context and additional request options. -// -// See GetTrafficPolicyInstanceCount 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 *Route53) GetTrafficPolicyInstanceCountWithContext(ctx aws.Context, input *GetTrafficPolicyInstanceCountInput, opts ...request.Option) (*GetTrafficPolicyInstanceCountOutput, error) { - req, out := c.GetTrafficPolicyInstanceCountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListGeoLocations = "ListGeoLocations" - -// ListGeoLocationsRequest generates a "aws/request.Request" representing the -// client's request for the ListGeoLocations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListGeoLocations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListGeoLocations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListGeoLocationsRequest method. -// req, resp := client.ListGeoLocationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListGeoLocations -func (c *Route53) ListGeoLocationsRequest(input *ListGeoLocationsInput) (req *request.Request, output *ListGeoLocationsOutput) { - op := &request.Operation{ - Name: opListGeoLocations, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/geolocations", - } - - if input == nil { - input = &ListGeoLocationsInput{} - } - - output = &ListGeoLocationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListGeoLocations API operation for Amazon Route 53. -// -// Retrieves a list of supported geo locations. Send a GET request to the /2013-04-01/geolocations -// resource. The response to this request includes a GeoLocationDetailsList -// element for each location that Amazon Route 53 supports. -// -// Countries are listed first, and continents are listed last. If Amazon Route -// 53 supports subdivisions for a country (for example, states or provinces), -// the subdivisions for that country are listed in alphabetical order immediately -// after the corresponding country. -// -// 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 Amazon Route 53's -// API operation ListGeoLocations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListGeoLocations -func (c *Route53) ListGeoLocations(input *ListGeoLocationsInput) (*ListGeoLocationsOutput, error) { - req, out := c.ListGeoLocationsRequest(input) - return out, req.Send() -} - -// ListGeoLocationsWithContext is the same as ListGeoLocations with the addition of -// the ability to pass a context and additional request options. -// -// See ListGeoLocations 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 *Route53) ListGeoLocationsWithContext(ctx aws.Context, input *ListGeoLocationsInput, opts ...request.Option) (*ListGeoLocationsOutput, error) { - req, out := c.ListGeoLocationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListHealthChecks = "ListHealthChecks" - -// ListHealthChecksRequest generates a "aws/request.Request" representing the -// client's request for the ListHealthChecks operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListHealthChecks for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListHealthChecks method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListHealthChecksRequest method. -// req, resp := client.ListHealthChecksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecks -func (c *Route53) ListHealthChecksRequest(input *ListHealthChecksInput) (req *request.Request, output *ListHealthChecksOutput) { - op := &request.Operation{ - Name: opListHealthChecks, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/healthcheck", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListHealthChecksInput{} - } - - output = &ListHealthChecksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListHealthChecks API operation for Amazon Route 53. -// -// Retrieve a list of your health checks. Send a GET request to the /2013-04-01/healthcheck -// resource. The response to this request includes a HealthChecks element with -// zero or more HealthCheck child elements. By default, the list of health checks -// is displayed on a single page. You can control the length of the page that -// is displayed by using the MaxItems parameter. You can use the Marker parameter -// to control the health check that the list begins with. -// -// For information about listing health checks using the Amazon Route 53 console, -// see Amazon Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html). -// -// 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 Amazon Route 53's -// API operation ListHealthChecks for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeIncompatibleVersion "IncompatibleVersion" -// The resource you're trying to access is unsupported on this Amazon Route -// 53 endpoint. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecks -func (c *Route53) ListHealthChecks(input *ListHealthChecksInput) (*ListHealthChecksOutput, error) { - req, out := c.ListHealthChecksRequest(input) - return out, req.Send() -} - -// ListHealthChecksWithContext is the same as ListHealthChecks with the addition of -// the ability to pass a context and additional request options. -// -// See ListHealthChecks 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 *Route53) ListHealthChecksWithContext(ctx aws.Context, input *ListHealthChecksInput, opts ...request.Option) (*ListHealthChecksOutput, error) { - req, out := c.ListHealthChecksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListHealthChecksPages iterates over the pages of a ListHealthChecks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHealthChecks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListHealthChecks operation. -// pageNum := 0 -// err := client.ListHealthChecksPages(params, -// func(page *ListHealthChecksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Route53) ListHealthChecksPages(input *ListHealthChecksInput, fn func(*ListHealthChecksOutput, bool) bool) error { - return c.ListHealthChecksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHealthChecksPagesWithContext same as ListHealthChecksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Route53) ListHealthChecksPagesWithContext(ctx aws.Context, input *ListHealthChecksInput, fn func(*ListHealthChecksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListHealthChecksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListHealthChecksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHealthChecksOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListHostedZones = "ListHostedZones" - -// ListHostedZonesRequest generates a "aws/request.Request" representing the -// client's request for the ListHostedZones operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListHostedZones for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListHostedZones method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListHostedZonesRequest method. -// req, resp := client.ListHostedZonesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZones -func (c *Route53) ListHostedZonesRequest(input *ListHostedZonesInput) (req *request.Request, output *ListHostedZonesOutput) { - op := &request.Operation{ - Name: opListHostedZones, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/hostedzone", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListHostedZonesInput{} - } - - output = &ListHostedZonesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListHostedZones API operation for Amazon Route 53. -// -// To retrieve a list of your public and private hosted zones, send a GET request -// to the /2013-04-01/hostedzone resource. The response to this request includes -// a HostedZones child element for each hosted zone created by the current AWS -// account. -// -// Amazon Route 53 returns a maximum of 100 items in each response. If you have -// a lot of hosted zones, you can use the maxitems parameter to list them in -// groups of up to 100. The response includes four values that help navigate -// from one group of maxitems hosted zones to the next: -// -// * MaxItems is the value specified for the maxitems parameter in the request -// that produced the current response. -// -// * If the value of IsTruncated in the response is true, there are more -// hosted zones associated with the current AWS account. -// -// * NextMarker is the hosted zone ID of the next hosted zone that is associated -// with the current AWS account. If you want to list more hosted zones, make -// another call to ListHostedZones, and specify the value of the NextMarker -// element in the marker parameter. -// -// If IsTruncated is false, the NextMarker element is omitted from the response. -// -// * If you're making the second or subsequent call to ListHostedZones, the -// Marker element matches the value that you specified in the marker parameter -// in the previous request. -// -// 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 Amazon Route 53's -// API operation ListHostedZones for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchDelegationSet "NoSuchDelegationSet" -// A reusable delegation set with the specified ID does not exist. -// -// * ErrCodeDelegationSetNotReusable "DelegationSetNotReusable" -// A reusable delegation set with the specified ID does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZones -func (c *Route53) ListHostedZones(input *ListHostedZonesInput) (*ListHostedZonesOutput, error) { - req, out := c.ListHostedZonesRequest(input) - return out, req.Send() -} - -// ListHostedZonesWithContext is the same as ListHostedZones with the addition of -// the ability to pass a context and additional request options. -// -// See ListHostedZones 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 *Route53) ListHostedZonesWithContext(ctx aws.Context, input *ListHostedZonesInput, opts ...request.Option) (*ListHostedZonesOutput, error) { - req, out := c.ListHostedZonesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListHostedZonesPages iterates over the pages of a ListHostedZones operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHostedZones method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListHostedZones operation. -// pageNum := 0 -// err := client.ListHostedZonesPages(params, -// func(page *ListHostedZonesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Route53) ListHostedZonesPages(input *ListHostedZonesInput, fn func(*ListHostedZonesOutput, bool) bool) error { - return c.ListHostedZonesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHostedZonesPagesWithContext same as ListHostedZonesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Route53) ListHostedZonesPagesWithContext(ctx aws.Context, input *ListHostedZonesInput, fn func(*ListHostedZonesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListHostedZonesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListHostedZonesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHostedZonesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListHostedZonesByName = "ListHostedZonesByName" - -// ListHostedZonesByNameRequest generates a "aws/request.Request" representing the -// client's request for the ListHostedZonesByName operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListHostedZonesByName for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListHostedZonesByName method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListHostedZonesByNameRequest method. -// req, resp := client.ListHostedZonesByNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByName -func (c *Route53) ListHostedZonesByNameRequest(input *ListHostedZonesByNameInput) (req *request.Request, output *ListHostedZonesByNameOutput) { - op := &request.Operation{ - Name: opListHostedZonesByName, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/hostedzonesbyname", - } - - if input == nil { - input = &ListHostedZonesByNameInput{} - } - - output = &ListHostedZonesByNameOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListHostedZonesByName API operation for Amazon Route 53. -// -// Retrieves a list of your hosted zones in lexicographic order. Send a GET -// request to the /2013-04-01/hostedzonesbyname resource. The response includes -// a HostedZones child element for each hosted zone created by the current AWS -// account. -// -// ListHostedZonesByName sorts hosted zones by name with the labels reversed. -// For example: -// -// * com.example.www. -// -// Note the trailing dot, which can change the sort order in some circumstances. -// -// If the domain name includes escape characters or Punycode, ListHostedZonesByName -// alphabetizes the domain name using the escaped or Punycoded value, which -// is the format that Amazon Route 53 saves in its database. For example, to -// create a hosted zone for example.com, specify ex\344mple.com for the domain -// name. ListHostedZonesByName alphabetizes it as: -// -// * com.ex\344mple. -// -// The labels are reversed and alphabetized using the escaped value. For more -// information about valid domain name formats, including internationalized -// domain names, see DNS Domain Name Format (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html) -// in the Amazon Route 53 Developer Guide. -// -// Amazon Route 53 returns up to 100 items in each response. If you have a lot -// of hosted zones, use the MaxItems parameter to list them in groups of up -// to 100. The response includes values that help navigate from one group of -// MaxItems hosted zones to the next: -// -// * The DNSName and HostedZoneId elements in the response contain the values, -// if any, specified for the dnsname and hostedzoneid parameters in the request -// that produced the current response. -// -// * The MaxItems element in the response contains the value, if any, that -// you specified for the maxitems parameter in the request that produced -// the current response. -// -// * If the value of IsTruncated in the response is true, there are more -// hosted zones associated with the current AWS account. -// -// If IsTruncated is false, this response includes the last hosted zone that -// is associated with the current account. The NextDNSName element and NextHostedZoneId -// elements are omitted from the response. -// -// * The NextDNSName and NextHostedZoneId elements in the response contain -// the domain name and the hosted zone ID of the next hosted zone that is -// associated with the current AWS account. If you want to list more hosted -// zones, make another call to ListHostedZonesByName, and specify the value -// of NextDNSName and NextHostedZoneId in the dnsname and hostedzoneid parameters, -// respectively. -// -// 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 Amazon Route 53's -// API operation ListHostedZonesByName for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeInvalidDomainName "InvalidDomainName" -// The specified domain name is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByName -func (c *Route53) ListHostedZonesByName(input *ListHostedZonesByNameInput) (*ListHostedZonesByNameOutput, error) { - req, out := c.ListHostedZonesByNameRequest(input) - return out, req.Send() -} - -// ListHostedZonesByNameWithContext is the same as ListHostedZonesByName with the addition of -// the ability to pass a context and additional request options. -// -// See ListHostedZonesByName 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 *Route53) ListHostedZonesByNameWithContext(ctx aws.Context, input *ListHostedZonesByNameInput, opts ...request.Option) (*ListHostedZonesByNameOutput, error) { - req, out := c.ListHostedZonesByNameRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListResourceRecordSets = "ListResourceRecordSets" - -// ListResourceRecordSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListResourceRecordSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListResourceRecordSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListResourceRecordSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListResourceRecordSetsRequest method. -// req, resp := client.ListResourceRecordSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListResourceRecordSets -func (c *Route53) ListResourceRecordSetsRequest(input *ListResourceRecordSetsInput) (req *request.Request, output *ListResourceRecordSetsOutput) { - op := &request.Operation{ - Name: opListResourceRecordSets, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/hostedzone/{Id}/rrset", - Paginator: &request.Paginator{ - InputTokens: []string{"StartRecordName", "StartRecordType", "StartRecordIdentifier"}, - OutputTokens: []string{"NextRecordName", "NextRecordType", "NextRecordIdentifier"}, - LimitToken: "MaxItems", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListResourceRecordSetsInput{} - } - - output = &ListResourceRecordSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListResourceRecordSets API operation for Amazon Route 53. -// -// Lists the resource record sets in a specified hosted zone. -// -// ListResourceRecordSets returns up to 100 resource record sets at a time in -// ASCII order, beginning at a position specified by the name and type elements. -// The action sorts results first by DNS name with the labels reversed, for -// example: -// -// com.example.www. -// -// Note the trailing dot, which can change the sort order in some circumstances. -// -// When multiple records have the same DNS name, the action sorts results by -// the record type. -// -// You can use the name and type elements to adjust the beginning position of -// the list of resource record sets returned: -// -// If you do not specify Name or TypeThe results begin with the first resource -// record set that the hosted zone contains. -// -// If you specify Name but not TypeThe results begin with the first resource -// record set in the list whose name is greater than or equal to Name. -// -// If you specify Type but not NameAmazon Route 53 returns the InvalidInput -// error. -// -// If you specify both Name and TypeThe results begin with the first resource -// record set in the list whose name is greater than or equal to Name, and whose -// type is greater than or equal to Type. -// -// This action returns the most current version of the records. This includes -// records that are PENDING, and that are not yet available on all Amazon Route -// 53 DNS servers. -// -// To ensure that you get an accurate listing of the resource record sets for -// a hosted zone at a point in time, do not submit a ChangeResourceRecordSets -// request while you're paging through the results of a ListResourceRecordSets -// request. If you do, some pages may display results without the latest changes -// while other pages display results with the latest changes. -// -// 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 Amazon Route 53's -// API operation ListResourceRecordSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListResourceRecordSets -func (c *Route53) ListResourceRecordSets(input *ListResourceRecordSetsInput) (*ListResourceRecordSetsOutput, error) { - req, out := c.ListResourceRecordSetsRequest(input) - return out, req.Send() -} - -// ListResourceRecordSetsWithContext is the same as ListResourceRecordSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListResourceRecordSets 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 *Route53) ListResourceRecordSetsWithContext(ctx aws.Context, input *ListResourceRecordSetsInput, opts ...request.Option) (*ListResourceRecordSetsOutput, error) { - req, out := c.ListResourceRecordSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListResourceRecordSetsPages iterates over the pages of a ListResourceRecordSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListResourceRecordSets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListResourceRecordSets operation. -// pageNum := 0 -// err := client.ListResourceRecordSetsPages(params, -// func(page *ListResourceRecordSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *Route53) ListResourceRecordSetsPages(input *ListResourceRecordSetsInput, fn func(*ListResourceRecordSetsOutput, bool) bool) error { - return c.ListResourceRecordSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListResourceRecordSetsPagesWithContext same as ListResourceRecordSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Route53) ListResourceRecordSetsPagesWithContext(ctx aws.Context, input *ListResourceRecordSetsInput, fn func(*ListResourceRecordSetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListResourceRecordSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListResourceRecordSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourceRecordSetsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListReusableDelegationSets = "ListReusableDelegationSets" - -// ListReusableDelegationSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListReusableDelegationSets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListReusableDelegationSets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListReusableDelegationSets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListReusableDelegationSetsRequest method. -// req, resp := client.ListReusableDelegationSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListReusableDelegationSets -func (c *Route53) ListReusableDelegationSetsRequest(input *ListReusableDelegationSetsInput) (req *request.Request, output *ListReusableDelegationSetsOutput) { - op := &request.Operation{ - Name: opListReusableDelegationSets, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/delegationset", - } - - if input == nil { - input = &ListReusableDelegationSetsInput{} - } - - output = &ListReusableDelegationSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListReusableDelegationSets API operation for Amazon Route 53. -// -// To retrieve a list of your reusable delegation sets, send a GET request to -// the /2013-04-01/delegationset resource. The response to this request includes -// a DelegationSets element with zero, one, or multiple DelegationSet child -// elements. By default, the list of delegation sets is displayed on a single -// page. You can control the length of the page that is displayed by using the -// MaxItems parameter. You can use the Marker parameter to control the delegation -// set that the list begins with. -// -// Amazon Route 53 returns a maximum of 100 items. If you set MaxItems to a -// value greater than 100, Amazon Route 53 returns only the first 100. -// -// 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 Amazon Route 53's -// API operation ListReusableDelegationSets for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListReusableDelegationSets -func (c *Route53) ListReusableDelegationSets(input *ListReusableDelegationSetsInput) (*ListReusableDelegationSetsOutput, error) { - req, out := c.ListReusableDelegationSetsRequest(input) - return out, req.Send() -} - -// ListReusableDelegationSetsWithContext is the same as ListReusableDelegationSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListReusableDelegationSets 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 *Route53) ListReusableDelegationSetsWithContext(ctx aws.Context, input *ListReusableDelegationSetsInput, opts ...request.Option) (*ListReusableDelegationSetsOutput, error) { - req, out := c.ListReusableDelegationSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsForResource for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsForResource method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResource -func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/tags/{ResourceType}/{ResourceId}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Route 53. -// -// Lists tags for one health check or hosted zone. -// -// For information about using tags for cost allocation, see Using Cost Allocation -// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management User Guide. -// -// 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 Amazon Route 53's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" -// If Amazon Route 53 can't process a request before the next request arrives, -// it will reject subsequent requests for the same hosted zone and return an -// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly -// for the same request, we recommend that you wait, in intervals of increasing -// duration, before you try the request again. -// -// * ErrCodeThrottlingException "ThrottlingException" -// The limit on the number of requests per second was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResource -func (c *Route53) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *Route53) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTagsForResources = "ListTagsForResources" - -// ListTagsForResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResources operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTagsForResources for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTagsForResources method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTagsForResourcesRequest method. -// req, resp := client.ListTagsForResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResources -func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput) (req *request.Request, output *ListTagsForResourcesOutput) { - op := &request.Operation{ - Name: opListTagsForResources, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/tags/{ResourceType}", - } - - if input == nil { - input = &ListTagsForResourcesInput{} - } - - output = &ListTagsForResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResources API operation for Amazon Route 53. -// -// Lists tags for up to 10 health checks or hosted zones. -// -// For information about using tags for cost allocation, see Using Cost Allocation -// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management User Guide. -// -// 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 Amazon Route 53's -// API operation ListTagsForResources for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" -// If Amazon Route 53 can't process a request before the next request arrives, -// it will reject subsequent requests for the same hosted zone and return an -// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly -// for the same request, we recommend that you wait, in intervals of increasing -// duration, before you try the request again. -// -// * ErrCodeThrottlingException "ThrottlingException" -// The limit on the number of requests per second was exceeded. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResources -func (c *Route53) ListTagsForResources(input *ListTagsForResourcesInput) (*ListTagsForResourcesOutput, error) { - req, out := c.ListTagsForResourcesRequest(input) - return out, req.Send() -} - -// ListTagsForResourcesWithContext is the same as ListTagsForResources with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResources 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 *Route53) ListTagsForResourcesWithContext(ctx aws.Context, input *ListTagsForResourcesInput, opts ...request.Option) (*ListTagsForResourcesOutput, error) { - req, out := c.ListTagsForResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTrafficPolicies = "ListTrafficPolicies" - -// ListTrafficPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListTrafficPolicies operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTrafficPolicies for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTrafficPolicies method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTrafficPoliciesRequest method. -// req, resp := client.ListTrafficPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicies -func (c *Route53) ListTrafficPoliciesRequest(input *ListTrafficPoliciesInput) (req *request.Request, output *ListTrafficPoliciesOutput) { - op := &request.Operation{ - Name: opListTrafficPolicies, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicies", - } - - if input == nil { - input = &ListTrafficPoliciesInput{} - } - - output = &ListTrafficPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTrafficPolicies API operation for Amazon Route 53. -// -// Gets information about the latest version for every traffic policy that is -// associated with the current AWS account. Send a GET request to the /Amazon -// Route 53 API version/trafficpolicy resource. -// -// Amazon Route 53 returns a maximum of 100 items in each response. If you have -// a lot of traffic policies, you can use the maxitems parameter to list them -// in groups of up to 100. -// -// The response includes three values that help you navigate from one group -// of maxitems traffic policies to the next: -// -// * IsTruncated -// -// If the value of IsTruncated in the response is true, there are more traffic -// policies associated with the current AWS account. -// -// If IsTruncated is false, this response includes the last traffic policy that -// is associated with the current account. -// -// * TrafficPolicyIdMarker -// -// If IsTruncated is true, TrafficPolicyIdMarker is the ID of the first traffic -// policy in the next group of MaxItems traffic policies. If you want to -// list more traffic policies, make another call to ListTrafficPolicies, -// and specify the value of the TrafficPolicyIdMarker element from the response -// in the TrafficPolicyIdMarker request parameter. -// -// If IsTruncated is false, the TrafficPolicyIdMarker element is omitted from -// the response. -// -// * MaxItems -// -// The value that you specified for the MaxItems parameter in the request that -// produced the current response. -// -// 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 Amazon Route 53's -// API operation ListTrafficPolicies for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicies -func (c *Route53) ListTrafficPolicies(input *ListTrafficPoliciesInput) (*ListTrafficPoliciesOutput, error) { - req, out := c.ListTrafficPoliciesRequest(input) - return out, req.Send() -} - -// ListTrafficPoliciesWithContext is the same as ListTrafficPolicies with the addition of -// the ability to pass a context and additional request options. -// -// See ListTrafficPolicies 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 *Route53) ListTrafficPoliciesWithContext(ctx aws.Context, input *ListTrafficPoliciesInput, opts ...request.Option) (*ListTrafficPoliciesOutput, error) { - req, out := c.ListTrafficPoliciesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTrafficPolicyInstances = "ListTrafficPolicyInstances" - -// ListTrafficPolicyInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListTrafficPolicyInstances operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTrafficPolicyInstances for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTrafficPolicyInstances method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTrafficPolicyInstancesRequest method. -// req, resp := client.ListTrafficPolicyInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstances -func (c *Route53) ListTrafficPolicyInstancesRequest(input *ListTrafficPolicyInstancesInput) (req *request.Request, output *ListTrafficPolicyInstancesOutput) { - op := &request.Operation{ - Name: opListTrafficPolicyInstances, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicyinstances", - } - - if input == nil { - input = &ListTrafficPolicyInstancesInput{} - } - - output = &ListTrafficPolicyInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTrafficPolicyInstances API operation for Amazon Route 53. -// -// Gets information about the traffic policy instances that you created by using -// the current AWS account. -// -// After you submit an UpdateTrafficPolicyInstance request, there's a brief -// delay while Amazon Route 53 creates the resource record sets that are specified -// in the traffic policy definition. For more information, see the State response -// element. -// -// Send a GET request to the /Amazon Route 53 API version/trafficpolicyinstance -// resource. -// -// Amazon Route 53 returns a maximum of 100 items in each response. If you have -// a lot of traffic policy instances, you can use the MaxItems parameter to -// list them in groups of up to 100. -// -// The response includes five values that help you navigate from one group of -// MaxItems traffic policy instances to the next: -// -// * IsTruncated -// -// If the value of IsTruncated in the response is true, there are more traffic -// policy instances associated with the current AWS account. -// -// If IsTruncated is false, this response includes the last traffic policy instance -// that is associated with the current account. -// -// * MaxItems -// -// The value that you specified for the MaxItems parameter in the request that -// produced the current response. -// -// * HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker -// -// If IsTruncated is true, these three values in the response represent the -// first traffic policy instance in the next group of MaxItems traffic policy -// instances. To list more traffic policy instances, make another call to -// ListTrafficPolicyInstances, and specify these values in the corresponding -// request parameters. -// -// If IsTruncated is false, all three elements are omitted from the response. -// -// 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 Amazon Route 53's -// API operation ListTrafficPolicyInstances for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" -// No traffic policy instance exists with the specified ID. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstances -func (c *Route53) ListTrafficPolicyInstances(input *ListTrafficPolicyInstancesInput) (*ListTrafficPolicyInstancesOutput, error) { - req, out := c.ListTrafficPolicyInstancesRequest(input) - return out, req.Send() -} - -// ListTrafficPolicyInstancesWithContext is the same as ListTrafficPolicyInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ListTrafficPolicyInstances 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 *Route53) ListTrafficPolicyInstancesWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesInput, opts ...request.Option) (*ListTrafficPolicyInstancesOutput, error) { - req, out := c.ListTrafficPolicyInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTrafficPolicyInstancesByHostedZone = "ListTrafficPolicyInstancesByHostedZone" - -// ListTrafficPolicyInstancesByHostedZoneRequest generates a "aws/request.Request" representing the -// client's request for the ListTrafficPolicyInstancesByHostedZone operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTrafficPolicyInstancesByHostedZone for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTrafficPolicyInstancesByHostedZone method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTrafficPolicyInstancesByHostedZoneRequest method. -// req, resp := client.ListTrafficPolicyInstancesByHostedZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByHostedZone -func (c *Route53) ListTrafficPolicyInstancesByHostedZoneRequest(input *ListTrafficPolicyInstancesByHostedZoneInput) (req *request.Request, output *ListTrafficPolicyInstancesByHostedZoneOutput) { - op := &request.Operation{ - Name: opListTrafficPolicyInstancesByHostedZone, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicyinstances/hostedzone", - } - - if input == nil { - input = &ListTrafficPolicyInstancesByHostedZoneInput{} - } - - output = &ListTrafficPolicyInstancesByHostedZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTrafficPolicyInstancesByHostedZone API operation for Amazon Route 53. -// -// Gets information about the traffic policy instances that you created in a -// specified hosted zone. -// -// After you submit an UpdateTrafficPolicyInstance request, there's a brief -// delay while Amazon Route 53 creates the resource record sets that are specified -// in the traffic policy definition. For more information, see the State response -// element. -// -// Send a GET request to the /Amazon Route 53 API version/trafficpolicyinstance -// resource and include the ID of the hosted zone. -// -// Amazon Route 53 returns a maximum of 100 items in each response. If you have -// a lot of traffic policy instances, you can use the MaxItems parameter to -// list them in groups of up to 100. -// -// The response includes four values that help you navigate from one group of -// MaxItems traffic policy instances to the next: -// -// * IsTruncated -// -// If the value of IsTruncated in the response is true, there are more traffic -// policy instances associated with the current AWS account. -// -// * If IsTruncated is false, this response includes the last traffic policy -// instance that is associated with the current account. -// -// * MaxItems -// -// * The value that you specified for the MaxItems parameter in the request -// that produced the current response. -// -// * TrafficPolicyInstanceNameMarker and TrafficPolicyInstanceTypeMarker -// -// * If IsTruncated is true, these two values in the response represent the -// first traffic policy instance in the next group of MaxItems traffic policy -// instances. To list more traffic policy instances, make another call to -// ListTrafficPolicyInstancesByHostedZone, and specify these values in the -// corresponding request parameters. -// -// * If IsTruncated is false, all three elements are omitted from the response. -// -// 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 Amazon Route 53's -// API operation ListTrafficPolicyInstancesByHostedZone for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" -// No traffic policy instance exists with the specified ID. -// -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByHostedZone -func (c *Route53) ListTrafficPolicyInstancesByHostedZone(input *ListTrafficPolicyInstancesByHostedZoneInput) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) { - req, out := c.ListTrafficPolicyInstancesByHostedZoneRequest(input) - return out, req.Send() -} - -// ListTrafficPolicyInstancesByHostedZoneWithContext is the same as ListTrafficPolicyInstancesByHostedZone with the addition of -// the ability to pass a context and additional request options. -// -// See ListTrafficPolicyInstancesByHostedZone 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 *Route53) ListTrafficPolicyInstancesByHostedZoneWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesByHostedZoneInput, opts ...request.Option) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) { - req, out := c.ListTrafficPolicyInstancesByHostedZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTrafficPolicyInstancesByPolicy = "ListTrafficPolicyInstancesByPolicy" - -// ListTrafficPolicyInstancesByPolicyRequest generates a "aws/request.Request" representing the -// client's request for the ListTrafficPolicyInstancesByPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTrafficPolicyInstancesByPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTrafficPolicyInstancesByPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTrafficPolicyInstancesByPolicyRequest method. -// req, resp := client.ListTrafficPolicyInstancesByPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByPolicy -func (c *Route53) ListTrafficPolicyInstancesByPolicyRequest(input *ListTrafficPolicyInstancesByPolicyInput) (req *request.Request, output *ListTrafficPolicyInstancesByPolicyOutput) { - op := &request.Operation{ - Name: opListTrafficPolicyInstancesByPolicy, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicyinstances/trafficpolicy", - } - - if input == nil { - input = &ListTrafficPolicyInstancesByPolicyInput{} - } - - output = &ListTrafficPolicyInstancesByPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTrafficPolicyInstancesByPolicy API operation for Amazon Route 53. -// -// Gets information about the traffic policy instances that you created by using -// a specify traffic policy version. -// -// After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance -// request, there's a brief delay while Amazon Route 53 creates the resource -// record sets that are specified in the traffic policy definition. For more -// information, see the State response element. -// -// Send a GET request to the /Route 53 API version/trafficpolicyinstance resource -// and include the ID and version of the traffic policy. -// -// Amazon Route 53 returns a maximum of 100 items in each response. If you have -// a lot of traffic policy instances, you can use the MaxItems parameter to -// list them in groups of up to 100. -// -// The response includes five values that help you navigate from one group of -// MaxItems traffic policy instances to the next: -// -// * IsTruncated -// -// If the value of IsTruncated in the response is true, there are more traffic -// policy instances associated with the specified traffic policy. -// -// If IsTruncated is false, this response includes the last traffic policy instance -// that is associated with the specified traffic policy. -// -// * MaxItems -// -// The value that you specified for the MaxItems parameter in the request that -// produced the current response. -// -// * HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker -// -// If IsTruncated is true, these values in the response represent the first -// traffic policy instance in the next group of MaxItems traffic policy instances. -// To list more traffic policy instances, make another call to ListTrafficPolicyInstancesByPolicy, -// and specify these values in the corresponding request parameters. -// -// If IsTruncated is false, all three elements are omitted from the response. -// -// 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 Amazon Route 53's -// API operation ListTrafficPolicyInstancesByPolicy for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" -// No traffic policy instance exists with the specified ID. -// -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByPolicy -func (c *Route53) ListTrafficPolicyInstancesByPolicy(input *ListTrafficPolicyInstancesByPolicyInput) (*ListTrafficPolicyInstancesByPolicyOutput, error) { - req, out := c.ListTrafficPolicyInstancesByPolicyRequest(input) - return out, req.Send() -} - -// ListTrafficPolicyInstancesByPolicyWithContext is the same as ListTrafficPolicyInstancesByPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See ListTrafficPolicyInstancesByPolicy 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 *Route53) ListTrafficPolicyInstancesByPolicyWithContext(ctx aws.Context, input *ListTrafficPolicyInstancesByPolicyInput, opts ...request.Option) (*ListTrafficPolicyInstancesByPolicyOutput, error) { - req, out := c.ListTrafficPolicyInstancesByPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTrafficPolicyVersions = "ListTrafficPolicyVersions" - -// ListTrafficPolicyVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListTrafficPolicyVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListTrafficPolicyVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListTrafficPolicyVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListTrafficPolicyVersionsRequest method. -// req, resp := client.ListTrafficPolicyVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyVersions -func (c *Route53) ListTrafficPolicyVersionsRequest(input *ListTrafficPolicyVersionsInput) (req *request.Request, output *ListTrafficPolicyVersionsOutput) { - op := &request.Operation{ - Name: opListTrafficPolicyVersions, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/trafficpolicies/{Id}/versions", - } - - if input == nil { - input = &ListTrafficPolicyVersionsInput{} - } - - output = &ListTrafficPolicyVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTrafficPolicyVersions API operation for Amazon Route 53. -// -// Gets information about all of the versions for a specified traffic policy. -// -// Send a GET request to the /Amazon Route 53 API version/trafficpolicy resource -// and specify the ID of the traffic policy for which you want to list versions. -// -// Amazon Route 53 returns a maximum of 100 items in each response. If you have -// a lot of traffic policies, you can use the maxitems parameter to list them -// in groups of up to 100. -// -// The response includes three values that help you navigate from one group -// of maxitems traffic policies to the next: -// -// * IsTruncated -// -// If the value of IsTruncated in the response is true, there are more traffic -// policy versions associated with the specified traffic policy. -// -// If IsTruncated is false, this response includes the last traffic policy version -// that is associated with the specified traffic policy. -// -// * TrafficPolicyVersionMarker -// -// The ID of the next traffic policy version that is associated with the current -// AWS account. If you want to list more traffic policies, make another call -// to ListTrafficPolicyVersions, and specify the value of the TrafficPolicyVersionMarker -// element in the TrafficPolicyVersionMarker request parameter. -// -// If IsTruncated is false, Amazon Route 53 omits the TrafficPolicyVersionMarker -// element from the response. -// -// * MaxItems -// -// The value that you specified for the MaxItems parameter in the request that -// produced the current response. -// -// 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 Amazon Route 53's -// API operation ListTrafficPolicyVersions for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyVersions -func (c *Route53) ListTrafficPolicyVersions(input *ListTrafficPolicyVersionsInput) (*ListTrafficPolicyVersionsOutput, error) { - req, out := c.ListTrafficPolicyVersionsRequest(input) - return out, req.Send() -} - -// ListTrafficPolicyVersionsWithContext is the same as ListTrafficPolicyVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListTrafficPolicyVersions 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 *Route53) ListTrafficPolicyVersionsWithContext(ctx aws.Context, input *ListTrafficPolicyVersionsInput, opts ...request.Option) (*ListTrafficPolicyVersionsOutput, error) { - req, out := c.ListTrafficPolicyVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListVPCAssociationAuthorizations = "ListVPCAssociationAuthorizations" - -// ListVPCAssociationAuthorizationsRequest generates a "aws/request.Request" representing the -// client's request for the ListVPCAssociationAuthorizations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListVPCAssociationAuthorizations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListVPCAssociationAuthorizations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListVPCAssociationAuthorizationsRequest method. -// req, resp := client.ListVPCAssociationAuthorizationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListVPCAssociationAuthorizations -func (c *Route53) ListVPCAssociationAuthorizationsRequest(input *ListVPCAssociationAuthorizationsInput) (req *request.Request, output *ListVPCAssociationAuthorizationsOutput) { - op := &request.Operation{ - Name: opListVPCAssociationAuthorizations, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/hostedzone/{Id}/authorizevpcassociation", - } - - if input == nil { - input = &ListVPCAssociationAuthorizationsInput{} - } - - output = &ListVPCAssociationAuthorizationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVPCAssociationAuthorizations API operation for Amazon Route 53. -// -// Gets a list of the VPCs that were created by other accounts and that can -// be associated with a specified hosted zone because you've submitted one or -// more CreateVPCAssociationAuthorization requests. -// -// Send a GET request to the /2013-04-01/hostedzone/hosted zone ID/authorizevpcassociation -// resource. The response to this request includes a VPCs element with a VPC -// child element for each VPC that can be associated with the hosted zone. -// -// Amazon Route 53 returns up to 50 VPCs per page. To return fewer VPCs per -// page, include the MaxResults parameter: -// -// /2013-04-01/hostedzone/hosted zone ID/authorizevpcassociation?MaxItems=VPCs -// per page -// -// If the response includes a NextToken element, there are more VPCs to list. -// To get the next page of VPCs, submit another ListVPCAssociationAuthorizations -// request, and include the value of the NextToken element from the response -// in the NextToken request parameter: -// -// /2013-04-01/hostedzone/hosted zone ID/authorizevpcassociation?MaxItems=VPCs -// per page&NextToken= -// -// 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 Amazon Route 53's -// API operation ListVPCAssociationAuthorizations for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeInvalidPaginationToken "InvalidPaginationToken" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListVPCAssociationAuthorizations -func (c *Route53) ListVPCAssociationAuthorizations(input *ListVPCAssociationAuthorizationsInput) (*ListVPCAssociationAuthorizationsOutput, error) { - req, out := c.ListVPCAssociationAuthorizationsRequest(input) - return out, req.Send() -} - -// ListVPCAssociationAuthorizationsWithContext is the same as ListVPCAssociationAuthorizations with the addition of -// the ability to pass a context and additional request options. -// -// See ListVPCAssociationAuthorizations 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 *Route53) ListVPCAssociationAuthorizationsWithContext(ctx aws.Context, input *ListVPCAssociationAuthorizationsInput, opts ...request.Option) (*ListVPCAssociationAuthorizationsOutput, error) { - req, out := c.ListVPCAssociationAuthorizationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTestDNSAnswer = "TestDNSAnswer" - -// TestDNSAnswerRequest generates a "aws/request.Request" representing the -// client's request for the TestDNSAnswer operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See TestDNSAnswer for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the TestDNSAnswer method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the TestDNSAnswerRequest method. -// req, resp := client.TestDNSAnswerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TestDNSAnswer -func (c *Route53) TestDNSAnswerRequest(input *TestDNSAnswerInput) (req *request.Request, output *TestDNSAnswerOutput) { - op := &request.Operation{ - Name: opTestDNSAnswer, - HTTPMethod: "GET", - HTTPPath: "/2013-04-01/testdnsanswer", - } - - if input == nil { - input = &TestDNSAnswerInput{} - } - - output = &TestDNSAnswerOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestDNSAnswer API operation for Amazon Route 53. -// -// Gets the value that Amazon Route 53 returns in response to a DNS request -// for a specified record name and type. You can optionally specify the IP address -// of a DNS resolver, an EDNS0 client subnet IP address, and a subnet mask. -// -// 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 Amazon Route 53's -// API operation TestDNSAnswer for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TestDNSAnswer -func (c *Route53) TestDNSAnswer(input *TestDNSAnswerInput) (*TestDNSAnswerOutput, error) { - req, out := c.TestDNSAnswerRequest(input) - return out, req.Send() -} - -// TestDNSAnswerWithContext is the same as TestDNSAnswer with the addition of -// the ability to pass a context and additional request options. -// -// See TestDNSAnswer 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 *Route53) TestDNSAnswerWithContext(ctx aws.Context, input *TestDNSAnswerInput, opts ...request.Option) (*TestDNSAnswerOutput, error) { - req, out := c.TestDNSAnswerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateHealthCheck = "UpdateHealthCheck" - -// UpdateHealthCheckRequest generates a "aws/request.Request" representing the -// client's request for the UpdateHealthCheck operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateHealthCheck for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateHealthCheck method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateHealthCheckRequest method. -// req, resp := client.UpdateHealthCheckRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHealthCheck -func (c *Route53) UpdateHealthCheckRequest(input *UpdateHealthCheckInput) (req *request.Request, output *UpdateHealthCheckOutput) { - op := &request.Operation{ - Name: opUpdateHealthCheck, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/healthcheck/{HealthCheckId}", - } - - if input == nil { - input = &UpdateHealthCheckInput{} - } - - output = &UpdateHealthCheckOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateHealthCheck API operation for Amazon Route 53. -// -// Updates an existing health check. -// -// Send a POST request to the /2013-04-01/healthcheck/health check ID resource. -// The request body must include a document with an UpdateHealthCheckRequest -// element. For more information about updating health checks, see Creating, -// Updating, and Deleting Health Checks (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-creating-deleting.html) -// in the Amazon Route 53 Developer Guide. -// -// 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 Amazon Route 53's -// API operation UpdateHealthCheck for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck" -// No health check exists with the ID that you specified in the DeleteHealthCheck -// request. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeHealthCheckVersionMismatch "HealthCheckVersionMismatch" -// The value of HealthCheckVersion in the request doesn't match the value of -// HealthCheckVersion in the health check. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHealthCheck -func (c *Route53) UpdateHealthCheck(input *UpdateHealthCheckInput) (*UpdateHealthCheckOutput, error) { - req, out := c.UpdateHealthCheckRequest(input) - return out, req.Send() -} - -// UpdateHealthCheckWithContext is the same as UpdateHealthCheck with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateHealthCheck 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 *Route53) UpdateHealthCheckWithContext(ctx aws.Context, input *UpdateHealthCheckInput, opts ...request.Option) (*UpdateHealthCheckOutput, error) { - req, out := c.UpdateHealthCheckRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateHostedZoneComment = "UpdateHostedZoneComment" - -// UpdateHostedZoneCommentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateHostedZoneComment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateHostedZoneComment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateHostedZoneComment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateHostedZoneCommentRequest method. -// req, resp := client.UpdateHostedZoneCommentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHostedZoneComment -func (c *Route53) UpdateHostedZoneCommentRequest(input *UpdateHostedZoneCommentInput) (req *request.Request, output *UpdateHostedZoneCommentOutput) { - op := &request.Operation{ - Name: opUpdateHostedZoneComment, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/hostedzone/{Id}", - } - - if input == nil { - input = &UpdateHostedZoneCommentInput{} - } - - output = &UpdateHostedZoneCommentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateHostedZoneComment API operation for Amazon Route 53. -// -// Updates the hosted zone comment. Send a POST request to the /2013-04-01/hostedzone/hosted -// zone ID resource. -// -// 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 Amazon Route 53's -// API operation UpdateHostedZoneComment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchHostedZone "NoSuchHostedZone" -// No hosted zone exists with the ID that you specified. -// -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHostedZoneComment -func (c *Route53) UpdateHostedZoneComment(input *UpdateHostedZoneCommentInput) (*UpdateHostedZoneCommentOutput, error) { - req, out := c.UpdateHostedZoneCommentRequest(input) - return out, req.Send() -} - -// UpdateHostedZoneCommentWithContext is the same as UpdateHostedZoneComment with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateHostedZoneComment 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 *Route53) UpdateHostedZoneCommentWithContext(ctx aws.Context, input *UpdateHostedZoneCommentInput, opts ...request.Option) (*UpdateHostedZoneCommentOutput, error) { - req, out := c.UpdateHostedZoneCommentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTrafficPolicyComment = "UpdateTrafficPolicyComment" - -// UpdateTrafficPolicyCommentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTrafficPolicyComment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateTrafficPolicyComment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateTrafficPolicyComment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateTrafficPolicyCommentRequest method. -// req, resp := client.UpdateTrafficPolicyCommentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyComment -func (c *Route53) UpdateTrafficPolicyCommentRequest(input *UpdateTrafficPolicyCommentInput) (req *request.Request, output *UpdateTrafficPolicyCommentOutput) { - op := &request.Operation{ - Name: opUpdateTrafficPolicyComment, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/trafficpolicy/{Id}/{Version}", - } - - if input == nil { - input = &UpdateTrafficPolicyCommentInput{} - } - - output = &UpdateTrafficPolicyCommentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTrafficPolicyComment API operation for Amazon Route 53. -// -// Updates the comment for a specified traffic policy version. -// -// Send a POST request to the /2013-04-01/trafficpolicy/ resource. -// -// The request body must include a document with an UpdateTrafficPolicyCommentRequest -// element. -// -// 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 Amazon Route 53's -// API operation UpdateTrafficPolicyComment for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// * ErrCodeConcurrentModification "ConcurrentModification" -// Another user submitted a request to update the object at the same time that -// you did. Retry the request. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyComment -func (c *Route53) UpdateTrafficPolicyComment(input *UpdateTrafficPolicyCommentInput) (*UpdateTrafficPolicyCommentOutput, error) { - req, out := c.UpdateTrafficPolicyCommentRequest(input) - return out, req.Send() -} - -// UpdateTrafficPolicyCommentWithContext is the same as UpdateTrafficPolicyComment with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTrafficPolicyComment 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 *Route53) UpdateTrafficPolicyCommentWithContext(ctx aws.Context, input *UpdateTrafficPolicyCommentInput, opts ...request.Option) (*UpdateTrafficPolicyCommentOutput, error) { - req, out := c.UpdateTrafficPolicyCommentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTrafficPolicyInstance = "UpdateTrafficPolicyInstance" - -// UpdateTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTrafficPolicyInstance operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UpdateTrafficPolicyInstance for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UpdateTrafficPolicyInstance method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UpdateTrafficPolicyInstanceRequest method. -// req, resp := client.UpdateTrafficPolicyInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyInstance -func (c *Route53) UpdateTrafficPolicyInstanceRequest(input *UpdateTrafficPolicyInstanceInput) (req *request.Request, output *UpdateTrafficPolicyInstanceOutput) { - op := &request.Operation{ - Name: opUpdateTrafficPolicyInstance, - HTTPMethod: "POST", - HTTPPath: "/2013-04-01/trafficpolicyinstance/{Id}", - } - - if input == nil { - input = &UpdateTrafficPolicyInstanceInput{} - } - - output = &UpdateTrafficPolicyInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTrafficPolicyInstance API operation for Amazon Route 53. -// -// Updates the resource record sets in a specified hosted zone that were created -// based on the settings in a specified traffic policy version. -// -// Send a POST request to the /2013-04-01/trafficpolicyinstance/traffic policy -// ID resource. The request body must include a document with an UpdateTrafficPolicyInstanceRequest -// element. -// -// When you update a traffic policy instance, Amazon Route 53 continues to respond -// to DNS queries for the root resource record set name (such as example.com) -// while it replaces one group of resource record sets with another. Amazon -// Route 53 performs the following operations: -// -// Amazon Route 53 creates a new group of resource record sets based on the -// specified traffic policy. This is true regardless of how substantial the -// differences are between the existing resource record sets and the new resource -// record sets. -// -// When all of the new resource record sets have been created, Amazon Route -// 53 starts to respond to DNS queries for the root resource record set name -// (such as example.com) by using the new resource record sets. -// -// Amazon Route 53 deletes the old group of resource record sets that are associated -// with the root resource record set name. -// -// 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 Amazon Route 53's -// API operation UpdateTrafficPolicyInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" -// The input is not valid. -// -// * ErrCodeNoSuchTrafficPolicy "NoSuchTrafficPolicy" -// No traffic policy exists with the specified ID. -// -// * ErrCodeNoSuchTrafficPolicyInstance "NoSuchTrafficPolicyInstance" -// No traffic policy instance exists with the specified ID. -// -// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete" -// If Amazon Route 53 can't process a request before the next request arrives, -// it will reject subsequent requests for the same hosted zone and return an -// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly -// for the same request, we recommend that you wait, in intervals of increasing -// duration, before you try the request again. -// -// * ErrCodeConflictingTypes "ConflictingTypes" -// You tried to update a traffic policy instance by using a traffic policy version -// that has a different DNS type than the current type for the instance. You -// specified the type in the JSON document in the CreateTrafficPolicy or CreateTrafficPolicyVersionrequest. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyInstance -func (c *Route53) UpdateTrafficPolicyInstance(input *UpdateTrafficPolicyInstanceInput) (*UpdateTrafficPolicyInstanceOutput, error) { - req, out := c.UpdateTrafficPolicyInstanceRequest(input) - return out, req.Send() -} - -// UpdateTrafficPolicyInstanceWithContext is the same as UpdateTrafficPolicyInstance with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTrafficPolicyInstance 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 *Route53) UpdateTrafficPolicyInstanceWithContext(ctx aws.Context, input *UpdateTrafficPolicyInstanceInput, opts ...request.Option) (*UpdateTrafficPolicyInstanceOutput, error) { - req, out := c.UpdateTrafficPolicyInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// A complex type that identifies the CloudWatch alarm that you want Amazon -// Route 53 health checkers to use to determine whether this health check is -// healthy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AlarmIdentifier -type AlarmIdentifier struct { - _ struct{} `type:"structure"` - - // The name of the CloudWatch alarm that you want Amazon Route 53 health checkers - // to use to determine whether this health check is healthy. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A complex type that identifies the CloudWatch alarm that you want Amazon - // Route 53 health checkers to use to determine whether this health check is - // healthy. - // - // For the current list of CloudWatch regions, see Amazon CloudWatch (http://docs.aws.amazon.com/general/latest/gr/rande.html#cw_region) - // in the AWS Regions and Endpoints chapter of the Amazon Web Services General - // Reference. - // - // Region is a required field - Region *string `min:"1" type:"string" required:"true" enum:"CloudWatchRegion"` -} - -// String returns the string representation -func (s AlarmIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AlarmIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AlarmIdentifier"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Region == nil { - invalidParams.Add(request.NewErrParamRequired("Region")) - } - if s.Region != nil && len(*s.Region) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Region", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *AlarmIdentifier) SetName(v string) *AlarmIdentifier { - s.Name = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *AlarmIdentifier) SetRegion(v string) *AlarmIdentifier { - s.Region = &v - return s -} - -// Alias resource record sets only: Information about the CloudFront distribution, -// Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or Amazon -// Route 53 resource record set that you're redirecting queries to. An Elastic -// Beanstalk environment must have a regionalized subdomain. -// -// When creating resource record sets for a private hosted zone, note the following: -// -// * Resource record sets can't be created for CloudFront distributions in -// a private hosted zone. -// -// * Creating geolocation alias resource record sets or latency alias resource -// record sets in a private hosted zone is unsupported. -// -// * For information about creating failover resource record sets in a private -// hosted zone, see Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AliasTarget -type AliasTarget struct { - _ struct{} `type:"structure"` - - // Alias resource record sets only: The value that you specify depends on where - // you want to route queries: - // - // CloudFront distributionSpecify the domain name that CloudFront assigned when - // you created your distribution. - // - // Your CloudFront distribution must include an alternate domain name that matches - // the name of the resource record set. For example, if the name of the resource - // record set is acme.example.com, your CloudFront distribution must include - // acme.example.com as one of the alternate domain names. For more information, - // see Using Alternate Domain Names (CNAMEs) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html) - // in the Amazon CloudFront Developer Guide. - // - // Elastic Beanstalk environmentSpecify the CNAME attribute for the environment. - // (The environment must have a regionalized domain name.) You can use the following - // methods to get the value of the CNAME attribute: - // - // AWS Management Console: For information about how to get the value by using - // the console, see Using Custom Domains with AWS Elastic Beanstalk (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html) - // in the AWS Elastic Beanstalk Developer Guide. - // - // Elastic Beanstalk API: Use the DescribeEnvironments action to get the value - // of the CNAME attribute. For more information, see DescribeEnvironments (http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html) - // in the AWS Elastic Beanstalk API Reference. - // - // AWS CLI: Use the describe-environments command to get the value of the CNAME - // attribute. For more information, see describe-environments (http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html) - // in the AWS Command Line Interface Reference. - // - // ELB load balancerSpecify the DNS name that is associated with the load balancer. - // Get the DNS name by using the AWS Management Console, the ELB API, or the - // AWS CLI. - // - // AWS Management Console: Go to the EC2 page, choose Load Balancers in the - // navigation pane, choose the load balancer, choose the Description tab, and - // get the value of the DNS name field. (If you're routing traffic to a Classic - // Load Balancer, get the value that begins with dualstack.) - // - // Elastic Load Balancing API: Use DescribeLoadBalancers to get the value of - // DNSName. For more information, see the applicable guide: - // - // Classic Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html) - // - // Application Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) - // - // AWS CLI: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html) - // to get the value of DNSName. - // - // Amazon S3 bucket that is configured as a static websiteSpecify the domain - // name of the Amazon S3 website endpoint in which you created the bucket, for - // example, s3-website-us-east-2.amazonaws.com. For more information about valid - // values, see the table Amazon Simple Storage Service (S3) Website Endpoints - // (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the - // Amazon Web Services General Reference. For more information about using S3 - // buckets for websites, see Getting Started with Amazon Route 53 (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html) - // in the Amazon Route 53 Developer Guide. - // - // Another Amazon Route 53 resource record setSpecify the value of the Name - // element for a resource record set in the current hosted zone. - // - // DNSName is a required field - DNSName *string `type:"string" required:"true"` - - // Applies only to alias, weighted alias, latency alias, and failover alias - // record sets: If you set the value of EvaluateTargetHealth to true for the - // resource record set or sets in an alias, weighted alias, latency alias, or - // failover alias resource record set, and if you specify a value for HealthCheck$Id - // for every resource record set that is referenced by these alias resource - // record sets, the alias resource record sets inherit the health of the referenced - // resource record sets. - // - // In this configuration, when Amazon Route 53 receives a DNS query for an alias - // resource record set: - // - // * Amazon Route 53 looks at the resource record sets that are referenced - // by the alias resource record sets to determine which health checks they're - // using. - // - // * Amazon Route 53 checks the current status of each health check. (Amazon - // Route 53 periodically checks the health of the endpoint that is specified - // in a health check; it doesn't perform the health check when the DNS query - // arrives.) - // - // * Based on the status of the health checks, Amazon Route 53 determines - // which resource record sets are healthy. Unhealthy resource record sets - // are immediately removed from consideration. In addition, if all of the - // resource record sets that are referenced by an alias resource record set - // are unhealthy, that alias resource record set also is immediately removed - // from consideration. - // - // * Based on the configuration of the alias resource record sets (weighted - // alias or latency alias, for example) and the configuration of the resource - // record sets that they reference, Amazon Route 53 chooses a resource record - // set from the healthy resource record sets, and responds to the query. - // - // Note the following: - // - // * You can't set EvaluateTargetHealth to true when the alias target is - // a CloudFront distribution. - // - // * If the AWS resource that you specify in AliasTarget is a resource record - // set or a group of resource record sets (for example, a group of weighted - // resource record sets), but it is not another alias resource record set, - // we recommend that you associate a health check with all of the resource - // record sets in the alias target.For more information, see What Happens - // When You Omit Health Checks? (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html#dns-failover-complex-configs-hc-omitting) - // in the Amazon Route 53 Developer Guide. - // - // * If you specify an Elastic Beanstalk environment in HostedZoneId and - // DNSName, and if the environment contains an ELB load balancer, Elastic - // Load Balancing routes queries only to the healthy Amazon EC2 instances - // that are registered with the load balancer. (An environment automatically - // contains an ELB load balancer if it includes more than one EC2 instance.) - // If you set EvaluateTargetHealth to true and either no EC2 instances are - // healthy or the load balancer itself is unhealthy, Amazon Route 53 routes - // queries to other available resources that are healthy, if any. - // - // If the environment contains a single EC2 instance, there are no special requirements. - // - // * If you specify an ELB load balancer in AliasTarget, Elastic Load Balancing - // routes queries only to the healthy EC2 instances that are registered with - // the load balancer. If no EC2 instances are healthy or if the load balancer - // itself is unhealthy, and if EvaluateTargetHealth is true for the corresponding - // alias resource record set, Amazon Route 53 routes queries to other resources. - // When you create a load balancer, you configure settings for Elastic Load - // Balancing health checks; they're not Amazon Route 53 health checks, but - // they perform a similar function. Do not create Amazon Route 53 health - // checks for the EC2 instances that you register with an ELB load balancer. - // - // For more information, see How Health Checks Work in More Complex Amazon Route - // 53 Configurations (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html) - // in the Amazon Route 53 Developers Guide. - // - // * We recommend that you set EvaluateTargetHealth to true only when you - // have enough idle capacity to handle the failure of one or more endpoints. - // - // For more information and examples, see Amazon Route 53 Health Checks and - // DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) - // in the Amazon Route 53 Developer Guide. - // - // EvaluateTargetHealth is a required field - EvaluateTargetHealth *bool `type:"boolean" required:"true"` - - // Alias resource records sets only: The value used depends on where you want - // to route traffic: - // - // CloudFront distributionSpecify Z2FDTNDATAQYW2. - // - // Alias resource record sets for CloudFront can't be created in a private zone. - // - // Elastic Beanstalk environmentSpecify the hosted zone ID for the region in - // which you created the environment. The environment must have a regionalized - // subdomain. For a list of regions and the corresponding hosted zone IDs, see - // AWS Elastic Beanstalk (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region) - // in the "AWS Regions and Endpoints" chapter of the Amazon Web Services General - // Reference. - // - // ELB load balancerSpecify the value of the hosted zone ID for the load balancer. - // Use the following methods to get the hosted zone ID: - // - // Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region) - // table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services - // General Reference: Use the value in the "Amazon Route 53 Hosted Zone ID" - // column that corresponds with the region that you created your load balancer - // in. - // - // AWS Management Console: Go to the Amazon EC2 page, click Load Balancers in - // the navigation pane, select the load balancer, and get the value of the Hosted - // zone field on the Description tab. - // - // Elastic Load Balancing API: Use DescribeLoadBalancers to get the value of - // CanonicalHostedZoneNameId. For more information, see the applicable guide: - // - // Classic Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html) - // - // Application Load Balancer: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) - // - // AWS CLI: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html) - // to get the value of CanonicalHostedZoneNameID. - // - // An Amazon S3 bucket configured as a static websiteSpecify the hosted zone - // ID for the region that you created the bucket in. For more information about - // valid values, see the Amazon Simple Storage Service Website Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) - // table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services - // General Reference. - // - // Another Amazon Route 53 resource record set in your hosted zoneSpecify the - // hosted zone ID of your hosted zone. (An alias resource record set can't reference - // a resource record set in a different hosted zone.) - // - // HostedZoneId is a required field - HostedZoneId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AliasTarget) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AliasTarget) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AliasTarget) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AliasTarget"} - if s.DNSName == nil { - invalidParams.Add(request.NewErrParamRequired("DNSName")) - } - if s.EvaluateTargetHealth == nil { - invalidParams.Add(request.NewErrParamRequired("EvaluateTargetHealth")) - } - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDNSName sets the DNSName field's value. -func (s *AliasTarget) SetDNSName(v string) *AliasTarget { - s.DNSName = &v - return s -} - -// SetEvaluateTargetHealth sets the EvaluateTargetHealth field's value. -func (s *AliasTarget) SetEvaluateTargetHealth(v bool) *AliasTarget { - s.EvaluateTargetHealth = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *AliasTarget) SetHostedZoneId(v string) *AliasTarget { - s.HostedZoneId = &v - return s -} - -// A complex type that contains information about the request to associate a -// VPC with a private hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZoneRequest -type AssociateVPCWithHostedZoneInput struct { - _ struct{} `locationName:"AssociateVPCWithHostedZoneRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // Optional: A comment about the association request. - Comment *string `type:"string"` - - // The ID of the private hosted zone that you want to associate an Amazon VPC - // with. - // - // Note that you can't associate a VPC with a hosted zone that doesn't have - // an existing VPC association. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // A complex type that contains information about the VPC that you want to associate - // with a private hosted zone. - // - // VPC is a required field - VPC *VPC `type:"structure" required:"true"` -} - -// String returns the string representation -func (s AssociateVPCWithHostedZoneInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateVPCWithHostedZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateVPCWithHostedZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateVPCWithHostedZoneInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.VPC == nil { - invalidParams.Add(request.NewErrParamRequired("VPC")) - } - if s.VPC != nil { - if err := s.VPC.Validate(); err != nil { - invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *AssociateVPCWithHostedZoneInput) SetComment(v string) *AssociateVPCWithHostedZoneInput { - s.Comment = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *AssociateVPCWithHostedZoneInput) SetHostedZoneId(v string) *AssociateVPCWithHostedZoneInput { - s.HostedZoneId = &v - return s -} - -// SetVPC sets the VPC field's value. -func (s *AssociateVPCWithHostedZoneInput) SetVPC(v *VPC) *AssociateVPCWithHostedZoneInput { - s.VPC = v - return s -} - -// A complex type that contains the response information for the AssociateVPCWithHostedZone -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/AssociateVPCWithHostedZoneResponse -type AssociateVPCWithHostedZoneOutput struct { - _ struct{} `type:"structure"` - - // A complex type that describes the changes made to your hosted zone. - // - // ChangeInfo is a required field - ChangeInfo *ChangeInfo `type:"structure" required:"true"` -} - -// String returns the string representation -func (s AssociateVPCWithHostedZoneOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateVPCWithHostedZoneOutput) GoString() string { - return s.String() -} - -// SetChangeInfo sets the ChangeInfo field's value. -func (s *AssociateVPCWithHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *AssociateVPCWithHostedZoneOutput { - s.ChangeInfo = v - return s -} - -// The information for each resource record set that you want to change. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/Change -type Change struct { - _ struct{} `type:"structure"` - - // The action to perform: - // - // * CREATE: Creates a resource record set that has the specified values. - // - // * DELETE: Deletes a existing resource record set. - // - // To delete the resource record set that is associated with a traffic policy - // instance, use DeleteTrafficPolicyInstance. Amazon Route 53 will delete - // the resource record set automatically. If you delete the resource record - // set by using ChangeResourceRecordSets, Amazon Route 53 doesn't automatically - // delete the traffic policy instance, and you'll continue to be charged - // for it even though it's no longer in use. - // - // * UPSERT: If a resource record set doesn't already exist, Amazon Route - // 53 creates it. If a resource record set does exist, Amazon Route 53 updates - // it with the values in the request. - // - // The values that you need to include in the request depend on the type of - // resource record set that you're creating, deleting, or updating: - // - // Basic resource record sets (excluding alias, failover, geolocation, latency, - // and weighted resource record sets) - // - // * Name - // - // * Type - // - // * TTL - // - // Failover, geolocation, latency, or weighted resource record sets (excluding - // alias resource record sets) - // - // * Name - // - // * Type - // - // * TTL - // - // * SetIdentifier - // - // Alias resource record sets (including failover alias, geolocation alias, - // latency alias, and weighted alias resource record sets) - // - // * Name - // - // * Type - // - // * AliasTarget (includes DNSName, EvaluateTargetHealth, and HostedZoneId) - // - // * SetIdentifier (for failover, geolocation, latency, and weighted resource - // record sets) - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ChangeAction"` - - // Information about the resource record set to create, delete, or update. - // - // ResourceRecordSet is a required field - ResourceRecordSet *ResourceRecordSet `type:"structure" required:"true"` -} - -// String returns the string representation -func (s Change) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Change) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Change) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Change"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.ResourceRecordSet == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceRecordSet")) - } - if s.ResourceRecordSet != nil { - if err := s.ResourceRecordSet.Validate(); err != nil { - invalidParams.AddNested("ResourceRecordSet", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *Change) SetAction(v string) *Change { - s.Action = &v - return s -} - -// SetResourceRecordSet sets the ResourceRecordSet field's value. -func (s *Change) SetResourceRecordSet(v *ResourceRecordSet) *Change { - s.ResourceRecordSet = v - return s -} - -// The information for a change request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeBatch -type ChangeBatch struct { - _ struct{} `type:"structure"` - - // Information about the changes to make to the record sets. - // - // Changes is a required field - Changes []*Change `locationNameList:"Change" min:"1" type:"list" required:"true"` - - // Optional: Any comments you want to include about a change batch request. - Comment *string `type:"string"` -} - -// String returns the string representation -func (s ChangeBatch) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeBatch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChangeBatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChangeBatch"} - if s.Changes == nil { - invalidParams.Add(request.NewErrParamRequired("Changes")) - } - if s.Changes != nil && len(s.Changes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Changes", 1)) - } - if s.Changes != nil { - for i, v := range s.Changes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Changes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChanges sets the Changes field's value. -func (s *ChangeBatch) SetChanges(v []*Change) *ChangeBatch { - s.Changes = v - return s -} - -// SetComment sets the Comment field's value. -func (s *ChangeBatch) SetComment(v string) *ChangeBatch { - s.Comment = &v - return s -} - -// A complex type that describes change information about changes made to your -// hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeInfo -type ChangeInfo struct { - _ struct{} `type:"structure"` - - // A complex type that describes change information about changes made to your - // hosted zone. - // - // This element contains an ID that you use when performing a GetChange action - // to get detailed information about the change. - Comment *string `type:"string"` - - // The ID of the request. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The current state of the request. PENDING indicates that this request has - // not yet been applied to all Amazon Route 53 DNS servers. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ChangeStatus"` - - // The date and time the change request was submitted, in Coordinated Universal - // Time (UTC) format: YYYY-MM-DDThh:mm:ssZ. For more information, see the Wikipedia - // entry ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601). - // - // SubmittedAt is a required field - SubmittedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` -} - -// String returns the string representation -func (s ChangeInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeInfo) GoString() string { - return s.String() -} - -// SetComment sets the Comment field's value. -func (s *ChangeInfo) SetComment(v string) *ChangeInfo { - s.Comment = &v - return s -} - -// SetId sets the Id field's value. -func (s *ChangeInfo) SetId(v string) *ChangeInfo { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ChangeInfo) SetStatus(v string) *ChangeInfo { - s.Status = &v - return s -} - -// SetSubmittedAt sets the SubmittedAt field's value. -func (s *ChangeInfo) SetSubmittedAt(v time.Time) *ChangeInfo { - s.SubmittedAt = &v - return s -} - -// A complex type that contains change information for the resource record set. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSetsRequest -type ChangeResourceRecordSetsInput struct { - _ struct{} `locationName:"ChangeResourceRecordSetsRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // A complex type that contains an optional comment and the Changes element. - // - // ChangeBatch is a required field - ChangeBatch *ChangeBatch `type:"structure" required:"true"` - - // The ID of the hosted zone that contains the resource record sets that you - // want to change. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s ChangeResourceRecordSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeResourceRecordSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChangeResourceRecordSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChangeResourceRecordSetsInput"} - if s.ChangeBatch == nil { - invalidParams.Add(request.NewErrParamRequired("ChangeBatch")) - } - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.ChangeBatch != nil { - if err := s.ChangeBatch.Validate(); err != nil { - invalidParams.AddNested("ChangeBatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChangeBatch sets the ChangeBatch field's value. -func (s *ChangeResourceRecordSetsInput) SetChangeBatch(v *ChangeBatch) *ChangeResourceRecordSetsInput { - s.ChangeBatch = v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *ChangeResourceRecordSetsInput) SetHostedZoneId(v string) *ChangeResourceRecordSetsInput { - s.HostedZoneId = &v - return s -} - -// A complex type containing the response for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSetsResponse -type ChangeResourceRecordSetsOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains information about changes made to your hosted - // zone. - // - // This element contains an ID that you use when performing a GetChange action - // to get detailed information about the change. - // - // ChangeInfo is a required field - ChangeInfo *ChangeInfo `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ChangeResourceRecordSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeResourceRecordSetsOutput) GoString() string { - return s.String() -} - -// SetChangeInfo sets the ChangeInfo field's value. -func (s *ChangeResourceRecordSetsOutput) SetChangeInfo(v *ChangeInfo) *ChangeResourceRecordSetsOutput { - s.ChangeInfo = v - return s -} - -// A complex type that contains information about the tags that you want to -// add, edit, or delete. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResourceRequest -type ChangeTagsForResourceInput struct { - _ struct{} `locationName:"ChangeTagsForResourceRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // A complex type that contains a list of the tags that you want to add to the - // specified health check or hosted zone and/or the tags for which you want - // to edit the Value element. - // - // You can add a maximum of 10 tags to a health check or a hosted zone. - AddTags []*Tag `locationNameList:"Tag" min:"1" type:"list"` - - // A complex type that contains a list of the tags that you want to delete from - // the specified health check or hosted zone. You can specify up to 10 keys. - RemoveTagKeys []*string `locationNameList:"Key" min:"1" type:"list"` - - // The ID of the resource for which you want to add, change, or delete tags. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` - - // The type of the resource. - // - // * The resource type for health checks is healthcheck. - // - // * The resource type for hosted zones is hostedzone. - // - // ResourceType is a required field - ResourceType *string `location:"uri" locationName:"ResourceType" type:"string" required:"true" enum:"TagResourceType"` -} - -// String returns the string representation -func (s ChangeTagsForResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChangeTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChangeTagsForResourceInput"} - if s.AddTags != nil && len(s.AddTags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AddTags", 1)) - } - if s.RemoveTagKeys != nil && len(s.RemoveTagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RemoveTagKeys", 1)) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddTags sets the AddTags field's value. -func (s *ChangeTagsForResourceInput) SetAddTags(v []*Tag) *ChangeTagsForResourceInput { - s.AddTags = v - return s -} - -// SetRemoveTagKeys sets the RemoveTagKeys field's value. -func (s *ChangeTagsForResourceInput) SetRemoveTagKeys(v []*string) *ChangeTagsForResourceInput { - s.RemoveTagKeys = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ChangeTagsForResourceInput) SetResourceId(v string) *ChangeTagsForResourceInput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ChangeTagsForResourceInput) SetResourceType(v string) *ChangeTagsForResourceInput { - s.ResourceType = &v - return s -} - -// Empty response for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeTagsForResourceResponse -type ChangeTagsForResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ChangeTagsForResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeTagsForResourceOutput) GoString() string { - return s.String() -} - -// A complex type that contains information about the CloudWatch alarm that -// Amazon Route 53 is monitoring for this health check. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CloudWatchAlarmConfiguration -type CloudWatchAlarmConfiguration struct { - _ struct{} `type:"structure"` - - // For the metric that the CloudWatch alarm is associated with, the arithmetic - // operation that is used for the comparison. - // - // ComparisonOperator is a required field - ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` - - // For the metric that the CloudWatch alarm is associated with, a complex type - // that contains information about the dimensions for the metric.For information, - // see Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) - // in the Amazon CloudWatch User Guide. - Dimensions []*Dimension `locationNameList:"Dimension" type:"list"` - - // For the metric that the CloudWatch alarm is associated with, the number of - // periods that the metric is compared to the threshold. - // - // EvaluationPeriods is a required field - EvaluationPeriods *int64 `min:"1" type:"integer" required:"true"` - - // The name of the CloudWatch metric that the alarm is associated with. - // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` - - // The namespace of the metric that the alarm is associated with. For more information, - // see Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) - // in the Amazon CloudWatch User Guide. - // - // Namespace is a required field - Namespace *string `min:"1" type:"string" required:"true"` - - // For the metric that the CloudWatch alarm is associated with, the duration - // of one evaluation period in seconds. - // - // Period is a required field - Period *int64 `min:"60" type:"integer" required:"true"` - - // For the metric that the CloudWatch alarm is associated with, the statistic - // that is applied to the metric. - // - // Statistic is a required field - Statistic *string `type:"string" required:"true" enum:"Statistic"` - - // For the metric that the CloudWatch alarm is associated with, the value the - // metric is compared with. - // - // Threshold is a required field - Threshold *float64 `type:"double" required:"true"` -} - -// String returns the string representation -func (s CloudWatchAlarmConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloudWatchAlarmConfiguration) GoString() string { - return s.String() -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *CloudWatchAlarmConfiguration) SetComparisonOperator(v string) *CloudWatchAlarmConfiguration { - s.ComparisonOperator = &v - return s -} - -// SetDimensions sets the Dimensions field's value. -func (s *CloudWatchAlarmConfiguration) SetDimensions(v []*Dimension) *CloudWatchAlarmConfiguration { - s.Dimensions = v - return s -} - -// SetEvaluationPeriods sets the EvaluationPeriods field's value. -func (s *CloudWatchAlarmConfiguration) SetEvaluationPeriods(v int64) *CloudWatchAlarmConfiguration { - s.EvaluationPeriods = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *CloudWatchAlarmConfiguration) SetMetricName(v string) *CloudWatchAlarmConfiguration { - s.MetricName = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *CloudWatchAlarmConfiguration) SetNamespace(v string) *CloudWatchAlarmConfiguration { - s.Namespace = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *CloudWatchAlarmConfiguration) SetPeriod(v int64) *CloudWatchAlarmConfiguration { - s.Period = &v - return s -} - -// SetStatistic sets the Statistic field's value. -func (s *CloudWatchAlarmConfiguration) SetStatistic(v string) *CloudWatchAlarmConfiguration { - s.Statistic = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *CloudWatchAlarmConfiguration) SetThreshold(v float64) *CloudWatchAlarmConfiguration { - s.Threshold = &v - return s -} - -// A complex type that contains the health check request information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHealthCheckRequest -type CreateHealthCheckInput struct { - _ struct{} `locationName:"CreateHealthCheckRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // A unique string that identifies the request and that allows failed CreateHealthCheck - // requests to be retried without the risk of executing the operation twice. - // You must use a unique CallerReference string every time you create a health - // check. - // - // CallerReference is a required field - CallerReference *string `min:"1" type:"string" required:"true"` - - // A complex type that contains the response to a CreateHealthCheck request. - // - // HealthCheckConfig is a required field - HealthCheckConfig *HealthCheckConfig `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateHealthCheckInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHealthCheckInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateHealthCheckInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateHealthCheckInput"} - if s.CallerReference == nil { - invalidParams.Add(request.NewErrParamRequired("CallerReference")) - } - if s.CallerReference != nil && len(*s.CallerReference) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CallerReference", 1)) - } - if s.HealthCheckConfig == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheckConfig")) - } - if s.HealthCheckConfig != nil { - if err := s.HealthCheckConfig.Validate(); err != nil { - invalidParams.AddNested("HealthCheckConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallerReference sets the CallerReference field's value. -func (s *CreateHealthCheckInput) SetCallerReference(v string) *CreateHealthCheckInput { - s.CallerReference = &v - return s -} - -// SetHealthCheckConfig sets the HealthCheckConfig field's value. -func (s *CreateHealthCheckInput) SetHealthCheckConfig(v *HealthCheckConfig) *CreateHealthCheckInput { - s.HealthCheckConfig = v - return s -} - -// A complex type containing the response information for the new health check. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHealthCheckResponse -type CreateHealthCheckOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains identifying information about the health check. - // - // HealthCheck is a required field - HealthCheck *HealthCheck `type:"structure" required:"true"` - - // The unique URL representing the new health check. - // - // Location is a required field - Location *string `location:"header" locationName:"Location" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateHealthCheckOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHealthCheckOutput) GoString() string { - return s.String() -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *CreateHealthCheckOutput) SetHealthCheck(v *HealthCheck) *CreateHealthCheckOutput { - s.HealthCheck = v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateHealthCheckOutput) SetLocation(v string) *CreateHealthCheckOutput { - s.Location = &v - return s -} - -// A complex type containing the hosted zone request information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHostedZoneRequest -type CreateHostedZoneInput struct { - _ struct{} `locationName:"CreateHostedZoneRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // A unique string that identifies the request and that allows failed CreateHostedZone - // requests to be retried without the risk of executing the operation twice. - // You must use a unique CallerReference string every time you create a hosted - // zone. CallerReference can be any unique string, for example, a date/time - // stamp. - // - // CallerReference is a required field - CallerReference *string `min:"1" type:"string" required:"true"` - - // If you want to associate a reusable delegation set with this hosted zone, - // the ID that Amazon Route 53 assigned to the reusable delegation set when - // you created it. For more information about reusable delegation sets, see - // CreateReusableDelegationSet. - // - // TypeString - // - // DefaultNone - // - // ParentCreatedHostedZoneRequest - DelegationSetId *string `type:"string"` - - // (Optional) A complex type that contains an optional comment about your hosted - // zone. If you don't want to specify a comment, omit both the HostedZoneConfig - // and Comment elements. - HostedZoneConfig *HostedZoneConfig `type:"structure"` - - // The name of the domain. For resource record types that include a domain name, - // specify a fully qualified domain name, for example, www.example.com. The - // trailing dot is optional; Amazon Route 53 assumes that the domain name is - // fully qualified. This means that Amazon Route 53 treats www.example.com (without - // a trailing dot) and www.example.com. (with a trailing dot) as identical. - // - // If you're creating a public hosted zone, this is the name you have registered - // with your DNS registrar. If your domain name is registered with a registrar - // other than Amazon Route 53, change the name servers for your domain to the - // set of NameServers that CreateHostedZone returns in the DelegationSet element. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The VPC that you want your hosted zone to be associated with. By providing - // this parameter, your newly created hosted can't be resolved anywhere other - // than the given VPC. - VPC *VPC `type:"structure"` -} - -// String returns the string representation -func (s CreateHostedZoneInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHostedZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateHostedZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateHostedZoneInput"} - if s.CallerReference == nil { - invalidParams.Add(request.NewErrParamRequired("CallerReference")) - } - if s.CallerReference != nil && len(*s.CallerReference) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CallerReference", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.VPC != nil { - if err := s.VPC.Validate(); err != nil { - invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallerReference sets the CallerReference field's value. -func (s *CreateHostedZoneInput) SetCallerReference(v string) *CreateHostedZoneInput { - s.CallerReference = &v - return s -} - -// SetDelegationSetId sets the DelegationSetId field's value. -func (s *CreateHostedZoneInput) SetDelegationSetId(v string) *CreateHostedZoneInput { - s.DelegationSetId = &v - return s -} - -// SetHostedZoneConfig sets the HostedZoneConfig field's value. -func (s *CreateHostedZoneInput) SetHostedZoneConfig(v *HostedZoneConfig) *CreateHostedZoneInput { - s.HostedZoneConfig = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateHostedZoneInput) SetName(v string) *CreateHostedZoneInput { - s.Name = &v - return s -} - -// SetVPC sets the VPC field's value. -func (s *CreateHostedZoneInput) SetVPC(v *VPC) *CreateHostedZoneInput { - s.VPC = v - return s -} - -// A complex type containing the response information for the hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateHostedZoneResponse -type CreateHostedZoneOutput struct { - _ struct{} `type:"structure"` - - // A complex type that describes the changes made to your hosted zone. - // - // ChangeInfo is a required field - ChangeInfo *ChangeInfo `type:"structure" required:"true"` - - // A complex type that describes the name servers for this hosted zone. - // - // DelegationSet is a required field - DelegationSet *DelegationSet `type:"structure" required:"true"` - - // A complex type that contains general information about the hosted zone. - // - // HostedZone is a required field - HostedZone *HostedZone `type:"structure" required:"true"` - - // The unique URL representing the new hosted zone. - // - // Location is a required field - Location *string `location:"header" locationName:"Location" type:"string" required:"true"` - - // A complex type that contains information about an Amazon VPC that you associated - // with this hosted zone. - VPC *VPC `type:"structure"` -} - -// String returns the string representation -func (s CreateHostedZoneOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateHostedZoneOutput) GoString() string { - return s.String() -} - -// SetChangeInfo sets the ChangeInfo field's value. -func (s *CreateHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *CreateHostedZoneOutput { - s.ChangeInfo = v - return s -} - -// SetDelegationSet sets the DelegationSet field's value. -func (s *CreateHostedZoneOutput) SetDelegationSet(v *DelegationSet) *CreateHostedZoneOutput { - s.DelegationSet = v - return s -} - -// SetHostedZone sets the HostedZone field's value. -func (s *CreateHostedZoneOutput) SetHostedZone(v *HostedZone) *CreateHostedZoneOutput { - s.HostedZone = v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateHostedZoneOutput) SetLocation(v string) *CreateHostedZoneOutput { - s.Location = &v - return s -} - -// SetVPC sets the VPC field's value. -func (s *CreateHostedZoneOutput) SetVPC(v *VPC) *CreateHostedZoneOutput { - s.VPC = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateReusableDelegationSetRequest -type CreateReusableDelegationSetInput struct { - _ struct{} `locationName:"CreateReusableDelegationSetRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // A unique string that identifies the request, and that allows you to retry - // failed CreateReusableDelegationSet requests without the risk of executing - // the operation twice. You must use a unique CallerReference string every time - // you submit a CreateReusableDelegationSet request. CallerReference can be - // any unique string, for example a date/time stamp. - // - // CallerReference is a required field - CallerReference *string `min:"1" type:"string" required:"true"` - - // If you want to mark the delegation set for an existing hosted zone as reusable, - // the ID for that hosted zone. - HostedZoneId *string `type:"string"` -} - -// String returns the string representation -func (s CreateReusableDelegationSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReusableDelegationSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReusableDelegationSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReusableDelegationSetInput"} - if s.CallerReference == nil { - invalidParams.Add(request.NewErrParamRequired("CallerReference")) - } - if s.CallerReference != nil && len(*s.CallerReference) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CallerReference", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallerReference sets the CallerReference field's value. -func (s *CreateReusableDelegationSetInput) SetCallerReference(v string) *CreateReusableDelegationSetInput { - s.CallerReference = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *CreateReusableDelegationSetInput) SetHostedZoneId(v string) *CreateReusableDelegationSetInput { - s.HostedZoneId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateReusableDelegationSetResponse -type CreateReusableDelegationSetOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains name server information. - // - // DelegationSet is a required field - DelegationSet *DelegationSet `type:"structure" required:"true"` - - // The unique URL representing the new reusable delegation set. - // - // Location is a required field - Location *string `location:"header" locationName:"Location" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateReusableDelegationSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateReusableDelegationSetOutput) GoString() string { - return s.String() -} - -// SetDelegationSet sets the DelegationSet field's value. -func (s *CreateReusableDelegationSetOutput) SetDelegationSet(v *DelegationSet) *CreateReusableDelegationSetOutput { - s.DelegationSet = v - return s -} - -// SetLocation sets the Location field's value. -func (s *CreateReusableDelegationSetOutput) SetLocation(v string) *CreateReusableDelegationSetOutput { - s.Location = &v - return s -} - -// A complex type that contains information about the traffic policy that you -// want to create. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyRequest -type CreateTrafficPolicyInput struct { - _ struct{} `locationName:"CreateTrafficPolicyRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // (Optional) Any comments that you want to include about the traffic policy. - Comment *string `type:"string"` - - // The definition of this traffic policy in JSON format. For more information, - // see Traffic Policy Document Format (http://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html). - // - // Document is a required field - Document *string `type:"string" required:"true"` - - // The name of the traffic policy. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateTrafficPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrafficPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrafficPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrafficPolicyInput"} - if s.Document == nil { - invalidParams.Add(request.NewErrParamRequired("Document")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *CreateTrafficPolicyInput) SetComment(v string) *CreateTrafficPolicyInput { - s.Comment = &v - return s -} - -// SetDocument sets the Document field's value. -func (s *CreateTrafficPolicyInput) SetDocument(v string) *CreateTrafficPolicyInput { - s.Document = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTrafficPolicyInput) SetName(v string) *CreateTrafficPolicyInput { - s.Name = &v - return s -} - -// A complex type that contains information about the resource record sets that -// you want to create based on a specified traffic policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyInstanceRequest -type CreateTrafficPolicyInstanceInput struct { - _ struct{} `locationName:"CreateTrafficPolicyInstanceRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // The ID of the hosted zone in which you want Amazon Route 53 to create resource - // record sets by using the configuration in a traffic policy. - // - // HostedZoneId is a required field - HostedZoneId *string `type:"string" required:"true"` - - // The domain name (such as example.com) or subdomain name (such as www.example.com) - // for which Amazon Route 53 responds to DNS queries by using the resource record - // sets that Amazon Route 53 creates for this traffic policy instance. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // (Optional) The TTL that you want Amazon Route 53 to assign to all of the - // resource record sets that it creates in the specified hosted zone. - // - // TTL is a required field - TTL *int64 `type:"long" required:"true"` - - // The ID of the traffic policy that you want to use to create resource record - // sets in the specified hosted zone. - // - // TrafficPolicyId is a required field - TrafficPolicyId *string `min:"1" type:"string" required:"true"` - - // The version of the traffic policy that you want to use to create resource - // record sets in the specified hosted zone. - // - // TrafficPolicyVersion is a required field - TrafficPolicyVersion *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s CreateTrafficPolicyInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrafficPolicyInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrafficPolicyInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrafficPolicyInstanceInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.TTL == nil { - invalidParams.Add(request.NewErrParamRequired("TTL")) - } - if s.TrafficPolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficPolicyId")) - } - if s.TrafficPolicyId != nil && len(*s.TrafficPolicyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyId", 1)) - } - if s.TrafficPolicyVersion == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficPolicyVersion")) - } - if s.TrafficPolicyVersion != nil && *s.TrafficPolicyVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("TrafficPolicyVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *CreateTrafficPolicyInstanceInput) SetHostedZoneId(v string) *CreateTrafficPolicyInstanceInput { - s.HostedZoneId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTrafficPolicyInstanceInput) SetName(v string) *CreateTrafficPolicyInstanceInput { - s.Name = &v - return s -} - -// SetTTL sets the TTL field's value. -func (s *CreateTrafficPolicyInstanceInput) SetTTL(v int64) *CreateTrafficPolicyInstanceInput { - s.TTL = &v - return s -} - -// SetTrafficPolicyId sets the TrafficPolicyId field's value. -func (s *CreateTrafficPolicyInstanceInput) SetTrafficPolicyId(v string) *CreateTrafficPolicyInstanceInput { - s.TrafficPolicyId = &v - return s -} - -// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. -func (s *CreateTrafficPolicyInstanceInput) SetTrafficPolicyVersion(v int64) *CreateTrafficPolicyInstanceInput { - s.TrafficPolicyVersion = &v - return s -} - -// A complex type that contains the response information for the CreateTrafficPolicyInstance -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyInstanceResponse -type CreateTrafficPolicyInstanceOutput struct { - _ struct{} `type:"structure"` - - // A unique URL that represents a new traffic policy instance. - // - // Location is a required field - Location *string `location:"header" locationName:"Location" type:"string" required:"true"` - - // A complex type that contains settings for the new traffic policy instance. - // - // TrafficPolicyInstance is a required field - TrafficPolicyInstance *TrafficPolicyInstance `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateTrafficPolicyInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrafficPolicyInstanceOutput) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *CreateTrafficPolicyInstanceOutput) SetLocation(v string) *CreateTrafficPolicyInstanceOutput { - s.Location = &v - return s -} - -// SetTrafficPolicyInstance sets the TrafficPolicyInstance field's value. -func (s *CreateTrafficPolicyInstanceOutput) SetTrafficPolicyInstance(v *TrafficPolicyInstance) *CreateTrafficPolicyInstanceOutput { - s.TrafficPolicyInstance = v - return s -} - -// A complex type that contains the response information for the CreateTrafficPolicy -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyResponse -type CreateTrafficPolicyOutput struct { - _ struct{} `type:"structure"` - - // A unique URL that represents a new traffic policy. - // - // Location is a required field - Location *string `location:"header" locationName:"Location" type:"string" required:"true"` - - // A complex type that contains settings for the new traffic policy. - // - // TrafficPolicy is a required field - TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateTrafficPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrafficPolicyOutput) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *CreateTrafficPolicyOutput) SetLocation(v string) *CreateTrafficPolicyOutput { - s.Location = &v - return s -} - -// SetTrafficPolicy sets the TrafficPolicy field's value. -func (s *CreateTrafficPolicyOutput) SetTrafficPolicy(v *TrafficPolicy) *CreateTrafficPolicyOutput { - s.TrafficPolicy = v - return s -} - -// A complex type that contains information about the traffic policy for which -// you want to create a new version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyVersionRequest -type CreateTrafficPolicyVersionInput struct { - _ struct{} `locationName:"CreateTrafficPolicyVersionRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // The comment that you specified in the CreateTrafficPolicyVersion request, - // if any. - Comment *string `type:"string"` - - // The definition of this version of the traffic policy, in JSON format. You - // specified the JSON in the CreateTrafficPolicyVersion request. For more information - // about the JSON format, see CreateTrafficPolicy. - // - // Document is a required field - Document *string `type:"string" required:"true"` - - // The ID of the traffic policy for which you want to create a new version. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateTrafficPolicyVersionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrafficPolicyVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrafficPolicyVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrafficPolicyVersionInput"} - if s.Document == nil { - invalidParams.Add(request.NewErrParamRequired("Document")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *CreateTrafficPolicyVersionInput) SetComment(v string) *CreateTrafficPolicyVersionInput { - s.Comment = &v - return s -} - -// SetDocument sets the Document field's value. -func (s *CreateTrafficPolicyVersionInput) SetDocument(v string) *CreateTrafficPolicyVersionInput { - s.Document = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateTrafficPolicyVersionInput) SetId(v string) *CreateTrafficPolicyVersionInput { - s.Id = &v - return s -} - -// A complex type that contains the response information for the CreateTrafficPolicyVersion -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicyVersionResponse -type CreateTrafficPolicyVersionOutput struct { - _ struct{} `type:"structure"` - - // A unique URL that represents a new traffic policy version. - // - // Location is a required field - Location *string `location:"header" locationName:"Location" type:"string" required:"true"` - - // A complex type that contains settings for the new version of the traffic - // policy. - // - // TrafficPolicy is a required field - TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateTrafficPolicyVersionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTrafficPolicyVersionOutput) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *CreateTrafficPolicyVersionOutput) SetLocation(v string) *CreateTrafficPolicyVersionOutput { - s.Location = &v - return s -} - -// SetTrafficPolicy sets the TrafficPolicy field's value. -func (s *CreateTrafficPolicyVersionOutput) SetTrafficPolicy(v *TrafficPolicy) *CreateTrafficPolicyVersionOutput { - s.TrafficPolicy = v - return s -} - -// A complex type that contains information about the request to authorize associating -// a VPC with your private hosted zone. Authorization is only required when -// a private hosted zone and a VPC were created by using different accounts. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateVPCAssociationAuthorizationRequest -type CreateVPCAssociationAuthorizationInput struct { - _ struct{} `locationName:"CreateVPCAssociationAuthorizationRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // The ID of the private hosted zone that you want to authorize associating - // a VPC with. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // A complex type that contains the VPC ID and region for the VPC that you want - // to authorize associating with your hosted zone. - // - // VPC is a required field - VPC *VPC `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateVPCAssociationAuthorizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCAssociationAuthorizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVPCAssociationAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVPCAssociationAuthorizationInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.VPC == nil { - invalidParams.Add(request.NewErrParamRequired("VPC")) - } - if s.VPC != nil { - if err := s.VPC.Validate(); err != nil { - invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *CreateVPCAssociationAuthorizationInput) SetHostedZoneId(v string) *CreateVPCAssociationAuthorizationInput { - s.HostedZoneId = &v - return s -} - -// SetVPC sets the VPC field's value. -func (s *CreateVPCAssociationAuthorizationInput) SetVPC(v *VPC) *CreateVPCAssociationAuthorizationInput { - s.VPC = v - return s -} - -// A complex type that contains the response information from a CreateVPCAssociationAuthorization -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateVPCAssociationAuthorizationResponse -type CreateVPCAssociationAuthorizationOutput struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone that you authorized associating a VPC with. - // - // HostedZoneId is a required field - HostedZoneId *string `type:"string" required:"true"` - - // The VPC that you authorized associating with a hosted zone. - // - // VPC is a required field - VPC *VPC `type:"structure" required:"true"` -} - -// String returns the string representation -func (s CreateVPCAssociationAuthorizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateVPCAssociationAuthorizationOutput) GoString() string { - return s.String() -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *CreateVPCAssociationAuthorizationOutput) SetHostedZoneId(v string) *CreateVPCAssociationAuthorizationOutput { - s.HostedZoneId = &v - return s -} - -// SetVPC sets the VPC field's value. -func (s *CreateVPCAssociationAuthorizationOutput) SetVPC(v *VPC) *CreateVPCAssociationAuthorizationOutput { - s.VPC = v - return s -} - -// A complex type that describes the name servers for this hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DelegationSet -type DelegationSet struct { - _ struct{} `type:"structure"` - - // A unique string that identifies the request, and that allows you to retry - // failed CreateReusableDelegationSet requests without the risk of executing - // the operation twice. You must use a unique CallerReference string every time - // you submit a CreateReusableDelegationSet request. CallerReference can be - // any unique string, for example, a date/time stamp. - CallerReference *string `min:"1" type:"string"` - - // The ID that Amazon Route 53 assigns to a reusable delegation set. - Id *string `type:"string"` - - // A complex type that contains a list of the authoritative name servers for - // the hosted zone. - // - // NameServers is a required field - NameServers []*string `locationNameList:"NameServer" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s DelegationSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DelegationSet) GoString() string { - return s.String() -} - -// SetCallerReference sets the CallerReference field's value. -func (s *DelegationSet) SetCallerReference(v string) *DelegationSet { - s.CallerReference = &v - return s -} - -// SetId sets the Id field's value. -func (s *DelegationSet) SetId(v string) *DelegationSet { - s.Id = &v - return s -} - -// SetNameServers sets the NameServers field's value. -func (s *DelegationSet) SetNameServers(v []*string) *DelegationSet { - s.NameServers = v - return s -} - -// This action deletes a health check. Send a DELETE request to the /2013-04-01/DeleteHealthCheckRequest -// resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHealthCheckRequest -type DeleteHealthCheckInput struct { - _ struct{} `type:"structure"` - - // The ID of the health check that you want to delete. - // - // HealthCheckId is a required field - HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteHealthCheckInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHealthCheckInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteHealthCheckInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteHealthCheckInput"} - if s.HealthCheckId == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheckId sets the HealthCheckId field's value. -func (s *DeleteHealthCheckInput) SetHealthCheckId(v string) *DeleteHealthCheckInput { - s.HealthCheckId = &v - return s -} - -// An empty element. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHealthCheckResponse -type DeleteHealthCheckOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteHealthCheckOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHealthCheckOutput) GoString() string { - return s.String() -} - -// A complex type that contains information about the hosted zone that you want -// to delete. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHostedZoneRequest -type DeleteHostedZoneInput struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone you want to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteHostedZoneInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHostedZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteHostedZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteHostedZoneInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteHostedZoneInput) SetId(v string) *DeleteHostedZoneInput { - s.Id = &v - return s -} - -// A complex type containing the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteHostedZoneResponse -type DeleteHostedZoneOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains the ID, the status, and the date and time of - // your delete request. - // - // ChangeInfo is a required field - ChangeInfo *ChangeInfo `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DeleteHostedZoneOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteHostedZoneOutput) GoString() string { - return s.String() -} - -// SetChangeInfo sets the ChangeInfo field's value. -func (s *DeleteHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *DeleteHostedZoneOutput { - s.ChangeInfo = v - return s -} - -// A complex type containing the information for the delete request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteReusableDelegationSetRequest -type DeleteReusableDelegationSetInput struct { - _ struct{} `type:"structure"` - - // The ID of the reusable delegation set you want to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteReusableDelegationSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReusableDelegationSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReusableDelegationSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReusableDelegationSetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteReusableDelegationSetInput) SetId(v string) *DeleteReusableDelegationSetInput { - s.Id = &v - return s -} - -// An empty element. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteReusableDelegationSetResponse -type DeleteReusableDelegationSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteReusableDelegationSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteReusableDelegationSetOutput) GoString() string { - return s.String() -} - -// A request to delete a specified traffic policy version. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyRequest -type DeleteTrafficPolicyInput struct { - _ struct{} `type:"structure"` - - // The ID of the traffic policy that you want to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` - - // The version number of the traffic policy that you want to delete. - // - // Version is a required field - Version *int64 `location:"uri" locationName:"Version" min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s DeleteTrafficPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrafficPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrafficPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficPolicyInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && *s.Version < 1 { - invalidParams.Add(request.NewErrParamMinValue("Version", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteTrafficPolicyInput) SetId(v string) *DeleteTrafficPolicyInput { - s.Id = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *DeleteTrafficPolicyInput) SetVersion(v int64) *DeleteTrafficPolicyInput { - s.Version = &v - return s -} - -// A complex type that contains information about the traffic policy instance -// that you want to delete. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstanceRequest -type DeleteTrafficPolicyInstanceInput struct { - _ struct{} `type:"structure"` - - // The ID of the traffic policy instance that you want to delete. - // - // When you delete a traffic policy instance, Amazon Route 53 also deletes all - // of the resource record sets that were created when you created the traffic - // policy instance. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteTrafficPolicyInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrafficPolicyInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrafficPolicyInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficPolicyInstanceInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteTrafficPolicyInstanceInput) SetId(v string) *DeleteTrafficPolicyInstanceInput { - s.Id = &v - return s -} - -// An empty element. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstanceResponse -type DeleteTrafficPolicyInstanceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteTrafficPolicyInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrafficPolicyInstanceOutput) GoString() string { - return s.String() -} - -// An empty element. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyResponse -type DeleteTrafficPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteTrafficPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTrafficPolicyOutput) GoString() string { - return s.String() -} - -// A complex type that contains information about the request to remove authorization -// to associate a VPC that was created by one AWS account with a hosted zone -// that was created with a different AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteVPCAssociationAuthorizationRequest -type DeleteVPCAssociationAuthorizationInput struct { - _ struct{} `locationName:"DeleteVPCAssociationAuthorizationRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // When removing authorization to associate a VPC that was created by one AWS - // account with a hosted zone that was created with a different AWS account, - // the ID of the hosted zone. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // When removing authorization to associate a VPC that was created by one AWS - // account with a hosted zone that was created with a different AWS account, - // a complex type that includes the ID and region of the VPC. - // - // VPC is a required field - VPC *VPC `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DeleteVPCAssociationAuthorizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCAssociationAuthorizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVPCAssociationAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVPCAssociationAuthorizationInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.VPC == nil { - invalidParams.Add(request.NewErrParamRequired("VPC")) - } - if s.VPC != nil { - if err := s.VPC.Validate(); err != nil { - invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *DeleteVPCAssociationAuthorizationInput) SetHostedZoneId(v string) *DeleteVPCAssociationAuthorizationInput { - s.HostedZoneId = &v - return s -} - -// SetVPC sets the VPC field's value. -func (s *DeleteVPCAssociationAuthorizationInput) SetVPC(v *VPC) *DeleteVPCAssociationAuthorizationInput { - s.VPC = v - return s -} - -// Empty response for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteVPCAssociationAuthorizationResponse -type DeleteVPCAssociationAuthorizationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteVPCAssociationAuthorizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteVPCAssociationAuthorizationOutput) GoString() string { - return s.String() -} - -// For the metric that the CloudWatch alarm is associated with, a complex type -// that contains information about one dimension. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/Dimension -type Dimension struct { - _ struct{} `type:"structure"` - - // For the metric that the CloudWatch alarm is associated with, the name of - // one dimension. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // For the metric that the CloudWatch alarm is associated with, the value of - // one dimension. - // - // Value is a required field - Value *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s Dimension) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Dimension) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Dimension) SetName(v string) *Dimension { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Dimension) SetValue(v string) *Dimension { - s.Value = &v - return s -} - -// A complex type that contains information about the VPC that you want to disassociate -// from a specified private hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DisassociateVPCFromHostedZoneRequest -type DisassociateVPCFromHostedZoneInput struct { - _ struct{} `locationName:"DisassociateVPCFromHostedZoneRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // Optional: A comment about the disassociation request. - Comment *string `type:"string"` - - // The ID of the private hosted zone that you want to disassociate a VPC from. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // A complex type that contains information about the VPC that you're disassociating - // from the specified hosted zone. - // - // VPC is a required field - VPC *VPC `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DisassociateVPCFromHostedZoneInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateVPCFromHostedZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateVPCFromHostedZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateVPCFromHostedZoneInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.VPC == nil { - invalidParams.Add(request.NewErrParamRequired("VPC")) - } - if s.VPC != nil { - if err := s.VPC.Validate(); err != nil { - invalidParams.AddNested("VPC", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *DisassociateVPCFromHostedZoneInput) SetComment(v string) *DisassociateVPCFromHostedZoneInput { - s.Comment = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *DisassociateVPCFromHostedZoneInput) SetHostedZoneId(v string) *DisassociateVPCFromHostedZoneInput { - s.HostedZoneId = &v - return s -} - -// SetVPC sets the VPC field's value. -func (s *DisassociateVPCFromHostedZoneInput) SetVPC(v *VPC) *DisassociateVPCFromHostedZoneInput { - s.VPC = v - return s -} - -// A complex type that contains the response information for the disassociate -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DisassociateVPCFromHostedZoneResponse -type DisassociateVPCFromHostedZoneOutput struct { - _ struct{} `type:"structure"` - - // A complex type that describes the changes made to the specified private hosted - // zone. - // - // ChangeInfo is a required field - ChangeInfo *ChangeInfo `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DisassociateVPCFromHostedZoneOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateVPCFromHostedZoneOutput) GoString() string { - return s.String() -} - -// SetChangeInfo sets the ChangeInfo field's value. -func (s *DisassociateVPCFromHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *DisassociateVPCFromHostedZoneOutput { - s.ChangeInfo = v - return s -} - -// A complex type that contains information about a geo location. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GeoLocation -type GeoLocation struct { - _ struct{} `type:"structure"` - - // The two-letter code for the continent. - // - // Valid values: AF | AN | AS | EU | OC | NA | SA - // - // Constraint: Specifying ContinentCode with either CountryCode or SubdivisionCode - // returns an InvalidInput error. - ContinentCode *string `min:"2" type:"string"` - - // The two-letter code for the country. - CountryCode *string `min:"1" type:"string"` - - // The code for the subdivision, for example, a state in the United States or - // a province in Canada. - SubdivisionCode *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GeoLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GeoLocation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GeoLocation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GeoLocation"} - if s.ContinentCode != nil && len(*s.ContinentCode) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ContinentCode", 2)) - } - if s.CountryCode != nil && len(*s.CountryCode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CountryCode", 1)) - } - if s.SubdivisionCode != nil && len(*s.SubdivisionCode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubdivisionCode", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContinentCode sets the ContinentCode field's value. -func (s *GeoLocation) SetContinentCode(v string) *GeoLocation { - s.ContinentCode = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *GeoLocation) SetCountryCode(v string) *GeoLocation { - s.CountryCode = &v - return s -} - -// SetSubdivisionCode sets the SubdivisionCode field's value. -func (s *GeoLocation) SetSubdivisionCode(v string) *GeoLocation { - s.SubdivisionCode = &v - return s -} - -// A complex type that contains the codes and full continent, country, and subdivision -// names for the specified geolocation code. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GeoLocationDetails -type GeoLocationDetails struct { - _ struct{} `type:"structure"` - - // The two-letter code for the continent. - ContinentCode *string `min:"2" type:"string"` - - // The full name of the continent. - ContinentName *string `min:"1" type:"string"` - - // The two-letter code for the country. - CountryCode *string `min:"1" type:"string"` - - // The name of the country. - CountryName *string `min:"1" type:"string"` - - // The code for the subdivision, for example, a state in the United States or - // a province in Canada. - SubdivisionCode *string `min:"1" type:"string"` - - // The full name of the subdivision, for example, a state in the United States - // or a province in Canada. - SubdivisionName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GeoLocationDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GeoLocationDetails) GoString() string { - return s.String() -} - -// SetContinentCode sets the ContinentCode field's value. -func (s *GeoLocationDetails) SetContinentCode(v string) *GeoLocationDetails { - s.ContinentCode = &v - return s -} - -// SetContinentName sets the ContinentName field's value. -func (s *GeoLocationDetails) SetContinentName(v string) *GeoLocationDetails { - s.ContinentName = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *GeoLocationDetails) SetCountryCode(v string) *GeoLocationDetails { - s.CountryCode = &v - return s -} - -// SetCountryName sets the CountryName field's value. -func (s *GeoLocationDetails) SetCountryName(v string) *GeoLocationDetails { - s.CountryName = &v - return s -} - -// SetSubdivisionCode sets the SubdivisionCode field's value. -func (s *GeoLocationDetails) SetSubdivisionCode(v string) *GeoLocationDetails { - s.SubdivisionCode = &v - return s -} - -// SetSubdivisionName sets the SubdivisionName field's value. -func (s *GeoLocationDetails) SetSubdivisionName(v string) *GeoLocationDetails { - s.SubdivisionName = &v - return s -} - -// The input for a GetChange request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetChangeRequest -type GetChangeInput struct { - _ struct{} `type:"structure"` - - // The ID of the change batch request. The value that you specify here is the - // value that ChangeResourceRecordSets returned in the Id element when you submitted - // the request. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetChangeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetChangeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChangeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChangeInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetChangeInput) SetId(v string) *GetChangeInput { - s.Id = &v - return s -} - -// A complex type that contains the ChangeInfo element. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetChangeResponse -type GetChangeOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains information about the specified change batch. - // - // ChangeInfo is a required field - ChangeInfo *ChangeInfo `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetChangeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetChangeOutput) GoString() string { - return s.String() -} - -// SetChangeInfo sets the ChangeInfo field's value. -func (s *GetChangeOutput) SetChangeInfo(v *ChangeInfo) *GetChangeOutput { - s.ChangeInfo = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRangesRequest -type GetCheckerIpRangesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetCheckerIpRangesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCheckerIpRangesInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetCheckerIpRangesResponse -type GetCheckerIpRangesOutput struct { - _ struct{} `type:"structure"` - - // CheckerIpRanges is a required field - CheckerIpRanges []*string `type:"list" required:"true"` -} - -// String returns the string representation -func (s GetCheckerIpRangesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCheckerIpRangesOutput) GoString() string { - return s.String() -} - -// SetCheckerIpRanges sets the CheckerIpRanges field's value. -func (s *GetCheckerIpRangesOutput) SetCheckerIpRanges(v []*string) *GetCheckerIpRangesOutput { - s.CheckerIpRanges = v - return s -} - -// A complex type that contains information about the request to get a geo location. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetGeoLocationRequest -type GetGeoLocationInput struct { - _ struct{} `type:"structure"` - - // Amazon Route 53 supports the following continent codes: - // - // * AF: Africa - // - // * AN: Antarctica - // - // * AS: Asia - // - // * EU: Europe - // - // * OC: Oceania - // - // * NA: North America - // - // * SA: South America - ContinentCode *string `location:"querystring" locationName:"continentcode" min:"2" type:"string"` - - // Amazon Route 53 uses the two-letter country codes that are specified in ISO - // standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). - CountryCode *string `location:"querystring" locationName:"countrycode" min:"1" type:"string"` - - // Amazon Route 53 uses the one- to three-letter subdivision codes that are - // specified in ISO standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). - // Amazon Route 53 doesn't support subdivision codes for all countries. If you - // specify SubdivisionCode, you must also specify CountryCode. - SubdivisionCode *string `location:"querystring" locationName:"subdivisioncode" min:"1" type:"string"` -} - -// String returns the string representation -func (s GetGeoLocationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGeoLocationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGeoLocationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGeoLocationInput"} - if s.ContinentCode != nil && len(*s.ContinentCode) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ContinentCode", 2)) - } - if s.CountryCode != nil && len(*s.CountryCode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CountryCode", 1)) - } - if s.SubdivisionCode != nil && len(*s.SubdivisionCode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubdivisionCode", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContinentCode sets the ContinentCode field's value. -func (s *GetGeoLocationInput) SetContinentCode(v string) *GetGeoLocationInput { - s.ContinentCode = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *GetGeoLocationInput) SetCountryCode(v string) *GetGeoLocationInput { - s.CountryCode = &v - return s -} - -// SetSubdivisionCode sets the SubdivisionCode field's value. -func (s *GetGeoLocationInput) SetSubdivisionCode(v string) *GetGeoLocationInput { - s.SubdivisionCode = &v - return s -} - -// A complex type that contains the response information for the specified geolocation -// code. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetGeoLocationResponse -type GetGeoLocationOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains the codes and full continent, country, and subdivision - // names for the specified geolocation code. - // - // GeoLocationDetails is a required field - GeoLocationDetails *GeoLocationDetails `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetGeoLocationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetGeoLocationOutput) GoString() string { - return s.String() -} - -// SetGeoLocationDetails sets the GeoLocationDetails field's value. -func (s *GetGeoLocationOutput) SetGeoLocationDetails(v *GeoLocationDetails) *GetGeoLocationOutput { - s.GeoLocationDetails = v - return s -} - -// To retrieve a count of all your health checks, send a GET request to the -// /2013-04-01/healthcheckcount resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckCountRequest -type GetHealthCheckCountInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetHealthCheckCountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckCountInput) GoString() string { - return s.String() -} - -// A complex type that contains the response to a healthcheckcount request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckCountResponse -type GetHealthCheckCountOutput struct { - _ struct{} `type:"structure"` - - // The number of health checks associated with the current AWS account. - // - // HealthCheckCount is a required field - HealthCheckCount *int64 `type:"long" required:"true"` -} - -// String returns the string representation -func (s GetHealthCheckCountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckCountOutput) GoString() string { - return s.String() -} - -// SetHealthCheckCount sets the HealthCheckCount field's value. -func (s *GetHealthCheckCountOutput) SetHealthCheckCount(v int64) *GetHealthCheckCountOutput { - s.HealthCheckCount = &v - return s -} - -// This action gets information about a specified health check. -// -// Send a GET request to the /Amazon Route 53 API version/gethealthcheckrequest -// resource. -// -// For information about getting information about a health check using the -// Amazon Route 53 console, see Amazon Route 53 Health Checks and DNS Failover -// (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) -// in the Amazon Route 53 Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckRequest -type GetHealthCheckInput struct { - _ struct{} `type:"structure"` - - // The identifier that Amazon Route 53 assigned to the health check when you - // created it. When you add or update a resource record set, you use this value - // to specify which health check to use. The value can be up to 64 characters - // long. - // - // HealthCheckId is a required field - HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetHealthCheckInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHealthCheckInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHealthCheckInput"} - if s.HealthCheckId == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheckId sets the HealthCheckId field's value. -func (s *GetHealthCheckInput) SetHealthCheckId(v string) *GetHealthCheckInput { - s.HealthCheckId = &v - return s -} - -// This action gets the reason that a specified health check failed most recently. -// -// To get the reason for the last failure of a health check, send a GET request -// to the /2013-04-01/healthcheck/health check ID/lastfailurereason resource. -// -// For information about viewing the last failure reason for a health check -// using the Amazon Route 53 console, see Viewing Health Check Status and the -// Reason for Health Check Failures (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-monitor-view-status.html) -// in the Amazon Route 53 Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckLastFailureReasonRequest -type GetHealthCheckLastFailureReasonInput struct { - _ struct{} `type:"structure"` - - // The ID for the health check for which you want the last failure reason. When - // you created the health check, CreateHealthCheck returned the ID in the response, - // in the HealthCheckId element. - // - // HealthCheckId is a required field - HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetHealthCheckLastFailureReasonInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckLastFailureReasonInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHealthCheckLastFailureReasonInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHealthCheckLastFailureReasonInput"} - if s.HealthCheckId == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheckId sets the HealthCheckId field's value. -func (s *GetHealthCheckLastFailureReasonInput) SetHealthCheckId(v string) *GetHealthCheckLastFailureReasonInput { - s.HealthCheckId = &v - return s -} - -// A complex type that contains the response to a GetHealthCheckLastFailureReason -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckLastFailureReasonResponse -type GetHealthCheckLastFailureReasonOutput struct { - _ struct{} `type:"structure"` - - // A list that contains one Observation element for each Amazon Route 53 health - // checker that is reporting a last failure reason. - // - // HealthCheckObservations is a required field - HealthCheckObservations []*HealthCheckObservation `locationNameList:"HealthCheckObservation" type:"list" required:"true"` -} - -// String returns the string representation -func (s GetHealthCheckLastFailureReasonOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckLastFailureReasonOutput) GoString() string { - return s.String() -} - -// SetHealthCheckObservations sets the HealthCheckObservations field's value. -func (s *GetHealthCheckLastFailureReasonOutput) SetHealthCheckObservations(v []*HealthCheckObservation) *GetHealthCheckLastFailureReasonOutput { - s.HealthCheckObservations = v - return s -} - -// A complex type that contains the response to a GetHealthCheck request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckResponse -type GetHealthCheckOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains information about one health check that is associated - // with the current AWS account. - // - // HealthCheck is a required field - HealthCheck *HealthCheck `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetHealthCheckOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckOutput) GoString() string { - return s.String() -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *GetHealthCheckOutput) SetHealthCheck(v *HealthCheck) *GetHealthCheckOutput { - s.HealthCheck = v - return s -} - -// A complex type that contains information about the request to get health -// check status for a health check. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckStatusRequest -type GetHealthCheckStatusInput struct { - _ struct{} `type:"structure"` - - // The ID for the health check for which you want the current status. When you - // created the health check, CreateHealthCheck returned the ID in the response, - // in the HealthCheckId element. - // - // If you want to check the status of a calculated health check, you must use - // the Amazon Route 53 console or the CloudWatch console. You can't use GetHealthCheckStatus - // to get the status of a calculated health check. - // - // HealthCheckId is a required field - HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetHealthCheckStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHealthCheckStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHealthCheckStatusInput"} - if s.HealthCheckId == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheckId sets the HealthCheckId field's value. -func (s *GetHealthCheckStatusInput) SetHealthCheckId(v string) *GetHealthCheckStatusInput { - s.HealthCheckId = &v - return s -} - -// A complex type that contains the response to a GetHealthCheck request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHealthCheckStatusResponse -type GetHealthCheckStatusOutput struct { - _ struct{} `type:"structure"` - - // A list that contains one HealthCheckObservation element for each Amazon Route - // 53 health checker that is reporting a status about the health check endpoint. - // - // HealthCheckObservations is a required field - HealthCheckObservations []*HealthCheckObservation `locationNameList:"HealthCheckObservation" type:"list" required:"true"` -} - -// String returns the string representation -func (s GetHealthCheckStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHealthCheckStatusOutput) GoString() string { - return s.String() -} - -// SetHealthCheckObservations sets the HealthCheckObservations field's value. -func (s *GetHealthCheckStatusOutput) SetHealthCheckObservations(v []*HealthCheckObservation) *GetHealthCheckStatusOutput { - s.HealthCheckObservations = v - return s -} - -// To retrieve a count of all your hosted zones, send a GET request to the /2013-04-01/hostedzonecount -// resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneCountRequest -type GetHostedZoneCountInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetHostedZoneCountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostedZoneCountInput) GoString() string { - return s.String() -} - -// A complex type that contains the response to a hostedzonecount request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneCountResponse -type GetHostedZoneCountOutput struct { - _ struct{} `type:"structure"` - - // The total number of public and private hosted zones associated with the current - // AWS account. - // - // HostedZoneCount is a required field - HostedZoneCount *int64 `type:"long" required:"true"` -} - -// String returns the string representation -func (s GetHostedZoneCountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostedZoneCountOutput) GoString() string { - return s.String() -} - -// SetHostedZoneCount sets the HostedZoneCount field's value. -func (s *GetHostedZoneCountOutput) SetHostedZoneCount(v int64) *GetHostedZoneCountOutput { - s.HostedZoneCount = &v - return s -} - -// The input for a GetHostedZone request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneRequest -type GetHostedZoneInput struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone for which you want to get a list of the name servers - // in the delegation set. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetHostedZoneInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostedZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHostedZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHostedZoneInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetHostedZoneInput) SetId(v string) *GetHostedZoneInput { - s.Id = &v - return s -} - -// A complex type containing the response information for the hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetHostedZoneResponse -type GetHostedZoneOutput struct { - _ struct{} `type:"structure"` - - // A complex type that describes the name servers for this hosted zone. - DelegationSet *DelegationSet `type:"structure"` - - // A complex type that contains general information about the hosted zone. - // - // HostedZone is a required field - HostedZone *HostedZone `type:"structure" required:"true"` - - // A complex type that contains information about VPCs associated with the specified - // hosted zone. - VPCs []*VPC `locationNameList:"VPC" min:"1" type:"list"` -} - -// String returns the string representation -func (s GetHostedZoneOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetHostedZoneOutput) GoString() string { - return s.String() -} - -// SetDelegationSet sets the DelegationSet field's value. -func (s *GetHostedZoneOutput) SetDelegationSet(v *DelegationSet) *GetHostedZoneOutput { - s.DelegationSet = v - return s -} - -// SetHostedZone sets the HostedZone field's value. -func (s *GetHostedZoneOutput) SetHostedZone(v *HostedZone) *GetHostedZoneOutput { - s.HostedZone = v - return s -} - -// SetVPCs sets the VPCs field's value. -func (s *GetHostedZoneOutput) SetVPCs(v []*VPC) *GetHostedZoneOutput { - s.VPCs = v - return s -} - -// The input for a GetReusableDelegationSet request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSetRequest -type GetReusableDelegationSetInput struct { - _ struct{} `type:"structure"` - - // The ID of the reusable delegation set for which you want to get a list of - // the name server. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetReusableDelegationSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetReusableDelegationSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReusableDelegationSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReusableDelegationSetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReusableDelegationSetInput) SetId(v string) *GetReusableDelegationSetInput { - s.Id = &v - return s -} - -// A complex type that contains the response to the GetReusableDelegationSet -// request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetReusableDelegationSetResponse -type GetReusableDelegationSetOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains information about the reusable delegation set. - // - // DelegationSet is a required field - DelegationSet *DelegationSet `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetReusableDelegationSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetReusableDelegationSetOutput) GoString() string { - return s.String() -} - -// SetDelegationSet sets the DelegationSet field's value. -func (s *GetReusableDelegationSetOutput) SetDelegationSet(v *DelegationSet) *GetReusableDelegationSetOutput { - s.DelegationSet = v - return s -} - -// Gets information about a specific traffic policy version. To get the information, -// send a GET request to the /2013-04-01/trafficpolicy resource, and specify -// the ID and the version of the traffic policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyRequest -type GetTrafficPolicyInput struct { - _ struct{} `type:"structure"` - - // The ID of the traffic policy that you want to get information about. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` - - // The version number of the traffic policy that you want to get information - // about. - // - // Version is a required field - Version *int64 `location:"uri" locationName:"Version" min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s GetTrafficPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrafficPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTrafficPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTrafficPolicyInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && *s.Version < 1 { - invalidParams.Add(request.NewErrParamMinValue("Version", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetTrafficPolicyInput) SetId(v string) *GetTrafficPolicyInput { - s.Id = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *GetTrafficPolicyInput) SetVersion(v int64) *GetTrafficPolicyInput { - s.Version = &v - return s -} - -// Request to get the number of traffic policy instances that are associated -// with the current AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCountRequest -type GetTrafficPolicyInstanceCountInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s GetTrafficPolicyInstanceCountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrafficPolicyInstanceCountInput) GoString() string { - return s.String() -} - -// A complex type that contains information about the resource record sets that -// Amazon Route 53 created based on a specified traffic policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceCountResponse -type GetTrafficPolicyInstanceCountOutput struct { - _ struct{} `type:"structure"` - - // The number of traffic policy instances that are associated with the current - // AWS account. - // - // TrafficPolicyInstanceCount is a required field - TrafficPolicyInstanceCount *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s GetTrafficPolicyInstanceCountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrafficPolicyInstanceCountOutput) GoString() string { - return s.String() -} - -// SetTrafficPolicyInstanceCount sets the TrafficPolicyInstanceCount field's value. -func (s *GetTrafficPolicyInstanceCountOutput) SetTrafficPolicyInstanceCount(v int64) *GetTrafficPolicyInstanceCountOutput { - s.TrafficPolicyInstanceCount = &v - return s -} - -// Gets information about a specified traffic policy instance. -// -// To get information about a traffic policy instance, send a GET request to -// the /Amazon Route 53 API version/trafficpolicyinstance/Id resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceRequest -type GetTrafficPolicyInstanceInput struct { - _ struct{} `type:"structure"` - - // The ID of the traffic policy instance that you want to get information about. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetTrafficPolicyInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrafficPolicyInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTrafficPolicyInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTrafficPolicyInstanceInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetTrafficPolicyInstanceInput) SetId(v string) *GetTrafficPolicyInstanceInput { - s.Id = &v - return s -} - -// A complex type that contains information about the resource record sets that -// Amazon Route 53 created based on a specified traffic policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyInstanceResponse -type GetTrafficPolicyInstanceOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains settings for the traffic policy instance. - // - // TrafficPolicyInstance is a required field - TrafficPolicyInstance *TrafficPolicyInstance `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetTrafficPolicyInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrafficPolicyInstanceOutput) GoString() string { - return s.String() -} - -// SetTrafficPolicyInstance sets the TrafficPolicyInstance field's value. -func (s *GetTrafficPolicyInstanceOutput) SetTrafficPolicyInstance(v *TrafficPolicyInstance) *GetTrafficPolicyInstanceOutput { - s.TrafficPolicyInstance = v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/GetTrafficPolicyResponse -type GetTrafficPolicyOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains settings for the specified traffic policy. - // - // TrafficPolicy is a required field - TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetTrafficPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetTrafficPolicyOutput) GoString() string { - return s.String() -} - -// SetTrafficPolicy sets the TrafficPolicy field's value. -func (s *GetTrafficPolicyOutput) SetTrafficPolicy(v *TrafficPolicy) *GetTrafficPolicyOutput { - s.TrafficPolicy = v - return s -} - -// A complex type that contains information about one health check that is associated -// with the current AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/HealthCheck -type HealthCheck struct { - _ struct{} `type:"structure"` - - // A unique string that you specified when you created the health check. - // - // CallerReference is a required field - CallerReference *string `min:"1" type:"string" required:"true"` - - // A complex type that contains information about the CloudWatch alarm that - // Amazon Route 53 is monitoring for this health check. - CloudWatchAlarmConfiguration *CloudWatchAlarmConfiguration `type:"structure"` - - // A complex type that contains detailed information about one health check. - // - // HealthCheckConfig is a required field - HealthCheckConfig *HealthCheckConfig `type:"structure" required:"true"` - - // The version of the health check. You can optionally pass this value in a - // call to UpdateHealthCheck to prevent overwriting another change to the health - // check. - // - // HealthCheckVersion is a required field - HealthCheckVersion *int64 `min:"1" type:"long" required:"true"` - - // The identifier that Amazon Route 53assigned to the health check when you - // created it. When you add or update a resource record set, you use this value - // to specify which health check to use. The value can be up to 64 characters - // long. - // - // Id is a required field - Id *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s HealthCheck) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HealthCheck) GoString() string { - return s.String() -} - -// SetCallerReference sets the CallerReference field's value. -func (s *HealthCheck) SetCallerReference(v string) *HealthCheck { - s.CallerReference = &v - return s -} - -// SetCloudWatchAlarmConfiguration sets the CloudWatchAlarmConfiguration field's value. -func (s *HealthCheck) SetCloudWatchAlarmConfiguration(v *CloudWatchAlarmConfiguration) *HealthCheck { - s.CloudWatchAlarmConfiguration = v - return s -} - -// SetHealthCheckConfig sets the HealthCheckConfig field's value. -func (s *HealthCheck) SetHealthCheckConfig(v *HealthCheckConfig) *HealthCheck { - s.HealthCheckConfig = v - return s -} - -// SetHealthCheckVersion sets the HealthCheckVersion field's value. -func (s *HealthCheck) SetHealthCheckVersion(v int64) *HealthCheck { - s.HealthCheckVersion = &v - return s -} - -// SetId sets the Id field's value. -func (s *HealthCheck) SetId(v string) *HealthCheck { - s.Id = &v - return s -} - -// A complex type that contains information about the health check. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/HealthCheckConfig -type HealthCheckConfig struct { - _ struct{} `type:"structure"` - - // A complex type that identifies the CloudWatch alarm that you want Amazon - // Route 53 health checkers to use to determine whether this health check is - // healthy. - AlarmIdentifier *AlarmIdentifier `type:"structure"` - - // (CALCULATED Health Checks Only) A complex type that contains one ChildHealthCheck - // element for each health check that you want to associate with a CALCULATED - // health check. - ChildHealthChecks []*string `locationNameList:"ChildHealthCheck" type:"list"` - - // Specify whether you want Amazon Route 53 to send the value of FullyQualifiedDomainName - // to the endpoint in the client_hello message during TLS negotiation. This - // allows the endpoint to respond to HTTPS health check requests with the applicable - // SSL/TLS certificate. - // - // Some endpoints require that HTTPS requests include the host name in the client_hello - // message. If you don't enable SNI, the status of the health check will be - // SSL alert handshake_failure. A health check can also have that status for - // other reasons. If SNI is enabled and you're still getting the error, check - // the SSL/TLS configuration on your endpoint and confirm that your certificate - // is valid. - // - // The SSL/TLS certificate on your endpoint includes a domain name in the Common - // Name field and possibly several more in the Subject Alternative Names field. - // One of the domain names in the certificate should match the value that you - // specify for FullyQualifiedDomainName. If the endpoint responds to the client_hello - // message with a certificate that does not include the domain name that you - // specified in FullyQualifiedDomainName, a health checker will retry the handshake. - // In the second attempt, the health checker will omit FullyQualifiedDomainName - // from the client_hello message. - EnableSNI *bool `type:"boolean"` - - // The number of consecutive health checks that an endpoint must pass or fail - // for Amazon Route 53 to change the current status of the endpoint from unhealthy - // to healthy or vice versa. For more information, see How Amazon Route 53 Determines - // Whether an Endpoint Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html) - // in the Amazon Route 53 Developer Guide. - // - // If you don't specify a value for FailureThreshold, the default value is three - // health checks. - FailureThreshold *int64 `min:"1" type:"integer"` - - // Amazon Route 53 behavior depends on whether you specify a value for IPAddress. - // - // If you specify a value forIPAddress: - // - // Amazon Route 53 sends health check requests to the specified IPv4 or IPv6 - // address and passes the value of FullyQualifiedDomainName in the Host header - // for all health checks except TCP health checks. This is typically the fully - // qualified DNS name of the endpoint on which you want Amazon Route 53 to perform - // health checks. - // - // When Amazon Route 53 checks the health of an endpoint, here is how it constructs - // the Host header: - // - // * If you specify a value of 80 for Port and HTTP or HTTP_STR_MATCH for - // Type, Amazon Route 53 passes the value of FullyQualifiedDomainName to - // the endpoint in the Host header. - // - // * If you specify a value of 443 for Port and HTTPS or HTTPS_STR_MATCH - // for Type, Amazon Route 53 passes the value of FullyQualifiedDomainName - // to the endpoint in the Host header. - // - // * If you specify another value for Port and any value except TCP for Type, - // Amazon Route 53 passes FullyQualifiedDomainName:Port to the endpoint in - // the Host header. - // - // If you don't specify a value for FullyQualifiedDomainName, Amazon Route 53 - // substitutes the value of IPAddress in the Host header in each of the preceding - // cases. - // - // If you don't specify a value for IPAddress: - // - // Amazon Route 53 sends a DNS request to the domain that you specify for FullyQualifiedDomainName - // at the interval that you specify for RequestInterval. Using an IPv4 address - // that DNS returns, Amazon Route 53 then checks the health of the endpoint. - // - // If you don't specify a value for IPAddress, Amazon Route 53 uses only IPv4 - // to send health checks to the endpoint. If there's no resource record set - // with a type of A for the name that you specify for FullyQualifiedDomainName, - // the health check fails with a "DNS resolution failed" error. - // - // If you want to check the health of weighted, latency, or failover resource - // record sets and you choose to specify the endpoint only by FullyQualifiedDomainName, - // we recommend that you create a separate health check for each endpoint. For - // example, create a health check for each HTTP server that is serving content - // for www.example.com. For the value of FullyQualifiedDomainName, specify the - // domain name of the server (such as us-east-2-www.example.com), not the name - // of the resource record sets (www.example.com). - // - // In this configuration, if you create a health check for which the value of - // FullyQualifiedDomainName matches the name of the resource record sets and - // you then associate the health check with those resource record sets, health - // check results will be unpredictable. - // - // In addition, if the value that you specify for Type is HTTP, HTTPS, HTTP_STR_MATCH, - // or HTTPS_STR_MATCH, Amazon Route 53 passes the value of FullyQualifiedDomainName - // in the Host header, as it does when you specify a value for IPAddress. If - // the value of Type is TCP, Amazon Route 53 doesn't pass a Host header. - FullyQualifiedDomainName *string `type:"string"` - - // The number of child health checks that are associated with a CALCULATED health - // that Amazon Route 53 must consider healthy for the CALCULATED health check - // to be considered healthy. To specify the child health checks that you want - // to associate with a CALCULATED health check, use the HealthCheckConfig$ChildHealthChecks - // and HealthCheckConfig$ChildHealthChecks elements. - // - // Note the following: - // - // * If you specify a number greater than the number of child health checks, - // Amazon Route 53 always considers this health check to be unhealthy. - // - // * If you specify 0, Amazon Route 53 always considers this health check - // to be healthy. - HealthThreshold *int64 `type:"integer"` - - // The IPv4 or IPv6 IP address of the endpoint that you want Amazon Route 53 - // to perform health checks on. If you don't specify a value for IPAddress, - // Amazon Route 53 sends a DNS request to resolve the domain name that you specify - // in FullyQualifiedDomainName at the interval that you specify in RequestInterval. - // Using an IP address returned by DNS, Amazon Route 53 then checks the health - // of the endpoint. - // - // Use one of the following formats for the value of IPAddress: - // - // * IPv4 address: four values between 0 and 255, separated by periods (.), - // for example, 192.0.2.44. - // - // * IPv6 address: eight groups of four hexadecimal values, separated by - // colons (:), for example, 2001:0db8:85a3:0000:0000:abcd:0001:2345. You - // can also shorten IPv6 addresses as described in RFC 5952, for example, - // 2001:db8:85a3::abcd:1:2345. - // - // If the endpoint is an EC2 instance, we recommend that you create an Elastic - // IP address, associate it with your EC2 instance, and specify the Elastic - // IP address for IPAddress. This ensures that the IP address of your instance - // will never change. - // - // For more information, see HealthCheckConfig$FullyQualifiedDomainName. - // - // Constraints: Amazon Route 53 can't check the health of endpoints for which - // the IP address is in local, private, non-routable, or multicast ranges. For - // more information about IP addresses for which you can't create health checks, - // see the following documents: - // - // * RFC 5735, Special Use IPv4 Addresses (https://tools.ietf.org/html/rfc5735) - // - // * RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space (https://tools.ietf.org/html/rfc6598) - // - // * RFC 5156, Special-Use IPv6 Addresses (https://tools.ietf.org/html/rfc5156) - // - // When the value of Type is CALCULATED or CLOUDWATCH_METRIC, omit IPAddress. - IPAddress *string `type:"string"` - - // When CloudWatch has insufficient data about the metric to determine the alarm - // state, the status that you want Amazon Route 53 to assign to the health check: - // - // * Healthy: Amazon Route 53 considers the health check to be healthy. - // - // * Unhealthy: Amazon Route 53 considers the health check to be unhealthy. - // - // * LastKnownStatus: Amazon Route 53uses the status of the health check - // from the last time CloudWatch had sufficient data to determine the alarm - // state. For new health checks that have no last known status, the default - // status for the health check is healthy. - InsufficientDataHealthStatus *string `type:"string" enum:"InsufficientDataHealthStatus"` - - // Specify whether you want Amazon Route 53 to invert the status of a health - // check, for example, to consider a health check unhealthy when it otherwise - // would be considered healthy. - Inverted *bool `type:"boolean"` - - // Specify whether you want Amazon Route 53 to measure the latency between health - // checkers in multiple AWS regions and your endpoint, and to display CloudWatch - // latency graphs on the Health Checks page in the Amazon Route 53 console. - // - // You can't change the value of MeasureLatency after you create a health check. - MeasureLatency *bool `type:"boolean"` - - // The port on the endpoint on which you want Amazon Route 53 to perform health - // checks. Specify a value for Port only when you specify a value for IPAddress. - Port *int64 `min:"1" type:"integer"` - - // A complex type that contains one Region element for each region from which - // you want Amazon Route 53 health checkers to check the specified endpoint. - // - // If you don't specify any regions, Amazon Route 53 health checkers automatically - // performs checks from all of the regions that are listed under Valid Values. - // - // If you update a health check to remove a region that has been performing - // health checks, Amazon Route 53 will briefly continue to perform checks from - // that region to ensure that some health checkers are always checking the endpoint - // (for example, if you replace three regions with four different regions). - Regions []*string `locationNameList:"Region" min:"1" type:"list"` - - // The number of seconds between the time that Amazon Route 53 gets a response - // from your endpoint and the time that it sends the next health check request. - // Each Amazon Route 53 health checker makes requests at this interval. - // - // You can't change the value of RequestInterval after you create a health check. - // - // If you don't specify a value for RequestInterval, the default value is 30 - // seconds. - RequestInterval *int64 `min:"10" type:"integer"` - - // The path, if any, that you want Amazon Route 53 to request when performing - // health checks. The path can be any value for which your endpoint will return - // an HTTP status code of 2xx or 3xx when the endpoint is healthy, for example, - // the file /docs/route53-health-check.html. - ResourcePath *string `type:"string"` - - // If the value of Type is HTTP_STR_MATCH or HTTP_STR_MATCH, the string that - // you want Amazon Route 53 to search for in the response body from the specified - // resource. If the string appears in the response body, Amazon Route 53 considers - // the resource healthy. - // - // Amazon Route 53 considers case when searching for SearchString in the response - // body. - SearchString *string `type:"string"` - - // The type of health check that you want to create, which indicates how Amazon - // Route 53 determines whether an endpoint is healthy. - // - // You can't change the value of Type after you create a health check. - // - // You can create the following types of health checks: - // - // * HTTP: Amazon Route 53 tries to establish a TCP connection. If successful, - // Amazon Route 53 submits an HTTP request and waits for an HTTP status code - // of 200 or greater and less than 400. - // - // * HTTPS: Amazon Route 53 tries to establish a TCP connection. If successful, - // Amazon Route 53 submits an HTTPS request and waits for an HTTP status - // code of 200 or greater and less than 400. - // - // If you specify HTTPS for the value of Type, the endpoint must support TLS - // v1.0 or later. - // - // * HTTP_STR_MATCH: Amazon Route 53 tries to establish a TCP connection. - // If successful, Amazon Route 53 submits an HTTP request and searches the - // first 5,120 bytes of the response body for the string that you specify - // in SearchString. - // - // * HTTPS_STR_MATCH: Amazon Route 53 tries to establish a TCP connection. - // If successful, Amazon Route 53 submits an HTTPS request and searches the - // first 5,120 bytes of the response body for the string that you specify - // in SearchString. - // - // * TCP: Amazon Route 53 tries to establish a TCP connection. - // - // * CLOUDWATCH_METRIC: The health check is associated with a CloudWatch - // alarm. If the state of the alarm is OK, the health check is considered - // healthy. If the state is ALARM, the health check is considered unhealthy. - // If CloudWatch doesn't have sufficient data to determine whether the state - // is OK or ALARM, the health check status depends on the setting for InsufficientDataHealthStatus: - // Healthy, Unhealthy, or LastKnownStatus. - // - // * CALCULATED: For health checks that monitor the status of other health - // checks, Amazon Route 53 adds up the number of health checks that Amazon - // Route 53 health checkers consider to be healthy and compares that number - // with the value of HealthThreshold. - // - // For more information about how Amazon Route 53 determines whether an endpoint - // is healthy, see the introduction to this topic. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"HealthCheckType"` -} - -// String returns the string representation -func (s HealthCheckConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HealthCheckConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HealthCheckConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HealthCheckConfig"} - if s.FailureThreshold != nil && *s.FailureThreshold < 1 { - invalidParams.Add(request.NewErrParamMinValue("FailureThreshold", 1)) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - if s.Regions != nil && len(s.Regions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Regions", 1)) - } - if s.RequestInterval != nil && *s.RequestInterval < 10 { - invalidParams.Add(request.NewErrParamMinValue("RequestInterval", 10)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.AlarmIdentifier != nil { - if err := s.AlarmIdentifier.Validate(); err != nil { - invalidParams.AddNested("AlarmIdentifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmIdentifier sets the AlarmIdentifier field's value. -func (s *HealthCheckConfig) SetAlarmIdentifier(v *AlarmIdentifier) *HealthCheckConfig { - s.AlarmIdentifier = v - return s -} - -// SetChildHealthChecks sets the ChildHealthChecks field's value. -func (s *HealthCheckConfig) SetChildHealthChecks(v []*string) *HealthCheckConfig { - s.ChildHealthChecks = v - return s -} - -// SetEnableSNI sets the EnableSNI field's value. -func (s *HealthCheckConfig) SetEnableSNI(v bool) *HealthCheckConfig { - s.EnableSNI = &v - return s -} - -// SetFailureThreshold sets the FailureThreshold field's value. -func (s *HealthCheckConfig) SetFailureThreshold(v int64) *HealthCheckConfig { - s.FailureThreshold = &v - return s -} - -// SetFullyQualifiedDomainName sets the FullyQualifiedDomainName field's value. -func (s *HealthCheckConfig) SetFullyQualifiedDomainName(v string) *HealthCheckConfig { - s.FullyQualifiedDomainName = &v - return s -} - -// SetHealthThreshold sets the HealthThreshold field's value. -func (s *HealthCheckConfig) SetHealthThreshold(v int64) *HealthCheckConfig { - s.HealthThreshold = &v - return s -} - -// SetIPAddress sets the IPAddress field's value. -func (s *HealthCheckConfig) SetIPAddress(v string) *HealthCheckConfig { - s.IPAddress = &v - return s -} - -// SetInsufficientDataHealthStatus sets the InsufficientDataHealthStatus field's value. -func (s *HealthCheckConfig) SetInsufficientDataHealthStatus(v string) *HealthCheckConfig { - s.InsufficientDataHealthStatus = &v - return s -} - -// SetInverted sets the Inverted field's value. -func (s *HealthCheckConfig) SetInverted(v bool) *HealthCheckConfig { - s.Inverted = &v - return s -} - -// SetMeasureLatency sets the MeasureLatency field's value. -func (s *HealthCheckConfig) SetMeasureLatency(v bool) *HealthCheckConfig { - s.MeasureLatency = &v - return s -} - -// SetPort sets the Port field's value. -func (s *HealthCheckConfig) SetPort(v int64) *HealthCheckConfig { - s.Port = &v - return s -} - -// SetRegions sets the Regions field's value. -func (s *HealthCheckConfig) SetRegions(v []*string) *HealthCheckConfig { - s.Regions = v - return s -} - -// SetRequestInterval sets the RequestInterval field's value. -func (s *HealthCheckConfig) SetRequestInterval(v int64) *HealthCheckConfig { - s.RequestInterval = &v - return s -} - -// SetResourcePath sets the ResourcePath field's value. -func (s *HealthCheckConfig) SetResourcePath(v string) *HealthCheckConfig { - s.ResourcePath = &v - return s -} - -// SetSearchString sets the SearchString field's value. -func (s *HealthCheckConfig) SetSearchString(v string) *HealthCheckConfig { - s.SearchString = &v - return s -} - -// SetType sets the Type field's value. -func (s *HealthCheckConfig) SetType(v string) *HealthCheckConfig { - s.Type = &v - return s -} - -// A complex type that contains the last failure reason as reported by one Amazon -// Route 53 health checker. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/HealthCheckObservation -type HealthCheckObservation struct { - _ struct{} `type:"structure"` - - // The IP address of the Amazon Route 53 health checker that provided the failure - // reason in StatusReport. - IPAddress *string `type:"string"` - - // The region of the Amazon Route 53 health checker that provided the status - // in StatusReport. - Region *string `min:"1" type:"string" enum:"HealthCheckRegion"` - - // A complex type that contains the last failure reason as reported by one Amazon - // Route 53 health checker and the time of the failed health check. - StatusReport *StatusReport `type:"structure"` -} - -// String returns the string representation -func (s HealthCheckObservation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HealthCheckObservation) GoString() string { - return s.String() -} - -// SetIPAddress sets the IPAddress field's value. -func (s *HealthCheckObservation) SetIPAddress(v string) *HealthCheckObservation { - s.IPAddress = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *HealthCheckObservation) SetRegion(v string) *HealthCheckObservation { - s.Region = &v - return s -} - -// SetStatusReport sets the StatusReport field's value. -func (s *HealthCheckObservation) SetStatusReport(v *StatusReport) *HealthCheckObservation { - s.StatusReport = v - return s -} - -// A complex type that contains general information about the hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/HostedZone -type HostedZone struct { - _ struct{} `type:"structure"` - - // The value that you specified for CallerReference when you created the hosted - // zone. - // - // CallerReference is a required field - CallerReference *string `min:"1" type:"string" required:"true"` - - // A complex type that includes the Comment and PrivateZone elements. If you - // omitted the HostedZoneConfig and Comment elements from the request, the Config - // and Comment elements don't appear in the response. - Config *HostedZoneConfig `type:"structure"` - - // The ID that Amazon Route 53 assigned to the hosted zone when you created - // it. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The name of the domain. For public hosted zones, this is the name that you - // have registered with your DNS registrar. - // - // For information about how to specify characters other than a-z, 0-9, and - // - (hyphen) and how to specify internationalized domain names, see CreateHostedZone. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The number of resource record sets in the hosted zone. - ResourceRecordSetCount *int64 `type:"long"` -} - -// String returns the string representation -func (s HostedZone) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostedZone) GoString() string { - return s.String() -} - -// SetCallerReference sets the CallerReference field's value. -func (s *HostedZone) SetCallerReference(v string) *HostedZone { - s.CallerReference = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *HostedZone) SetConfig(v *HostedZoneConfig) *HostedZone { - s.Config = v - return s -} - -// SetId sets the Id field's value. -func (s *HostedZone) SetId(v string) *HostedZone { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *HostedZone) SetName(v string) *HostedZone { - s.Name = &v - return s -} - -// SetResourceRecordSetCount sets the ResourceRecordSetCount field's value. -func (s *HostedZone) SetResourceRecordSetCount(v int64) *HostedZone { - s.ResourceRecordSetCount = &v - return s -} - -// A complex type that contains an optional comment about your hosted zone. -// If you don't want to specify a comment, omit both the HostedZoneConfig and -// Comment elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/HostedZoneConfig -type HostedZoneConfig struct { - _ struct{} `type:"structure"` - - // Any comments that you want to include about the hosted zone. - Comment *string `type:"string"` - - // A value that indicates whether this is a private hosted zone. - PrivateZone *bool `type:"boolean"` -} - -// String returns the string representation -func (s HostedZoneConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HostedZoneConfig) GoString() string { - return s.String() -} - -// SetComment sets the Comment field's value. -func (s *HostedZoneConfig) SetComment(v string) *HostedZoneConfig { - s.Comment = &v - return s -} - -// SetPrivateZone sets the PrivateZone field's value. -func (s *HostedZoneConfig) SetPrivateZone(v bool) *HostedZoneConfig { - s.PrivateZone = &v - return s -} - -// To get a list of geographic locations that Amazon Route 53 supports for geolocation, -// send a GET request to the /Amazon Route 53 API version/geolocations resource. -// The response to this request includes a GeoLocationDetails element for each -// location that Amazon Route 53 supports. -// -// Countries are listed first, and continents are listed last. If Amazon Route -// 53 supports subdivisions for a country (for example, states or provinces), -// the subdivisions for that country are listed in alphabetical order immediately -// after the corresponding country. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListGeoLocationsRequest -type ListGeoLocationsInput struct { - _ struct{} `type:"structure"` - - // (Optional) The maximum number of geolocations to be included in the response - // body for this request. If more than MaxItems geolocations remain to be listed, - // then the value of the IsTruncated element in the response is true. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` - - // The code for the continent with which you want to start listing locations - // that Amazon Route 53 supports for geolocation. If Amazon Route 53 has already - // returned a page or more of results, if IsTruncated is true, and if NextContinentCode - // from the previous response has a value, enter that value in StartContinentCode - // to return the next page of results. - // - // Include StartContinentCode only if you want to list continents. Don't include - // StartContinentCode when you're listing countries or countries with their - // subdivisions. - StartContinentCode *string `location:"querystring" locationName:"startcontinentcode" min:"2" type:"string"` - - // The code for the country with which you want to start listing locations that - // Amazon Route 53 supports for geolocation. If Amazon Route 53 has already - // returned a page or more of results, if IsTruncated is true, and if NextCountryCode - // from the previous response has a value, enter that value in StartCountryCode - // to return the next page of results. - // - // Amazon Route 53 uses the two-letter country codes that are specified in ISO - // standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). - StartCountryCode *string `location:"querystring" locationName:"startcountrycode" min:"1" type:"string"` - - // The code for the subdivision (for example, state or province) with which - // you want to start listing locations that Amazon Route 53 supports for geolocation. - // If Amazon Route 53 has already returned a page or more of results, if IsTruncated - // is true, and if NextSubdivisionCode from the previous response has a value, - // enter that value in StartSubdivisionCode to return the next page of results. - // - // To list subdivisions of a country, you must include both StartCountryCode - // and StartSubdivisionCode. - StartSubdivisionCode *string `location:"querystring" locationName:"startsubdivisioncode" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListGeoLocationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGeoLocationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGeoLocationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGeoLocationsInput"} - if s.StartContinentCode != nil && len(*s.StartContinentCode) < 2 { - invalidParams.Add(request.NewErrParamMinLen("StartContinentCode", 2)) - } - if s.StartCountryCode != nil && len(*s.StartCountryCode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartCountryCode", 1)) - } - if s.StartSubdivisionCode != nil && len(*s.StartSubdivisionCode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartSubdivisionCode", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListGeoLocationsInput) SetMaxItems(v string) *ListGeoLocationsInput { - s.MaxItems = &v - return s -} - -// SetStartContinentCode sets the StartContinentCode field's value. -func (s *ListGeoLocationsInput) SetStartContinentCode(v string) *ListGeoLocationsInput { - s.StartContinentCode = &v - return s -} - -// SetStartCountryCode sets the StartCountryCode field's value. -func (s *ListGeoLocationsInput) SetStartCountryCode(v string) *ListGeoLocationsInput { - s.StartCountryCode = &v - return s -} - -// SetStartSubdivisionCode sets the StartSubdivisionCode field's value. -func (s *ListGeoLocationsInput) SetStartSubdivisionCode(v string) *ListGeoLocationsInput { - s.StartSubdivisionCode = &v - return s -} - -// A complex type containing the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListGeoLocationsResponse -type ListGeoLocationsOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains one GeoLocationDetails element for each location - // that Amazon Route 53 supports for geolocation. - // - // GeoLocationDetailsList is a required field - GeoLocationDetailsList []*GeoLocationDetails `locationNameList:"GeoLocationDetails" type:"list" required:"true"` - - // A value that indicates whether more locations remain to be listed after the - // last location in this response. If so, the value of IsTruncated is true. - // To get more values, submit another request and include the values of NextContinentCode, - // NextCountryCode, and NextSubdivisionCode in the StartContinentCode, StartCountryCode, - // and StartSubdivisionCode, as applicable. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The value that you specified for MaxItems in the request. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, you can make a follow-up request to display more - // locations. Enter the value of NextContinentCode in the StartContinentCode - // parameter in another GETListGeoLocations request. - NextContinentCode *string `min:"2" type:"string"` - - // If IsTruncated is true, you can make a follow-up request to display more - // locations. Enter the value of NextCountryCode in the StartCountryCode parameter - // in another GETListGeoLocations request. - NextCountryCode *string `min:"1" type:"string"` - - // If IsTruncated is true, you can make a follow-up request to display more - // locations. Enter the value of NextSubdivisionCode in the StartSubdivisionCode - // parameter in another GETListGeoLocations request. - NextSubdivisionCode *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s ListGeoLocationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListGeoLocationsOutput) GoString() string { - return s.String() -} - -// SetGeoLocationDetailsList sets the GeoLocationDetailsList field's value. -func (s *ListGeoLocationsOutput) SetGeoLocationDetailsList(v []*GeoLocationDetails) *ListGeoLocationsOutput { - s.GeoLocationDetailsList = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListGeoLocationsOutput) SetIsTruncated(v bool) *ListGeoLocationsOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListGeoLocationsOutput) SetMaxItems(v string) *ListGeoLocationsOutput { - s.MaxItems = &v - return s -} - -// SetNextContinentCode sets the NextContinentCode field's value. -func (s *ListGeoLocationsOutput) SetNextContinentCode(v string) *ListGeoLocationsOutput { - s.NextContinentCode = &v - return s -} - -// SetNextCountryCode sets the NextCountryCode field's value. -func (s *ListGeoLocationsOutput) SetNextCountryCode(v string) *ListGeoLocationsOutput { - s.NextCountryCode = &v - return s -} - -// SetNextSubdivisionCode sets the NextSubdivisionCode field's value. -func (s *ListGeoLocationsOutput) SetNextSubdivisionCode(v string) *ListGeoLocationsOutput { - s.NextSubdivisionCode = &v - return s -} - -// To retrieve a list of your health checks, send a GET request to the /2013-04-01/healthcheck -// resource. The response to this request includes a HealthChecks element with -// zero or more HealthCheck child elements. By default, the list of health checks -// is displayed on a single page. You can control the length of the page that -// is displayed by using the MaxItems parameter. You can use the Marker parameter -// to control the health check that the list begins with. -// -// Amazon Route 53 returns a maximum of 100 items. If you set MaxItems to a -// value greater than 100, Amazon Route 53 returns only the first 100. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecksRequest -type ListHealthChecksInput struct { - _ struct{} `type:"structure"` - - // If the response to a ListHealthChecks is more than one page, marker is the - // health check ID for the first health check on the next page of results. For - // more information, see ListHealthChecksResponse$MaxItems. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // The maximum number of HealthCheck elements you want ListHealthChecks to return - // on each page of the response body. If the AWS account includes more HealthCheck - // elements than the value of maxitems, the response is broken into pages. Each - // page contains the number of HealthCheck elements specified by maxitems. - // - // For example, suppose you specify 10 for maxitems and the current AWS account - // has 51 health checks. In the response, ListHealthChecks sets ListHealthChecksResponse$IsTruncated - // to true and includes the ListHealthChecksResponse$NextMarker element. To - // access the second and subsequent pages, you resend the GETListHealthChecks - // request, add the ListHealthChecksResponse$Marker parameter to the request, - // and specify the value of the ListHealthChecksResponse$NextMarker element - // from the previous response. On the last (sixth) page of the response, which - // contains only one HealthCheck element: - // - // * The value of ListHealthChecksResponse$IsTruncated is false. - // - // * ListHealthChecksResponse$NextMarker is omitted. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` -} - -// String returns the string representation -func (s ListHealthChecksInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListHealthChecksInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListHealthChecksInput) SetMarker(v string) *ListHealthChecksInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListHealthChecksInput) SetMaxItems(v string) *ListHealthChecksInput { - s.MaxItems = &v - return s -} - -// A complex type that contains the response to a ListHealthChecks request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHealthChecksResponse -type ListHealthChecksOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains one HealthCheck element for each health check - // that is associated with the current AWS account. - // - // HealthChecks is a required field - HealthChecks []*HealthCheck `locationNameList:"HealthCheck" type:"list" required:"true"` - - // A flag that indicates whether there are more health checks to be listed. - // If the response was truncated, you can get the next group of maxitems health - // checks by calling ListHealthChecks again and specifying the value of the - // NextMarker element in the marker parameter. - // - // Valid Values: true | false - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // For the second and subsequent calls to ListHealthChecks, Marker is the value - // that you specified for the marker parameter in the previous request. - // - // Marker is a required field - Marker *string `type:"string" required:"true"` - - // The value that you specified for the maxitems parameter in the call to ListHealthChecks - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, the value of NextMarker identifies the first health - // check in the next group of maxitems health checks. Call ListHealthChecks - // again and specify the value of NextMarker in the marker parameter. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s ListHealthChecksOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListHealthChecksOutput) GoString() string { - return s.String() -} - -// SetHealthChecks sets the HealthChecks field's value. -func (s *ListHealthChecksOutput) SetHealthChecks(v []*HealthCheck) *ListHealthChecksOutput { - s.HealthChecks = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListHealthChecksOutput) SetIsTruncated(v bool) *ListHealthChecksOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListHealthChecksOutput) SetMarker(v string) *ListHealthChecksOutput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListHealthChecksOutput) SetMaxItems(v string) *ListHealthChecksOutput { - s.MaxItems = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListHealthChecksOutput) SetNextMarker(v string) *ListHealthChecksOutput { - s.NextMarker = &v - return s -} - -// To retrieve a list of your public and private hosted zones in ASCII order -// by domain name, send a GET request to the /Amazon Route 53 API version/hostedzonesbyname -// resource. The response to this request includes a HostedZone child element -// for each hosted zone that was created by the current AWS account. ListHostedZonesByName -// sorts hosted zones by name with the labels reversed, for example: -// -// com.example.www. -// -// Note the trailing dot, which can change the sort order in some circumstances. -// -// If the domain name includes escape characters or Punycode, ListHostedZonesByName -// alphabetizes the domain name using the escaped or Punycoded value, which -// is the format that Amazon Route 53 saves in its database. For example, to -// create a hosted zone for exämple.com, you specify ex\344mple.com for the -// domain name. ListHostedZonesByName alphabetizes it as: com.ex\344mple. The -// labels are reversed, and it's alphabetized using the escaped value. For more -// information about valid domain name formats, including internationalized -// domain names, see DNS Domain Name Format (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html) -// in the Amazon Route 53 Developer Guide. -// -// Amazon Route 53 returns up to 100 items in each response. If you have a lot -// of hosted zones, you can use the MaxItems parameter to list them in groups -// of up to 100. The response includes values that help you navigate from one -// group of MaxItems hosted zones to the next: -// -// * The DNSName and HostedZoneId elements in the response contain the values, -// if any, that you specified for the dnsname and hostedzoneid parameters -// in the request that produced the current response. -// -// * The MaxItems element in the response contains the value, if any, that -// you specified for the maxitems parameter in the request that produced -// the current response. -// -// * If the value of IsTruncated in the response is true, there are more -// hosted zones associated with the current Amazon Route 53 account. -// -// If IsTruncated is false, this response includes the last hosted zone that -// is associated with the current account. The NextDNSName element and NextHostedZoneId -// elements are omitted from the response. -// -// * The NextDNSName and NextHostedZoneId elements in the response contain -// the domain name and the hosted zone ID of the next hosted zone that is -// associated with the current AWS account. If you want to list more hosted -// zones, make another call to ListHostedZonesByName, and specify the value -// of NextDNSName and NextHostedZoneId in the dnsname and hostedzoneid parameters, -// respectively. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByNameRequest -type ListHostedZonesByNameInput struct { - _ struct{} `type:"structure"` - - // (Optional) For your first request to ListHostedZonesByName, include the dnsname - // parameter only if you want to specify the name of the first hosted zone in - // the response. If you don't include the dnsname parameter, Amazon Route 53 - // returns all of the hosted zones that were created by the current AWS account, - // in ASCII order. For subsequent requests, include both dnsname and hostedzoneid - // parameters. For dnsname, specify the value of NextDNSName from the previous - // response. - DNSName *string `location:"querystring" locationName:"dnsname" type:"string"` - - // (Optional) For your first request to ListHostedZonesByName, do not include - // the hostedzoneid parameter. - // - // If you have more hosted zones than the value of maxitems, ListHostedZonesByName - // returns only the first maxitems hosted zones. To get the next group of maxitems - // hosted zones, submit another request to ListHostedZonesByName and include - // both dnsname and hostedzoneid parameters. For the value of hostedzoneid, - // specify the value of the NextHostedZoneId element from the previous response. - HostedZoneId *string `location:"querystring" locationName:"hostedzoneid" type:"string"` - - // The maximum number of hosted zones to be included in the response body for - // this request. If you have more than maxitems hosted zones, then the value - // of the IsTruncated element in the response is true, and the values of NextDNSName - // and NextHostedZoneId specify the first hosted zone in the next group of maxitems - // hosted zones. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` -} - -// String returns the string representation -func (s ListHostedZonesByNameInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListHostedZonesByNameInput) GoString() string { - return s.String() -} - -// SetDNSName sets the DNSName field's value. -func (s *ListHostedZonesByNameInput) SetDNSName(v string) *ListHostedZonesByNameInput { - s.DNSName = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *ListHostedZonesByNameInput) SetHostedZoneId(v string) *ListHostedZonesByNameInput { - s.HostedZoneId = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListHostedZonesByNameInput) SetMaxItems(v string) *ListHostedZonesByNameInput { - s.MaxItems = &v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesByNameResponse -type ListHostedZonesByNameOutput struct { - _ struct{} `type:"structure"` - - // For the second and subsequent calls to ListHostedZonesByName, DNSName is - // the value that you specified for the dnsname parameter in the request that - // produced the current response. - DNSName *string `type:"string"` - - // The ID that Amazon Route 53 assigned to the hosted zone when you created - // it. - HostedZoneId *string `type:"string"` - - // A complex type that contains general information about the hosted zone. - // - // HostedZones is a required field - HostedZones []*HostedZone `locationNameList:"HostedZone" type:"list" required:"true"` - - // A flag that indicates whether there are more hosted zones to be listed. If - // the response was truncated, you can get the next group of maxitems hosted - // zones by calling ListHostedZonesByName again and specifying the values of - // NextDNSName and NextHostedZoneId elements in the dnsname and hostedzoneid - // parameters. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The value that you specified for the maxitems parameter in the call to ListHostedZonesByName - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, the value of NextDNSName is the name of the first - // hosted zone in the next group of maxitems hosted zones. Call ListHostedZonesByName - // again and specify the value of NextDNSName and NextHostedZoneId in the dnsname - // and hostedzoneid parameters, respectively. - // - // This element is present only if IsTruncated is true. - NextDNSName *string `type:"string"` - - // If IsTruncated is true, the value of NextHostedZoneId identifies the first - // hosted zone in the next group of maxitems hosted zones. Call ListHostedZonesByName - // again and specify the value of NextDNSName and NextHostedZoneId in the dnsname - // and hostedzoneid parameters, respectively. - // - // This element is present only if IsTruncated is true. - NextHostedZoneId *string `type:"string"` -} - -// String returns the string representation -func (s ListHostedZonesByNameOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListHostedZonesByNameOutput) GoString() string { - return s.String() -} - -// SetDNSName sets the DNSName field's value. -func (s *ListHostedZonesByNameOutput) SetDNSName(v string) *ListHostedZonesByNameOutput { - s.DNSName = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *ListHostedZonesByNameOutput) SetHostedZoneId(v string) *ListHostedZonesByNameOutput { - s.HostedZoneId = &v - return s -} - -// SetHostedZones sets the HostedZones field's value. -func (s *ListHostedZonesByNameOutput) SetHostedZones(v []*HostedZone) *ListHostedZonesByNameOutput { - s.HostedZones = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListHostedZonesByNameOutput) SetIsTruncated(v bool) *ListHostedZonesByNameOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListHostedZonesByNameOutput) SetMaxItems(v string) *ListHostedZonesByNameOutput { - s.MaxItems = &v - return s -} - -// SetNextDNSName sets the NextDNSName field's value. -func (s *ListHostedZonesByNameOutput) SetNextDNSName(v string) *ListHostedZonesByNameOutput { - s.NextDNSName = &v - return s -} - -// SetNextHostedZoneId sets the NextHostedZoneId field's value. -func (s *ListHostedZonesByNameOutput) SetNextHostedZoneId(v string) *ListHostedZonesByNameOutput { - s.NextHostedZoneId = &v - return s -} - -// To retrieve a list of your public and private hosted zones, send a GET request -// to the /2013-04-01/hostedzone resource. The response to this request includes -// a HostedZone child element for each hosted zone that was created by the current -// AWS account. -// -// Amazon Route 53 returns a maximum of 100 items in each response. If you have -// a lot of hosted zones, you can use the maxitems parameter to list them in -// groups of up to 100. The response includes four values that help you navigate -// from one group of maxitems hosted zones to the next: -// -// * MaxItems is the value that you specified for the maxitems parameter -// in the request that produced the current response. -// -// * If the value of IsTruncated in the response is true, there are more -// hosted zones associated with the current AWS account. -// -// If IsTruncated is false, this response includes the last hosted zone that -// is associated with the current account. -// -// * NextMarker is the hosted zone ID of the next hosted zone that is associated -// with the current AWS account. If you want to list more hosted zones, make -// another call to ListHostedZones, and specify the value of the NextMarker -// element in the marker parameter. -// -// If IsTruncated is false, the NextMarker element is omitted from the response. -// -// * If you're making the second or subsequent call to ListHostedZones, the -// Marker element matches the value that you specified in the marker parameter -// in the previous request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesRequest -type ListHostedZonesInput struct { - _ struct{} `type:"structure"` - - // If you're using reusable delegation sets and you want to list all of the - // hosted zones that are associated with a reusable delegation set, specify - // the ID of that reusable delegation set. - DelegationSetId *string `location:"querystring" locationName:"delegationsetid" type:"string"` - - // (Optional) If you have more hosted zones than the value of maxitems, ListHostedZones - // returns only the first maxitems hosted zones. To get the next group of maxitems - // hosted zones, submit another request to ListHostedZones. For the value of - // marker, specify the value of the NextMarker element that was returned in - // the previous response. - // - // Hosted zones are listed in the order in which they were created. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // (Optional) The maximum number of hosted zones to be included in the response - // body for this request. If you have more than maxitems hosted zones, the value - // of the IsTruncated element in the response is true, and the value of the - // NextMarker element is the hosted zone ID of the first hosted zone in the - // next group of maxitems hosted zones. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` -} - -// String returns the string representation -func (s ListHostedZonesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListHostedZonesInput) GoString() string { - return s.String() -} - -// SetDelegationSetId sets the DelegationSetId field's value. -func (s *ListHostedZonesInput) SetDelegationSetId(v string) *ListHostedZonesInput { - s.DelegationSetId = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListHostedZonesInput) SetMarker(v string) *ListHostedZonesInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListHostedZonesInput) SetMaxItems(v string) *ListHostedZonesInput { - s.MaxItems = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListHostedZonesResponse -type ListHostedZonesOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains general information about the hosted zone. - // - // HostedZones is a required field - HostedZones []*HostedZone `locationNameList:"HostedZone" type:"list" required:"true"` - - // A flag indicating whether there are more hosted zones to be listed. If the - // response was truncated, you can get the next group of maxitems hosted zones - // by calling ListHostedZones again and specifying the value of the NextMarker - // element in the marker parameter. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // For the second and subsequent calls to ListHostedZones, Marker is the value - // that you specified for the marker parameter in the request that produced - // the current response. - // - // Marker is a required field - Marker *string `type:"string" required:"true"` - - // The value that you specified for the maxitems parameter in the call to ListHostedZones - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, the value of NextMarker identifies the first hosted - // zone in the next group of maxitems hosted zones. Call ListHostedZones again - // and specify the value of NextMarker in the marker parameter. - // - // This element is present only if IsTruncated is true. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s ListHostedZonesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListHostedZonesOutput) GoString() string { - return s.String() -} - -// SetHostedZones sets the HostedZones field's value. -func (s *ListHostedZonesOutput) SetHostedZones(v []*HostedZone) *ListHostedZonesOutput { - s.HostedZones = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListHostedZonesOutput) SetIsTruncated(v bool) *ListHostedZonesOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListHostedZonesOutput) SetMarker(v string) *ListHostedZonesOutput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListHostedZonesOutput) SetMaxItems(v string) *ListHostedZonesOutput { - s.MaxItems = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListHostedZonesOutput) SetNextMarker(v string) *ListHostedZonesOutput { - s.NextMarker = &v - return s -} - -// The input for a ListResourceRecordSets request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListResourceRecordSetsRequest -type ListResourceRecordSetsInput struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone that contains the resource record sets that you - // want to get. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // (Optional) The maximum number of resource records sets to include in the - // response body for this request. If the response includes more than maxitems - // resource record sets, the value of the IsTruncated element in the response - // is true, and the values of the NextRecordName and NextRecordType elements - // in the response identify the first resource record set in the next group - // of maxitems resource record sets. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` - - // Weighted resource record sets only: If results were truncated for a given - // DNS name and type, specify the value of NextRecordIdentifier from the previous - // response to get the next resource record set that has the current DNS name - // and type. - StartRecordIdentifier *string `location:"querystring" locationName:"identifier" min:"1" type:"string"` - - // The first name in the lexicographic ordering of domain names that you want - // the ListResourceRecordSets request to list. - StartRecordName *string `location:"querystring" locationName:"name" type:"string"` - - // The type of resource record set to begin the record listing from. - // - // Valid values for basic resource record sets: A | AAAA | CNAME | MX | NAPTR - // | NS | PTR | SOA | SPF | SRV | TXT - // - // Values for weighted, latency, geo, and failover resource record sets: A | - // AAAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT - // - // Values for alias resource record sets: - // - // * CloudFront distribution: A or AAAA - // - // * Elastic Beanstalk environment that has a regionalized subdomain: A - // - // * ELB load balancer: A | AAAA - // - // * Amazon S3 bucket: A - // - // Constraint: Specifying type without specifying name returns an InvalidInput - // error. - StartRecordType *string `location:"querystring" locationName:"type" type:"string" enum:"RRType"` -} - -// String returns the string representation -func (s ListResourceRecordSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListResourceRecordSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListResourceRecordSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListResourceRecordSetsInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.StartRecordIdentifier != nil && len(*s.StartRecordIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartRecordIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *ListResourceRecordSetsInput) SetHostedZoneId(v string) *ListResourceRecordSetsInput { - s.HostedZoneId = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListResourceRecordSetsInput) SetMaxItems(v string) *ListResourceRecordSetsInput { - s.MaxItems = &v - return s -} - -// SetStartRecordIdentifier sets the StartRecordIdentifier field's value. -func (s *ListResourceRecordSetsInput) SetStartRecordIdentifier(v string) *ListResourceRecordSetsInput { - s.StartRecordIdentifier = &v - return s -} - -// SetStartRecordName sets the StartRecordName field's value. -func (s *ListResourceRecordSetsInput) SetStartRecordName(v string) *ListResourceRecordSetsInput { - s.StartRecordName = &v - return s -} - -// SetStartRecordType sets the StartRecordType field's value. -func (s *ListResourceRecordSetsInput) SetStartRecordType(v string) *ListResourceRecordSetsInput { - s.StartRecordType = &v - return s -} - -// A complex type that contains list information for the resource record set. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListResourceRecordSetsResponse -type ListResourceRecordSetsOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether more resource record sets remain to be listed. - // If your results were truncated, you can make a follow-up pagination request - // by using the NextRecordName element. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The maximum number of records you requested. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // Weighted, latency, geolocation, and failover resource record sets only: If - // results were truncated for a given DNS name and type, the value of SetIdentifier - // for the next resource record set that has the current DNS name and type. - NextRecordIdentifier *string `min:"1" type:"string"` - - // If the results were truncated, the name of the next record in the list. - // - // This element is present only if IsTruncated is true. - NextRecordName *string `type:"string"` - - // If the results were truncated, the type of the next record in the list. - // - // This element is present only if IsTruncated is true. - NextRecordType *string `type:"string" enum:"RRType"` - - // Information about multiple resource record sets. - // - // ResourceRecordSets is a required field - ResourceRecordSets []*ResourceRecordSet `locationNameList:"ResourceRecordSet" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListResourceRecordSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListResourceRecordSetsOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListResourceRecordSetsOutput) SetIsTruncated(v bool) *ListResourceRecordSetsOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListResourceRecordSetsOutput) SetMaxItems(v string) *ListResourceRecordSetsOutput { - s.MaxItems = &v - return s -} - -// SetNextRecordIdentifier sets the NextRecordIdentifier field's value. -func (s *ListResourceRecordSetsOutput) SetNextRecordIdentifier(v string) *ListResourceRecordSetsOutput { - s.NextRecordIdentifier = &v - return s -} - -// SetNextRecordName sets the NextRecordName field's value. -func (s *ListResourceRecordSetsOutput) SetNextRecordName(v string) *ListResourceRecordSetsOutput { - s.NextRecordName = &v - return s -} - -// SetNextRecordType sets the NextRecordType field's value. -func (s *ListResourceRecordSetsOutput) SetNextRecordType(v string) *ListResourceRecordSetsOutput { - s.NextRecordType = &v - return s -} - -// SetResourceRecordSets sets the ResourceRecordSets field's value. -func (s *ListResourceRecordSetsOutput) SetResourceRecordSets(v []*ResourceRecordSet) *ListResourceRecordSetsOutput { - s.ResourceRecordSets = v - return s -} - -// To retrieve a list of your reusable delegation sets, send a GET request to -// the /2013-04-01/delegationset resource. The response to this request includes -// a DelegationSets element with zero or more DelegationSet child elements. -// By default, the list of reusable delegation sets is displayed on a single -// page. You can control the length of the page that is displayed by using the -// MaxItems parameter. You can use the Marker parameter to control the delegation -// set that the list begins with. -// -// Amazon Route 53 returns a maximum of 100 items. If you set MaxItems to a -// value greater than 100, Amazon Route 53 returns only the first 100. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListReusableDelegationSetsRequest -type ListReusableDelegationSetsInput struct { - _ struct{} `type:"structure"` - - // If you're making the second or subsequent call to ListReusableDelegationSets, - // the Marker element matches the value that you specified in the marker parameter - // in the previous request. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // The value that you specified for the maxitems parameter in the request that - // produced the current response. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` -} - -// String returns the string representation -func (s ListReusableDelegationSetsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListReusableDelegationSetsInput) GoString() string { - return s.String() -} - -// SetMarker sets the Marker field's value. -func (s *ListReusableDelegationSetsInput) SetMarker(v string) *ListReusableDelegationSetsInput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListReusableDelegationSetsInput) SetMaxItems(v string) *ListReusableDelegationSetsInput { - s.MaxItems = &v - return s -} - -// A complex type that contains information about the reusable delegation sets -// that are associated with the current AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListReusableDelegationSetsResponse -type ListReusableDelegationSetsOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains one DelegationSet element for each reusable - // delegation set that was created by the current AWS account. - // - // DelegationSets is a required field - DelegationSets []*DelegationSet `locationNameList:"DelegationSet" type:"list" required:"true"` - - // A flag that indicates whether there are more reusable delegation sets to - // be listed. If the response is truncated, you can get the next group of maxitems - // reusable delegation sets by calling ListReusableDelegationSets again and - // specifying the value of the NextMarker element in the marker parameter. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // For the second and subsequent calls to ListReusableDelegationSets, Marker - // is the value that you specified for the marker parameter in the request that - // produced the current response. - // - // Marker is a required field - Marker *string `type:"string" required:"true"` - - // The value that you specified for the maxitems parameter in the call to ListReusableDelegationSets - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, the value of NextMarker identifies the first reusable - // delegation set in the next group of maxitems reusable delegation sets. Call - // ListReusableDelegationSets again and specify the value of NextMarker in the - // marker parameter. - NextMarker *string `type:"string"` -} - -// String returns the string representation -func (s ListReusableDelegationSetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListReusableDelegationSetsOutput) GoString() string { - return s.String() -} - -// SetDelegationSets sets the DelegationSets field's value. -func (s *ListReusableDelegationSetsOutput) SetDelegationSets(v []*DelegationSet) *ListReusableDelegationSetsOutput { - s.DelegationSets = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListReusableDelegationSetsOutput) SetIsTruncated(v bool) *ListReusableDelegationSetsOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListReusableDelegationSetsOutput) SetMarker(v string) *ListReusableDelegationSetsOutput { - s.Marker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListReusableDelegationSetsOutput) SetMaxItems(v string) *ListReusableDelegationSetsOutput { - s.MaxItems = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListReusableDelegationSetsOutput) SetNextMarker(v string) *ListReusableDelegationSetsOutput { - s.NextMarker = &v - return s -} - -// A complex type containing information about a request for a list of the tags -// that are associated with an individual resource. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResourceRequest -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The ID of the resource for which you want to retrieve tags. - // - // ResourceId is a required field - ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` - - // The type of the resource. - // - // * The resource type for health checks is healthcheck. - // - // * The resource type for hosted zones is hostedzone. - // - // ResourceType is a required field - ResourceType *string `location:"uri" locationName:"ResourceType" type:"string" required:"true" enum:"TagResourceType"` -} - -// String returns the string representation -func (s ListTagsForResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *ListTagsForResourceInput) SetResourceId(v string) *ListTagsForResourceInput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ListTagsForResourceInput) SetResourceType(v string) *ListTagsForResourceInput { - s.ResourceType = &v - return s -} - -// A complex type that contains information about the health checks or hosted -// zones for which you want to list tags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResourceResponse -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A ResourceTagSet containing tags associated with the specified resource. - // - // ResourceTagSet is a required field - ResourceTagSet *ResourceTagSet `type:"structure" required:"true"` -} - -// String returns the string representation -func (s ListTagsForResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetResourceTagSet sets the ResourceTagSet field's value. -func (s *ListTagsForResourceOutput) SetResourceTagSet(v *ResourceTagSet) *ListTagsForResourceOutput { - s.ResourceTagSet = v - return s -} - -// A complex type that contains information about the health checks or hosted -// zones for which you want to list tags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResourcesRequest -type ListTagsForResourcesInput struct { - _ struct{} `locationName:"ListTagsForResourcesRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // A complex type that contains the ResourceId element for each resource for - // which you want to get a list of tags. - // - // ResourceIds is a required field - ResourceIds []*string `locationNameList:"ResourceId" min:"1" type:"list" required:"true"` - - // The type of the resources. - // - // * The resource type for health checks is healthcheck. - // - // * The resource type for hosted zones is hostedzone. - // - // ResourceType is a required field - ResourceType *string `location:"uri" locationName:"ResourceType" type:"string" required:"true" enum:"TagResourceType"` -} - -// String returns the string representation -func (s ListTagsForResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourcesInput"} - if s.ResourceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIds")) - } - if s.ResourceIds != nil && len(s.ResourceIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIds", 1)) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *ListTagsForResourcesInput) SetResourceIds(v []*string) *ListTagsForResourcesInput { - s.ResourceIds = v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ListTagsForResourcesInput) SetResourceType(v string) *ListTagsForResourcesInput { - s.ResourceType = &v - return s -} - -// A complex type containing tags for the specified resources. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTagsForResourcesResponse -type ListTagsForResourcesOutput struct { - _ struct{} `type:"structure"` - - // A list of ResourceTagSets containing tags associated with the specified resources. - // - // ResourceTagSets is a required field - ResourceTagSets []*ResourceTagSet `locationNameList:"ResourceTagSet" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListTagsForResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTagsForResourcesOutput) GoString() string { - return s.String() -} - -// SetResourceTagSets sets the ResourceTagSets field's value. -func (s *ListTagsForResourcesOutput) SetResourceTagSets(v []*ResourceTagSet) *ListTagsForResourcesOutput { - s.ResourceTagSets = v - return s -} - -// A complex type that contains the information about the request to list the -// traffic policies that are associated with the current AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPoliciesRequest -type ListTrafficPoliciesInput struct { - _ struct{} `type:"structure"` - - // (Optional) The maximum number of traffic policies to be included in the response - // body for this request. If you have more than MaxItems traffic policies, the - // value of the IsTruncated element in the response is true, and the value of - // the TrafficPolicyIdMarker element is the ID of the first traffic policy in - // the next group of MaxItems traffic policies. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` - - // (Conditional) For your first request to ListTrafficPolicies, do not include - // the TrafficPolicyIdMarker parameter. - // - // If you have more traffic policies than the value of MaxItems, ListTrafficPolicies - // returns only the first MaxItems traffic policies. To get the next group of - // MaxItems policies, submit another request to ListTrafficPolicies. For the - // value of TrafficPolicyIdMarker, specify the value of the TrafficPolicyIdMarker - // element that was returned in the previous response. - // - // Policies are listed in the order in which they were created. - TrafficPolicyIdMarker *string `location:"querystring" locationName:"trafficpolicyid" min:"1" type:"string"` -} - -// String returns the string representation -func (s ListTrafficPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTrafficPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTrafficPoliciesInput"} - if s.TrafficPolicyIdMarker != nil && len(*s.TrafficPolicyIdMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyIdMarker", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPoliciesInput) SetMaxItems(v string) *ListTrafficPoliciesInput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyIdMarker sets the TrafficPolicyIdMarker field's value. -func (s *ListTrafficPoliciesInput) SetTrafficPolicyIdMarker(v string) *ListTrafficPoliciesInput { - s.TrafficPolicyIdMarker = &v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPoliciesResponse -type ListTrafficPoliciesOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more traffic policies to be listed. - // If the response was truncated, you can get the next group of MaxItems traffic - // policies by calling ListTrafficPolicies again and specifying the value of - // the TrafficPolicyIdMarker element in the TrafficPolicyIdMarker request parameter. - // - // Valid Values: true | false - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The value that you specified for the MaxItems parameter in the call to ListTrafficPolicies - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If the value of IsTruncated is true, TrafficPolicyIdMarker is the ID of the - // first traffic policy in the next group of MaxItems traffic policies. - // - // TrafficPolicyIdMarker is a required field - TrafficPolicyIdMarker *string `min:"1" type:"string" required:"true"` - - // A list that contains one TrafficPolicySummary element for each traffic policy - // that was created by the current AWS account. - // - // TrafficPolicySummaries is a required field - TrafficPolicySummaries []*TrafficPolicySummary `locationNameList:"TrafficPolicySummary" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListTrafficPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPoliciesOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListTrafficPoliciesOutput) SetIsTruncated(v bool) *ListTrafficPoliciesOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPoliciesOutput) SetMaxItems(v string) *ListTrafficPoliciesOutput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyIdMarker sets the TrafficPolicyIdMarker field's value. -func (s *ListTrafficPoliciesOutput) SetTrafficPolicyIdMarker(v string) *ListTrafficPoliciesOutput { - s.TrafficPolicyIdMarker = &v - return s -} - -// SetTrafficPolicySummaries sets the TrafficPolicySummaries field's value. -func (s *ListTrafficPoliciesOutput) SetTrafficPolicySummaries(v []*TrafficPolicySummary) *ListTrafficPoliciesOutput { - s.TrafficPolicySummaries = v - return s -} - -// A request for the traffic policy instances that you created in a specified -// hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByHostedZoneRequest -type ListTrafficPolicyInstancesByHostedZoneInput struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone for which you want to list traffic policy instances. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"querystring" locationName:"id" type:"string" required:"true"` - - // The maximum number of traffic policy instances to be included in the response - // body for this request. If you have more than MaxItems traffic policy instances, - // the value of the IsTruncated element in the response is true, and the values - // of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker - // represent the first traffic policy instance in the next group of MaxItems - // traffic policy instances. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` - - // For the first request to ListTrafficPolicyInstancesByHostedZone, omit this - // value. - // - // If the value of IsTruncated in the previous response was true, TrafficPolicyInstanceNameMarker - // is the name of the first traffic policy instance in the next group of MaxItems - // traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get for this hosted zone. - // - // If the value of IsTruncated in the previous response was false, omit this - // value. - TrafficPolicyInstanceNameMarker *string `location:"querystring" locationName:"trafficpolicyinstancename" type:"string"` - - // For the first request to ListTrafficPolicyInstancesByHostedZone, omit this - // value. - // - // If the value of IsTruncated in the previous response was true, TrafficPolicyInstanceTypeMarker - // is the DNS type of the first traffic policy instance in the next group of - // MaxItems traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get for this hosted zone. - TrafficPolicyInstanceTypeMarker *string `location:"querystring" locationName:"trafficpolicyinstancetype" type:"string" enum:"RRType"` -} - -// String returns the string representation -func (s ListTrafficPolicyInstancesByHostedZoneInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyInstancesByHostedZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTrafficPolicyInstancesByHostedZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTrafficPolicyInstancesByHostedZoneInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetHostedZoneId(v string) *ListTrafficPolicyInstancesByHostedZoneInput { - s.HostedZoneId = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetMaxItems(v string) *ListTrafficPolicyInstancesByHostedZoneInput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByHostedZoneInput { - s.TrafficPolicyInstanceNameMarker = &v - return s -} - -// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneInput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByHostedZoneInput { - s.TrafficPolicyInstanceTypeMarker = &v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByHostedZoneResponse -type ListTrafficPolicyInstancesByHostedZoneOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more traffic policy instances to - // be listed. If the response was truncated, you can get the next group of MaxItems - // traffic policy instances by calling ListTrafficPolicyInstancesByHostedZone - // again and specifying the values of the HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, - // and TrafficPolicyInstanceTypeMarker elements in the corresponding request - // parameters. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The value that you specified for the MaxItems parameter in the call to ListTrafficPolicyInstancesByHostedZone - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the - // first traffic policy instance in the next group of MaxItems traffic policy - // instances. - TrafficPolicyInstanceNameMarker *string `type:"string"` - - // If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of - // the resource record sets that are associated with the first traffic policy - // instance in the next group of MaxItems traffic policy instances. - TrafficPolicyInstanceTypeMarker *string `type:"string" enum:"RRType"` - - // A list that contains one TrafficPolicyInstance element for each traffic policy - // instance that matches the elements in the request. - // - // TrafficPolicyInstances is a required field - TrafficPolicyInstances []*TrafficPolicyInstance `locationNameList:"TrafficPolicyInstance" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListTrafficPolicyInstancesByHostedZoneOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyInstancesByHostedZoneOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetIsTruncated(v bool) *ListTrafficPolicyInstancesByHostedZoneOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetMaxItems(v string) *ListTrafficPolicyInstancesByHostedZoneOutput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByHostedZoneOutput { - s.TrafficPolicyInstanceNameMarker = &v - return s -} - -// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByHostedZoneOutput { - s.TrafficPolicyInstanceTypeMarker = &v - return s -} - -// SetTrafficPolicyInstances sets the TrafficPolicyInstances field's value. -func (s *ListTrafficPolicyInstancesByHostedZoneOutput) SetTrafficPolicyInstances(v []*TrafficPolicyInstance) *ListTrafficPolicyInstancesByHostedZoneOutput { - s.TrafficPolicyInstances = v - return s -} - -// A complex type that contains the information about the request to list your -// traffic policy instances. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByPolicyRequest -type ListTrafficPolicyInstancesByPolicyInput struct { - _ struct{} `type:"structure"` - - // For the first request to ListTrafficPolicyInstancesByPolicy, omit this value. - // - // If the value of IsTruncated in the previous response was true, HostedZoneIdMarker - // is the ID of the hosted zone for the first traffic policy instance in the - // next group of MaxItems traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get for this hosted zone. - // - // If the value of IsTruncated in the previous response was false, omit this - // value. - HostedZoneIdMarker *string `location:"querystring" locationName:"hostedzoneid" type:"string"` - - // The maximum number of traffic policy instances to be included in the response - // body for this request. If you have more than MaxItems traffic policy instances, - // the value of the IsTruncated element in the response is true, and the values - // of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker - // represent the first traffic policy instance in the next group of MaxItems - // traffic policy instances. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` - - // The ID of the traffic policy for which you want to list traffic policy instances. - // - // TrafficPolicyId is a required field - TrafficPolicyId *string `location:"querystring" locationName:"id" min:"1" type:"string" required:"true"` - - // For the first request to ListTrafficPolicyInstancesByPolicy, omit this value. - // - // If the value of IsTruncated in the previous response was true, TrafficPolicyInstanceNameMarker - // is the name of the first traffic policy instance in the next group of MaxItems - // traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get for this hosted zone. - // - // If the value of IsTruncated in the previous response was false, omit this - // value. - TrafficPolicyInstanceNameMarker *string `location:"querystring" locationName:"trafficpolicyinstancename" type:"string"` - - // For the first request to ListTrafficPolicyInstancesByPolicy, omit this value. - // - // If the value of IsTruncated in the previous response was true, TrafficPolicyInstanceTypeMarker - // is the DNS type of the first traffic policy instance in the next group of - // MaxItems traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get for this hosted zone. - TrafficPolicyInstanceTypeMarker *string `location:"querystring" locationName:"trafficpolicyinstancetype" type:"string" enum:"RRType"` - - // The version of the traffic policy for which you want to list traffic policy - // instances. The version must be associated with the traffic policy that is - // specified by TrafficPolicyId. - // - // TrafficPolicyVersion is a required field - TrafficPolicyVersion *int64 `location:"querystring" locationName:"version" min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s ListTrafficPolicyInstancesByPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyInstancesByPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTrafficPolicyInstancesByPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTrafficPolicyInstancesByPolicyInput"} - if s.TrafficPolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficPolicyId")) - } - if s.TrafficPolicyId != nil && len(*s.TrafficPolicyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyId", 1)) - } - if s.TrafficPolicyVersion == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficPolicyVersion")) - } - if s.TrafficPolicyVersion != nil && *s.TrafficPolicyVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("TrafficPolicyVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. -func (s *ListTrafficPolicyInstancesByPolicyInput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesByPolicyInput { - s.HostedZoneIdMarker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyInstancesByPolicyInput) SetMaxItems(v string) *ListTrafficPolicyInstancesByPolicyInput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyId sets the TrafficPolicyId field's value. -func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyId(v string) *ListTrafficPolicyInstancesByPolicyInput { - s.TrafficPolicyId = &v - return s -} - -// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. -func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByPolicyInput { - s.TrafficPolicyInstanceNameMarker = &v - return s -} - -// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. -func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByPolicyInput { - s.TrafficPolicyInstanceTypeMarker = &v - return s -} - -// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. -func (s *ListTrafficPolicyInstancesByPolicyInput) SetTrafficPolicyVersion(v int64) *ListTrafficPolicyInstancesByPolicyInput { - s.TrafficPolicyVersion = &v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesByPolicyResponse -type ListTrafficPolicyInstancesByPolicyOutput struct { - _ struct{} `type:"structure"` - - // If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of - // the first traffic policy instance in the next group of MaxItems traffic policy - // instances. - HostedZoneIdMarker *string `type:"string"` - - // A flag that indicates whether there are more traffic policy instances to - // be listed. If the response was truncated, you can get the next group of MaxItems - // traffic policy instances by calling ListTrafficPolicyInstancesByPolicy again - // and specifying the values of the HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, - // and TrafficPolicyInstanceTypeMarker elements in the corresponding request - // parameters. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The value that you specified for the MaxItems parameter in the call to ListTrafficPolicyInstancesByPolicy - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the - // first traffic policy instance in the next group of MaxItems traffic policy - // instances. - TrafficPolicyInstanceNameMarker *string `type:"string"` - - // If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of - // the resource record sets that are associated with the first traffic policy - // instance in the next group of MaxItems traffic policy instances. - TrafficPolicyInstanceTypeMarker *string `type:"string" enum:"RRType"` - - // A list that contains one TrafficPolicyInstance element for each traffic policy - // instance that matches the elements in the request. - // - // TrafficPolicyInstances is a required field - TrafficPolicyInstances []*TrafficPolicyInstance `locationNameList:"TrafficPolicyInstance" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListTrafficPolicyInstancesByPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyInstancesByPolicyOutput) GoString() string { - return s.String() -} - -// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. -func (s *ListTrafficPolicyInstancesByPolicyOutput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesByPolicyOutput { - s.HostedZoneIdMarker = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListTrafficPolicyInstancesByPolicyOutput) SetIsTruncated(v bool) *ListTrafficPolicyInstancesByPolicyOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyInstancesByPolicyOutput) SetMaxItems(v string) *ListTrafficPolicyInstancesByPolicyOutput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. -func (s *ListTrafficPolicyInstancesByPolicyOutput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesByPolicyOutput { - s.TrafficPolicyInstanceNameMarker = &v - return s -} - -// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. -func (s *ListTrafficPolicyInstancesByPolicyOutput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesByPolicyOutput { - s.TrafficPolicyInstanceTypeMarker = &v - return s -} - -// SetTrafficPolicyInstances sets the TrafficPolicyInstances field's value. -func (s *ListTrafficPolicyInstancesByPolicyOutput) SetTrafficPolicyInstances(v []*TrafficPolicyInstance) *ListTrafficPolicyInstancesByPolicyOutput { - s.TrafficPolicyInstances = v - return s -} - -// A request to get information about the traffic policy instances that you -// created by using the current AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesRequest -type ListTrafficPolicyInstancesInput struct { - _ struct{} `type:"structure"` - - // For the first request to ListTrafficPolicyInstances, omit this value. - // - // If the value of IsTruncated in the previous response was true, you have more - // traffic policy instances. To get the next group of MaxItems traffic policy - // instances, submit another ListTrafficPolicyInstances request. For the value - // of HostedZoneIdMarker, specify the value of HostedZoneIdMarker from the previous - // response, which is the hosted zone ID of the first traffic policy instance - // in the next group of MaxItems traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get. - HostedZoneIdMarker *string `location:"querystring" locationName:"hostedzoneid" type:"string"` - - // The maximum number of traffic policy instances to be included in the response - // body for this request. If you have more than MaxItems traffic policy instances, - // the value of the IsTruncated element in the response is true, and the values - // of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker - // represent the first traffic policy instance in the next group of MaxItems - // traffic policy instances. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` - - // For the first request to ListTrafficPolicyInstances, omit this value. - // - // If the value of IsTruncated in the previous response was true, TrafficPolicyInstanceNameMarker - // is the name of the first traffic policy instance in the next group of MaxItems - // traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get. - TrafficPolicyInstanceNameMarker *string `location:"querystring" locationName:"trafficpolicyinstancename" type:"string"` - - // For the first request to ListTrafficPolicyInstances, omit this value. - // - // If the value of IsTruncated in the previous response was true, TrafficPolicyInstanceTypeMarker - // is the DNS type of the first traffic policy instance in the next group of - // MaxItems traffic policy instances. - // - // If the value of IsTruncated in the previous response was false, there are - // no more traffic policy instances to get. - TrafficPolicyInstanceTypeMarker *string `location:"querystring" locationName:"trafficpolicyinstancetype" type:"string" enum:"RRType"` -} - -// String returns the string representation -func (s ListTrafficPolicyInstancesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyInstancesInput) GoString() string { - return s.String() -} - -// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. -func (s *ListTrafficPolicyInstancesInput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesInput { - s.HostedZoneIdMarker = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyInstancesInput) SetMaxItems(v string) *ListTrafficPolicyInstancesInput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. -func (s *ListTrafficPolicyInstancesInput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesInput { - s.TrafficPolicyInstanceNameMarker = &v - return s -} - -// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. -func (s *ListTrafficPolicyInstancesInput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesInput { - s.TrafficPolicyInstanceTypeMarker = &v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyInstancesResponse -type ListTrafficPolicyInstancesOutput struct { - _ struct{} `type:"structure"` - - // If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of - // the first traffic policy instance in the next group of MaxItems traffic policy - // instances. - HostedZoneIdMarker *string `type:"string"` - - // A flag that indicates whether there are more traffic policy instances to - // be listed. If the response was truncated, you can get the next group of MaxItems - // traffic policy instances by calling ListTrafficPolicyInstances again and - // specifying the values of the HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, - // and TrafficPolicyInstanceTypeMarker elements in the corresponding request - // parameters. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The value that you specified for the MaxItems parameter in the call to ListTrafficPolicyInstances - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the - // first traffic policy instance in the next group of MaxItems traffic policy - // instances. - TrafficPolicyInstanceNameMarker *string `type:"string"` - - // If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of - // the resource record sets that are associated with the first traffic policy - // instance in the next group of MaxItems traffic policy instances. - TrafficPolicyInstanceTypeMarker *string `type:"string" enum:"RRType"` - - // A list that contains one TrafficPolicyInstance element for each traffic policy - // instance that matches the elements in the request. - // - // TrafficPolicyInstances is a required field - TrafficPolicyInstances []*TrafficPolicyInstance `locationNameList:"TrafficPolicyInstance" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListTrafficPolicyInstancesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyInstancesOutput) GoString() string { - return s.String() -} - -// SetHostedZoneIdMarker sets the HostedZoneIdMarker field's value. -func (s *ListTrafficPolicyInstancesOutput) SetHostedZoneIdMarker(v string) *ListTrafficPolicyInstancesOutput { - s.HostedZoneIdMarker = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListTrafficPolicyInstancesOutput) SetIsTruncated(v bool) *ListTrafficPolicyInstancesOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyInstancesOutput) SetMaxItems(v string) *ListTrafficPolicyInstancesOutput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyInstanceNameMarker sets the TrafficPolicyInstanceNameMarker field's value. -func (s *ListTrafficPolicyInstancesOutput) SetTrafficPolicyInstanceNameMarker(v string) *ListTrafficPolicyInstancesOutput { - s.TrafficPolicyInstanceNameMarker = &v - return s -} - -// SetTrafficPolicyInstanceTypeMarker sets the TrafficPolicyInstanceTypeMarker field's value. -func (s *ListTrafficPolicyInstancesOutput) SetTrafficPolicyInstanceTypeMarker(v string) *ListTrafficPolicyInstancesOutput { - s.TrafficPolicyInstanceTypeMarker = &v - return s -} - -// SetTrafficPolicyInstances sets the TrafficPolicyInstances field's value. -func (s *ListTrafficPolicyInstancesOutput) SetTrafficPolicyInstances(v []*TrafficPolicyInstance) *ListTrafficPolicyInstancesOutput { - s.TrafficPolicyInstances = v - return s -} - -// A complex type that contains the information about the request to list your -// traffic policies. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyVersionsRequest -type ListTrafficPolicyVersionsInput struct { - _ struct{} `type:"structure"` - - // Specify the value of Id of the traffic policy for which you want to list - // all versions. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` - - // The maximum number of traffic policy versions that you want Amazon Route - // 53 to include in the response body for this request. If the specified traffic - // policy has more than MaxItems versions, the value of the IsTruncated element - // in the response is true, and the value of the TrafficPolicyVersionMarker - // element is the ID of the first version in the next group of MaxItems traffic - // policy versions. - MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"` - - // For your first request to ListTrafficPolicyVersions, do not include the TrafficPolicyVersionMarker - // parameter. - // - // If you have more traffic policy versions than the value of MaxItems, ListTrafficPolicyVersions - // returns only the first group of MaxItems versions. To get the next group - // of MaxItems traffic policy versions, submit another request to ListTrafficPolicyVersions. - // For the value of TrafficPolicyVersionMarker, specify the value of the TrafficPolicyVersionMarker - // element that was returned in the previous response. - // - // Traffic policy versions are listed in sequential order. - TrafficPolicyVersionMarker *string `location:"querystring" locationName:"trafficpolicyversion" type:"string"` -} - -// String returns the string representation -func (s ListTrafficPolicyVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTrafficPolicyVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTrafficPolicyVersionsInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *ListTrafficPolicyVersionsInput) SetId(v string) *ListTrafficPolicyVersionsInput { - s.Id = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyVersionsInput) SetMaxItems(v string) *ListTrafficPolicyVersionsInput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicyVersionMarker sets the TrafficPolicyVersionMarker field's value. -func (s *ListTrafficPolicyVersionsInput) SetTrafficPolicyVersionMarker(v string) *ListTrafficPolicyVersionsInput { - s.TrafficPolicyVersionMarker = &v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListTrafficPolicyVersionsResponse -type ListTrafficPolicyVersionsOutput struct { - _ struct{} `type:"structure"` - - // A flag that indicates whether there are more traffic policies to be listed. - // If the response was truncated, you can get the next group of maxitems traffic - // policies by calling ListTrafficPolicyVersions again and specifying the value - // of the NextMarker element in the marker parameter. - // - // IsTruncated is a required field - IsTruncated *bool `type:"boolean" required:"true"` - - // The value that you specified for the maxitems parameter in the call to ListTrafficPolicyVersions - // that produced the current response. - // - // MaxItems is a required field - MaxItems *string `type:"string" required:"true"` - - // A list that contains one TrafficPolicy element for each traffic policy version - // that is associated with the specified traffic policy. - // - // TrafficPolicies is a required field - TrafficPolicies []*TrafficPolicy `locationNameList:"TrafficPolicy" type:"list" required:"true"` - - // If IsTruncated is true, the value of TrafficPolicyVersionMarker identifies - // the first traffic policy in the next group of MaxItems traffic policies. - // Call ListTrafficPolicyVersions again and specify the value of TrafficPolicyVersionMarker - // in the TrafficPolicyVersionMarker request parameter. - // - // This element is present only if IsTruncated is true. - // - // TrafficPolicyVersionMarker is a required field - TrafficPolicyVersionMarker *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ListTrafficPolicyVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListTrafficPolicyVersionsOutput) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListTrafficPolicyVersionsOutput) SetIsTruncated(v bool) *ListTrafficPolicyVersionsOutput { - s.IsTruncated = &v - return s -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListTrafficPolicyVersionsOutput) SetMaxItems(v string) *ListTrafficPolicyVersionsOutput { - s.MaxItems = &v - return s -} - -// SetTrafficPolicies sets the TrafficPolicies field's value. -func (s *ListTrafficPolicyVersionsOutput) SetTrafficPolicies(v []*TrafficPolicy) *ListTrafficPolicyVersionsOutput { - s.TrafficPolicies = v - return s -} - -// SetTrafficPolicyVersionMarker sets the TrafficPolicyVersionMarker field's value. -func (s *ListTrafficPolicyVersionsOutput) SetTrafficPolicyVersionMarker(v string) *ListTrafficPolicyVersionsOutput { - s.TrafficPolicyVersionMarker = &v - return s -} - -// A complex type that contains information about that can be associated with -// your hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListVPCAssociationAuthorizationsRequest -type ListVPCAssociationAuthorizationsInput struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone for which you want a list of VPCs that can be associated - // with the hosted zone. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"` - - // Optional: An integer that specifies the maximum number of VPCs that you want - // Amazon Route 53 to return. - MaxResults *string `location:"querystring" locationName:"maxresults" type:"string"` - - // Optional: If a response includes a NextToken element, there are more VPCs - // that can be associated with the specified hosted zone. To get the next page - // of results, submit another request, and include the value of the NextToken - // element in from the response in the NextToken parameter in another ListVPCAssociationAuthorizations - // request. - NextToken *string `location:"querystring" locationName:"nexttoken" type:"string"` -} - -// String returns the string representation -func (s ListVPCAssociationAuthorizationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVPCAssociationAuthorizationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVPCAssociationAuthorizationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVPCAssociationAuthorizationsInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *ListVPCAssociationAuthorizationsInput) SetHostedZoneId(v string) *ListVPCAssociationAuthorizationsInput { - s.HostedZoneId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVPCAssociationAuthorizationsInput) SetMaxResults(v string) *ListVPCAssociationAuthorizationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVPCAssociationAuthorizationsInput) SetNextToken(v string) *ListVPCAssociationAuthorizationsInput { - s.NextToken = &v - return s -} - -// A complex type that contains the response information for the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ListVPCAssociationAuthorizationsResponse -type ListVPCAssociationAuthorizationsOutput struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone that you can associate the listed VPCs with. - // - // HostedZoneId is a required field - HostedZoneId *string `type:"string" required:"true"` - - // When the response includes a NextToken element, there are more VPCs that - // can be associated with the specified hosted zone. To get the next page of - // VPCs, submit another ListVPCAssociationAuthorizations request, and include - // the value of the NextToken element from the response in the NextToken request - // parameter: - // - // /2013-04-01/hostedzone/hosted zone ID/authorizevpcassociation?MaxItems=VPCs - // per page&NextToken= - NextToken *string `type:"string"` - - // The list of VPCs that are authorized to be associated with the specified - // hosted zone. - // - // VPCs is a required field - VPCs []*VPC `locationNameList:"VPC" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s ListVPCAssociationAuthorizationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListVPCAssociationAuthorizationsOutput) GoString() string { - return s.String() -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *ListVPCAssociationAuthorizationsOutput) SetHostedZoneId(v string) *ListVPCAssociationAuthorizationsOutput { - s.HostedZoneId = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVPCAssociationAuthorizationsOutput) SetNextToken(v string) *ListVPCAssociationAuthorizationsOutput { - s.NextToken = &v - return s -} - -// SetVPCs sets the VPCs field's value. -func (s *ListVPCAssociationAuthorizationsOutput) SetVPCs(v []*VPC) *ListVPCAssociationAuthorizationsOutput { - s.VPCs = v - return s -} - -// Information specific to the resource record. -// -// If you're creating an alias resource record set, omit ResourceRecord. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ResourceRecord -type ResourceRecord struct { - _ struct{} `type:"structure"` - - // The current or new DNS record value, not to exceed 4,000 characters. In the - // case of a DELETE action, if the current value does not match the actual value, - // an error is returned. For descriptions about how to format Value for different - // record types, see Supported DNS Resource Record Types (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html) - // in the Amazon Route 53 Developer Guide. - // - // You can specify more than one value for all record types except CNAME and - // SOA. - // - // If you're creating an alias resource record set, omit Value. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ResourceRecord) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceRecord) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResourceRecord) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResourceRecord"} - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetValue sets the Value field's value. -func (s *ResourceRecord) SetValue(v string) *ResourceRecord { - s.Value = &v - return s -} - -// Information about the resource record set to create or delete. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ResourceRecordSet -type ResourceRecordSet struct { - _ struct{} `type:"structure"` - - // Alias resource record sets only: Information about the CloudFront distribution, - // AWS Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or - // Amazon Route 53 resource record set to which you're redirecting queries. - // The AWS Elastic Beanstalk environment must have a regionalized subdomain. - // - // If you're creating resource records sets for a private hosted zone, note - // the following: - // - // * You can't create alias resource record sets for CloudFront distributions - // in a private hosted zone. - // - // * Creating geolocation alias resource record sets or latency alias resource - // record sets in a private hosted zone is unsupported. - // - // * For information about creating failover resource record sets in a private - // hosted zone, see Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html) - // in the Amazon Route 53 Developer Guide. - AliasTarget *AliasTarget `type:"structure"` - - // Failover resource record sets only: To configure failover, you add the Failover - // element to two resource record sets. For one resource record set, you specify - // PRIMARY as the value for Failover; for the other resource record set, you - // specify SECONDARY. In addition, you include the HealthCheckId element and - // specify the health check that you want Amazon Route 53 to perform for each - // resource record set. - // - // Except where noted, the following failover behaviors assume that you have - // included the HealthCheckId element in both resource record sets: - // - // * When the primary resource record set is healthy, Amazon Route 53 responds - // to DNS queries with the applicable value from the primary resource record - // set regardless of the health of the secondary resource record set. - // - // * When the primary resource record set is unhealthy and the secondary - // resource record set is healthy, Amazon Route 53 responds to DNS queries - // with the applicable value from the secondary resource record set. - // - // * When the secondary resource record set is unhealthy, Amazon Route 53 - // responds to DNS queries with the applicable value from the primary resource - // record set regardless of the health of the primary resource record set. - // - // * If you omit the HealthCheckId element for the secondary resource record - // set, and if the primary resource record set is unhealthy, Amazon Route - // 53 always responds to DNS queries with the applicable value from the secondary - // resource record set. This is true regardless of the health of the associated - // endpoint. - // - // You can't create non-failover resource record sets that have the same values - // for the Name and Type elements as failover resource record sets. - // - // For failover alias resource record sets, you must also include the EvaluateTargetHealth - // element and set the value to true. - // - // For more information about configuring failover for Amazon Route 53, see - // the following topics in the Amazon Route 53 Developer Guide: - // - // * Amazon Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) - // - // * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html) - // - // Valid values: PRIMARY | SECONDARY - Failover *string `type:"string" enum:"ResourceRecordSetFailover"` - - // Geo location resource record sets only: A complex type that lets you control - // how Amazon Route 53 responds to DNS queries based on the geographic origin - // of the query. For example, if you want all queries from Africa to be routed - // to a web server with an IP address of 192.0.2.111, create a resource record - // set with a Type of A and a ContinentCode of AF. - // - // Creating geolocation and geolocation alias resource record sets in private - // hosted zones is not supported. - // - // If you create separate resource record sets for overlapping geographic regions - // (for example, one resource record set for a continent and one for a country - // on the same continent), priority goes to the smallest geographic region. - // This allows you to route most queries for a continent to one resource and - // to route queries for a country on that continent to a different resource. - // - // You can't create two geolocation resource record sets that specify the same - // geographic location. - // - // The value * in the CountryCode element matches all geographic locations that - // aren't specified in other geolocation resource record sets that have the - // same values for the Name and Type elements. - // - // Geolocation works by mapping IP addresses to locations. However, some IP - // addresses aren't mapped to geographic locations, so even if you create geolocation - // resource record sets that cover all seven continents, Amazon Route 53 will - // receive some DNS queries from locations that it can't identify. We recommend - // that you create a resource record set for which the value of CountryCode - // is *, which handles both queries that come from locations for which you haven't - // created geolocation resource record sets and queries from IP addresses that - // aren't mapped to a location. If you don't create a * resource record set, - // Amazon Route 53 returns a "no answer" response for queries from those locations. - // - // You can't create non-geolocation resource record sets that have the same - // values for the Name and Type elements as geolocation resource record sets. - GeoLocation *GeoLocation `type:"structure"` - - // If you want Amazon Route 53 to return this resource record set in response - // to a DNS query only when a health check is passing, include the HealthCheckId - // element and specify the ID of the applicable health check. - // - // Amazon Route 53 determines whether a resource record set is healthy based - // on one of the following: - // - // * By periodically sending a request to the endpoint that is specified - // in the health check - // - // * By aggregating the status of a specified group of health checks (calculated - // health checks) - // - // * By determining the current state of a CloudWatch alarm (CloudWatch metric - // health checks) - // - // For more information, see How Amazon Route 53 Determines Whether an Endpoint - // Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html). - // - // The HealthCheckId element is only useful when Amazon Route 53 is choosing - // between two or more resource record sets to respond to a DNS query, and you - // want Amazon Route 53 to base the choice in part on the status of a health - // check. Configuring health checks only makes sense in the following configurations: - // - // * You're checking the health of the resource record sets in a group of - // weighted, latency, geolocation, or failover resource record sets, and - // you specify health check IDs for all of the resource record sets. If the - // health check for one resource record set specifies an endpoint that is - // not healthy, Amazon Route 53 stops responding to queries using the value - // for that resource record set. - // - // * You set EvaluateTargetHealth to true for the resource record sets in - // a group of alias, weighted alias, latency alias, geolocation alias, or - // failover alias resource record sets, and you specify health check IDs - // for all of the resource record sets that are referenced by the alias resource - // record sets. - // - // Amazon Route 53 doesn't check the health of the endpoint specified in the - // resource record set, for example, the endpoint specified by the IP address - // in the Value element. When you add a HealthCheckId element to a resource - // record set, Amazon Route 53 checks the health of the endpoint that you specified - // in the health check. - // - // For geolocation resource record sets, if an endpoint is unhealthy, Amazon - // Route 53 looks for a resource record set for the larger, associated geographic - // region. For example, suppose you have resource record sets for a state in - // the United States, for the United States, for North America, and for all - // locations. If the endpoint for the state resource record set is unhealthy, - // Amazon Route 53 checks the resource record sets for the United States, for - // North America, and for all locations (a resource record set for which the - // value of CountryCode is *), in that order, until it finds a resource record - // set for which the endpoint is healthy. - // - // If your health checks specify the endpoint only by domain name, we recommend - // that you create a separate health check for each endpoint. For example, create - // a health check for each HTTP server that is serving content for www.example.com. - // For the value of FullyQualifiedDomainName, specify the domain name of the - // server (such as us-east-2-www.example.com), not the name of the resource - // record sets (example.com). - // - // n this configuration, if you create a health check for which the value of - // FullyQualifiedDomainName matches the name of the resource record sets and - // then associate the health check with those resource record sets, health check - // results will be unpredictable. - // - // For more information, see the following topics in the Amazon Route 53 Developer - // Guide: - // - // * Amazon Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html) - // - // * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html) - HealthCheckId *string `type:"string"` - - // The name of the domain you want to perform the action on. - // - // Enter a fully qualified domain name, for example, www.example.com. You can - // optionally include a trailing dot. If you omit the trailing dot, Amazon Route - // 53 still assumes that the domain name that you specify is fully qualified. - // This means that Amazon Route 53 treats www.example.com (without a trailing - // dot) and www.example.com. (with a trailing dot) as identical. - // - // For information about how to specify characters other than a-z, 0-9, and - // - (hyphen) and how to specify internationalized domain names, see DNS Domain - // Name Format (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html) - // in the Amazon Route 53 Developer Guide. - // - // You can use the asterisk (*) wildcard to replace the leftmost label in a - // domain name. For example, *.example.com. Note the following: - // - // * The * must replace the entire label. For example, you can't specify - // *prod.example.com or prod*.example.com. - // - // * The * can't replace any of the middle labels, for example, marketing.*.example.com. - // - // * If you include * in any position other than the leftmost label in a - // domain name, DNS treats it as an * character (ASCII 42), not as a wildcard. - // - // You can't use the * wildcard for resource records sets that have a type of - // NS. - // - // You can use the * wildcard as the leftmost label in a domain name, for example, - // *.example.com. You can't use an * for one of the middle labels, for example, - // marketing.*.example.com. In addition, the * must replace the entire label; - // for example, you can't specify prod*.example.com. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Latency-based resource record sets only: The Amazon EC2 Region where the - // resource that is specified in this resource record set resides. The resource - // typically is an AWS resource, such as an EC2 instance or an ELB load balancer, - // and is referred to by an IP address or a DNS domain name, depending on the - // record type. - // - // Creating latency and latency alias resource record sets in private hosted - // zones is not supported. - // - // When Amazon Route 53 receives a DNS query for a domain name and type for - // which you have created latency resource record sets, Amazon Route 53 selects - // the latency resource record set that has the lowest latency between the end - // user and the associated Amazon EC2 Region. Amazon Route 53 then returns the - // value that is associated with the selected resource record set. - // - // Note the following: - // - // * You can only specify one ResourceRecord per latency resource record - // set. - // - // * You can only create one latency resource record set for each Amazon - // EC2 Region. - // - // * You aren't required to create latency resource record sets for all Amazon - // EC2 Regions. Amazon Route 53 will choose the region with the best latency - // from among the regions for which you create latency resource record sets. - // - // * You can't create non-latency resource record sets that have the same - // values for the Name and Type elements as latency resource record sets. - Region *string `min:"1" type:"string" enum:"ResourceRecordSetRegion"` - - // Information about the resource records to act upon. - // - // If you're creating an alias resource record set, omit ResourceRecords. - ResourceRecords []*ResourceRecord `locationNameList:"ResourceRecord" min:"1" type:"list"` - - // Weighted, Latency, Geo, and Failover resource record sets only: An identifier - // that differentiates among multiple resource record sets that have the same - // combination of DNS name and type. The value of SetIdentifier must be unique - // for each resource record set that has the same combination of DNS name and - // type. Omit SetIdentifier for any other types of record sets. - SetIdentifier *string `min:"1" type:"string"` - - // The resource record cache time to live (TTL), in seconds. Note the following: - // - // * If you're creating an alias resource record set, omit TTL. Amazon Route - // 53 uses the value of TTL for the alias target. - // - // * If you're associating this resource record set with a health check (if - // you're adding a HealthCheckId element), we recommend that you specify - // a TTL of 60 seconds or less so clients respond quickly to changes in health - // status. - // - // * All of the resource record sets in a group of weighted, latency, geolocation, - // or failover resource record sets must have the same value for TTL. - // - // * If a group of weighted resource record sets includes one or more weighted - // alias resource record sets for which the alias target is an ELB load balancer, - // we recommend that you specify a TTL of 60 seconds for all of the non-alias - // weighted resource record sets that have the same name and type. Values - // other than 60 seconds (the TTL for load balancers) will change the effect - // of the values that you specify for Weight. - TTL *int64 `type:"long"` - - // When you create a traffic policy instance, Amazon Route 53 automatically - // creates a resource record set. TrafficPolicyInstanceId is the ID of the traffic - // policy instance that Amazon Route 53 created this resource record set for. - // - // To delete the resource record set that is associated with a traffic policy - // instance, use DeleteTrafficPolicyInstance. Amazon Route 53 will delete the - // resource record set automatically. If you delete the resource record set - // by using ChangeResourceRecordSets, Amazon Route 53 doesn't automatically - // delete the traffic policy instance, and you'll continue to be charged for - // it even though it's no longer in use. - TrafficPolicyInstanceId *string `min:"1" type:"string"` - - // The DNS record type. For information about different record types and how - // data is encoded for them, see Supported DNS Resource Record Types (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html) - // in the Amazon Route 53 Developer Guide. - // - // Valid values for basic resource record sets: A | AAAA | CNAME | MX | NAPTR - // | NS | PTR | SOA | SPF | SRV | TXT - // - // Values for weighted, latency, geolocation, and failover resource record sets: - // A | AAAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT. When creating a group - // of weighted, latency, geolocation, or failover resource record sets, specify - // the same value for all of the resource record sets in the group. - // - // SPF records were formerly used to verify the identity of the sender of email - // messages. However, we no longer recommend that you create resource record - // sets for which the value of Type is SPF. RFC 7208, Sender Policy Framework - // (SPF) for Authorizing Use of Domains in Email, Version 1, has been updated - // to say, "...[I]ts existence and mechanism defined in [RFC4408] have led to - // some interoperability issues. Accordingly, its use is no longer appropriate - // for SPF version 1; implementations are not to use it." In RFC 7208, see section - // 14.1, The SPF DNS Record Type (http://tools.ietf.org/html/rfc7208#section-14.1). - // - // Values for alias resource record sets: - // - // * CloudFront distributions:A - // - // If IPv6 is enabled for the distribution, create two resource record sets - // to route traffic to your distribution, one with a value of A and one with - // a value of AAAA. - // - // * AWS Elastic Beanstalk environment that has a regionalized subdomain: - // A - // - // * ELB load balancers:A | AAAA - // - // * Amazon S3 buckets:A - // - // * Another resource record set in this hosted zone: Specify the type of - // the resource record set for which you're creating the alias. Specify any - // value except NS or SOA. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"RRType"` - - // Weighted resource record sets only: Among resource record sets that have - // the same combination of DNS name and type, a value that determines the proportion - // of DNS queries that Amazon Route 53 responds to using the current resource - // record set. Amazon Route 53 calculates the sum of the weights for the resource - // record sets that have the same combination of DNS name and type. Amazon Route - // 53 then responds to queries based on the ratio of a resource's weight to - // the total. Note the following: - // - // * You must specify a value for the Weight element for every weighted resource - // record set. - // - // * You can only specify one ResourceRecord per weighted resource record - // set. - // - // * You can't create latency, failover, or geolocation resource record sets - // that have the same values for the Name and Type elements as weighted resource - // record sets. - // - // * You can create a maximum of 100 weighted resource record sets that have - // the same values for the Name and Type elements. - // - // * For weighted (but not weighted alias) resource record sets, if you set - // Weight to 0 for a resource record set, Amazon Route 53 never responds - // to queries with the applicable value for that resource record set. However, - // if you set Weight to 0 for all resource record sets that have the same - // combination of DNS name and type, traffic is routed to all resources with - // equal probability. - // - // The effect of setting Weight to 0 is different when you associate health - // checks with weighted resource record sets. For more information, see Options - // for Configuring Amazon Route 53 Active-Active and Active-Passive Failover - // (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html) - // in the Amazon Route 53 Developer Guide. - Weight *int64 `type:"long"` -} - -// String returns the string representation -func (s ResourceRecordSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceRecordSet) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResourceRecordSet) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResourceRecordSet"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Region != nil && len(*s.Region) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Region", 1)) - } - if s.ResourceRecords != nil && len(s.ResourceRecords) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceRecords", 1)) - } - if s.SetIdentifier != nil && len(*s.SetIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SetIdentifier", 1)) - } - if s.TrafficPolicyInstanceId != nil && len(*s.TrafficPolicyInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyInstanceId", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.AliasTarget != nil { - if err := s.AliasTarget.Validate(); err != nil { - invalidParams.AddNested("AliasTarget", err.(request.ErrInvalidParams)) - } - } - if s.GeoLocation != nil { - if err := s.GeoLocation.Validate(); err != nil { - invalidParams.AddNested("GeoLocation", err.(request.ErrInvalidParams)) - } - } - if s.ResourceRecords != nil { - for i, v := range s.ResourceRecords { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceRecords", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasTarget sets the AliasTarget field's value. -func (s *ResourceRecordSet) SetAliasTarget(v *AliasTarget) *ResourceRecordSet { - s.AliasTarget = v - return s -} - -// SetFailover sets the Failover field's value. -func (s *ResourceRecordSet) SetFailover(v string) *ResourceRecordSet { - s.Failover = &v - return s -} - -// SetGeoLocation sets the GeoLocation field's value. -func (s *ResourceRecordSet) SetGeoLocation(v *GeoLocation) *ResourceRecordSet { - s.GeoLocation = v - return s -} - -// SetHealthCheckId sets the HealthCheckId field's value. -func (s *ResourceRecordSet) SetHealthCheckId(v string) *ResourceRecordSet { - s.HealthCheckId = &v - return s -} - -// SetName sets the Name field's value. -func (s *ResourceRecordSet) SetName(v string) *ResourceRecordSet { - s.Name = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *ResourceRecordSet) SetRegion(v string) *ResourceRecordSet { - s.Region = &v - return s -} - -// SetResourceRecords sets the ResourceRecords field's value. -func (s *ResourceRecordSet) SetResourceRecords(v []*ResourceRecord) *ResourceRecordSet { - s.ResourceRecords = v - return s -} - -// SetSetIdentifier sets the SetIdentifier field's value. -func (s *ResourceRecordSet) SetSetIdentifier(v string) *ResourceRecordSet { - s.SetIdentifier = &v - return s -} - -// SetTTL sets the TTL field's value. -func (s *ResourceRecordSet) SetTTL(v int64) *ResourceRecordSet { - s.TTL = &v - return s -} - -// SetTrafficPolicyInstanceId sets the TrafficPolicyInstanceId field's value. -func (s *ResourceRecordSet) SetTrafficPolicyInstanceId(v string) *ResourceRecordSet { - s.TrafficPolicyInstanceId = &v - return s -} - -// SetType sets the Type field's value. -func (s *ResourceRecordSet) SetType(v string) *ResourceRecordSet { - s.Type = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *ResourceRecordSet) SetWeight(v int64) *ResourceRecordSet { - s.Weight = &v - return s -} - -// A complex type containing a resource and its associated tags. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ResourceTagSet -type ResourceTagSet struct { - _ struct{} `type:"structure"` - - // The ID for the specified resource. - ResourceId *string `type:"string"` - - // The type of the resource. - // - // * The resource type for health checks is healthcheck. - // - // * The resource type for hosted zones is hostedzone. - ResourceType *string `type:"string" enum:"TagResourceType"` - - // The tags associated with the specified resource. - Tags []*Tag `locationNameList:"Tag" min:"1" type:"list"` -} - -// String returns the string representation -func (s ResourceTagSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ResourceTagSet) GoString() string { - return s.String() -} - -// SetResourceId sets the ResourceId field's value. -func (s *ResourceTagSet) SetResourceId(v string) *ResourceTagSet { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ResourceTagSet) SetResourceType(v string) *ResourceTagSet { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ResourceTagSet) SetTags(v []*Tag) *ResourceTagSet { - s.Tags = v - return s -} - -// A complex type that contains the status that one Amazon Route 53 health checker -// reports and the time of the health check. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/StatusReport -type StatusReport struct { - _ struct{} `type:"structure"` - - // The time at which the health checker performed the health check in ISO 8601 - // format (https://en.wikipedia.org/wiki/ISO_8601) and Coordinated Universal - // Time (UTC). For example, the value 2014-10-27T17:48:16.751Z represents October - // 27, 2014 at 17:48:16.751 UTC. - CheckedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A description of the status of the health check endpoint as reported by one - // of the Amazon Route 53 health checkers. - Status *string `type:"string"` -} - -// String returns the string representation -func (s StatusReport) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StatusReport) GoString() string { - return s.String() -} - -// SetCheckedTime sets the CheckedTime field's value. -func (s *StatusReport) SetCheckedTime(v time.Time) *StatusReport { - s.CheckedTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StatusReport) SetStatus(v string) *StatusReport { - s.Status = &v - return s -} - -// A complex type that contains information about a tag that you want to add -// or edit for the specified health check or hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // The value of Key depends on the operation that you want to perform: - // - // * Add a tag to a health check or hosted zone: Key is the name that you - // want to give the new tag. - // - // * Edit a tag: Key is the name of the tag whose Value element you want - // to remove. - // - // * Delete a key: Key is the name of the tag you want to remove. - // - // * Give a name to a health check: Edit the default Name tag. In the Amazon - // Route 53 console, the list of your health checks includes a Name column - // that lets you see the name that you've given to each health check. - Key *string `type:"string"` - - // The value of Value depends on the operation that you want to perform: - // - // * Add a tag to a health check or hosted zone: Value is the value that - // you want to give the new tag. - // - // * Edit a tag: Value is the new value that you want to assign the tag. - Value *string `type:"string"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// Gets the value that Amazon Route 53 returns in response to a DNS request -// for a specified record name and type. You can optionally specify the IP address -// of a DNS resolver, an EDNS0 client subnet IP address, and a subnet mask. -// -// Parameters -// -// hostedzoneidThe ID of the hosted zone that you want Amazon Route 53 to simulate -// a query for. -// -// recordnameThe name of the resource record set that you want Amazon Route -// 53 to simulate a query for. -// -// recordtypeThe type of the resource record set. -// -// resolverip (optional)If you want to simulate a request from a specific DNS -// resolver, specify the IP address for that resolver. If you omit this value, -// TestDNSAnswer uses the IP address of a DNS resolver in the AWS US East region. -// -// edns0clientsubnetip (optional)If the resolver that you specified for resolverip -// supports EDNS0, specify the IP address of a client in the applicable location. -// -// edns0clientsubnetmask (optional)If you specify an IP address for edns0clientsubnetip, -// you can optionally specify the number of bits of the IP address that you -// want the checking tool to include in the DNS query. For example, if you specify -// 192.0.2.44 for edns0clientsubnetip and 24 for edns0clientsubnetmask, the -// checking tool will simulate a request from 192.0.2.0/24. The default value -// is 24 bits. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TestDNSAnswerRequest -type TestDNSAnswerInput struct { - _ struct{} `type:"structure"` - - // If the resolver that you specified for resolverip supports EDNS0, specify - // the IP address of a client in the applicable location. - EDNS0ClientSubnetIP *string `location:"querystring" locationName:"edns0clientsubnetip" type:"string"` - - // If you specify an IP address for edns0clientsubnetip, you can optionally - // specify the number of bits of the IP address that you want the checking tool - // to include in the DNS query. For example, if you specify 192.0.2.44 for edns0clientsubnetip - // and 24 for edns0clientsubnetmask, the checking tool will simulate a request - // from 192.0.2.0/24. The default value is 24 bits. - EDNS0ClientSubnetMask *string `location:"querystring" locationName:"edns0clientsubnetmask" type:"string"` - - // The ID of the hosted zone that you want Amazon Route 53 to simulate a query - // for. - // - // HostedZoneId is a required field - HostedZoneId *string `location:"querystring" locationName:"hostedzoneid" type:"string" required:"true"` - - // The name of the resource record set that you want Amazon Route 53 to simulate - // a query for. - // - // RecordName is a required field - RecordName *string `location:"querystring" locationName:"recordname" type:"string" required:"true"` - - // The type of the resource record set. - // - // RecordType is a required field - RecordType *string `location:"querystring" locationName:"recordtype" type:"string" required:"true" enum:"RRType"` - - // If you want to simulate a request from a specific DNS resolver, specify the - // IP address for that resolver. If you omit this value, TestDnsAnswer uses - // the IP address of a DNS resolver in the AWS US East region. - ResolverIP *string `location:"querystring" locationName:"resolverip" type:"string"` -} - -// String returns the string representation -func (s TestDNSAnswerInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestDNSAnswerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestDNSAnswerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestDNSAnswerInput"} - if s.HostedZoneId == nil { - invalidParams.Add(request.NewErrParamRequired("HostedZoneId")) - } - if s.RecordName == nil { - invalidParams.Add(request.NewErrParamRequired("RecordName")) - } - if s.RecordType == nil { - invalidParams.Add(request.NewErrParamRequired("RecordType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEDNS0ClientSubnetIP sets the EDNS0ClientSubnetIP field's value. -func (s *TestDNSAnswerInput) SetEDNS0ClientSubnetIP(v string) *TestDNSAnswerInput { - s.EDNS0ClientSubnetIP = &v - return s -} - -// SetEDNS0ClientSubnetMask sets the EDNS0ClientSubnetMask field's value. -func (s *TestDNSAnswerInput) SetEDNS0ClientSubnetMask(v string) *TestDNSAnswerInput { - s.EDNS0ClientSubnetMask = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *TestDNSAnswerInput) SetHostedZoneId(v string) *TestDNSAnswerInput { - s.HostedZoneId = &v - return s -} - -// SetRecordName sets the RecordName field's value. -func (s *TestDNSAnswerInput) SetRecordName(v string) *TestDNSAnswerInput { - s.RecordName = &v - return s -} - -// SetRecordType sets the RecordType field's value. -func (s *TestDNSAnswerInput) SetRecordType(v string) *TestDNSAnswerInput { - s.RecordType = &v - return s -} - -// SetResolverIP sets the ResolverIP field's value. -func (s *TestDNSAnswerInput) SetResolverIP(v string) *TestDNSAnswerInput { - s.ResolverIP = &v - return s -} - -// A complex type that contains the response to a TestDNSAnswer request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TestDNSAnswerResponse -type TestDNSAnswerOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Route 53 name server used to respond to the request. - // - // Nameserver is a required field - Nameserver *string `type:"string" required:"true"` - - // The protocol that Amazon Route 53 used to respond to the request, either - // UDP or TCP. - // - // Protocol is a required field - Protocol *string `type:"string" required:"true"` - - // A list that contains values that Amazon Route 53 returned for this resource - // record set. - // - // RecordData is a required field - RecordData []*string `locationNameList:"RecordDataEntry" type:"list" required:"true"` - - // The name of the resource record set that you submitted a request for. - // - // RecordName is a required field - RecordName *string `type:"string" required:"true"` - - // The type of the resource record set that you submitted a request for. - // - // RecordType is a required field - RecordType *string `type:"string" required:"true" enum:"RRType"` - - // A code that indicates whether the request is valid or not. The most common - // response code is NOERROR, meaning that the request is valid. If the response - // is not valid, Amazon Route 53 returns a response code that describes the - // error. For a list of possible response codes, see DNS RCODES (http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6) - // on the IANA website. - // - // ResponseCode is a required field - ResponseCode *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s TestDNSAnswerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TestDNSAnswerOutput) GoString() string { - return s.String() -} - -// SetNameserver sets the Nameserver field's value. -func (s *TestDNSAnswerOutput) SetNameserver(v string) *TestDNSAnswerOutput { - s.Nameserver = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *TestDNSAnswerOutput) SetProtocol(v string) *TestDNSAnswerOutput { - s.Protocol = &v - return s -} - -// SetRecordData sets the RecordData field's value. -func (s *TestDNSAnswerOutput) SetRecordData(v []*string) *TestDNSAnswerOutput { - s.RecordData = v - return s -} - -// SetRecordName sets the RecordName field's value. -func (s *TestDNSAnswerOutput) SetRecordName(v string) *TestDNSAnswerOutput { - s.RecordName = &v - return s -} - -// SetRecordType sets the RecordType field's value. -func (s *TestDNSAnswerOutput) SetRecordType(v string) *TestDNSAnswerOutput { - s.RecordType = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *TestDNSAnswerOutput) SetResponseCode(v string) *TestDNSAnswerOutput { - s.ResponseCode = &v - return s -} - -// A complex type that contains settings for a traffic policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TrafficPolicy -type TrafficPolicy struct { - _ struct{} `type:"structure"` - - // The comment that you specify in the CreateTrafficPolicy request, if any. - Comment *string `type:"string"` - - // The definition of a traffic policy in JSON format. You specify the JSON document - // to use for a new traffic policy in the CreateTrafficPolicy request. For more - // information about the JSON format, see Traffic Policy Document Format (http://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html). - // - // Document is a required field - Document *string `type:"string" required:"true"` - - // The ID that Amazon Route 53 assigned to a traffic policy when you created - // it. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // The name that you specified when you created the traffic policy. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The DNS type of the resource record sets that Amazon Route 53 creates when - // you use a traffic policy to create a traffic policy instance. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"RRType"` - - // The version number that Amazon Route 53 assigns to a traffic policy. For - // a new traffic policy, the value of Version is always 1. - // - // Version is a required field - Version *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s TrafficPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TrafficPolicy) GoString() string { - return s.String() -} - -// SetComment sets the Comment field's value. -func (s *TrafficPolicy) SetComment(v string) *TrafficPolicy { - s.Comment = &v - return s -} - -// SetDocument sets the Document field's value. -func (s *TrafficPolicy) SetDocument(v string) *TrafficPolicy { - s.Document = &v - return s -} - -// SetId sets the Id field's value. -func (s *TrafficPolicy) SetId(v string) *TrafficPolicy { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *TrafficPolicy) SetName(v string) *TrafficPolicy { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *TrafficPolicy) SetType(v string) *TrafficPolicy { - s.Type = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *TrafficPolicy) SetVersion(v int64) *TrafficPolicy { - s.Version = &v - return s -} - -// A complex type that contains settings for the new traffic policy instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TrafficPolicyInstance -type TrafficPolicyInstance struct { - _ struct{} `type:"structure"` - - // The ID of the hosted zone that Amazon Route 53 created resource record sets - // in. - // - // HostedZoneId is a required field - HostedZoneId *string `type:"string" required:"true"` - - // The ID that Amazon Route 53 assigned to the new traffic policy instance. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // If State is Failed, an explanation of the reason for the failure. If State - // is another value, Message is empty. - // - // Message is a required field - Message *string `type:"string" required:"true"` - - // The DNS name, such as www.example.com, for which Amazon Route 53 responds - // to queries by using the resource record sets that are associated with this - // traffic policy instance. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The value of State is one of the following values: - // - // AppliedAmazon Route 53 has finished creating resource record sets, and changes - // have propagated to all Amazon Route 53 edge locations. - // - // CreatingAmazon Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance - // to confirm that the CreateTrafficPolicyInstance request completed successfully. - // - // FailedAmazon Route 53 wasn't able to create or update the resource record - // sets. When the value of State is Failed, see Message for an explanation of - // what caused the request to fail. - // - // State is a required field - State *string `type:"string" required:"true"` - - // The TTL that Amazon Route 53 assigned to all of the resource record sets - // that it created in the specified hosted zone. - // - // TTL is a required field - TTL *int64 `type:"long" required:"true"` - - // The ID of the traffic policy that Amazon Route 53 used to create resource - // record sets in the specified hosted zone. - // - // TrafficPolicyId is a required field - TrafficPolicyId *string `min:"1" type:"string" required:"true"` - - // The DNS type that Amazon Route 53 assigned to all of the resource record - // sets that it created for this traffic policy instance. - // - // TrafficPolicyType is a required field - TrafficPolicyType *string `type:"string" required:"true" enum:"RRType"` - - // The version of the traffic policy that Amazon Route 53 used to create resource - // record sets in the specified hosted zone. - // - // TrafficPolicyVersion is a required field - TrafficPolicyVersion *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s TrafficPolicyInstance) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TrafficPolicyInstance) GoString() string { - return s.String() -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *TrafficPolicyInstance) SetHostedZoneId(v string) *TrafficPolicyInstance { - s.HostedZoneId = &v - return s -} - -// SetId sets the Id field's value. -func (s *TrafficPolicyInstance) SetId(v string) *TrafficPolicyInstance { - s.Id = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *TrafficPolicyInstance) SetMessage(v string) *TrafficPolicyInstance { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *TrafficPolicyInstance) SetName(v string) *TrafficPolicyInstance { - s.Name = &v - return s -} - -// SetState sets the State field's value. -func (s *TrafficPolicyInstance) SetState(v string) *TrafficPolicyInstance { - s.State = &v - return s -} - -// SetTTL sets the TTL field's value. -func (s *TrafficPolicyInstance) SetTTL(v int64) *TrafficPolicyInstance { - s.TTL = &v - return s -} - -// SetTrafficPolicyId sets the TrafficPolicyId field's value. -func (s *TrafficPolicyInstance) SetTrafficPolicyId(v string) *TrafficPolicyInstance { - s.TrafficPolicyId = &v - return s -} - -// SetTrafficPolicyType sets the TrafficPolicyType field's value. -func (s *TrafficPolicyInstance) SetTrafficPolicyType(v string) *TrafficPolicyInstance { - s.TrafficPolicyType = &v - return s -} - -// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. -func (s *TrafficPolicyInstance) SetTrafficPolicyVersion(v int64) *TrafficPolicyInstance { - s.TrafficPolicyVersion = &v - return s -} - -// A complex type that contains information about the latest version of one -// traffic policy that is associated with the current AWS account. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/TrafficPolicySummary -type TrafficPolicySummary struct { - _ struct{} `type:"structure"` - - // The ID that Amazon Route 53 assigned to the traffic policy when you created - // it. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // The version number of the latest version of the traffic policy. - // - // LatestVersion is a required field - LatestVersion *int64 `min:"1" type:"integer" required:"true"` - - // The name that you specified for the traffic policy when you created it. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The number of traffic policies that are associated with the current AWS account. - // - // TrafficPolicyCount is a required field - TrafficPolicyCount *int64 `min:"1" type:"integer" required:"true"` - - // The DNS type of the resource record sets that Amazon Route 53 creates when - // you use a traffic policy to create a traffic policy instance. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"RRType"` -} - -// String returns the string representation -func (s TrafficPolicySummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TrafficPolicySummary) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *TrafficPolicySummary) SetId(v string) *TrafficPolicySummary { - s.Id = &v - return s -} - -// SetLatestVersion sets the LatestVersion field's value. -func (s *TrafficPolicySummary) SetLatestVersion(v int64) *TrafficPolicySummary { - s.LatestVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *TrafficPolicySummary) SetName(v string) *TrafficPolicySummary { - s.Name = &v - return s -} - -// SetTrafficPolicyCount sets the TrafficPolicyCount field's value. -func (s *TrafficPolicySummary) SetTrafficPolicyCount(v int64) *TrafficPolicySummary { - s.TrafficPolicyCount = &v - return s -} - -// SetType sets the Type field's value. -func (s *TrafficPolicySummary) SetType(v string) *TrafficPolicySummary { - s.Type = &v - return s -} - -// A complex type that contains the health check request information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHealthCheckRequest -type UpdateHealthCheckInput struct { - _ struct{} `locationName:"UpdateHealthCheckRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // A complex type that identifies the CloudWatch alarm that you want Amazon - // Route 53 health checkers to use to determine whether this health check is - // healthy. - AlarmIdentifier *AlarmIdentifier `type:"structure"` - - // A complex type that contains one ChildHealthCheck element for each health - // check that you want to associate with a CALCULATED health check. - ChildHealthChecks []*string `locationNameList:"ChildHealthCheck" type:"list"` - - // Specify whether you want Amazon Route 53 to send the value of FullyQualifiedDomainName - // to the endpoint in the client_hello message during TLS negotiation. This - // allows the endpoint to respond to HTTPS health check requests with the applicable - // SSL/TLS certificate. - // - // Some endpoints require that HTTPS requests include the host name in the client_hello - // message. If you don't enable SNI, the status of the health check will be - // SSL alert handshake_failure. A health check can also have that status for - // other reasons. If SNI is enabled and you're still getting the error, check - // the SSL/TLS configuration on your endpoint and confirm that your certificate - // is valid. - // - // The SSL/TLS certificate on your endpoint includes a domain name in the Common - // Name field and possibly several more in the Subject Alternative Names field. - // One of the domain names in the certificate should match the value that you - // specify for FullyQualifiedDomainName. If the endpoint responds to the client_hello - // message with a certificate that does not include the domain name that you - // specified in FullyQualifiedDomainName, a health checker will retry the handshake. - // In the second attempt, the health checker will omit FullyQualifiedDomainName - // from the client_hello message. - EnableSNI *bool `type:"boolean"` - - // The number of consecutive health checks that an endpoint must pass or fail - // for Amazon Route 53 to change the current status of the endpoint from unhealthy - // to healthy or vice versa. For more information, see How Amazon Route 53 Determines - // Whether an Endpoint Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html) - // in the Amazon Route 53 Developer Guide. - // - // If you don't specify a value for FailureThreshold, the default value is three - // health checks. - FailureThreshold *int64 `min:"1" type:"integer"` - - // Amazon Route 53 behavior depends on whether you specify a value for IPAddress. - // - // If a health check already has a value for IPAddress, you can change the value. - // However, you can't update an existing health check to add or remove the value - // of IPAddress. - // - // If you specify a value forIPAddress: - // - // Amazon Route 53 sends health check requests to the specified IPv4 or IPv6 - // address and passes the value of FullyQualifiedDomainName in the Host header - // for all health checks except TCP health checks. This is typically the fully - // qualified DNS name of the endpoint on which you want Amazon Route 53 to perform - // health checks. - // - // When Amazon Route 53 checks the health of an endpoint, here is how it constructs - // the Host header: - // - // * If you specify a value of 80 for Port and HTTP or HTTP_STR_MATCH for - // Type, Amazon Route 53 passes the value of FullyQualifiedDomainName to - // the endpoint in the Host header. - // - // * If you specify a value of 443 for Port and HTTPS or HTTPS_STR_MATCH - // for Type, Amazon Route 53 passes the value of FullyQualifiedDomainName - // to the endpoint in the Host header. - // - // * If you specify another value for Port and any value except TCP for Type, - // Amazon Route 53 passes FullyQualifiedDomainName:Port to the endpoint in - // the Host header. - // - // If you don't specify a value for FullyQualifiedDomainName, Amazon Route 53 - // substitutes the value of IPAddress in the Host header in each of the above - // cases. - // - // If you don't specify a value forIPAddress: - // - // If you don't specify a value for IPAddress, Amazon Route 53 sends a DNS request - // to the domain that you specify in FullyQualifiedDomainName at the interval - // you specify in RequestInterval. Using an IPv4 address that is returned by - // DNS, Amazon Route 53 then checks the health of the endpoint. - // - // If you don't specify a value for IPAddress, Amazon Route 53 uses only IPv4 - // to send health checks to the endpoint. If there's no resource record set - // with a type of A for the name that you specify for FullyQualifiedDomainName, - // the health check fails with a "DNS resolution failed" error. - // - // If you want to check the health of weighted, latency, or failover resource - // record sets and you choose to specify the endpoint only by FullyQualifiedDomainName, - // we recommend that you create a separate health check for each endpoint. For - // example, create a health check for each HTTP server that is serving content - // for www.example.com. For the value of FullyQualifiedDomainName, specify the - // domain name of the server (such as us-east-2-www.example.com), not the name - // of the resource record sets (www.example.com). - // - // In this configuration, if the value of FullyQualifiedDomainName matches the - // name of the resource record sets and you then associate the health check - // with those resource record sets, health check results will be unpredictable. - // - // In addition, if the value of Type is HTTP, HTTPS, HTTP_STR_MATCH, or HTTPS_STR_MATCH, - // Amazon Route 53 passes the value of FullyQualifiedDomainName in the Host - // header, as it does when you specify a value for IPAddress. If the value of - // Type is TCP, Amazon Route 53 doesn't pass a Host header. - FullyQualifiedDomainName *string `type:"string"` - - // The ID for the health check for which you want detailed information. When - // you created the health check, CreateHealthCheck returned the ID in the response, - // in the HealthCheckId element. - // - // HealthCheckId is a required field - HealthCheckId *string `location:"uri" locationName:"HealthCheckId" type:"string" required:"true"` - - // A sequential counter that Amazon Route 53 sets to 1 when you create a health - // check and increments by 1 each time you update settings for the health check. - // - // We recommend that you use GetHealthCheck or ListHealthChecks to get the current - // value of HealthCheckVersion for the health check that you want to update, - // and that you include that value in your UpdateHealthCheck request. This prevents - // Amazon Route 53 from overwriting an intervening update: - // - // * f the value in the UpdateHealthCheck request matches the value of HealthCheckVersion - // in the health check, Amazon Route 53 updates the health check with the - // new settings. - // - // * If the value of HealthCheckVersion in the health check is greater, the - // health check was changed after you got the version number. Amazon Route - // 53 does not update the health check, and it returns a HealthCheckVersionMismatch - // error. - HealthCheckVersion *int64 `min:"1" type:"long"` - - // The number of child health checks that are associated with a CALCULATED health - // that Amazon Route 53 must consider healthy for the CALCULATED health check - // to be considered healthy. To specify the child health checks that you want - // to associate with a CALCULATED health check, use the ChildHealthChecks and - // ChildHealthCheck elements. - // - // Note the following: - // - // * If you specify a number greater than the number of child health checks, - // Amazon Route 53 always considers this health check to be unhealthy. - // - // * If you specify 0, Amazon Route 53 always considers this health check - // to be healthy. - HealthThreshold *int64 `type:"integer"` - - // The IPv4 or IPv6 IP address for the endpoint that you want Amazon Route 53 - // to perform health checks on. If you don't specify a value for IPAddress, - // Amazon Route 53 sends a DNS request to resolve the domain name that you specify - // in FullyQualifiedDomainName at the interval that you specify in RequestInterval. - // Using an IP address that is returned by DNS, Amazon Route 53 then checks - // the health of the endpoint. - // - // Use one of the following formats for the value of IPAddress: - // - // * IPv4 address: four values between 0 and 255, separated by periods (.), - // for example, 192.0.2.44. - // - // * IPv6 address: eight groups of four hexadecimal values, separated by - // colons (:), for example, 2001:0db8:85a3:0000:0000:abcd:0001:2345. You - // can also shorten IPv6 addresses as described in RFC 5952, for example, - // 2001:db8:85a3::abcd:1:2345. - // - // If the endpoint is an EC2 instance, we recommend that you create an Elastic - // IP address, associate it with your EC2 instance, and specify the Elastic - // IP address for IPAddress. This ensures that the IP address of your instance - // never changes. For more information, see Elastic IP Addresses (EIP) (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) - // in the Amazon EC2 User Guide for Linux Instances. - // - // If a health check already has a value for IPAddress, you can change the value. - // However, you can't update an existing health check to add or remove the value - // of IPAddress. - // - // For more information, see UpdateHealthCheckRequest$FullyQualifiedDomainName. - // - // Constraints: Amazon Route 53 can't check the health of endpoints for which - // the IP address is in local, private, non-routable, or multicast ranges. For - // more information about IP addresses for which you can't create health checks, - // see the following documents: - // - // * RFC 5735, Special Use IPv4 Addresses (https://tools.ietf.org/html/rfc5735) - // - // * RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space (https://tools.ietf.org/html/rfc6598) - // - // * RFC 5156, Special-Use IPv6 Addresses (https://tools.ietf.org/html/rfc5156) - IPAddress *string `type:"string"` - - // When CloudWatch has insufficient data about the metric to determine the alarm - // state, the status that you want Amazon Route 53 to assign to the health check: - // - // * Healthy: Amazon Route 53 considers the health check to be healthy. - // - // * Unhealthy: Amazon Route 53 considers the health check to be unhealthy. - // - // * LastKnownStatus: Amazon Route 53 uses the status of the health check - // from the last time CloudWatch had sufficient data to determine the alarm - // state. For new health checks that have no last known status, the default - // status for the health check is healthy. - InsufficientDataHealthStatus *string `type:"string" enum:"InsufficientDataHealthStatus"` - - // Specify whether you want Amazon Route 53 to invert the status of a health - // check, for example, to consider a health check unhealthy when it otherwise - // would be considered healthy. - Inverted *bool `type:"boolean"` - - // The port on the endpoint on which you want Amazon Route 53 to perform health - // checks. - Port *int64 `min:"1" type:"integer"` - - // A complex type that contains one Region element for each region from which - // you want Amazon Route 53 health checkers to check the specified endpoint. - Regions []*string `locationNameList:"Region" min:"1" type:"list"` - - // The path that you want Amazon Route 53 to request when performing health - // checks. The path can be any value for which your endpoint will return an - // HTTP status code of 2xx or 3xx when the endpoint is healthy, for example - // the file /docs/route53-health-check.html. - // - // Specify this value only if you want to change it. - ResourcePath *string `type:"string"` - - // If the value of Type is HTTP_STR_MATCH or HTTP_STR_MATCH, the string that - // you want Amazon Route 53 to search for in the response body from the specified - // resource. If the string appears in the response body, Amazon Route 53 considers - // the resource healthy. (You can't change the value of Type when you update - // a health check.) - SearchString *string `type:"string"` -} - -// String returns the string representation -func (s UpdateHealthCheckInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateHealthCheckInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateHealthCheckInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateHealthCheckInput"} - if s.FailureThreshold != nil && *s.FailureThreshold < 1 { - invalidParams.Add(request.NewErrParamMinValue("FailureThreshold", 1)) - } - if s.HealthCheckId == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheckId")) - } - if s.HealthCheckVersion != nil && *s.HealthCheckVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("HealthCheckVersion", 1)) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - if s.Regions != nil && len(s.Regions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Regions", 1)) - } - if s.AlarmIdentifier != nil { - if err := s.AlarmIdentifier.Validate(); err != nil { - invalidParams.AddNested("AlarmIdentifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlarmIdentifier sets the AlarmIdentifier field's value. -func (s *UpdateHealthCheckInput) SetAlarmIdentifier(v *AlarmIdentifier) *UpdateHealthCheckInput { - s.AlarmIdentifier = v - return s -} - -// SetChildHealthChecks sets the ChildHealthChecks field's value. -func (s *UpdateHealthCheckInput) SetChildHealthChecks(v []*string) *UpdateHealthCheckInput { - s.ChildHealthChecks = v - return s -} - -// SetEnableSNI sets the EnableSNI field's value. -func (s *UpdateHealthCheckInput) SetEnableSNI(v bool) *UpdateHealthCheckInput { - s.EnableSNI = &v - return s -} - -// SetFailureThreshold sets the FailureThreshold field's value. -func (s *UpdateHealthCheckInput) SetFailureThreshold(v int64) *UpdateHealthCheckInput { - s.FailureThreshold = &v - return s -} - -// SetFullyQualifiedDomainName sets the FullyQualifiedDomainName field's value. -func (s *UpdateHealthCheckInput) SetFullyQualifiedDomainName(v string) *UpdateHealthCheckInput { - s.FullyQualifiedDomainName = &v - return s -} - -// SetHealthCheckId sets the HealthCheckId field's value. -func (s *UpdateHealthCheckInput) SetHealthCheckId(v string) *UpdateHealthCheckInput { - s.HealthCheckId = &v - return s -} - -// SetHealthCheckVersion sets the HealthCheckVersion field's value. -func (s *UpdateHealthCheckInput) SetHealthCheckVersion(v int64) *UpdateHealthCheckInput { - s.HealthCheckVersion = &v - return s -} - -// SetHealthThreshold sets the HealthThreshold field's value. -func (s *UpdateHealthCheckInput) SetHealthThreshold(v int64) *UpdateHealthCheckInput { - s.HealthThreshold = &v - return s -} - -// SetIPAddress sets the IPAddress field's value. -func (s *UpdateHealthCheckInput) SetIPAddress(v string) *UpdateHealthCheckInput { - s.IPAddress = &v - return s -} - -// SetInsufficientDataHealthStatus sets the InsufficientDataHealthStatus field's value. -func (s *UpdateHealthCheckInput) SetInsufficientDataHealthStatus(v string) *UpdateHealthCheckInput { - s.InsufficientDataHealthStatus = &v - return s -} - -// SetInverted sets the Inverted field's value. -func (s *UpdateHealthCheckInput) SetInverted(v bool) *UpdateHealthCheckInput { - s.Inverted = &v - return s -} - -// SetPort sets the Port field's value. -func (s *UpdateHealthCheckInput) SetPort(v int64) *UpdateHealthCheckInput { - s.Port = &v - return s -} - -// SetRegions sets the Regions field's value. -func (s *UpdateHealthCheckInput) SetRegions(v []*string) *UpdateHealthCheckInput { - s.Regions = v - return s -} - -// SetResourcePath sets the ResourcePath field's value. -func (s *UpdateHealthCheckInput) SetResourcePath(v string) *UpdateHealthCheckInput { - s.ResourcePath = &v - return s -} - -// SetSearchString sets the SearchString field's value. -func (s *UpdateHealthCheckInput) SetSearchString(v string) *UpdateHealthCheckInput { - s.SearchString = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHealthCheckResponse -type UpdateHealthCheckOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains information about one health check that is associated - // with the current AWS account. - // - // HealthCheck is a required field - HealthCheck *HealthCheck `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateHealthCheckOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateHealthCheckOutput) GoString() string { - return s.String() -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *UpdateHealthCheckOutput) SetHealthCheck(v *HealthCheck) *UpdateHealthCheckOutput { - s.HealthCheck = v - return s -} - -// A complex type that contains the hosted zone request information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHostedZoneCommentRequest -type UpdateHostedZoneCommentInput struct { - _ struct{} `locationName:"UpdateHostedZoneCommentRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // The new comment for the hosted zone. If you don't specify a value for Comment, - // Amazon Route 53 deletes the existing value of the Comment element, if any. - Comment *string `type:"string"` - - // The ID for the hosted zone for which you want to update the comment. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" type:"string" required:"true"` -} - -// String returns the string representation -func (s UpdateHostedZoneCommentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateHostedZoneCommentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateHostedZoneCommentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateHostedZoneCommentInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *UpdateHostedZoneCommentInput) SetComment(v string) *UpdateHostedZoneCommentInput { - s.Comment = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateHostedZoneCommentInput) SetId(v string) *UpdateHostedZoneCommentInput { - s.Id = &v - return s -} - -// A complex type that contains the response to the UpdateHostedZoneCommentRequest. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateHostedZoneCommentResponse -type UpdateHostedZoneCommentOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains general information about the hosted zone. - // - // HostedZone is a required field - HostedZone *HostedZone `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateHostedZoneCommentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateHostedZoneCommentOutput) GoString() string { - return s.String() -} - -// SetHostedZone sets the HostedZone field's value. -func (s *UpdateHostedZoneCommentOutput) SetHostedZone(v *HostedZone) *UpdateHostedZoneCommentOutput { - s.HostedZone = v - return s -} - -// A complex type that contains information about the traffic policy for which -// you want to update the comment. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyCommentRequest -type UpdateTrafficPolicyCommentInput struct { - _ struct{} `locationName:"UpdateTrafficPolicyCommentRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // The new comment for the specified traffic policy and version. - // - // Comment is a required field - Comment *string `type:"string" required:"true"` - - // The value of Id for the traffic policy for which you want to update the comment. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` - - // The value of Version for the traffic policy for which you want to update - // the comment. - // - // Version is a required field - Version *int64 `location:"uri" locationName:"Version" min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s UpdateTrafficPolicyCommentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTrafficPolicyCommentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTrafficPolicyCommentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTrafficPolicyCommentInput"} - if s.Comment == nil { - invalidParams.Add(request.NewErrParamRequired("Comment")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && *s.Version < 1 { - invalidParams.Add(request.NewErrParamMinValue("Version", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *UpdateTrafficPolicyCommentInput) SetComment(v string) *UpdateTrafficPolicyCommentInput { - s.Comment = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateTrafficPolicyCommentInput) SetId(v string) *UpdateTrafficPolicyCommentInput { - s.Id = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *UpdateTrafficPolicyCommentInput) SetVersion(v int64) *UpdateTrafficPolicyCommentInput { - s.Version = &v - return s -} - -// A complex type that contains the response information for the traffic policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyCommentResponse -type UpdateTrafficPolicyCommentOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains settings for the specified traffic policy. - // - // TrafficPolicy is a required field - TrafficPolicy *TrafficPolicy `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateTrafficPolicyCommentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTrafficPolicyCommentOutput) GoString() string { - return s.String() -} - -// SetTrafficPolicy sets the TrafficPolicy field's value. -func (s *UpdateTrafficPolicyCommentOutput) SetTrafficPolicy(v *TrafficPolicy) *UpdateTrafficPolicyCommentOutput { - s.TrafficPolicy = v - return s -} - -// A complex type that contains information about the resource record sets that -// you want to update based on a specified traffic policy instance. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyInstanceRequest -type UpdateTrafficPolicyInstanceInput struct { - _ struct{} `locationName:"UpdateTrafficPolicyInstanceRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"` - - // The ID of the traffic policy instance that you want to update. - // - // Id is a required field - Id *string `location:"uri" locationName:"Id" min:"1" type:"string" required:"true"` - - // The TTL that you want Amazon Route 53 to assign to all of the updated resource - // record sets. - // - // TTL is a required field - TTL *int64 `type:"long" required:"true"` - - // The ID of the traffic policy that you want Amazon Route 53 to use to update - // resource record sets for the specified traffic policy instance. - // - // TrafficPolicyId is a required field - TrafficPolicyId *string `min:"1" type:"string" required:"true"` - - // The version of the traffic policy that you want Amazon Route 53 to use to - // update resource record sets for the specified traffic policy instance. - // - // TrafficPolicyVersion is a required field - TrafficPolicyVersion *int64 `min:"1" type:"integer" required:"true"` -} - -// String returns the string representation -func (s UpdateTrafficPolicyInstanceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTrafficPolicyInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTrafficPolicyInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTrafficPolicyInstanceInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.TTL == nil { - invalidParams.Add(request.NewErrParamRequired("TTL")) - } - if s.TrafficPolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficPolicyId")) - } - if s.TrafficPolicyId != nil && len(*s.TrafficPolicyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrafficPolicyId", 1)) - } - if s.TrafficPolicyVersion == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficPolicyVersion")) - } - if s.TrafficPolicyVersion != nil && *s.TrafficPolicyVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("TrafficPolicyVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *UpdateTrafficPolicyInstanceInput) SetId(v string) *UpdateTrafficPolicyInstanceInput { - s.Id = &v - return s -} - -// SetTTL sets the TTL field's value. -func (s *UpdateTrafficPolicyInstanceInput) SetTTL(v int64) *UpdateTrafficPolicyInstanceInput { - s.TTL = &v - return s -} - -// SetTrafficPolicyId sets the TrafficPolicyId field's value. -func (s *UpdateTrafficPolicyInstanceInput) SetTrafficPolicyId(v string) *UpdateTrafficPolicyInstanceInput { - s.TrafficPolicyId = &v - return s -} - -// SetTrafficPolicyVersion sets the TrafficPolicyVersion field's value. -func (s *UpdateTrafficPolicyInstanceInput) SetTrafficPolicyVersion(v int64) *UpdateTrafficPolicyInstanceInput { - s.TrafficPolicyVersion = &v - return s -} - -// A complex type that contains information about the resource record sets that -// Amazon Route 53 created based on a specified traffic policy. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/UpdateTrafficPolicyInstanceResponse -type UpdateTrafficPolicyInstanceOutput struct { - _ struct{} `type:"structure"` - - // A complex type that contains settings for the updated traffic policy instance. - // - // TrafficPolicyInstance is a required field - TrafficPolicyInstance *TrafficPolicyInstance `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateTrafficPolicyInstanceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateTrafficPolicyInstanceOutput) GoString() string { - return s.String() -} - -// SetTrafficPolicyInstance sets the TrafficPolicyInstance field's value. -func (s *UpdateTrafficPolicyInstanceOutput) SetTrafficPolicyInstance(v *TrafficPolicyInstance) *UpdateTrafficPolicyInstanceOutput { - s.TrafficPolicyInstance = v - return s -} - -// A complex type that contains information about an Amazon VPC that is associated -// with a private hosted zone. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/VPC -type VPC struct { - _ struct{} `type:"structure"` - - // The ID of an Amazon VPC. - VPCId *string `type:"string"` - - // The region in which you created the VPC that you want to associate with the - // specified Amazon Route 53 hosted zone. - VPCRegion *string `min:"1" type:"string" enum:"VPCRegion"` -} - -// String returns the string representation -func (s VPC) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VPC) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VPC) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VPC"} - if s.VPCRegion != nil && len(*s.VPCRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VPCRegion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVPCId sets the VPCId field's value. -func (s *VPC) SetVPCId(v string) *VPC { - s.VPCId = &v - return s -} - -// SetVPCRegion sets the VPCRegion field's value. -func (s *VPC) SetVPCRegion(v string) *VPC { - s.VPCRegion = &v - return s -} - -const ( - // ChangeActionCreate is a ChangeAction enum value - ChangeActionCreate = "CREATE" - - // ChangeActionDelete is a ChangeAction enum value - ChangeActionDelete = "DELETE" - - // ChangeActionUpsert is a ChangeAction enum value - ChangeActionUpsert = "UPSERT" -) - -const ( - // ChangeStatusPending is a ChangeStatus enum value - ChangeStatusPending = "PENDING" - - // ChangeStatusInsync is a ChangeStatus enum value - ChangeStatusInsync = "INSYNC" -) - -const ( - // CloudWatchRegionUsEast1 is a CloudWatchRegion enum value - CloudWatchRegionUsEast1 = "us-east-1" - - // CloudWatchRegionUsEast2 is a CloudWatchRegion enum value - CloudWatchRegionUsEast2 = "us-east-2" - - // CloudWatchRegionUsWest1 is a CloudWatchRegion enum value - CloudWatchRegionUsWest1 = "us-west-1" - - // CloudWatchRegionUsWest2 is a CloudWatchRegion enum value - CloudWatchRegionUsWest2 = "us-west-2" - - // CloudWatchRegionCaCentral1 is a CloudWatchRegion enum value - CloudWatchRegionCaCentral1 = "ca-central-1" - - // CloudWatchRegionEuCentral1 is a CloudWatchRegion enum value - CloudWatchRegionEuCentral1 = "eu-central-1" - - // CloudWatchRegionEuWest1 is a CloudWatchRegion enum value - CloudWatchRegionEuWest1 = "eu-west-1" - - // CloudWatchRegionEuWest2 is a CloudWatchRegion enum value - CloudWatchRegionEuWest2 = "eu-west-2" - - // CloudWatchRegionApSouth1 is a CloudWatchRegion enum value - CloudWatchRegionApSouth1 = "ap-south-1" - - // CloudWatchRegionApSoutheast1 is a CloudWatchRegion enum value - CloudWatchRegionApSoutheast1 = "ap-southeast-1" - - // CloudWatchRegionApSoutheast2 is a CloudWatchRegion enum value - CloudWatchRegionApSoutheast2 = "ap-southeast-2" - - // CloudWatchRegionApNortheast1 is a CloudWatchRegion enum value - CloudWatchRegionApNortheast1 = "ap-northeast-1" - - // CloudWatchRegionApNortheast2 is a CloudWatchRegion enum value - CloudWatchRegionApNortheast2 = "ap-northeast-2" - - // CloudWatchRegionSaEast1 is a CloudWatchRegion enum value - CloudWatchRegionSaEast1 = "sa-east-1" -) - -const ( - // ComparisonOperatorGreaterThanOrEqualToThreshold is a ComparisonOperator enum value - ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold" - - // ComparisonOperatorGreaterThanThreshold is a ComparisonOperator enum value - ComparisonOperatorGreaterThanThreshold = "GreaterThanThreshold" - - // ComparisonOperatorLessThanThreshold is a ComparisonOperator enum value - ComparisonOperatorLessThanThreshold = "LessThanThreshold" - - // ComparisonOperatorLessThanOrEqualToThreshold is a ComparisonOperator enum value - ComparisonOperatorLessThanOrEqualToThreshold = "LessThanOrEqualToThreshold" -) - -const ( - // HealthCheckRegionUsEast1 is a HealthCheckRegion enum value - HealthCheckRegionUsEast1 = "us-east-1" - - // HealthCheckRegionUsWest1 is a HealthCheckRegion enum value - HealthCheckRegionUsWest1 = "us-west-1" - - // HealthCheckRegionUsWest2 is a HealthCheckRegion enum value - HealthCheckRegionUsWest2 = "us-west-2" - - // HealthCheckRegionEuWest1 is a HealthCheckRegion enum value - HealthCheckRegionEuWest1 = "eu-west-1" - - // HealthCheckRegionApSoutheast1 is a HealthCheckRegion enum value - HealthCheckRegionApSoutheast1 = "ap-southeast-1" - - // HealthCheckRegionApSoutheast2 is a HealthCheckRegion enum value - HealthCheckRegionApSoutheast2 = "ap-southeast-2" - - // HealthCheckRegionApNortheast1 is a HealthCheckRegion enum value - HealthCheckRegionApNortheast1 = "ap-northeast-1" - - // HealthCheckRegionSaEast1 is a HealthCheckRegion enum value - HealthCheckRegionSaEast1 = "sa-east-1" -) - -const ( - // HealthCheckTypeHttp is a HealthCheckType enum value - HealthCheckTypeHttp = "HTTP" - - // HealthCheckTypeHttps is a HealthCheckType enum value - HealthCheckTypeHttps = "HTTPS" - - // HealthCheckTypeHttpStrMatch is a HealthCheckType enum value - HealthCheckTypeHttpStrMatch = "HTTP_STR_MATCH" - - // HealthCheckTypeHttpsStrMatch is a HealthCheckType enum value - HealthCheckTypeHttpsStrMatch = "HTTPS_STR_MATCH" - - // HealthCheckTypeTcp is a HealthCheckType enum value - HealthCheckTypeTcp = "TCP" - - // HealthCheckTypeCalculated is a HealthCheckType enum value - HealthCheckTypeCalculated = "CALCULATED" - - // HealthCheckTypeCloudwatchMetric is a HealthCheckType enum value - HealthCheckTypeCloudwatchMetric = "CLOUDWATCH_METRIC" -) - -const ( - // InsufficientDataHealthStatusHealthy is a InsufficientDataHealthStatus enum value - InsufficientDataHealthStatusHealthy = "Healthy" - - // InsufficientDataHealthStatusUnhealthy is a InsufficientDataHealthStatus enum value - InsufficientDataHealthStatusUnhealthy = "Unhealthy" - - // InsufficientDataHealthStatusLastKnownStatus is a InsufficientDataHealthStatus enum value - InsufficientDataHealthStatusLastKnownStatus = "LastKnownStatus" -) - -const ( - // RRTypeSoa is a RRType enum value - RRTypeSoa = "SOA" - - // RRTypeA is a RRType enum value - RRTypeA = "A" - - // RRTypeTxt is a RRType enum value - RRTypeTxt = "TXT" - - // RRTypeNs is a RRType enum value - RRTypeNs = "NS" - - // RRTypeCname is a RRType enum value - RRTypeCname = "CNAME" - - // RRTypeMx is a RRType enum value - RRTypeMx = "MX" - - // RRTypeNaptr is a RRType enum value - RRTypeNaptr = "NAPTR" - - // RRTypePtr is a RRType enum value - RRTypePtr = "PTR" - - // RRTypeSrv is a RRType enum value - RRTypeSrv = "SRV" - - // RRTypeSpf is a RRType enum value - RRTypeSpf = "SPF" - - // RRTypeAaaa is a RRType enum value - RRTypeAaaa = "AAAA" -) - -const ( - // ResourceRecordSetFailoverPrimary is a ResourceRecordSetFailover enum value - ResourceRecordSetFailoverPrimary = "PRIMARY" - - // ResourceRecordSetFailoverSecondary is a ResourceRecordSetFailover enum value - ResourceRecordSetFailoverSecondary = "SECONDARY" -) - -const ( - // ResourceRecordSetRegionUsEast1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionUsEast1 = "us-east-1" - - // ResourceRecordSetRegionUsEast2 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionUsEast2 = "us-east-2" - - // ResourceRecordSetRegionUsWest1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionUsWest1 = "us-west-1" - - // ResourceRecordSetRegionUsWest2 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionUsWest2 = "us-west-2" - - // ResourceRecordSetRegionCaCentral1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionCaCentral1 = "ca-central-1" - - // ResourceRecordSetRegionEuWest1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionEuWest1 = "eu-west-1" - - // ResourceRecordSetRegionEuWest2 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionEuWest2 = "eu-west-2" - - // ResourceRecordSetRegionEuCentral1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionEuCentral1 = "eu-central-1" - - // ResourceRecordSetRegionApSoutheast1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionApSoutheast1 = "ap-southeast-1" - - // ResourceRecordSetRegionApSoutheast2 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionApSoutheast2 = "ap-southeast-2" - - // ResourceRecordSetRegionApNortheast1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionApNortheast1 = "ap-northeast-1" - - // ResourceRecordSetRegionApNortheast2 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionApNortheast2 = "ap-northeast-2" - - // ResourceRecordSetRegionSaEast1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionSaEast1 = "sa-east-1" - - // ResourceRecordSetRegionCnNorth1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionCnNorth1 = "cn-north-1" - - // ResourceRecordSetRegionApSouth1 is a ResourceRecordSetRegion enum value - ResourceRecordSetRegionApSouth1 = "ap-south-1" -) - -const ( - // StatisticAverage is a Statistic enum value - StatisticAverage = "Average" - - // StatisticSum is a Statistic enum value - StatisticSum = "Sum" - - // StatisticSampleCount is a Statistic enum value - StatisticSampleCount = "SampleCount" - - // StatisticMaximum is a Statistic enum value - StatisticMaximum = "Maximum" - - // StatisticMinimum is a Statistic enum value - StatisticMinimum = "Minimum" -) - -const ( - // TagResourceTypeHealthcheck is a TagResourceType enum value - TagResourceTypeHealthcheck = "healthcheck" - - // TagResourceTypeHostedzone is a TagResourceType enum value - TagResourceTypeHostedzone = "hostedzone" -) - -const ( - // VPCRegionUsEast1 is a VPCRegion enum value - VPCRegionUsEast1 = "us-east-1" - - // VPCRegionUsEast2 is a VPCRegion enum value - VPCRegionUsEast2 = "us-east-2" - - // VPCRegionUsWest1 is a VPCRegion enum value - VPCRegionUsWest1 = "us-west-1" - - // VPCRegionUsWest2 is a VPCRegion enum value - VPCRegionUsWest2 = "us-west-2" - - // VPCRegionEuWest1 is a VPCRegion enum value - VPCRegionEuWest1 = "eu-west-1" - - // VPCRegionEuWest2 is a VPCRegion enum value - VPCRegionEuWest2 = "eu-west-2" - - // VPCRegionEuCentral1 is a VPCRegion enum value - VPCRegionEuCentral1 = "eu-central-1" - - // VPCRegionApSoutheast1 is a VPCRegion enum value - VPCRegionApSoutheast1 = "ap-southeast-1" - - // VPCRegionApSoutheast2 is a VPCRegion enum value - VPCRegionApSoutheast2 = "ap-southeast-2" - - // VPCRegionApSouth1 is a VPCRegion enum value - VPCRegionApSouth1 = "ap-south-1" - - // VPCRegionApNortheast1 is a VPCRegion enum value - VPCRegionApNortheast1 = "ap-northeast-1" - - // VPCRegionApNortheast2 is a VPCRegion enum value - VPCRegionApNortheast2 = "ap-northeast-2" - - // VPCRegionSaEast1 is a VPCRegion enum value - VPCRegionSaEast1 = "sa-east-1" - - // VPCRegionCaCentral1 is a VPCRegion enum value - VPCRegionCaCentral1 = "ca-central-1" - - // VPCRegionCnNorth1 is a VPCRegion enum value - VPCRegionCnNorth1 = "cn-north-1" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go deleted file mode 100644 index efe2d6e..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go +++ /dev/null @@ -1,42 +0,0 @@ -package route53 - -import ( - "net/url" - "regexp" - - "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/private/protocol/restxml" -) - -func init() { - initClient = func(c *client.Client) { - c.Handlers.Build.PushBack(sanitizeURL) - } - - initRequest = func(r *request.Request) { - switch r.Operation.Name { - case opChangeResourceRecordSets: - r.Handlers.UnmarshalError.Remove(restxml.UnmarshalErrorHandler) - r.Handlers.UnmarshalError.PushBack(unmarshalChangeResourceRecordSetsError) - } - } -} - -var reSanitizeURL = regexp.MustCompile(`\/%2F\w+%2F`) - -func sanitizeURL(r *request.Request) { - r.HTTPRequest.URL.RawPath = - reSanitizeURL.ReplaceAllString(r.HTTPRequest.URL.RawPath, "/") - - // Update Path so that it reflects the cleaned RawPath - updated, err := url.Parse(r.HTTPRequest.URL.RawPath) - if err != nil { - r.Error = awserr.New("SerializationError", "failed to clean Route53 URL", err) - return - } - - // Take the updated path so the requests's URL Path has parity with RawPath. - r.HTTPRequest.URL.Path = updated.Path -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/customizations_test.go b/vendor/github.com/aws/aws-sdk-go/service/route53/customizations_test.go deleted file mode 100644 index 2823b26..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/customizations_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package route53_test - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/route53" -) - -func TestBuildCorrectURI(t *testing.T) { - const expectPath = "/2013-04-01/hostedzone/ABCDEFG" - - svc := route53.New(unit.Session) - svc.Handlers.Validate.Clear() - req, _ := svc.GetHostedZoneRequest(&route53.GetHostedZoneInput{ - Id: aws.String("/hostedzone/ABCDEFG"), - }) - - req.HTTPRequest.URL.RawQuery = "abc=123" - - req.Build() - - if a, e := req.HTTPRequest.URL.Path, expectPath; a != e { - t.Errorf("expect path %q, got %q", e, a) - } - - if a, e := req.HTTPRequest.URL.RawPath, expectPath; a != e { - t.Errorf("expect raw path %q, got %q", e, a) - } - - if a, e := req.HTTPRequest.URL.RawQuery, "abc=123"; a != e { - t.Errorf("expect query to be %q, got %q", e, a) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go deleted file mode 100644 index 6dcbc3f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go +++ /dev/null @@ -1,321 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package route53 - -const ( - - // ErrCodeConcurrentModification for service response error code - // "ConcurrentModification". - // - // Another user submitted a request to update the object at the same time that - // you did. Retry the request. - ErrCodeConcurrentModification = "ConcurrentModification" - - // ErrCodeConflictingDomainExists for service response error code - // "ConflictingDomainExists". - // - // You specified an Amazon VPC that you're already using for another hosted - // zone, and the domain that you specified for one of the hosted zones is a - // subdomain of the domain that you specified for the other hosted zone. For - // example, you can't use the same Amazon VPC for the hosted zones for example.com - // and test.example.com. - ErrCodeConflictingDomainExists = "ConflictingDomainExists" - - // ErrCodeConflictingTypes for service response error code - // "ConflictingTypes". - // - // You tried to update a traffic policy instance by using a traffic policy version - // that has a different DNS type than the current type for the instance. You - // specified the type in the JSON document in the CreateTrafficPolicy or CreateTrafficPolicyVersionrequest. - ErrCodeConflictingTypes = "ConflictingTypes" - - // ErrCodeDelegationSetAlreadyCreated for service response error code - // "DelegationSetAlreadyCreated". - // - // A delegation set with the same owner and caller reference combination has - // already been created. - ErrCodeDelegationSetAlreadyCreated = "DelegationSetAlreadyCreated" - - // ErrCodeDelegationSetAlreadyReusable for service response error code - // "DelegationSetAlreadyReusable". - // - // The specified delegation set has already been marked as reusable. - ErrCodeDelegationSetAlreadyReusable = "DelegationSetAlreadyReusable" - - // ErrCodeDelegationSetInUse for service response error code - // "DelegationSetInUse". - // - // The specified delegation contains associated hosted zones which must be deleted - // before the reusable delegation set can be deleted. - ErrCodeDelegationSetInUse = "DelegationSetInUse" - - // ErrCodeDelegationSetNotAvailable for service response error code - // "DelegationSetNotAvailable". - // - // You can create a hosted zone that has the same name as an existing hosted - // zone (example.com is common), but there is a limit to the number of hosted - // zones that have the same name. If you get this error, Amazon Route 53 has - // reached that limit. If you own the domain name and Amazon Route 53 generates - // this error, contact Customer Support. - ErrCodeDelegationSetNotAvailable = "DelegationSetNotAvailable" - - // ErrCodeDelegationSetNotReusable for service response error code - // "DelegationSetNotReusable". - // - // A reusable delegation set with the specified ID does not exist. - ErrCodeDelegationSetNotReusable = "DelegationSetNotReusable" - - // ErrCodeHealthCheckAlreadyExists for service response error code - // "HealthCheckAlreadyExists". - // - // The health check you're attempting to create already exists. Amazon Route - // 53 returns this error when a health check has already been created with the - // specified value for CallerReference. - ErrCodeHealthCheckAlreadyExists = "HealthCheckAlreadyExists" - - // ErrCodeHealthCheckInUse for service response error code - // "HealthCheckInUse". - // - // The health check ID for this health check is referenced in the HealthCheckId - // element in one of the resource record sets in one of the hosted zones that - // are owned by the current AWS account. - ErrCodeHealthCheckInUse = "HealthCheckInUse" - - // ErrCodeHealthCheckVersionMismatch for service response error code - // "HealthCheckVersionMismatch". - // - // The value of HealthCheckVersion in the request doesn't match the value of - // HealthCheckVersion in the health check. - ErrCodeHealthCheckVersionMismatch = "HealthCheckVersionMismatch" - - // ErrCodeHostedZoneAlreadyExists for service response error code - // "HostedZoneAlreadyExists". - // - // The hosted zone you're trying to create already exists. Amazon Route 53 returns - // this error when a hosted zone has already been created with the specified - // CallerReference. - ErrCodeHostedZoneAlreadyExists = "HostedZoneAlreadyExists" - - // ErrCodeHostedZoneNotEmpty for service response error code - // "HostedZoneNotEmpty". - // - // The hosted zone contains resource records that are not SOA or NS records. - ErrCodeHostedZoneNotEmpty = "HostedZoneNotEmpty" - - // ErrCodeHostedZoneNotFound for service response error code - // "HostedZoneNotFound". - // - // The specified HostedZone can't be found. - ErrCodeHostedZoneNotFound = "HostedZoneNotFound" - - // ErrCodeIncompatibleVersion for service response error code - // "IncompatibleVersion". - // - // The resource you're trying to access is unsupported on this Amazon Route - // 53 endpoint. - ErrCodeIncompatibleVersion = "IncompatibleVersion" - - // ErrCodeInvalidArgument for service response error code - // "InvalidArgument". - // - // Parameter name is invalid. - ErrCodeInvalidArgument = "InvalidArgument" - - // ErrCodeInvalidChangeBatch for service response error code - // "InvalidChangeBatch". - // - // This exception contains a list of messages that might contain one or more - // error messages. Each error message indicates one error in the change batch. - ErrCodeInvalidChangeBatch = "InvalidChangeBatch" - - // ErrCodeInvalidDomainName for service response error code - // "InvalidDomainName". - // - // The specified domain name is not valid. - ErrCodeInvalidDomainName = "InvalidDomainName" - - // ErrCodeInvalidInput for service response error code - // "InvalidInput". - // - // The input is not valid. - ErrCodeInvalidInput = "InvalidInput" - - // ErrCodeInvalidPaginationToken for service response error code - // "InvalidPaginationToken". - ErrCodeInvalidPaginationToken = "InvalidPaginationToken" - - // ErrCodeInvalidTrafficPolicyDocument for service response error code - // "InvalidTrafficPolicyDocument". - // - // The format of the traffic policy document that you specified in the Document - // element is invalid. - ErrCodeInvalidTrafficPolicyDocument = "InvalidTrafficPolicyDocument" - - // ErrCodeInvalidVPCId for service response error code - // "InvalidVPCId". - // - // The VPC ID that you specified either isn't a valid ID or the current account - // is not authorized to access this VPC. - ErrCodeInvalidVPCId = "InvalidVPCId" - - // ErrCodeLastVPCAssociation for service response error code - // "LastVPCAssociation". - // - // The VPC that you're trying to disassociate from the private hosted zone is - // the last VPC that is associated with the hosted zone. Amazon Route 53 doesn't - // support disassociating the last VPC from a hosted zone. - ErrCodeLastVPCAssociation = "LastVPCAssociation" - - // ErrCodeLimitsExceeded for service response error code - // "LimitsExceeded". - // - // The limits specified for a resource have been exceeded. - ErrCodeLimitsExceeded = "LimitsExceeded" - - // ErrCodeNoSuchChange for service response error code - // "NoSuchChange". - // - // A change with the specified change ID does not exist. - ErrCodeNoSuchChange = "NoSuchChange" - - // ErrCodeNoSuchDelegationSet for service response error code - // "NoSuchDelegationSet". - // - // A reusable delegation set with the specified ID does not exist. - ErrCodeNoSuchDelegationSet = "NoSuchDelegationSet" - - // ErrCodeNoSuchGeoLocation for service response error code - // "NoSuchGeoLocation". - // - // Amazon Route 53 doesn't support the specified geolocation. - ErrCodeNoSuchGeoLocation = "NoSuchGeoLocation" - - // ErrCodeNoSuchHealthCheck for service response error code - // "NoSuchHealthCheck". - // - // No health check exists with the ID that you specified in the DeleteHealthCheck - // request. - ErrCodeNoSuchHealthCheck = "NoSuchHealthCheck" - - // ErrCodeNoSuchHostedZone for service response error code - // "NoSuchHostedZone". - // - // No hosted zone exists with the ID that you specified. - ErrCodeNoSuchHostedZone = "NoSuchHostedZone" - - // ErrCodeNoSuchTrafficPolicy for service response error code - // "NoSuchTrafficPolicy". - // - // No traffic policy exists with the specified ID. - ErrCodeNoSuchTrafficPolicy = "NoSuchTrafficPolicy" - - // ErrCodeNoSuchTrafficPolicyInstance for service response error code - // "NoSuchTrafficPolicyInstance". - // - // No traffic policy instance exists with the specified ID. - ErrCodeNoSuchTrafficPolicyInstance = "NoSuchTrafficPolicyInstance" - - // ErrCodeNotAuthorizedException for service response error code - // "NotAuthorizedException". - // - // Associating the specified VPC with the specified hosted zone has not been - // authorized. - ErrCodeNotAuthorizedException = "NotAuthorizedException" - - // ErrCodePriorRequestNotComplete for service response error code - // "PriorRequestNotComplete". - // - // If Amazon Route 53 can't process a request before the next request arrives, - // it will reject subsequent requests for the same hosted zone and return an - // HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly - // for the same request, we recommend that you wait, in intervals of increasing - // duration, before you try the request again. - ErrCodePriorRequestNotComplete = "PriorRequestNotComplete" - - // ErrCodePublicZoneVPCAssociation for service response error code - // "PublicZoneVPCAssociation". - // - // You're trying to associate a VPC with a public hosted zone. Amazon Route - // 53 doesn't support associating a VPC with a public hosted zone. - ErrCodePublicZoneVPCAssociation = "PublicZoneVPCAssociation" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The limit on the number of requests per second was exceeded. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeTooManyHealthChecks for service response error code - // "TooManyHealthChecks". - // - // You have reached the maximum number of active health checks for an AWS account. - // The default limit is 100. To request a higher limit, create a case (http://aws.amazon.com/route53-request) - // with the AWS Support Center. - ErrCodeTooManyHealthChecks = "TooManyHealthChecks" - - // ErrCodeTooManyHostedZones for service response error code - // "TooManyHostedZones". - // - // This hosted zone can't be created because the hosted zone limit is exceeded. - // To request a limit increase, go to the Amazon Route 53 Contact Us (http://aws.amazon.com/route53-request/) - // page. - ErrCodeTooManyHostedZones = "TooManyHostedZones" - - // ErrCodeTooManyTrafficPolicies for service response error code - // "TooManyTrafficPolicies". - // - // You've created the maximum number of traffic policies that can be created - // for the current AWS account. You can request an increase to the limit on - // the Contact Us (http://aws.amazon.com/route53-request/) page. - ErrCodeTooManyTrafficPolicies = "TooManyTrafficPolicies" - - // ErrCodeTooManyTrafficPolicyInstances for service response error code - // "TooManyTrafficPolicyInstances". - // - // You've created the maximum number of traffic policy instances that can be - // created for the current AWS account. You can request an increase to the limit - // on the Contact Us (http://aws.amazon.com/route53-request/) page. - ErrCodeTooManyTrafficPolicyInstances = "TooManyTrafficPolicyInstances" - - // ErrCodeTooManyVPCAssociationAuthorizations for service response error code - // "TooManyVPCAssociationAuthorizations". - // - // You've created the maximum number of authorizations that can be created for - // the specified hosted zone. To authorize another VPC to be associated with - // the hosted zone, submit a DeleteVPCAssociationAuthorization request to remove - // an existing authorization. To get a list of existing authorizations, submit - // a ListVPCAssociationAuthorizations request. - ErrCodeTooManyVPCAssociationAuthorizations = "TooManyVPCAssociationAuthorizations" - - // ErrCodeTrafficPolicyAlreadyExists for service response error code - // "TrafficPolicyAlreadyExists". - // - // A traffic policy that has the same value for Name already exists. - ErrCodeTrafficPolicyAlreadyExists = "TrafficPolicyAlreadyExists" - - // ErrCodeTrafficPolicyInUse for service response error code - // "TrafficPolicyInUse". - // - // One or more traffic policy instances were created by using the specified - // traffic policy. - ErrCodeTrafficPolicyInUse = "TrafficPolicyInUse" - - // ErrCodeTrafficPolicyInstanceAlreadyExists for service response error code - // "TrafficPolicyInstanceAlreadyExists". - // - // Traffic policy instance with given Id already exists. - ErrCodeTrafficPolicyInstanceAlreadyExists = "TrafficPolicyInstanceAlreadyExists" - - // ErrCodeVPCAssociationAuthorizationNotFound for service response error code - // "VPCAssociationAuthorizationNotFound". - // - // The VPC that you specified is not authorized to be associated with the hosted - // zone. - ErrCodeVPCAssociationAuthorizationNotFound = "VPCAssociationAuthorizationNotFound" - - // ErrCodeVPCAssociationNotFound for service response error code - // "VPCAssociationNotFound". - // - // The specified VPC and hosted zone are not currently associated. - ErrCodeVPCAssociationNotFound = "VPCAssociationNotFound" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/route53/examples_test.go deleted file mode 100644 index a2b7aa7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/examples_test.go +++ /dev/null @@ -1,1221 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package route53_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/route53" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleRoute53_AssociateVPCWithHostedZone() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.AssociateVPCWithHostedZoneInput{ - HostedZoneId: aws.String("ResourceId"), // Required - VPC: &route53.VPC{ // Required - VPCId: aws.String("VPCId"), - VPCRegion: aws.String("VPCRegion"), - }, - Comment: aws.String("AssociateVPCComment"), - } - resp, err := svc.AssociateVPCWithHostedZone(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ChangeResourceRecordSets() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ChangeResourceRecordSetsInput{ - ChangeBatch: &route53.ChangeBatch{ // Required - Changes: []*route53.Change{ // Required - { // Required - Action: aws.String("ChangeAction"), // Required - ResourceRecordSet: &route53.ResourceRecordSet{ // Required - Name: aws.String("DNSName"), // Required - Type: aws.String("RRType"), // Required - AliasTarget: &route53.AliasTarget{ - DNSName: aws.String("DNSName"), // Required - EvaluateTargetHealth: aws.Bool(true), // Required - HostedZoneId: aws.String("ResourceId"), // Required - }, - Failover: aws.String("ResourceRecordSetFailover"), - GeoLocation: &route53.GeoLocation{ - ContinentCode: aws.String("GeoLocationContinentCode"), - CountryCode: aws.String("GeoLocationCountryCode"), - SubdivisionCode: aws.String("GeoLocationSubdivisionCode"), - }, - HealthCheckId: aws.String("HealthCheckId"), - Region: aws.String("ResourceRecordSetRegion"), - ResourceRecords: []*route53.ResourceRecord{ - { // Required - Value: aws.String("RData"), // Required - }, - // More values... - }, - SetIdentifier: aws.String("ResourceRecordSetIdentifier"), - TTL: aws.Int64(1), - TrafficPolicyInstanceId: aws.String("TrafficPolicyInstanceId"), - Weight: aws.Int64(1), - }, - }, - // More values... - }, - Comment: aws.String("ResourceDescription"), - }, - HostedZoneId: aws.String("ResourceId"), // Required - } - resp, err := svc.ChangeResourceRecordSets(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ChangeTagsForResource() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ChangeTagsForResourceInput{ - ResourceId: aws.String("TagResourceId"), // Required - ResourceType: aws.String("TagResourceType"), // Required - AddTags: []*route53.Tag{ - { // Required - Key: aws.String("TagKey"), - Value: aws.String("TagValue"), - }, - // More values... - }, - RemoveTagKeys: []*string{ - aws.String("TagKey"), // Required - // More values... - }, - } - resp, err := svc.ChangeTagsForResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_CreateHealthCheck() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.CreateHealthCheckInput{ - CallerReference: aws.String("HealthCheckNonce"), // Required - HealthCheckConfig: &route53.HealthCheckConfig{ // Required - Type: aws.String("HealthCheckType"), // Required - AlarmIdentifier: &route53.AlarmIdentifier{ - Name: aws.String("AlarmName"), // Required - Region: aws.String("CloudWatchRegion"), // Required - }, - ChildHealthChecks: []*string{ - aws.String("HealthCheckId"), // Required - // More values... - }, - EnableSNI: aws.Bool(true), - FailureThreshold: aws.Int64(1), - FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"), - HealthThreshold: aws.Int64(1), - IPAddress: aws.String("IPAddress"), - InsufficientDataHealthStatus: aws.String("InsufficientDataHealthStatus"), - Inverted: aws.Bool(true), - MeasureLatency: aws.Bool(true), - Port: aws.Int64(1), - Regions: []*string{ - aws.String("HealthCheckRegion"), // Required - // More values... - }, - RequestInterval: aws.Int64(1), - ResourcePath: aws.String("ResourcePath"), - SearchString: aws.String("SearchString"), - }, - } - resp, err := svc.CreateHealthCheck(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_CreateHostedZone() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.CreateHostedZoneInput{ - CallerReference: aws.String("Nonce"), // Required - Name: aws.String("DNSName"), // Required - DelegationSetId: aws.String("ResourceId"), - HostedZoneConfig: &route53.HostedZoneConfig{ - Comment: aws.String("ResourceDescription"), - PrivateZone: aws.Bool(true), - }, - VPC: &route53.VPC{ - VPCId: aws.String("VPCId"), - VPCRegion: aws.String("VPCRegion"), - }, - } - resp, err := svc.CreateHostedZone(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_CreateReusableDelegationSet() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.CreateReusableDelegationSetInput{ - CallerReference: aws.String("Nonce"), // Required - HostedZoneId: aws.String("ResourceId"), - } - resp, err := svc.CreateReusableDelegationSet(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_CreateTrafficPolicy() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.CreateTrafficPolicyInput{ - Document: aws.String("TrafficPolicyDocument"), // Required - Name: aws.String("TrafficPolicyName"), // Required - Comment: aws.String("TrafficPolicyComment"), - } - resp, err := svc.CreateTrafficPolicy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_CreateTrafficPolicyInstance() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.CreateTrafficPolicyInstanceInput{ - HostedZoneId: aws.String("ResourceId"), // Required - Name: aws.String("DNSName"), // Required - TTL: aws.Int64(1), // Required - TrafficPolicyId: aws.String("TrafficPolicyId"), // Required - TrafficPolicyVersion: aws.Int64(1), // Required - } - resp, err := svc.CreateTrafficPolicyInstance(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_CreateTrafficPolicyVersion() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.CreateTrafficPolicyVersionInput{ - Document: aws.String("TrafficPolicyDocument"), // Required - Id: aws.String("TrafficPolicyId"), // Required - Comment: aws.String("TrafficPolicyComment"), - } - resp, err := svc.CreateTrafficPolicyVersion(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_CreateVPCAssociationAuthorization() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.CreateVPCAssociationAuthorizationInput{ - HostedZoneId: aws.String("ResourceId"), // Required - VPC: &route53.VPC{ // Required - VPCId: aws.String("VPCId"), - VPCRegion: aws.String("VPCRegion"), - }, - } - resp, err := svc.CreateVPCAssociationAuthorization(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_DeleteHealthCheck() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.DeleteHealthCheckInput{ - HealthCheckId: aws.String("HealthCheckId"), // Required - } - resp, err := svc.DeleteHealthCheck(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_DeleteHostedZone() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.DeleteHostedZoneInput{ - Id: aws.String("ResourceId"), // Required - } - resp, err := svc.DeleteHostedZone(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_DeleteReusableDelegationSet() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.DeleteReusableDelegationSetInput{ - Id: aws.String("ResourceId"), // Required - } - resp, err := svc.DeleteReusableDelegationSet(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_DeleteTrafficPolicy() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.DeleteTrafficPolicyInput{ - Id: aws.String("TrafficPolicyId"), // Required - Version: aws.Int64(1), // Required - } - resp, err := svc.DeleteTrafficPolicy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_DeleteTrafficPolicyInstance() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.DeleteTrafficPolicyInstanceInput{ - Id: aws.String("TrafficPolicyInstanceId"), // Required - } - resp, err := svc.DeleteTrafficPolicyInstance(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_DeleteVPCAssociationAuthorization() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.DeleteVPCAssociationAuthorizationInput{ - HostedZoneId: aws.String("ResourceId"), // Required - VPC: &route53.VPC{ // Required - VPCId: aws.String("VPCId"), - VPCRegion: aws.String("VPCRegion"), - }, - } - resp, err := svc.DeleteVPCAssociationAuthorization(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_DisassociateVPCFromHostedZone() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.DisassociateVPCFromHostedZoneInput{ - HostedZoneId: aws.String("ResourceId"), // Required - VPC: &route53.VPC{ // Required - VPCId: aws.String("VPCId"), - VPCRegion: aws.String("VPCRegion"), - }, - Comment: aws.String("DisassociateVPCComment"), - } - resp, err := svc.DisassociateVPCFromHostedZone(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetChange() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetChangeInput{ - Id: aws.String("ResourceId"), // Required - } - resp, err := svc.GetChange(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetCheckerIpRanges() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - var params *route53.GetCheckerIpRangesInput - resp, err := svc.GetCheckerIpRanges(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetGeoLocation() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetGeoLocationInput{ - ContinentCode: aws.String("GeoLocationContinentCode"), - CountryCode: aws.String("GeoLocationCountryCode"), - SubdivisionCode: aws.String("GeoLocationSubdivisionCode"), - } - resp, err := svc.GetGeoLocation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetHealthCheck() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetHealthCheckInput{ - HealthCheckId: aws.String("HealthCheckId"), // Required - } - resp, err := svc.GetHealthCheck(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetHealthCheckCount() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - var params *route53.GetHealthCheckCountInput - resp, err := svc.GetHealthCheckCount(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetHealthCheckLastFailureReason() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetHealthCheckLastFailureReasonInput{ - HealthCheckId: aws.String("HealthCheckId"), // Required - } - resp, err := svc.GetHealthCheckLastFailureReason(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetHealthCheckStatus() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetHealthCheckStatusInput{ - HealthCheckId: aws.String("HealthCheckId"), // Required - } - resp, err := svc.GetHealthCheckStatus(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetHostedZone() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetHostedZoneInput{ - Id: aws.String("ResourceId"), // Required - } - resp, err := svc.GetHostedZone(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetHostedZoneCount() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - var params *route53.GetHostedZoneCountInput - resp, err := svc.GetHostedZoneCount(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetReusableDelegationSet() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetReusableDelegationSetInput{ - Id: aws.String("ResourceId"), // Required - } - resp, err := svc.GetReusableDelegationSet(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetTrafficPolicy() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetTrafficPolicyInput{ - Id: aws.String("TrafficPolicyId"), // Required - Version: aws.Int64(1), // Required - } - resp, err := svc.GetTrafficPolicy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetTrafficPolicyInstance() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.GetTrafficPolicyInstanceInput{ - Id: aws.String("TrafficPolicyInstanceId"), // Required - } - resp, err := svc.GetTrafficPolicyInstance(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_GetTrafficPolicyInstanceCount() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - var params *route53.GetTrafficPolicyInstanceCountInput - resp, err := svc.GetTrafficPolicyInstanceCount(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListGeoLocations() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListGeoLocationsInput{ - MaxItems: aws.String("PageMaxItems"), - StartContinentCode: aws.String("GeoLocationContinentCode"), - StartCountryCode: aws.String("GeoLocationCountryCode"), - StartSubdivisionCode: aws.String("GeoLocationSubdivisionCode"), - } - resp, err := svc.ListGeoLocations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListHealthChecks() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListHealthChecksInput{ - Marker: aws.String("PageMarker"), - MaxItems: aws.String("PageMaxItems"), - } - resp, err := svc.ListHealthChecks(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListHostedZones() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListHostedZonesInput{ - DelegationSetId: aws.String("ResourceId"), - Marker: aws.String("PageMarker"), - MaxItems: aws.String("PageMaxItems"), - } - resp, err := svc.ListHostedZones(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListHostedZonesByName() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListHostedZonesByNameInput{ - DNSName: aws.String("DNSName"), - HostedZoneId: aws.String("ResourceId"), - MaxItems: aws.String("PageMaxItems"), - } - resp, err := svc.ListHostedZonesByName(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListResourceRecordSets() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListResourceRecordSetsInput{ - HostedZoneId: aws.String("ResourceId"), // Required - MaxItems: aws.String("PageMaxItems"), - StartRecordIdentifier: aws.String("ResourceRecordSetIdentifier"), - StartRecordName: aws.String("DNSName"), - StartRecordType: aws.String("RRType"), - } - resp, err := svc.ListResourceRecordSets(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListReusableDelegationSets() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListReusableDelegationSetsInput{ - Marker: aws.String("PageMarker"), - MaxItems: aws.String("PageMaxItems"), - } - resp, err := svc.ListReusableDelegationSets(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListTagsForResource() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListTagsForResourceInput{ - ResourceId: aws.String("TagResourceId"), // Required - ResourceType: aws.String("TagResourceType"), // Required - } - resp, err := svc.ListTagsForResource(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListTagsForResources() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListTagsForResourcesInput{ - ResourceIds: []*string{ // Required - aws.String("TagResourceId"), // Required - // More values... - }, - ResourceType: aws.String("TagResourceType"), // Required - } - resp, err := svc.ListTagsForResources(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListTrafficPolicies() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListTrafficPoliciesInput{ - MaxItems: aws.String("PageMaxItems"), - TrafficPolicyIdMarker: aws.String("TrafficPolicyId"), - } - resp, err := svc.ListTrafficPolicies(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListTrafficPolicyInstances() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListTrafficPolicyInstancesInput{ - HostedZoneIdMarker: aws.String("ResourceId"), - MaxItems: aws.String("PageMaxItems"), - TrafficPolicyInstanceNameMarker: aws.String("DNSName"), - TrafficPolicyInstanceTypeMarker: aws.String("RRType"), - } - resp, err := svc.ListTrafficPolicyInstances(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListTrafficPolicyInstancesByHostedZone() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListTrafficPolicyInstancesByHostedZoneInput{ - HostedZoneId: aws.String("ResourceId"), // Required - MaxItems: aws.String("PageMaxItems"), - TrafficPolicyInstanceNameMarker: aws.String("DNSName"), - TrafficPolicyInstanceTypeMarker: aws.String("RRType"), - } - resp, err := svc.ListTrafficPolicyInstancesByHostedZone(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListTrafficPolicyInstancesByPolicy() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListTrafficPolicyInstancesByPolicyInput{ - TrafficPolicyId: aws.String("TrafficPolicyId"), // Required - TrafficPolicyVersion: aws.Int64(1), // Required - HostedZoneIdMarker: aws.String("ResourceId"), - MaxItems: aws.String("PageMaxItems"), - TrafficPolicyInstanceNameMarker: aws.String("DNSName"), - TrafficPolicyInstanceTypeMarker: aws.String("RRType"), - } - resp, err := svc.ListTrafficPolicyInstancesByPolicy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListTrafficPolicyVersions() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListTrafficPolicyVersionsInput{ - Id: aws.String("TrafficPolicyId"), // Required - MaxItems: aws.String("PageMaxItems"), - TrafficPolicyVersionMarker: aws.String("TrafficPolicyVersionMarker"), - } - resp, err := svc.ListTrafficPolicyVersions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_ListVPCAssociationAuthorizations() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.ListVPCAssociationAuthorizationsInput{ - HostedZoneId: aws.String("ResourceId"), // Required - MaxResults: aws.String("MaxResults"), - NextToken: aws.String("PaginationToken"), - } - resp, err := svc.ListVPCAssociationAuthorizations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_TestDNSAnswer() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.TestDNSAnswerInput{ - HostedZoneId: aws.String("ResourceId"), // Required - RecordName: aws.String("DNSName"), // Required - RecordType: aws.String("RRType"), // Required - EDNS0ClientSubnetIP: aws.String("IPAddress"), - EDNS0ClientSubnetMask: aws.String("SubnetMask"), - ResolverIP: aws.String("IPAddress"), - } - resp, err := svc.TestDNSAnswer(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_UpdateHealthCheck() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.UpdateHealthCheckInput{ - HealthCheckId: aws.String("HealthCheckId"), // Required - AlarmIdentifier: &route53.AlarmIdentifier{ - Name: aws.String("AlarmName"), // Required - Region: aws.String("CloudWatchRegion"), // Required - }, - ChildHealthChecks: []*string{ - aws.String("HealthCheckId"), // Required - // More values... - }, - EnableSNI: aws.Bool(true), - FailureThreshold: aws.Int64(1), - FullyQualifiedDomainName: aws.String("FullyQualifiedDomainName"), - HealthCheckVersion: aws.Int64(1), - HealthThreshold: aws.Int64(1), - IPAddress: aws.String("IPAddress"), - InsufficientDataHealthStatus: aws.String("InsufficientDataHealthStatus"), - Inverted: aws.Bool(true), - Port: aws.Int64(1), - Regions: []*string{ - aws.String("HealthCheckRegion"), // Required - // More values... - }, - ResourcePath: aws.String("ResourcePath"), - SearchString: aws.String("SearchString"), - } - resp, err := svc.UpdateHealthCheck(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_UpdateHostedZoneComment() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.UpdateHostedZoneCommentInput{ - Id: aws.String("ResourceId"), // Required - Comment: aws.String("ResourceDescription"), - } - resp, err := svc.UpdateHostedZoneComment(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_UpdateTrafficPolicyComment() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.UpdateTrafficPolicyCommentInput{ - Comment: aws.String("TrafficPolicyComment"), // Required - Id: aws.String("TrafficPolicyId"), // Required - Version: aws.Int64(1), // Required - } - resp, err := svc.UpdateTrafficPolicyComment(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleRoute53_UpdateTrafficPolicyInstance() { - sess := session.Must(session.NewSession()) - - svc := route53.New(sess) - - params := &route53.UpdateTrafficPolicyInstanceInput{ - Id: aws.String("TrafficPolicyInstanceId"), // Required - TTL: aws.Int64(1), // Required - TrafficPolicyId: aws.String("TrafficPolicyId"), // Required - TrafficPolicyVersion: aws.Int64(1), // Required - } - resp, err := svc.UpdateTrafficPolicyInstance(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go deleted file mode 100644 index 9b2e767..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package route53 - -import ( - "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/private/protocol/restxml" -) - -// Route53 is a client for Route 53. -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01 -type Route53 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "route53" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the Route53 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: -// // Create a Route53 client from just a session. -// svc := route53.New(mySession) -// -// // Create a Route53 client with additional configuration -// svc := route53.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Route53 { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Route53 { - svc := &Route53{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2013-04-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Route53 operation and runs any -// custom request initialization. -func (c *Route53) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go deleted file mode 100644 index 266e9a8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go +++ /dev/null @@ -1,77 +0,0 @@ -package route53 - -import ( - "bytes" - "encoding/xml" - "io/ioutil" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -type baseXMLErrorResponse struct { - XMLName xml.Name -} - -type standardXMLErrorResponse struct { - XMLName xml.Name `xml:"ErrorResponse"` - Code string `xml:"Error>Code"` - Message string `xml:"Error>Message"` - RequestID string `xml:"RequestId"` -} - -type invalidChangeBatchXMLErrorResponse struct { - XMLName xml.Name `xml:"InvalidChangeBatch"` - Messages []string `xml:"Messages>Message"` -} - -func unmarshalChangeResourceRecordSetsError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - responseBody, err := ioutil.ReadAll(r.HTTPResponse.Body) - - if err != nil { - r.Error = awserr.New("SerializationError", "failed to read Route53 XML error response", err) - return - } - - baseError := &baseXMLErrorResponse{} - - if err := xml.Unmarshal(responseBody, baseError); err != nil { - r.Error = awserr.New("SerializationError", "failed to decode Route53 XML error response", err) - return - } - - switch baseError.XMLName.Local { - case "InvalidChangeBatch": - unmarshalInvalidChangeBatchError(r, responseBody) - default: - r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewReader(responseBody)) - restxml.UnmarshalError(r) - } -} - -func unmarshalInvalidChangeBatchError(r *request.Request, requestBody []byte) { - resp := &invalidChangeBatchXMLErrorResponse{} - err := xml.Unmarshal(requestBody, resp) - - if err != nil { - r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err) - return - } - - const errorCode = "InvalidChangeBatch" - errors := []error{} - - for _, msg := range resp.Messages { - errors = append(errors, awserr.New(errorCode, msg, nil)) - } - - r.Error = awserr.NewRequestFailure( - awserr.NewBatchError(errorCode, "ChangeBatch errors occurred", errors), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error_leak_test.go b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error_leak_test.go deleted file mode 100644 index 2d6d86d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error_leak_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package route53 - -import ( - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/awstesting" -) - -func TestUnmarhsalErrorLeak(t *testing.T) { - req := &request.Request{ - Operation: &request.Operation{ - Name: opChangeResourceRecordSets, - }, - 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) - unmarshalChangeResourceRecordSetsError(req) - - assert.NotNil(t, req.Error) - assert.Equal(t, reader.Closed, true) - assert.Equal(t, reader.Size, 0) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error_test.go b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error_test.go deleted file mode 100644 index 7d5aa90..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package route53_test - -import ( - "bytes" - "io/ioutil" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - - "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/route53" -) - -func makeClientWithResponse(response string) *route53.Route53 { - r := route53.New(unit.Session) - r.Handlers.Send.Clear() - r.Handlers.Send.PushBack(func(r *request.Request) { - body := ioutil.NopCloser(bytes.NewReader([]byte(response))) - r.HTTPResponse = &http.Response{ - ContentLength: int64(len(response)), - StatusCode: 400, - Status: "Bad Request", - Body: body, - } - }) - - return r -} - -func TestUnmarshalStandardError(t *testing.T) { - const errorResponse = ` - - - InvalidDomainName - The domain name is invalid - - 12345 - -` - - r := makeClientWithResponse(errorResponse) - - _, err := r.CreateHostedZone(&route53.CreateHostedZoneInput{ - CallerReference: aws.String("test"), - Name: aws.String("test_zone"), - }) - - assert.Error(t, err) - assert.Equal(t, "InvalidDomainName", err.(awserr.Error).Code()) - assert.Equal(t, "The domain name is invalid", err.(awserr.Error).Message()) -} - -func TestUnmarshalInvalidChangeBatch(t *testing.T) { - const errorMessage = ` -Tried to create resource record set duplicate.example.com. type A, -but it already exists -` - const errorResponse = ` - - - ` + errorMessage + ` - - -` - - r := makeClientWithResponse(errorResponse) - - req := &route53.ChangeResourceRecordSetsInput{ - HostedZoneId: aws.String("zoneId"), - ChangeBatch: &route53.ChangeBatch{ - Changes: []*route53.Change{ - { - Action: aws.String("CREATE"), - ResourceRecordSet: &route53.ResourceRecordSet{ - Name: aws.String("domain"), - Type: aws.String("CNAME"), - TTL: aws.Int64(120), - ResourceRecords: []*route53.ResourceRecord{ - { - Value: aws.String("cname"), - }, - }, - }, - }, - }, - }, - } - - _, err := r.ChangeResourceRecordSets(req) - assert.Error(t, err) - - if reqErr, ok := err.(awserr.RequestFailure); ok { - assert.Error(t, reqErr) - assert.Equal(t, 400, reqErr.StatusCode()) - } else { - assert.Fail(t, "returned error is not a RequestFailure") - } - - if batchErr, ok := err.(awserr.BatchedErrors); ok { - errs := batchErr.OrigErrs() - assert.Len(t, errs, 1) - assert.Equal(t, "InvalidChangeBatch", errs[0].(awserr.Error).Code()) - assert.Equal(t, errorMessage, errs[0].(awserr.Error).Message()) - } else { - assert.Fail(t, "returned error is not a BatchedErrors") - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go deleted file mode 100644 index 71d99e6..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/waiters.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package route53 - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilResourceRecordSetsChanged uses the Route 53 API operation -// GetChange to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *Route53) WaitUntilResourceRecordSetsChanged(input *GetChangeInput) error { - return c.WaitUntilResourceRecordSetsChangedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilResourceRecordSetsChangedWithContext is an extended version of WaitUntilResourceRecordSetsChanged. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Route53) WaitUntilResourceRecordSetsChangedWithContext(ctx aws.Context, input *GetChangeInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilResourceRecordSetsChanged", - MaxAttempts: 60, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "ChangeInfo.Status", - Expected: "INSYNC", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetChangeInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetChangeRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} 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 deleted file mode 100644 index 3f0fc2f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ /dev/null @@ -1,19248 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package s3 provides a client for Amazon Simple Storage Service. -package s3 - -import ( - "fmt" - "io" - "time" - - "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/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -const opAbortMultipartUpload = "AbortMultipartUpload" - -// AbortMultipartUploadRequest generates a "aws/request.Request" representing the -// client's request for the AbortMultipartUpload operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AbortMultipartUpload for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AbortMultipartUpload method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AbortMultipartUploadRequest method. -// req, resp := client.AbortMultipartUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload -func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req *request.Request, output *AbortMultipartUploadOutput) { - op := &request.Operation{ - Name: opAbortMultipartUpload, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &AbortMultipartUploadInput{} - } - - output = &AbortMultipartUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// AbortMultipartUpload API operation for Amazon Simple Storage Service. -// -// Aborts a multipart upload. -// -// To verify that all parts have been removed, so you don't get charged for -// the part storage, you should call the List Parts operation and ensure the -// parts list is empty. -// -// 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 Amazon Simple Storage Service's -// API operation AbortMultipartUpload for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchUpload "NoSuchUpload" -// The specified multipart upload does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload -func (c *S3) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { - req, out := c.AbortMultipartUploadRequest(input) - return out, req.Send() -} - -// AbortMultipartUploadWithContext is the same as AbortMultipartUpload with the addition of -// the ability to pass a context and additional request options. -// -// See AbortMultipartUpload 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 *S3) AbortMultipartUploadWithContext(ctx aws.Context, input *AbortMultipartUploadInput, opts ...request.Option) (*AbortMultipartUploadOutput, error) { - req, out := c.AbortMultipartUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCompleteMultipartUpload = "CompleteMultipartUpload" - -// CompleteMultipartUploadRequest generates a "aws/request.Request" representing the -// client's request for the CompleteMultipartUpload operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CompleteMultipartUpload for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CompleteMultipartUpload method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CompleteMultipartUploadRequest method. -// req, resp := client.CompleteMultipartUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload -func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) (req *request.Request, output *CompleteMultipartUploadOutput) { - op := &request.Operation{ - Name: opCompleteMultipartUpload, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &CompleteMultipartUploadInput{} - } - - output = &CompleteMultipartUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// CompleteMultipartUpload API operation for Amazon Simple Storage Service. -// -// Completes a multipart upload by assembling previously uploaded parts. -// -// 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 Amazon Simple Storage Service's -// API operation CompleteMultipartUpload for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload -func (c *S3) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*CompleteMultipartUploadOutput, error) { - req, out := c.CompleteMultipartUploadRequest(input) - return out, req.Send() -} - -// CompleteMultipartUploadWithContext is the same as CompleteMultipartUpload with the addition of -// the ability to pass a context and additional request options. -// -// See CompleteMultipartUpload 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 *S3) CompleteMultipartUploadWithContext(ctx aws.Context, input *CompleteMultipartUploadInput, opts ...request.Option) (*CompleteMultipartUploadOutput, error) { - req, out := c.CompleteMultipartUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCopyObject = "CopyObject" - -// CopyObjectRequest generates a "aws/request.Request" representing the -// client's request for the CopyObject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CopyObject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CopyObject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CopyObjectRequest method. -// req, resp := client.CopyObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject -func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, output *CopyObjectOutput) { - op := &request.Operation{ - Name: opCopyObject, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &CopyObjectInput{} - } - - output = &CopyObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyObject API operation for Amazon Simple Storage Service. -// -// Creates a copy of an object that is already stored in Amazon S3. -// -// 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 Amazon Simple Storage Service's -// API operation CopyObject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeObjectNotInActiveTierError "ObjectNotInActiveTierError" -// The source object of the COPY operation is not in the active tier and is -// only stored in Amazon Glacier. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject -func (c *S3) CopyObject(input *CopyObjectInput) (*CopyObjectOutput, error) { - req, out := c.CopyObjectRequest(input) - return out, req.Send() -} - -// CopyObjectWithContext is the same as CopyObject with the addition of -// the ability to pass a context and additional request options. -// -// See CopyObject 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 *S3) CopyObjectWithContext(ctx aws.Context, input *CopyObjectInput, opts ...request.Option) (*CopyObjectOutput, error) { - req, out := c.CopyObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateBucket = "CreateBucket" - -// CreateBucketRequest generates a "aws/request.Request" representing the -// client's request for the CreateBucket operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateBucket for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateBucket method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateBucketRequest method. -// req, resp := client.CreateBucketRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket -func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request, output *CreateBucketOutput) { - op := &request.Operation{ - Name: opCreateBucket, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}", - } - - if input == nil { - input = &CreateBucketInput{} - } - - output = &CreateBucketOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateBucket API operation for Amazon Simple Storage Service. -// -// Creates a new bucket. -// -// 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 Amazon Simple Storage Service's -// API operation CreateBucket for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBucketAlreadyExists "BucketAlreadyExists" -// The requested bucket name is not available. The bucket namespace is shared -// by all users of the system. Please select a different name and try again. -// -// * ErrCodeBucketAlreadyOwnedByYou "BucketAlreadyOwnedByYou" -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket -func (c *S3) CreateBucket(input *CreateBucketInput) (*CreateBucketOutput, error) { - req, out := c.CreateBucketRequest(input) - return out, req.Send() -} - -// CreateBucketWithContext is the same as CreateBucket with the addition of -// the ability to pass a context and additional request options. -// -// See CreateBucket 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 *S3) CreateBucketWithContext(ctx aws.Context, input *CreateBucketInput, opts ...request.Option) (*CreateBucketOutput, error) { - req, out := c.CreateBucketRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateMultipartUpload = "CreateMultipartUpload" - -// CreateMultipartUploadRequest generates a "aws/request.Request" representing the -// client's request for the CreateMultipartUpload operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateMultipartUpload for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateMultipartUpload method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateMultipartUploadRequest method. -// req, resp := client.CreateMultipartUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload -func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (req *request.Request, output *CreateMultipartUploadOutput) { - op := &request.Operation{ - Name: opCreateMultipartUpload, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}/{Key+}?uploads", - } - - if input == nil { - input = &CreateMultipartUploadInput{} - } - - output = &CreateMultipartUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMultipartUpload API operation for Amazon Simple Storage Service. -// -// Initiates a multipart upload and returns an upload ID. -// -// Note: After you initiate multipart upload and upload one or more parts, you -// must either complete or abort multipart upload in order to stop getting charged -// for storage of the uploaded parts. Only after you either complete or abort -// multipart upload, Amazon S3 frees up the parts storage and stops charging -// you for the parts storage. -// -// 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 Amazon Simple Storage Service's -// API operation CreateMultipartUpload for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload -func (c *S3) CreateMultipartUpload(input *CreateMultipartUploadInput) (*CreateMultipartUploadOutput, error) { - req, out := c.CreateMultipartUploadRequest(input) - return out, req.Send() -} - -// CreateMultipartUploadWithContext is the same as CreateMultipartUpload with the addition of -// the ability to pass a context and additional request options. -// -// See CreateMultipartUpload 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 *S3) CreateMultipartUploadWithContext(ctx aws.Context, input *CreateMultipartUploadInput, opts ...request.Option) (*CreateMultipartUploadOutput, error) { - req, out := c.CreateMultipartUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucket = "DeleteBucket" - -// DeleteBucketRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucket operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucket for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucket method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketRequest method. -// req, resp := client.DeleteBucketRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket -func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request, output *DeleteBucketOutput) { - op := &request.Operation{ - Name: opDeleteBucket, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}", - } - - if input == nil { - input = &DeleteBucketInput{} - } - - output = &DeleteBucketOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucket API operation for Amazon Simple Storage Service. -// -// Deletes the bucket. All objects (including all object versions and Delete -// Markers) in the bucket must be deleted before the bucket itself can be deleted. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucket for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket -func (c *S3) DeleteBucket(input *DeleteBucketInput) (*DeleteBucketOutput, error) { - req, out := c.DeleteBucketRequest(input) - return out, req.Send() -} - -// DeleteBucketWithContext is the same as DeleteBucket with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucket 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 *S3) DeleteBucketWithContext(ctx aws.Context, input *DeleteBucketInput, opts ...request.Option) (*DeleteBucketOutput, error) { - req, out := c.DeleteBucketRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketAnalyticsConfiguration = "DeleteBucketAnalyticsConfiguration" - -// DeleteBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketAnalyticsConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketAnalyticsConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketAnalyticsConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketAnalyticsConfigurationRequest method. -// req, resp := client.DeleteBucketAnalyticsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration -func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyticsConfigurationInput) (req *request.Request, output *DeleteBucketAnalyticsConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteBucketAnalyticsConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &DeleteBucketAnalyticsConfigurationInput{} - } - - output = &DeleteBucketAnalyticsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. -// -// Deletes an analytics configuration for the bucket (specified by the analytics -// configuration ID). -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketAnalyticsConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration -func (c *S3) DeleteBucketAnalyticsConfiguration(input *DeleteBucketAnalyticsConfigurationInput) (*DeleteBucketAnalyticsConfigurationOutput, error) { - req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) - return out, req.Send() -} - -// DeleteBucketAnalyticsConfigurationWithContext is the same as DeleteBucketAnalyticsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketAnalyticsConfiguration 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 *S3) DeleteBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *DeleteBucketAnalyticsConfigurationInput, opts ...request.Option) (*DeleteBucketAnalyticsConfigurationOutput, error) { - req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketCors = "DeleteBucketCors" - -// DeleteBucketCorsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketCors operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketCors for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketCors method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketCorsRequest method. -// req, resp := client.DeleteBucketCorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors -func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request.Request, output *DeleteBucketCorsOutput) { - op := &request.Operation{ - Name: opDeleteBucketCors, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?cors", - } - - if input == nil { - input = &DeleteBucketCorsInput{} - } - - output = &DeleteBucketCorsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketCors API operation for Amazon Simple Storage Service. -// -// Deletes the cors configuration information set for the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketCors for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors -func (c *S3) DeleteBucketCors(input *DeleteBucketCorsInput) (*DeleteBucketCorsOutput, error) { - req, out := c.DeleteBucketCorsRequest(input) - return out, req.Send() -} - -// DeleteBucketCorsWithContext is the same as DeleteBucketCors with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketCors 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 *S3) DeleteBucketCorsWithContext(ctx aws.Context, input *DeleteBucketCorsInput, opts ...request.Option) (*DeleteBucketCorsOutput, error) { - req, out := c.DeleteBucketCorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketInventoryConfiguration = "DeleteBucketInventoryConfiguration" - -// DeleteBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketInventoryConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketInventoryConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketInventoryConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketInventoryConfigurationRequest method. -// req, resp := client.DeleteBucketInventoryConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration -func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInventoryConfigurationInput) (req *request.Request, output *DeleteBucketInventoryConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteBucketInventoryConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &DeleteBucketInventoryConfigurationInput{} - } - - output = &DeleteBucketInventoryConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketInventoryConfiguration API operation for Amazon Simple Storage Service. -// -// Deletes an inventory configuration (identified by the inventory ID) from -// the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketInventoryConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration -func (c *S3) DeleteBucketInventoryConfiguration(input *DeleteBucketInventoryConfigurationInput) (*DeleteBucketInventoryConfigurationOutput, error) { - req, out := c.DeleteBucketInventoryConfigurationRequest(input) - return out, req.Send() -} - -// DeleteBucketInventoryConfigurationWithContext is the same as DeleteBucketInventoryConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketInventoryConfiguration 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 *S3) DeleteBucketInventoryConfigurationWithContext(ctx aws.Context, input *DeleteBucketInventoryConfigurationInput, opts ...request.Option) (*DeleteBucketInventoryConfigurationOutput, error) { - req, out := c.DeleteBucketInventoryConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketLifecycle = "DeleteBucketLifecycle" - -// DeleteBucketLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketLifecycle operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketLifecycle for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketLifecycle method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketLifecycleRequest method. -// req, resp := client.DeleteBucketLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle -func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (req *request.Request, output *DeleteBucketLifecycleOutput) { - op := &request.Operation{ - Name: opDeleteBucketLifecycle, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &DeleteBucketLifecycleInput{} - } - - output = &DeleteBucketLifecycleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketLifecycle API operation for Amazon Simple Storage Service. -// -// Deletes the lifecycle configuration from the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketLifecycle for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle -func (c *S3) DeleteBucketLifecycle(input *DeleteBucketLifecycleInput) (*DeleteBucketLifecycleOutput, error) { - req, out := c.DeleteBucketLifecycleRequest(input) - return out, req.Send() -} - -// DeleteBucketLifecycleWithContext is the same as DeleteBucketLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketLifecycle 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 *S3) DeleteBucketLifecycleWithContext(ctx aws.Context, input *DeleteBucketLifecycleInput, opts ...request.Option) (*DeleteBucketLifecycleOutput, error) { - req, out := c.DeleteBucketLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketMetricsConfiguration = "DeleteBucketMetricsConfiguration" - -// DeleteBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketMetricsConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketMetricsConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketMetricsConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketMetricsConfigurationRequest method. -// req, resp := client.DeleteBucketMetricsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration -func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsConfigurationInput) (req *request.Request, output *DeleteBucketMetricsConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteBucketMetricsConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &DeleteBucketMetricsConfigurationInput{} - } - - output = &DeleteBucketMetricsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketMetricsConfiguration API operation for Amazon Simple Storage Service. -// -// Deletes a metrics configuration (specified by the metrics configuration ID) -// from the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketMetricsConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration -func (c *S3) DeleteBucketMetricsConfiguration(input *DeleteBucketMetricsConfigurationInput) (*DeleteBucketMetricsConfigurationOutput, error) { - req, out := c.DeleteBucketMetricsConfigurationRequest(input) - return out, req.Send() -} - -// DeleteBucketMetricsConfigurationWithContext is the same as DeleteBucketMetricsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketMetricsConfiguration 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 *S3) DeleteBucketMetricsConfigurationWithContext(ctx aws.Context, input *DeleteBucketMetricsConfigurationInput, opts ...request.Option) (*DeleteBucketMetricsConfigurationOutput, error) { - req, out := c.DeleteBucketMetricsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketPolicy = "DeleteBucketPolicy" - -// DeleteBucketPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketPolicyRequest method. -// req, resp := client.DeleteBucketPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy -func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *request.Request, output *DeleteBucketPolicyOutput) { - op := &request.Operation{ - Name: opDeleteBucketPolicy, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?policy", - } - - if input == nil { - input = &DeleteBucketPolicyInput{} - } - - output = &DeleteBucketPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketPolicy API operation for Amazon Simple Storage Service. -// -// Deletes the policy from the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy -func (c *S3) DeleteBucketPolicy(input *DeleteBucketPolicyInput) (*DeleteBucketPolicyOutput, error) { - req, out := c.DeleteBucketPolicyRequest(input) - return out, req.Send() -} - -// DeleteBucketPolicyWithContext is the same as DeleteBucketPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketPolicy 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 *S3) DeleteBucketPolicyWithContext(ctx aws.Context, input *DeleteBucketPolicyInput, opts ...request.Option) (*DeleteBucketPolicyOutput, error) { - req, out := c.DeleteBucketPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketReplication = "DeleteBucketReplication" - -// DeleteBucketReplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketReplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketReplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketReplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketReplicationRequest method. -// req, resp := client.DeleteBucketReplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication -func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) (req *request.Request, output *DeleteBucketReplicationOutput) { - op := &request.Operation{ - Name: opDeleteBucketReplication, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?replication", - } - - if input == nil { - input = &DeleteBucketReplicationInput{} - } - - output = &DeleteBucketReplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketReplication API operation for Amazon Simple Storage Service. -// -// Deletes the replication configuration from the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketReplication for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication -func (c *S3) DeleteBucketReplication(input *DeleteBucketReplicationInput) (*DeleteBucketReplicationOutput, error) { - req, out := c.DeleteBucketReplicationRequest(input) - return out, req.Send() -} - -// DeleteBucketReplicationWithContext is the same as DeleteBucketReplication with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketReplication 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 *S3) DeleteBucketReplicationWithContext(ctx aws.Context, input *DeleteBucketReplicationInput, opts ...request.Option) (*DeleteBucketReplicationOutput, error) { - req, out := c.DeleteBucketReplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketTagging = "DeleteBucketTagging" - -// DeleteBucketTaggingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketTagging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketTagging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketTagging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketTaggingRequest method. -// req, resp := client.DeleteBucketTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging -func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *request.Request, output *DeleteBucketTaggingOutput) { - op := &request.Operation{ - Name: opDeleteBucketTagging, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?tagging", - } - - if input == nil { - input = &DeleteBucketTaggingInput{} - } - - output = &DeleteBucketTaggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketTagging API operation for Amazon Simple Storage Service. -// -// Deletes the tags from the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketTagging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging -func (c *S3) DeleteBucketTagging(input *DeleteBucketTaggingInput) (*DeleteBucketTaggingOutput, error) { - req, out := c.DeleteBucketTaggingRequest(input) - return out, req.Send() -} - -// DeleteBucketTaggingWithContext is the same as DeleteBucketTagging with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketTagging 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 *S3) DeleteBucketTaggingWithContext(ctx aws.Context, input *DeleteBucketTaggingInput, opts ...request.Option) (*DeleteBucketTaggingOutput, error) { - req, out := c.DeleteBucketTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketWebsite = "DeleteBucketWebsite" - -// DeleteBucketWebsiteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketWebsite operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteBucketWebsite for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteBucketWebsite method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteBucketWebsiteRequest method. -// req, resp := client.DeleteBucketWebsiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite -func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *request.Request, output *DeleteBucketWebsiteOutput) { - op := &request.Operation{ - Name: opDeleteBucketWebsite, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?website", - } - - if input == nil { - input = &DeleteBucketWebsiteInput{} - } - - output = &DeleteBucketWebsiteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketWebsite API operation for Amazon Simple Storage Service. -// -// This operation removes the website configuration from the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteBucketWebsite for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite -func (c *S3) DeleteBucketWebsite(input *DeleteBucketWebsiteInput) (*DeleteBucketWebsiteOutput, error) { - req, out := c.DeleteBucketWebsiteRequest(input) - return out, req.Send() -} - -// DeleteBucketWebsiteWithContext is the same as DeleteBucketWebsite with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketWebsite 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 *S3) DeleteBucketWebsiteWithContext(ctx aws.Context, input *DeleteBucketWebsiteInput, opts ...request.Option) (*DeleteBucketWebsiteOutput, error) { - req, out := c.DeleteBucketWebsiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteObject = "DeleteObject" - -// DeleteObjectRequest generates a "aws/request.Request" representing the -// client's request for the DeleteObject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteObject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteObject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteObjectRequest method. -// req, resp := client.DeleteObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject -func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request, output *DeleteObjectOutput) { - op := &request.Operation{ - Name: opDeleteObject, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &DeleteObjectInput{} - } - - output = &DeleteObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteObject API operation for Amazon Simple Storage Service. -// -// Removes the null version (if there is one) of an object and inserts a delete -// marker, which becomes the latest version of the object. If there isn't a -// null version, Amazon S3 does not remove any objects. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteObject for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject -func (c *S3) DeleteObject(input *DeleteObjectInput) (*DeleteObjectOutput, error) { - req, out := c.DeleteObjectRequest(input) - return out, req.Send() -} - -// DeleteObjectWithContext is the same as DeleteObject with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteObject 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 *S3) DeleteObjectWithContext(ctx aws.Context, input *DeleteObjectInput, opts ...request.Option) (*DeleteObjectOutput, error) { - req, out := c.DeleteObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteObjectTagging = "DeleteObjectTagging" - -// DeleteObjectTaggingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteObjectTagging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteObjectTagging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteObjectTagging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteObjectTaggingRequest method. -// req, resp := client.DeleteObjectTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging -func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *request.Request, output *DeleteObjectTaggingOutput) { - op := &request.Operation{ - Name: opDeleteObjectTagging, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}/{Key+}?tagging", - } - - if input == nil { - input = &DeleteObjectTaggingInput{} - } - - output = &DeleteObjectTaggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteObjectTagging API operation for Amazon Simple Storage Service. -// -// Removes the tag-set from an existing object. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteObjectTagging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging -func (c *S3) DeleteObjectTagging(input *DeleteObjectTaggingInput) (*DeleteObjectTaggingOutput, error) { - req, out := c.DeleteObjectTaggingRequest(input) - return out, req.Send() -} - -// DeleteObjectTaggingWithContext is the same as DeleteObjectTagging with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteObjectTagging 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 *S3) DeleteObjectTaggingWithContext(ctx aws.Context, input *DeleteObjectTaggingInput, opts ...request.Option) (*DeleteObjectTaggingOutput, error) { - req, out := c.DeleteObjectTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteObjects = "DeleteObjects" - -// DeleteObjectsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteObjects operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteObjects for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteObjects method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteObjectsRequest method. -// req, resp := client.DeleteObjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects -func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Request, output *DeleteObjectsOutput) { - op := &request.Operation{ - Name: opDeleteObjects, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}?delete", - } - - if input == nil { - input = &DeleteObjectsInput{} - } - - output = &DeleteObjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteObjects API operation for Amazon Simple Storage Service. -// -// This operation enables you to delete multiple objects from a bucket using -// a single HTTP request. You may specify up to 1000 keys. -// -// 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 Amazon Simple Storage Service's -// API operation DeleteObjects for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects -func (c *S3) DeleteObjects(input *DeleteObjectsInput) (*DeleteObjectsOutput, error) { - req, out := c.DeleteObjectsRequest(input) - return out, req.Send() -} - -// DeleteObjectsWithContext is the same as DeleteObjects with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteObjects 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 *S3) DeleteObjectsWithContext(ctx aws.Context, input *DeleteObjectsInput, opts ...request.Option) (*DeleteObjectsOutput, error) { - req, out := c.DeleteObjectsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" - -// GetBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketAccelerateConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketAccelerateConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketAccelerateConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketAccelerateConfigurationRequest method. -// req, resp := client.GetBucketAccelerateConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration -func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateConfigurationInput) (req *request.Request, output *GetBucketAccelerateConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketAccelerateConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?accelerate", - } - - if input == nil { - input = &GetBucketAccelerateConfigurationInput{} - } - - output = &GetBucketAccelerateConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. -// -// Returns the accelerate configuration of a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketAccelerateConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration -func (c *S3) GetBucketAccelerateConfiguration(input *GetBucketAccelerateConfigurationInput) (*GetBucketAccelerateConfigurationOutput, error) { - req, out := c.GetBucketAccelerateConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketAccelerateConfigurationWithContext is the same as GetBucketAccelerateConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketAccelerateConfiguration 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 *S3) GetBucketAccelerateConfigurationWithContext(ctx aws.Context, input *GetBucketAccelerateConfigurationInput, opts ...request.Option) (*GetBucketAccelerateConfigurationOutput, error) { - req, out := c.GetBucketAccelerateConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketAcl = "GetBucketAcl" - -// GetBucketAclRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketAcl operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketAcl for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketAcl method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketAclRequest method. -// req, resp := client.GetBucketAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl -func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request, output *GetBucketAclOutput) { - op := &request.Operation{ - Name: opGetBucketAcl, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?acl", - } - - if input == nil { - input = &GetBucketAclInput{} - } - - output = &GetBucketAclOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketAcl API operation for Amazon Simple Storage Service. -// -// Gets the access control policy for the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketAcl for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl -func (c *S3) GetBucketAcl(input *GetBucketAclInput) (*GetBucketAclOutput, error) { - req, out := c.GetBucketAclRequest(input) - return out, req.Send() -} - -// GetBucketAclWithContext is the same as GetBucketAcl with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketAcl 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 *S3) GetBucketAclWithContext(ctx aws.Context, input *GetBucketAclInput, opts ...request.Option) (*GetBucketAclOutput, error) { - req, out := c.GetBucketAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketAnalyticsConfiguration = "GetBucketAnalyticsConfiguration" - -// GetBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketAnalyticsConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketAnalyticsConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketAnalyticsConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketAnalyticsConfigurationRequest method. -// req, resp := client.GetBucketAnalyticsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration -func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsConfigurationInput) (req *request.Request, output *GetBucketAnalyticsConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketAnalyticsConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &GetBucketAnalyticsConfigurationInput{} - } - - output = &GetBucketAnalyticsConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. -// -// Gets an analytics configuration for the bucket (specified by the analytics -// configuration ID). -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketAnalyticsConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration -func (c *S3) GetBucketAnalyticsConfiguration(input *GetBucketAnalyticsConfigurationInput) (*GetBucketAnalyticsConfigurationOutput, error) { - req, out := c.GetBucketAnalyticsConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketAnalyticsConfigurationWithContext is the same as GetBucketAnalyticsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketAnalyticsConfiguration 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 *S3) GetBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *GetBucketAnalyticsConfigurationInput, opts ...request.Option) (*GetBucketAnalyticsConfigurationOutput, error) { - req, out := c.GetBucketAnalyticsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketCors = "GetBucketCors" - -// GetBucketCorsRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketCors operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketCors for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketCors method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketCorsRequest method. -// req, resp := client.GetBucketCorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors -func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Request, output *GetBucketCorsOutput) { - op := &request.Operation{ - Name: opGetBucketCors, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?cors", - } - - if input == nil { - input = &GetBucketCorsInput{} - } - - output = &GetBucketCorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketCors API operation for Amazon Simple Storage Service. -// -// Returns the cors configuration for the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketCors for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors -func (c *S3) GetBucketCors(input *GetBucketCorsInput) (*GetBucketCorsOutput, error) { - req, out := c.GetBucketCorsRequest(input) - return out, req.Send() -} - -// GetBucketCorsWithContext is the same as GetBucketCors with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketCors 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 *S3) GetBucketCorsWithContext(ctx aws.Context, input *GetBucketCorsInput, opts ...request.Option) (*GetBucketCorsOutput, error) { - req, out := c.GetBucketCorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketInventoryConfiguration = "GetBucketInventoryConfiguration" - -// GetBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketInventoryConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketInventoryConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketInventoryConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketInventoryConfigurationRequest method. -// req, resp := client.GetBucketInventoryConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration -func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryConfigurationInput) (req *request.Request, output *GetBucketInventoryConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketInventoryConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &GetBucketInventoryConfigurationInput{} - } - - output = &GetBucketInventoryConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketInventoryConfiguration API operation for Amazon Simple Storage Service. -// -// Returns an inventory configuration (identified by the inventory ID) from -// the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketInventoryConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration -func (c *S3) GetBucketInventoryConfiguration(input *GetBucketInventoryConfigurationInput) (*GetBucketInventoryConfigurationOutput, error) { - req, out := c.GetBucketInventoryConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketInventoryConfigurationWithContext is the same as GetBucketInventoryConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketInventoryConfiguration 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 *S3) GetBucketInventoryConfigurationWithContext(ctx aws.Context, input *GetBucketInventoryConfigurationInput, opts ...request.Option) (*GetBucketInventoryConfigurationOutput, error) { - req, out := c.GetBucketInventoryConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLifecycle = "GetBucketLifecycle" - -// GetBucketLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLifecycle operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketLifecycle for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketLifecycle method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketLifecycleRequest method. -// req, resp := client.GetBucketLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle -func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *request.Request, output *GetBucketLifecycleOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, GetBucketLifecycle, has been deprecated") - } - op := &request.Operation{ - Name: opGetBucketLifecycle, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &GetBucketLifecycleInput{} - } - - output = &GetBucketLifecycleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLifecycle API operation for Amazon Simple Storage Service. -// -// Deprecated, see the GetBucketLifecycleConfiguration operation. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketLifecycle for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle -func (c *S3) GetBucketLifecycle(input *GetBucketLifecycleInput) (*GetBucketLifecycleOutput, error) { - req, out := c.GetBucketLifecycleRequest(input) - return out, req.Send() -} - -// GetBucketLifecycleWithContext is the same as GetBucketLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLifecycle 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 *S3) GetBucketLifecycleWithContext(ctx aws.Context, input *GetBucketLifecycleInput, opts ...request.Option) (*GetBucketLifecycleOutput, error) { - req, out := c.GetBucketLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLifecycleConfiguration = "GetBucketLifecycleConfiguration" - -// GetBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLifecycleConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketLifecycleConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketLifecycleConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketLifecycleConfigurationRequest method. -// req, resp := client.GetBucketLifecycleConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration -func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleConfigurationInput) (req *request.Request, output *GetBucketLifecycleConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketLifecycleConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &GetBucketLifecycleConfigurationInput{} - } - - output = &GetBucketLifecycleConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. -// -// Returns the lifecycle configuration information set on the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketLifecycleConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration -func (c *S3) GetBucketLifecycleConfiguration(input *GetBucketLifecycleConfigurationInput) (*GetBucketLifecycleConfigurationOutput, error) { - req, out := c.GetBucketLifecycleConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketLifecycleConfigurationWithContext is the same as GetBucketLifecycleConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLifecycleConfiguration 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 *S3) GetBucketLifecycleConfigurationWithContext(ctx aws.Context, input *GetBucketLifecycleConfigurationInput, opts ...request.Option) (*GetBucketLifecycleConfigurationOutput, error) { - req, out := c.GetBucketLifecycleConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLocation = "GetBucketLocation" - -// GetBucketLocationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLocation operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketLocation for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketLocation method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketLocationRequest method. -// req, resp := client.GetBucketLocationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation -func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *request.Request, output *GetBucketLocationOutput) { - op := &request.Operation{ - Name: opGetBucketLocation, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?location", - } - - if input == nil { - input = &GetBucketLocationInput{} - } - - output = &GetBucketLocationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLocation API operation for Amazon Simple Storage Service. -// -// Returns the region the bucket resides in. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketLocation for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation -func (c *S3) GetBucketLocation(input *GetBucketLocationInput) (*GetBucketLocationOutput, error) { - req, out := c.GetBucketLocationRequest(input) - return out, req.Send() -} - -// GetBucketLocationWithContext is the same as GetBucketLocation with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLocation 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 *S3) GetBucketLocationWithContext(ctx aws.Context, input *GetBucketLocationInput, opts ...request.Option) (*GetBucketLocationOutput, error) { - req, out := c.GetBucketLocationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLogging = "GetBucketLogging" - -// GetBucketLoggingRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLogging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketLogging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketLogging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketLoggingRequest method. -// req, resp := client.GetBucketLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging -func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request.Request, output *GetBucketLoggingOutput) { - op := &request.Operation{ - Name: opGetBucketLogging, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?logging", - } - - if input == nil { - input = &GetBucketLoggingInput{} - } - - output = &GetBucketLoggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLogging API operation for Amazon Simple Storage Service. -// -// Returns the logging status of a bucket and the permissions users have to -// view and modify that status. To use GET, you must be the bucket owner. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketLogging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging -func (c *S3) GetBucketLogging(input *GetBucketLoggingInput) (*GetBucketLoggingOutput, error) { - req, out := c.GetBucketLoggingRequest(input) - return out, req.Send() -} - -// GetBucketLoggingWithContext is the same as GetBucketLogging with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLogging 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 *S3) GetBucketLoggingWithContext(ctx aws.Context, input *GetBucketLoggingInput, opts ...request.Option) (*GetBucketLoggingOutput, error) { - req, out := c.GetBucketLoggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketMetricsConfiguration = "GetBucketMetricsConfiguration" - -// GetBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketMetricsConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketMetricsConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketMetricsConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketMetricsConfigurationRequest method. -// req, resp := client.GetBucketMetricsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration -func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigurationInput) (req *request.Request, output *GetBucketMetricsConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketMetricsConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &GetBucketMetricsConfigurationInput{} - } - - output = &GetBucketMetricsConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketMetricsConfiguration API operation for Amazon Simple Storage Service. -// -// Gets a metrics configuration (specified by the metrics configuration ID) -// from the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketMetricsConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration -func (c *S3) GetBucketMetricsConfiguration(input *GetBucketMetricsConfigurationInput) (*GetBucketMetricsConfigurationOutput, error) { - req, out := c.GetBucketMetricsConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketMetricsConfigurationWithContext is the same as GetBucketMetricsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketMetricsConfiguration 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 *S3) GetBucketMetricsConfigurationWithContext(ctx aws.Context, input *GetBucketMetricsConfigurationInput, opts ...request.Option) (*GetBucketMetricsConfigurationOutput, error) { - req, out := c.GetBucketMetricsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketNotification = "GetBucketNotification" - -// GetBucketNotificationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketNotification operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketNotification for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketNotification method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketNotificationRequest method. -// req, resp := client.GetBucketNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification -func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfigurationDeprecated) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, GetBucketNotification, has been deprecated") - } - op := &request.Operation{ - Name: opGetBucketNotification, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &GetBucketNotificationConfigurationRequest{} - } - - output = &NotificationConfigurationDeprecated{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketNotification API operation for Amazon Simple Storage Service. -// -// Deprecated, see the GetBucketNotificationConfiguration operation. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketNotification for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification -func (c *S3) GetBucketNotification(input *GetBucketNotificationConfigurationRequest) (*NotificationConfigurationDeprecated, error) { - req, out := c.GetBucketNotificationRequest(input) - return out, req.Send() -} - -// GetBucketNotificationWithContext is the same as GetBucketNotification with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketNotification 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 *S3) GetBucketNotificationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfigurationDeprecated, error) { - req, out := c.GetBucketNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketNotificationConfiguration = "GetBucketNotificationConfiguration" - -// GetBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketNotificationConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketNotificationConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketNotificationConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketNotificationConfigurationRequest method. -// req, resp := client.GetBucketNotificationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration -func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfiguration) { - op := &request.Operation{ - Name: opGetBucketNotificationConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &GetBucketNotificationConfigurationRequest{} - } - - output = &NotificationConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketNotificationConfiguration API operation for Amazon Simple Storage Service. -// -// Returns the notification configuration of a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketNotificationConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration -func (c *S3) GetBucketNotificationConfiguration(input *GetBucketNotificationConfigurationRequest) (*NotificationConfiguration, error) { - req, out := c.GetBucketNotificationConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketNotificationConfigurationWithContext is the same as GetBucketNotificationConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketNotificationConfiguration 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 *S3) GetBucketNotificationConfigurationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfiguration, error) { - req, out := c.GetBucketNotificationConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketPolicy = "GetBucketPolicy" - -// GetBucketPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketPolicyRequest method. -// req, resp := client.GetBucketPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy -func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.Request, output *GetBucketPolicyOutput) { - op := &request.Operation{ - Name: opGetBucketPolicy, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?policy", - } - - if input == nil { - input = &GetBucketPolicyInput{} - } - - output = &GetBucketPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketPolicy API operation for Amazon Simple Storage Service. -// -// Returns the policy of a specified bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy -func (c *S3) GetBucketPolicy(input *GetBucketPolicyInput) (*GetBucketPolicyOutput, error) { - req, out := c.GetBucketPolicyRequest(input) - return out, req.Send() -} - -// GetBucketPolicyWithContext is the same as GetBucketPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketPolicy 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 *S3) GetBucketPolicyWithContext(ctx aws.Context, input *GetBucketPolicyInput, opts ...request.Option) (*GetBucketPolicyOutput, error) { - req, out := c.GetBucketPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketReplication = "GetBucketReplication" - -// GetBucketReplicationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketReplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketReplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketReplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketReplicationRequest method. -// req, resp := client.GetBucketReplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication -func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req *request.Request, output *GetBucketReplicationOutput) { - op := &request.Operation{ - Name: opGetBucketReplication, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?replication", - } - - if input == nil { - input = &GetBucketReplicationInput{} - } - - output = &GetBucketReplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketReplication API operation for Amazon Simple Storage Service. -// -// Returns the replication configuration of a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketReplication for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication -func (c *S3) GetBucketReplication(input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error) { - req, out := c.GetBucketReplicationRequest(input) - return out, req.Send() -} - -// GetBucketReplicationWithContext is the same as GetBucketReplication with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketReplication 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 *S3) GetBucketReplicationWithContext(ctx aws.Context, input *GetBucketReplicationInput, opts ...request.Option) (*GetBucketReplicationOutput, error) { - req, out := c.GetBucketReplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketRequestPayment = "GetBucketRequestPayment" - -// GetBucketRequestPaymentRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketRequestPayment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketRequestPayment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketRequestPayment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketRequestPaymentRequest method. -// req, resp := client.GetBucketRequestPaymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment -func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) (req *request.Request, output *GetBucketRequestPaymentOutput) { - op := &request.Operation{ - Name: opGetBucketRequestPayment, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?requestPayment", - } - - if input == nil { - input = &GetBucketRequestPaymentInput{} - } - - output = &GetBucketRequestPaymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketRequestPayment API operation for Amazon Simple Storage Service. -// -// Returns the request payment configuration of a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketRequestPayment for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment -func (c *S3) GetBucketRequestPayment(input *GetBucketRequestPaymentInput) (*GetBucketRequestPaymentOutput, error) { - req, out := c.GetBucketRequestPaymentRequest(input) - return out, req.Send() -} - -// GetBucketRequestPaymentWithContext is the same as GetBucketRequestPayment with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketRequestPayment 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 *S3) GetBucketRequestPaymentWithContext(ctx aws.Context, input *GetBucketRequestPaymentInput, opts ...request.Option) (*GetBucketRequestPaymentOutput, error) { - req, out := c.GetBucketRequestPaymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketTagging = "GetBucketTagging" - -// GetBucketTaggingRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketTagging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketTagging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketTagging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketTaggingRequest method. -// req, resp := client.GetBucketTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging -func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request.Request, output *GetBucketTaggingOutput) { - op := &request.Operation{ - Name: opGetBucketTagging, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?tagging", - } - - if input == nil { - input = &GetBucketTaggingInput{} - } - - output = &GetBucketTaggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketTagging API operation for Amazon Simple Storage Service. -// -// Returns the tag set associated with the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketTagging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging -func (c *S3) GetBucketTagging(input *GetBucketTaggingInput) (*GetBucketTaggingOutput, error) { - req, out := c.GetBucketTaggingRequest(input) - return out, req.Send() -} - -// GetBucketTaggingWithContext is the same as GetBucketTagging with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketTagging 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 *S3) GetBucketTaggingWithContext(ctx aws.Context, input *GetBucketTaggingInput, opts ...request.Option) (*GetBucketTaggingOutput, error) { - req, out := c.GetBucketTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketVersioning = "GetBucketVersioning" - -// GetBucketVersioningRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketVersioning operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketVersioning for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketVersioning method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketVersioningRequest method. -// req, resp := client.GetBucketVersioningRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning -func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *request.Request, output *GetBucketVersioningOutput) { - op := &request.Operation{ - Name: opGetBucketVersioning, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?versioning", - } - - if input == nil { - input = &GetBucketVersioningInput{} - } - - output = &GetBucketVersioningOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketVersioning API operation for Amazon Simple Storage Service. -// -// Returns the versioning state of a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketVersioning for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning -func (c *S3) GetBucketVersioning(input *GetBucketVersioningInput) (*GetBucketVersioningOutput, error) { - req, out := c.GetBucketVersioningRequest(input) - return out, req.Send() -} - -// GetBucketVersioningWithContext is the same as GetBucketVersioning with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketVersioning 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 *S3) GetBucketVersioningWithContext(ctx aws.Context, input *GetBucketVersioningInput, opts ...request.Option) (*GetBucketVersioningOutput, error) { - req, out := c.GetBucketVersioningRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketWebsite = "GetBucketWebsite" - -// GetBucketWebsiteRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketWebsite operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetBucketWebsite for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetBucketWebsite method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetBucketWebsiteRequest method. -// req, resp := client.GetBucketWebsiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite -func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request.Request, output *GetBucketWebsiteOutput) { - op := &request.Operation{ - Name: opGetBucketWebsite, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?website", - } - - if input == nil { - input = &GetBucketWebsiteInput{} - } - - output = &GetBucketWebsiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketWebsite API operation for Amazon Simple Storage Service. -// -// Returns the website configuration for a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetBucketWebsite for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite -func (c *S3) GetBucketWebsite(input *GetBucketWebsiteInput) (*GetBucketWebsiteOutput, error) { - req, out := c.GetBucketWebsiteRequest(input) - return out, req.Send() -} - -// GetBucketWebsiteWithContext is the same as GetBucketWebsite with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketWebsite 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 *S3) GetBucketWebsiteWithContext(ctx aws.Context, input *GetBucketWebsiteInput, opts ...request.Option) (*GetBucketWebsiteOutput, error) { - req, out := c.GetBucketWebsiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObject = "GetObject" - -// GetObjectRequest generates a "aws/request.Request" representing the -// client's request for the GetObject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetObject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetObject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetObjectRequest method. -// req, resp := client.GetObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject -func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, output *GetObjectOutput) { - op := &request.Operation{ - Name: opGetObject, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &GetObjectInput{} - } - - output = &GetObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObject API operation for Amazon Simple Storage Service. -// -// Retrieves objects from Amazon S3. -// -// 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 Amazon Simple Storage Service's -// API operation GetObject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject -func (c *S3) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { - req, out := c.GetObjectRequest(input) - return out, req.Send() -} - -// GetObjectWithContext is the same as GetObject with the addition of -// the ability to pass a context and additional request options. -// -// See GetObject 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 *S3) GetObjectWithContext(ctx aws.Context, input *GetObjectInput, opts ...request.Option) (*GetObjectOutput, error) { - req, out := c.GetObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectAcl = "GetObjectAcl" - -// GetObjectAclRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectAcl operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetObjectAcl for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetObjectAcl method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetObjectAclRequest method. -// req, resp := client.GetObjectAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl -func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request, output *GetObjectAclOutput) { - op := &request.Operation{ - Name: opGetObjectAcl, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?acl", - } - - if input == nil { - input = &GetObjectAclInput{} - } - - output = &GetObjectAclOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectAcl API operation for Amazon Simple Storage Service. -// -// Returns the access control list (ACL) of an object. -// -// 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 Amazon Simple Storage Service's -// API operation GetObjectAcl for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl -func (c *S3) GetObjectAcl(input *GetObjectAclInput) (*GetObjectAclOutput, error) { - req, out := c.GetObjectAclRequest(input) - return out, req.Send() -} - -// GetObjectAclWithContext is the same as GetObjectAcl with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectAcl 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 *S3) GetObjectAclWithContext(ctx aws.Context, input *GetObjectAclInput, opts ...request.Option) (*GetObjectAclOutput, error) { - req, out := c.GetObjectAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectTagging = "GetObjectTagging" - -// GetObjectTaggingRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectTagging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetObjectTagging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetObjectTagging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetObjectTaggingRequest method. -// req, resp := client.GetObjectTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging -func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request.Request, output *GetObjectTaggingOutput) { - op := &request.Operation{ - Name: opGetObjectTagging, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?tagging", - } - - if input == nil { - input = &GetObjectTaggingInput{} - } - - output = &GetObjectTaggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectTagging API operation for Amazon Simple Storage Service. -// -// Returns the tag-set of an object. -// -// 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 Amazon Simple Storage Service's -// API operation GetObjectTagging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging -func (c *S3) GetObjectTagging(input *GetObjectTaggingInput) (*GetObjectTaggingOutput, error) { - req, out := c.GetObjectTaggingRequest(input) - return out, req.Send() -} - -// GetObjectTaggingWithContext is the same as GetObjectTagging with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectTagging 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 *S3) GetObjectTaggingWithContext(ctx aws.Context, input *GetObjectTaggingInput, opts ...request.Option) (*GetObjectTaggingOutput, error) { - req, out := c.GetObjectTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectTorrent = "GetObjectTorrent" - -// GetObjectTorrentRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectTorrent operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetObjectTorrent for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetObjectTorrent method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetObjectTorrentRequest method. -// req, resp := client.GetObjectTorrentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent -func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request.Request, output *GetObjectTorrentOutput) { - op := &request.Operation{ - Name: opGetObjectTorrent, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?torrent", - } - - if input == nil { - input = &GetObjectTorrentInput{} - } - - output = &GetObjectTorrentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectTorrent API operation for Amazon Simple Storage Service. -// -// Return torrent files from a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation GetObjectTorrent for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent -func (c *S3) GetObjectTorrent(input *GetObjectTorrentInput) (*GetObjectTorrentOutput, error) { - req, out := c.GetObjectTorrentRequest(input) - return out, req.Send() -} - -// GetObjectTorrentWithContext is the same as GetObjectTorrent with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectTorrent 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 *S3) GetObjectTorrentWithContext(ctx aws.Context, input *GetObjectTorrentInput, opts ...request.Option) (*GetObjectTorrentOutput, error) { - req, out := c.GetObjectTorrentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opHeadBucket = "HeadBucket" - -// HeadBucketRequest generates a "aws/request.Request" representing the -// client's request for the HeadBucket operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See HeadBucket for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the HeadBucket method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the HeadBucketRequest method. -// req, resp := client.HeadBucketRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket -func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, output *HeadBucketOutput) { - op := &request.Operation{ - Name: opHeadBucket, - HTTPMethod: "HEAD", - HTTPPath: "/{Bucket}", - } - - if input == nil { - input = &HeadBucketInput{} - } - - output = &HeadBucketOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// HeadBucket API operation for Amazon Simple Storage Service. -// -// This operation is useful to determine if a bucket exists and you have permission -// to access it. -// -// 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 Amazon Simple Storage Service's -// API operation HeadBucket for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchBucket "NoSuchBucket" -// The specified bucket does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket -func (c *S3) HeadBucket(input *HeadBucketInput) (*HeadBucketOutput, error) { - req, out := c.HeadBucketRequest(input) - return out, req.Send() -} - -// HeadBucketWithContext is the same as HeadBucket with the addition of -// the ability to pass a context and additional request options. -// -// See HeadBucket 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 *S3) HeadBucketWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.Option) (*HeadBucketOutput, error) { - req, out := c.HeadBucketRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opHeadObject = "HeadObject" - -// HeadObjectRequest generates a "aws/request.Request" representing the -// client's request for the HeadObject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See HeadObject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the HeadObject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the HeadObjectRequest method. -// req, resp := client.HeadObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject -func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, output *HeadObjectOutput) { - op := &request.Operation{ - Name: opHeadObject, - HTTPMethod: "HEAD", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &HeadObjectInput{} - } - - output = &HeadObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// HeadObject API operation for Amazon Simple Storage Service. -// -// The HEAD operation retrieves metadata from an object without returning the -// object itself. This operation is useful if you're only interested in an object's -// metadata. To use HEAD, you must have READ access to the object. -// -// 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 Amazon Simple Storage Service's -// API operation HeadObject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject -func (c *S3) HeadObject(input *HeadObjectInput) (*HeadObjectOutput, error) { - req, out := c.HeadObjectRequest(input) - return out, req.Send() -} - -// HeadObjectWithContext is the same as HeadObject with the addition of -// the ability to pass a context and additional request options. -// -// See HeadObject 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 *S3) HeadObjectWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.Option) (*HeadObjectOutput, error) { - req, out := c.HeadObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBucketAnalyticsConfigurations = "ListBucketAnalyticsConfigurations" - -// ListBucketAnalyticsConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListBucketAnalyticsConfigurations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBucketAnalyticsConfigurations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBucketAnalyticsConfigurations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBucketAnalyticsConfigurationsRequest method. -// req, resp := client.ListBucketAnalyticsConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations -func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalyticsConfigurationsInput) (req *request.Request, output *ListBucketAnalyticsConfigurationsOutput) { - op := &request.Operation{ - Name: opListBucketAnalyticsConfigurations, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &ListBucketAnalyticsConfigurationsInput{} - } - - output = &ListBucketAnalyticsConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBucketAnalyticsConfigurations API operation for Amazon Simple Storage Service. -// -// Lists the analytics configurations for the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation ListBucketAnalyticsConfigurations for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations -func (c *S3) ListBucketAnalyticsConfigurations(input *ListBucketAnalyticsConfigurationsInput) (*ListBucketAnalyticsConfigurationsOutput, error) { - req, out := c.ListBucketAnalyticsConfigurationsRequest(input) - return out, req.Send() -} - -// ListBucketAnalyticsConfigurationsWithContext is the same as ListBucketAnalyticsConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListBucketAnalyticsConfigurations 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 *S3) ListBucketAnalyticsConfigurationsWithContext(ctx aws.Context, input *ListBucketAnalyticsConfigurationsInput, opts ...request.Option) (*ListBucketAnalyticsConfigurationsOutput, error) { - req, out := c.ListBucketAnalyticsConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBucketInventoryConfigurations = "ListBucketInventoryConfigurations" - -// ListBucketInventoryConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListBucketInventoryConfigurations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBucketInventoryConfigurations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBucketInventoryConfigurations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBucketInventoryConfigurationsRequest method. -// req, resp := client.ListBucketInventoryConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations -func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventoryConfigurationsInput) (req *request.Request, output *ListBucketInventoryConfigurationsOutput) { - op := &request.Operation{ - Name: opListBucketInventoryConfigurations, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &ListBucketInventoryConfigurationsInput{} - } - - output = &ListBucketInventoryConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBucketInventoryConfigurations API operation for Amazon Simple Storage Service. -// -// Returns a list of inventory configurations for the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation ListBucketInventoryConfigurations for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations -func (c *S3) ListBucketInventoryConfigurations(input *ListBucketInventoryConfigurationsInput) (*ListBucketInventoryConfigurationsOutput, error) { - req, out := c.ListBucketInventoryConfigurationsRequest(input) - return out, req.Send() -} - -// ListBucketInventoryConfigurationsWithContext is the same as ListBucketInventoryConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListBucketInventoryConfigurations 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 *S3) ListBucketInventoryConfigurationsWithContext(ctx aws.Context, input *ListBucketInventoryConfigurationsInput, opts ...request.Option) (*ListBucketInventoryConfigurationsOutput, error) { - req, out := c.ListBucketInventoryConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBucketMetricsConfigurations = "ListBucketMetricsConfigurations" - -// ListBucketMetricsConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListBucketMetricsConfigurations operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBucketMetricsConfigurations for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBucketMetricsConfigurations method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBucketMetricsConfigurationsRequest method. -// req, resp := client.ListBucketMetricsConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations -func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConfigurationsInput) (req *request.Request, output *ListBucketMetricsConfigurationsOutput) { - op := &request.Operation{ - Name: opListBucketMetricsConfigurations, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &ListBucketMetricsConfigurationsInput{} - } - - output = &ListBucketMetricsConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBucketMetricsConfigurations API operation for Amazon Simple Storage Service. -// -// Lists the metrics configurations for the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation ListBucketMetricsConfigurations for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations -func (c *S3) ListBucketMetricsConfigurations(input *ListBucketMetricsConfigurationsInput) (*ListBucketMetricsConfigurationsOutput, error) { - req, out := c.ListBucketMetricsConfigurationsRequest(input) - return out, req.Send() -} - -// ListBucketMetricsConfigurationsWithContext is the same as ListBucketMetricsConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListBucketMetricsConfigurations 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 *S3) ListBucketMetricsConfigurationsWithContext(ctx aws.Context, input *ListBucketMetricsConfigurationsInput, opts ...request.Option) (*ListBucketMetricsConfigurationsOutput, error) { - req, out := c.ListBucketMetricsConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBuckets = "ListBuckets" - -// ListBucketsRequest generates a "aws/request.Request" representing the -// client's request for the ListBuckets operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListBuckets for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListBuckets method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListBucketsRequest method. -// req, resp := client.ListBucketsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets -func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request, output *ListBucketsOutput) { - op := &request.Operation{ - Name: opListBuckets, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ListBucketsInput{} - } - - output = &ListBucketsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBuckets API operation for Amazon Simple Storage Service. -// -// Returns a list of all buckets owned by the authenticated sender of the request. -// -// 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 Amazon Simple Storage Service's -// API operation ListBuckets for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets -func (c *S3) ListBuckets(input *ListBucketsInput) (*ListBucketsOutput, error) { - req, out := c.ListBucketsRequest(input) - return out, req.Send() -} - -// ListBucketsWithContext is the same as ListBuckets with the addition of -// the ability to pass a context and additional request options. -// -// See ListBuckets 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 *S3) ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput, opts ...request.Option) (*ListBucketsOutput, error) { - req, out := c.ListBucketsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListMultipartUploads = "ListMultipartUploads" - -// ListMultipartUploadsRequest generates a "aws/request.Request" representing the -// client's request for the ListMultipartUploads operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListMultipartUploads for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListMultipartUploads method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListMultipartUploadsRequest method. -// req, resp := client.ListMultipartUploadsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads -func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req *request.Request, output *ListMultipartUploadsOutput) { - op := &request.Operation{ - Name: opListMultipartUploads, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?uploads", - Paginator: &request.Paginator{ - InputTokens: []string{"KeyMarker", "UploadIdMarker"}, - OutputTokens: []string{"NextKeyMarker", "NextUploadIdMarker"}, - LimitToken: "MaxUploads", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListMultipartUploadsInput{} - } - - output = &ListMultipartUploadsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMultipartUploads API operation for Amazon Simple Storage Service. -// -// This operation lists in-progress multipart uploads. -// -// 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 Amazon Simple Storage Service's -// API operation ListMultipartUploads for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads -func (c *S3) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { - req, out := c.ListMultipartUploadsRequest(input) - return out, req.Send() -} - -// ListMultipartUploadsWithContext is the same as ListMultipartUploads with the addition of -// the ability to pass a context and additional request options. -// -// See ListMultipartUploads 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 *S3) ListMultipartUploadsWithContext(ctx aws.Context, input *ListMultipartUploadsInput, opts ...request.Option) (*ListMultipartUploadsOutput, error) { - req, out := c.ListMultipartUploadsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMultipartUploads method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMultipartUploads operation. -// pageNum := 0 -// err := client.ListMultipartUploadsPages(params, -// func(page *ListMultipartUploadsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool) error { - return c.ListMultipartUploadsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMultipartUploadsPagesWithContext same as ListMultipartUploadsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *S3) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMultipartUploadsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMultipartUploadsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListObjectVersions = "ListObjectVersions" - -// ListObjectVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListObjectVersions operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListObjectVersions for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListObjectVersions method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListObjectVersionsRequest method. -// req, resp := client.ListObjectVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions -func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *request.Request, output *ListObjectVersionsOutput) { - op := &request.Operation{ - Name: opListObjectVersions, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?versions", - Paginator: &request.Paginator{ - InputTokens: []string{"KeyMarker", "VersionIdMarker"}, - OutputTokens: []string{"NextKeyMarker", "NextVersionIdMarker"}, - LimitToken: "MaxKeys", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListObjectVersionsInput{} - } - - output = &ListObjectVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListObjectVersions API operation for Amazon Simple Storage Service. -// -// Returns metadata about all of the versions of objects in a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation ListObjectVersions for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions -func (c *S3) ListObjectVersions(input *ListObjectVersionsInput) (*ListObjectVersionsOutput, error) { - req, out := c.ListObjectVersionsRequest(input) - return out, req.Send() -} - -// ListObjectVersionsWithContext is the same as ListObjectVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListObjectVersions 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 *S3) ListObjectVersionsWithContext(ctx aws.Context, input *ListObjectVersionsInput, opts ...request.Option) (*ListObjectVersionsOutput, error) { - req, out := c.ListObjectVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListObjectVersionsPages iterates over the pages of a ListObjectVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectVersions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListObjectVersions operation. -// pageNum := 0 -// err := client.ListObjectVersionsPages(params, -// func(page *ListObjectVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListObjectVersionsPages(input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool) error { - return c.ListObjectVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectVersionsPagesWithContext same as ListObjectVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *S3) ListObjectVersionsPagesWithContext(ctx aws.Context, input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListObjectVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListObjectVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListObjects = "ListObjects" - -// ListObjectsRequest generates a "aws/request.Request" representing the -// client's request for the ListObjects operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListObjects for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListObjects method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListObjectsRequest method. -// req, resp := client.ListObjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects -func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, output *ListObjectsOutput) { - op := &request.Operation{ - Name: opListObjects, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker || Contents[-1].Key"}, - LimitToken: "MaxKeys", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListObjectsInput{} - } - - output = &ListObjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListObjects API operation for Amazon Simple Storage Service. -// -// Returns some or all (up to 1000) of the objects in a bucket. You can use -// the request parameters as selection criteria to return a subset of the objects -// in a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation ListObjects for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchBucket "NoSuchBucket" -// The specified bucket does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects -func (c *S3) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { - req, out := c.ListObjectsRequest(input) - return out, req.Send() -} - -// ListObjectsWithContext is the same as ListObjects with the addition of -// the ability to pass a context and additional request options. -// -// See ListObjects 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 *S3) ListObjectsWithContext(ctx aws.Context, input *ListObjectsInput, opts ...request.Option) (*ListObjectsOutput, error) { - req, out := c.ListObjectsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListObjectsPages iterates over the pages of a ListObjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjects method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListObjects operation. -// pageNum := 0 -// err := client.ListObjectsPages(params, -// func(page *ListObjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListObjectsPages(input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool) error { - return c.ListObjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectsPagesWithContext same as ListObjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *S3) ListObjectsPagesWithContext(ctx aws.Context, input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListObjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListObjectsV2 = "ListObjectsV2" - -// ListObjectsV2Request generates a "aws/request.Request" representing the -// client's request for the ListObjectsV2 operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListObjectsV2 for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListObjectsV2 method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListObjectsV2Request method. -// req, resp := client.ListObjectsV2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 -func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Request, output *ListObjectsV2Output) { - op := &request.Operation{ - Name: opListObjectsV2, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?list-type=2", - Paginator: &request.Paginator{ - InputTokens: []string{"ContinuationToken"}, - OutputTokens: []string{"NextContinuationToken"}, - LimitToken: "MaxKeys", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListObjectsV2Input{} - } - - output = &ListObjectsV2Output{} - req = c.newRequest(op, input, output) - return -} - -// ListObjectsV2 API operation for Amazon Simple Storage Service. -// -// Returns some or all (up to 1000) of the objects in a bucket. You can use -// the request parameters as selection criteria to return a subset of the objects -// in a bucket. Note: ListObjectsV2 is the revised List Objects API and we recommend -// you use this revised API for new application development. -// -// 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 Amazon Simple Storage Service's -// API operation ListObjectsV2 for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchBucket "NoSuchBucket" -// The specified bucket does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 -func (c *S3) ListObjectsV2(input *ListObjectsV2Input) (*ListObjectsV2Output, error) { - req, out := c.ListObjectsV2Request(input) - return out, req.Send() -} - -// ListObjectsV2WithContext is the same as ListObjectsV2 with the addition of -// the ability to pass a context and additional request options. -// -// See ListObjectsV2 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 *S3) ListObjectsV2WithContext(ctx aws.Context, input *ListObjectsV2Input, opts ...request.Option) (*ListObjectsV2Output, error) { - req, out := c.ListObjectsV2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListObjectsV2Pages iterates over the pages of a ListObjectsV2 operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectsV2 method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListObjectsV2 operation. -// pageNum := 0 -// err := client.ListObjectsV2Pages(params, -// func(page *ListObjectsV2Output, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListObjectsV2Pages(input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool) error { - return c.ListObjectsV2PagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectsV2PagesWithContext same as ListObjectsV2Pages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *S3) ListObjectsV2PagesWithContext(ctx aws.Context, input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListObjectsV2Input - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListObjectsV2Request(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) - } - return p.Err() -} - -const opListParts = "ListParts" - -// ListPartsRequest generates a "aws/request.Request" representing the -// client's request for the ListParts operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListParts for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListParts method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListPartsRequest method. -// req, resp := client.ListPartsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts -func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, output *ListPartsOutput) { - op := &request.Operation{ - Name: opListParts, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}", - Paginator: &request.Paginator{ - InputTokens: []string{"PartNumberMarker"}, - OutputTokens: []string{"NextPartNumberMarker"}, - LimitToken: "MaxParts", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListPartsInput{} - } - - output = &ListPartsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListParts API operation for Amazon Simple Storage Service. -// -// Lists the parts that have been uploaded for a specific multipart upload. -// -// 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 Amazon Simple Storage Service's -// API operation ListParts for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts -func (c *S3) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { - req, out := c.ListPartsRequest(input) - return out, req.Send() -} - -// ListPartsWithContext is the same as ListParts with the addition of -// the ability to pass a context and additional request options. -// -// See ListParts 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 *S3) ListPartsWithContext(ctx aws.Context, input *ListPartsInput, opts ...request.Option) (*ListPartsOutput, error) { - req, out := c.ListPartsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPartsPages iterates over the pages of a ListParts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListParts operation. -// pageNum := 0 -// err := client.ListPartsPages(params, -// func(page *ListPartsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *S3) ListPartsPages(input *ListPartsInput, fn func(*ListPartsOutput, bool) bool) error { - return c.ListPartsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPartsPagesWithContext same as ListPartsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *S3) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInput, fn func(*ListPartsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPartsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPartsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" - -// PutBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketAccelerateConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketAccelerateConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketAccelerateConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketAccelerateConfigurationRequest method. -// req, resp := client.PutBucketAccelerateConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration -func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateConfigurationInput) (req *request.Request, output *PutBucketAccelerateConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketAccelerateConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?accelerate", - } - - if input == nil { - input = &PutBucketAccelerateConfigurationInput{} - } - - output = &PutBucketAccelerateConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. -// -// Sets the accelerate configuration of an existing bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketAccelerateConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration -func (c *S3) PutBucketAccelerateConfiguration(input *PutBucketAccelerateConfigurationInput) (*PutBucketAccelerateConfigurationOutput, error) { - req, out := c.PutBucketAccelerateConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketAccelerateConfigurationWithContext is the same as PutBucketAccelerateConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketAccelerateConfiguration 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 *S3) PutBucketAccelerateConfigurationWithContext(ctx aws.Context, input *PutBucketAccelerateConfigurationInput, opts ...request.Option) (*PutBucketAccelerateConfigurationOutput, error) { - req, out := c.PutBucketAccelerateConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketAcl = "PutBucketAcl" - -// PutBucketAclRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketAcl operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketAcl for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketAcl method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketAclRequest method. -// req, resp := client.PutBucketAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl -func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request, output *PutBucketAclOutput) { - op := &request.Operation{ - Name: opPutBucketAcl, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?acl", - } - - if input == nil { - input = &PutBucketAclInput{} - } - - output = &PutBucketAclOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketAcl API operation for Amazon Simple Storage Service. -// -// Sets the permissions on a bucket using access control lists (ACL). -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketAcl for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl -func (c *S3) PutBucketAcl(input *PutBucketAclInput) (*PutBucketAclOutput, error) { - req, out := c.PutBucketAclRequest(input) - return out, req.Send() -} - -// PutBucketAclWithContext is the same as PutBucketAcl with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketAcl 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 *S3) PutBucketAclWithContext(ctx aws.Context, input *PutBucketAclInput, opts ...request.Option) (*PutBucketAclOutput, error) { - req, out := c.PutBucketAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketAnalyticsConfiguration = "PutBucketAnalyticsConfiguration" - -// PutBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketAnalyticsConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketAnalyticsConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketAnalyticsConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketAnalyticsConfigurationRequest method. -// req, resp := client.PutBucketAnalyticsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration -func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsConfigurationInput) (req *request.Request, output *PutBucketAnalyticsConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketAnalyticsConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &PutBucketAnalyticsConfigurationInput{} - } - - output = &PutBucketAnalyticsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. -// -// Sets an analytics configuration for the bucket (specified by the analytics -// configuration ID). -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketAnalyticsConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration -func (c *S3) PutBucketAnalyticsConfiguration(input *PutBucketAnalyticsConfigurationInput) (*PutBucketAnalyticsConfigurationOutput, error) { - req, out := c.PutBucketAnalyticsConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketAnalyticsConfigurationWithContext is the same as PutBucketAnalyticsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketAnalyticsConfiguration 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 *S3) PutBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *PutBucketAnalyticsConfigurationInput, opts ...request.Option) (*PutBucketAnalyticsConfigurationOutput, error) { - req, out := c.PutBucketAnalyticsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketCors = "PutBucketCors" - -// PutBucketCorsRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketCors operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketCors for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketCors method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketCorsRequest method. -// req, resp := client.PutBucketCorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors -func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Request, output *PutBucketCorsOutput) { - op := &request.Operation{ - Name: opPutBucketCors, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?cors", - } - - if input == nil { - input = &PutBucketCorsInput{} - } - - output = &PutBucketCorsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketCors API operation for Amazon Simple Storage Service. -// -// Sets the cors configuration for a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketCors for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors -func (c *S3) PutBucketCors(input *PutBucketCorsInput) (*PutBucketCorsOutput, error) { - req, out := c.PutBucketCorsRequest(input) - return out, req.Send() -} - -// PutBucketCorsWithContext is the same as PutBucketCors with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketCors 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 *S3) PutBucketCorsWithContext(ctx aws.Context, input *PutBucketCorsInput, opts ...request.Option) (*PutBucketCorsOutput, error) { - req, out := c.PutBucketCorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketInventoryConfiguration = "PutBucketInventoryConfiguration" - -// PutBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketInventoryConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketInventoryConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketInventoryConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketInventoryConfigurationRequest method. -// req, resp := client.PutBucketInventoryConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration -func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryConfigurationInput) (req *request.Request, output *PutBucketInventoryConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketInventoryConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &PutBucketInventoryConfigurationInput{} - } - - output = &PutBucketInventoryConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketInventoryConfiguration API operation for Amazon Simple Storage Service. -// -// Adds an inventory configuration (identified by the inventory ID) from the -// bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketInventoryConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration -func (c *S3) PutBucketInventoryConfiguration(input *PutBucketInventoryConfigurationInput) (*PutBucketInventoryConfigurationOutput, error) { - req, out := c.PutBucketInventoryConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketInventoryConfigurationWithContext is the same as PutBucketInventoryConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketInventoryConfiguration 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 *S3) PutBucketInventoryConfigurationWithContext(ctx aws.Context, input *PutBucketInventoryConfigurationInput, opts ...request.Option) (*PutBucketInventoryConfigurationOutput, error) { - req, out := c.PutBucketInventoryConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketLifecycle = "PutBucketLifecycle" - -// PutBucketLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketLifecycle operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketLifecycle for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketLifecycle method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketLifecycleRequest method. -// req, resp := client.PutBucketLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle -func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *request.Request, output *PutBucketLifecycleOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, PutBucketLifecycle, has been deprecated") - } - op := &request.Operation{ - Name: opPutBucketLifecycle, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &PutBucketLifecycleInput{} - } - - output = &PutBucketLifecycleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketLifecycle API operation for Amazon Simple Storage Service. -// -// Deprecated, see the PutBucketLifecycleConfiguration operation. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketLifecycle for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle -func (c *S3) PutBucketLifecycle(input *PutBucketLifecycleInput) (*PutBucketLifecycleOutput, error) { - req, out := c.PutBucketLifecycleRequest(input) - return out, req.Send() -} - -// PutBucketLifecycleWithContext is the same as PutBucketLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketLifecycle 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 *S3) PutBucketLifecycleWithContext(ctx aws.Context, input *PutBucketLifecycleInput, opts ...request.Option) (*PutBucketLifecycleOutput, error) { - req, out := c.PutBucketLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketLifecycleConfiguration = "PutBucketLifecycleConfiguration" - -// PutBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketLifecycleConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketLifecycleConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketLifecycleConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketLifecycleConfigurationRequest method. -// req, resp := client.PutBucketLifecycleConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration -func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleConfigurationInput) (req *request.Request, output *PutBucketLifecycleConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketLifecycleConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &PutBucketLifecycleConfigurationInput{} - } - - output = &PutBucketLifecycleConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. -// -// Sets lifecycle configuration for your bucket. If a lifecycle configuration -// exists, it replaces it. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketLifecycleConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration -func (c *S3) PutBucketLifecycleConfiguration(input *PutBucketLifecycleConfigurationInput) (*PutBucketLifecycleConfigurationOutput, error) { - req, out := c.PutBucketLifecycleConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketLifecycleConfigurationWithContext is the same as PutBucketLifecycleConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketLifecycleConfiguration 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 *S3) PutBucketLifecycleConfigurationWithContext(ctx aws.Context, input *PutBucketLifecycleConfigurationInput, opts ...request.Option) (*PutBucketLifecycleConfigurationOutput, error) { - req, out := c.PutBucketLifecycleConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketLogging = "PutBucketLogging" - -// PutBucketLoggingRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketLogging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketLogging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketLogging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketLoggingRequest method. -// req, resp := client.PutBucketLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging -func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request.Request, output *PutBucketLoggingOutput) { - op := &request.Operation{ - Name: opPutBucketLogging, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?logging", - } - - if input == nil { - input = &PutBucketLoggingInput{} - } - - output = &PutBucketLoggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketLogging API operation for Amazon Simple Storage Service. -// -// Set the logging parameters for a bucket and to specify permissions for who -// can view and modify the logging parameters. To set the logging status of -// a bucket, you must be the bucket owner. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketLogging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging -func (c *S3) PutBucketLogging(input *PutBucketLoggingInput) (*PutBucketLoggingOutput, error) { - req, out := c.PutBucketLoggingRequest(input) - return out, req.Send() -} - -// PutBucketLoggingWithContext is the same as PutBucketLogging with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketLogging 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 *S3) PutBucketLoggingWithContext(ctx aws.Context, input *PutBucketLoggingInput, opts ...request.Option) (*PutBucketLoggingOutput, error) { - req, out := c.PutBucketLoggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketMetricsConfiguration = "PutBucketMetricsConfiguration" - -// PutBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketMetricsConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketMetricsConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketMetricsConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketMetricsConfigurationRequest method. -// req, resp := client.PutBucketMetricsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration -func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigurationInput) (req *request.Request, output *PutBucketMetricsConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketMetricsConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &PutBucketMetricsConfigurationInput{} - } - - output = &PutBucketMetricsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketMetricsConfiguration API operation for Amazon Simple Storage Service. -// -// Sets a metrics configuration (specified by the metrics configuration ID) -// for the bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketMetricsConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration -func (c *S3) PutBucketMetricsConfiguration(input *PutBucketMetricsConfigurationInput) (*PutBucketMetricsConfigurationOutput, error) { - req, out := c.PutBucketMetricsConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketMetricsConfigurationWithContext is the same as PutBucketMetricsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketMetricsConfiguration 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 *S3) PutBucketMetricsConfigurationWithContext(ctx aws.Context, input *PutBucketMetricsConfigurationInput, opts ...request.Option) (*PutBucketMetricsConfigurationOutput, error) { - req, out := c.PutBucketMetricsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketNotification = "PutBucketNotification" - -// PutBucketNotificationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketNotification operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketNotification for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketNotification method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketNotificationRequest method. -// req, resp := client.PutBucketNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification -func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (req *request.Request, output *PutBucketNotificationOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, PutBucketNotification, has been deprecated") - } - op := &request.Operation{ - Name: opPutBucketNotification, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &PutBucketNotificationInput{} - } - - output = &PutBucketNotificationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketNotification API operation for Amazon Simple Storage Service. -// -// Deprecated, see the PutBucketNotificationConfiguraiton operation. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketNotification for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification -func (c *S3) PutBucketNotification(input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error) { - req, out := c.PutBucketNotificationRequest(input) - return out, req.Send() -} - -// PutBucketNotificationWithContext is the same as PutBucketNotification with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketNotification 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 *S3) PutBucketNotificationWithContext(ctx aws.Context, input *PutBucketNotificationInput, opts ...request.Option) (*PutBucketNotificationOutput, error) { - req, out := c.PutBucketNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketNotificationConfiguration = "PutBucketNotificationConfiguration" - -// PutBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketNotificationConfiguration operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketNotificationConfiguration for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketNotificationConfiguration method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketNotificationConfigurationRequest method. -// req, resp := client.PutBucketNotificationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration -func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificationConfigurationInput) (req *request.Request, output *PutBucketNotificationConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketNotificationConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &PutBucketNotificationConfigurationInput{} - } - - output = &PutBucketNotificationConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketNotificationConfiguration API operation for Amazon Simple Storage Service. -// -// Enables notifications of specified events for a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketNotificationConfiguration for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration -func (c *S3) PutBucketNotificationConfiguration(input *PutBucketNotificationConfigurationInput) (*PutBucketNotificationConfigurationOutput, error) { - req, out := c.PutBucketNotificationConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketNotificationConfigurationWithContext is the same as PutBucketNotificationConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketNotificationConfiguration 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 *S3) PutBucketNotificationConfigurationWithContext(ctx aws.Context, input *PutBucketNotificationConfigurationInput, opts ...request.Option) (*PutBucketNotificationConfigurationOutput, error) { - req, out := c.PutBucketNotificationConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketPolicy = "PutBucketPolicy" - -// PutBucketPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketPolicy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketPolicy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketPolicy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketPolicyRequest method. -// req, resp := client.PutBucketPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy -func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.Request, output *PutBucketPolicyOutput) { - op := &request.Operation{ - Name: opPutBucketPolicy, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?policy", - } - - if input == nil { - input = &PutBucketPolicyInput{} - } - - output = &PutBucketPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketPolicy API operation for Amazon Simple Storage Service. -// -// Replaces a policy on a bucket. If the bucket already has a policy, the one -// in this request completely replaces it. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketPolicy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy -func (c *S3) PutBucketPolicy(input *PutBucketPolicyInput) (*PutBucketPolicyOutput, error) { - req, out := c.PutBucketPolicyRequest(input) - return out, req.Send() -} - -// PutBucketPolicyWithContext is the same as PutBucketPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketPolicy 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 *S3) PutBucketPolicyWithContext(ctx aws.Context, input *PutBucketPolicyInput, opts ...request.Option) (*PutBucketPolicyOutput, error) { - req, out := c.PutBucketPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketReplication = "PutBucketReplication" - -// PutBucketReplicationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketReplication operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketReplication for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketReplication method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketReplicationRequest method. -// req, resp := client.PutBucketReplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication -func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req *request.Request, output *PutBucketReplicationOutput) { - op := &request.Operation{ - Name: opPutBucketReplication, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?replication", - } - - if input == nil { - input = &PutBucketReplicationInput{} - } - - output = &PutBucketReplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketReplication API operation for Amazon Simple Storage Service. -// -// Creates a new replication configuration (or replaces an existing one, if -// present). -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketReplication for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication -func (c *S3) PutBucketReplication(input *PutBucketReplicationInput) (*PutBucketReplicationOutput, error) { - req, out := c.PutBucketReplicationRequest(input) - return out, req.Send() -} - -// PutBucketReplicationWithContext is the same as PutBucketReplication with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketReplication 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 *S3) PutBucketReplicationWithContext(ctx aws.Context, input *PutBucketReplicationInput, opts ...request.Option) (*PutBucketReplicationOutput, error) { - req, out := c.PutBucketReplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketRequestPayment = "PutBucketRequestPayment" - -// PutBucketRequestPaymentRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketRequestPayment operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketRequestPayment for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketRequestPayment method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketRequestPaymentRequest method. -// req, resp := client.PutBucketRequestPaymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment -func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) (req *request.Request, output *PutBucketRequestPaymentOutput) { - op := &request.Operation{ - Name: opPutBucketRequestPayment, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?requestPayment", - } - - if input == nil { - input = &PutBucketRequestPaymentInput{} - } - - output = &PutBucketRequestPaymentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketRequestPayment API operation for Amazon Simple Storage Service. -// -// Sets the request payment configuration for a bucket. By default, the bucket -// owner pays for downloads from the bucket. This configuration parameter enables -// the bucket owner (only) to specify that the person requesting the download -// will be charged for the download. Documentation on requester pays buckets -// can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketRequestPayment for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment -func (c *S3) PutBucketRequestPayment(input *PutBucketRequestPaymentInput) (*PutBucketRequestPaymentOutput, error) { - req, out := c.PutBucketRequestPaymentRequest(input) - return out, req.Send() -} - -// PutBucketRequestPaymentWithContext is the same as PutBucketRequestPayment with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketRequestPayment 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 *S3) PutBucketRequestPaymentWithContext(ctx aws.Context, input *PutBucketRequestPaymentInput, opts ...request.Option) (*PutBucketRequestPaymentOutput, error) { - req, out := c.PutBucketRequestPaymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketTagging = "PutBucketTagging" - -// PutBucketTaggingRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketTagging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketTagging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketTagging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketTaggingRequest method. -// req, resp := client.PutBucketTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging -func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request.Request, output *PutBucketTaggingOutput) { - op := &request.Operation{ - Name: opPutBucketTagging, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?tagging", - } - - if input == nil { - input = &PutBucketTaggingInput{} - } - - output = &PutBucketTaggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketTagging API operation for Amazon Simple Storage Service. -// -// Sets the tags for a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketTagging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging -func (c *S3) PutBucketTagging(input *PutBucketTaggingInput) (*PutBucketTaggingOutput, error) { - req, out := c.PutBucketTaggingRequest(input) - return out, req.Send() -} - -// PutBucketTaggingWithContext is the same as PutBucketTagging with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketTagging 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 *S3) PutBucketTaggingWithContext(ctx aws.Context, input *PutBucketTaggingInput, opts ...request.Option) (*PutBucketTaggingOutput, error) { - req, out := c.PutBucketTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketVersioning = "PutBucketVersioning" - -// PutBucketVersioningRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketVersioning operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketVersioning for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketVersioning method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketVersioningRequest method. -// req, resp := client.PutBucketVersioningRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning -func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *request.Request, output *PutBucketVersioningOutput) { - op := &request.Operation{ - Name: opPutBucketVersioning, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?versioning", - } - - if input == nil { - input = &PutBucketVersioningInput{} - } - - output = &PutBucketVersioningOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketVersioning API operation for Amazon Simple Storage Service. -// -// Sets the versioning state of an existing bucket. To set the versioning state, -// you must be the bucket owner. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketVersioning for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning -func (c *S3) PutBucketVersioning(input *PutBucketVersioningInput) (*PutBucketVersioningOutput, error) { - req, out := c.PutBucketVersioningRequest(input) - return out, req.Send() -} - -// PutBucketVersioningWithContext is the same as PutBucketVersioning with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketVersioning 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 *S3) PutBucketVersioningWithContext(ctx aws.Context, input *PutBucketVersioningInput, opts ...request.Option) (*PutBucketVersioningOutput, error) { - req, out := c.PutBucketVersioningRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketWebsite = "PutBucketWebsite" - -// PutBucketWebsiteRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketWebsite operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutBucketWebsite for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutBucketWebsite method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutBucketWebsiteRequest method. -// req, resp := client.PutBucketWebsiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite -func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request.Request, output *PutBucketWebsiteOutput) { - op := &request.Operation{ - Name: opPutBucketWebsite, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?website", - } - - if input == nil { - input = &PutBucketWebsiteInput{} - } - - output = &PutBucketWebsiteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketWebsite API operation for Amazon Simple Storage Service. -// -// Set the website configuration for a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutBucketWebsite for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite -func (c *S3) PutBucketWebsite(input *PutBucketWebsiteInput) (*PutBucketWebsiteOutput, error) { - req, out := c.PutBucketWebsiteRequest(input) - return out, req.Send() -} - -// PutBucketWebsiteWithContext is the same as PutBucketWebsite with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketWebsite 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 *S3) PutBucketWebsiteWithContext(ctx aws.Context, input *PutBucketWebsiteInput, opts ...request.Option) (*PutBucketWebsiteOutput, error) { - req, out := c.PutBucketWebsiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObject = "PutObject" - -// PutObjectRequest generates a "aws/request.Request" representing the -// client's request for the PutObject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutObject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutObject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutObjectRequest method. -// req, resp := client.PutObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject -func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, output *PutObjectOutput) { - op := &request.Operation{ - Name: opPutObject, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &PutObjectInput{} - } - - output = &PutObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutObject API operation for Amazon Simple Storage Service. -// -// Adds an object to a bucket. -// -// 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 Amazon Simple Storage Service's -// API operation PutObject for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject -func (c *S3) PutObject(input *PutObjectInput) (*PutObjectOutput, error) { - req, out := c.PutObjectRequest(input) - return out, req.Send() -} - -// PutObjectWithContext is the same as PutObject with the addition of -// the ability to pass a context and additional request options. -// -// See PutObject 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 *S3) PutObjectWithContext(ctx aws.Context, input *PutObjectInput, opts ...request.Option) (*PutObjectOutput, error) { - req, out := c.PutObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObjectAcl = "PutObjectAcl" - -// PutObjectAclRequest generates a "aws/request.Request" representing the -// client's request for the PutObjectAcl operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutObjectAcl for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutObjectAcl method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutObjectAclRequest method. -// req, resp := client.PutObjectAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl -func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request, output *PutObjectAclOutput) { - op := &request.Operation{ - Name: opPutObjectAcl, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}?acl", - } - - if input == nil { - input = &PutObjectAclInput{} - } - - output = &PutObjectAclOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutObjectAcl API operation for Amazon Simple Storage Service. -// -// uses the acl subresource to set the access control list (ACL) permissions -// for an object that already exists in a bucket -// -// 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 Amazon Simple Storage Service's -// API operation PutObjectAcl for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl -func (c *S3) PutObjectAcl(input *PutObjectAclInput) (*PutObjectAclOutput, error) { - req, out := c.PutObjectAclRequest(input) - return out, req.Send() -} - -// PutObjectAclWithContext is the same as PutObjectAcl with the addition of -// the ability to pass a context and additional request options. -// -// See PutObjectAcl 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 *S3) PutObjectAclWithContext(ctx aws.Context, input *PutObjectAclInput, opts ...request.Option) (*PutObjectAclOutput, error) { - req, out := c.PutObjectAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObjectTagging = "PutObjectTagging" - -// PutObjectTaggingRequest generates a "aws/request.Request" representing the -// client's request for the PutObjectTagging operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PutObjectTagging for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PutObjectTagging method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PutObjectTaggingRequest method. -// req, resp := client.PutObjectTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging -func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request.Request, output *PutObjectTaggingOutput) { - op := &request.Operation{ - Name: opPutObjectTagging, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}?tagging", - } - - if input == nil { - input = &PutObjectTaggingInput{} - } - - output = &PutObjectTaggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutObjectTagging API operation for Amazon Simple Storage Service. -// -// Sets the supplied tag-set to an object that already exists in a bucket -// -// 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 Amazon Simple Storage Service's -// API operation PutObjectTagging for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging -func (c *S3) PutObjectTagging(input *PutObjectTaggingInput) (*PutObjectTaggingOutput, error) { - req, out := c.PutObjectTaggingRequest(input) - return out, req.Send() -} - -// PutObjectTaggingWithContext is the same as PutObjectTagging with the addition of -// the ability to pass a context and additional request options. -// -// See PutObjectTagging 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 *S3) PutObjectTaggingWithContext(ctx aws.Context, input *PutObjectTaggingInput, opts ...request.Option) (*PutObjectTaggingOutput, error) { - req, out := c.PutObjectTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreObject = "RestoreObject" - -// RestoreObjectRequest generates a "aws/request.Request" representing the -// client's request for the RestoreObject operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RestoreObject for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RestoreObject method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RestoreObjectRequest method. -// req, resp := client.RestoreObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject -func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Request, output *RestoreObjectOutput) { - op := &request.Operation{ - Name: opRestoreObject, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}/{Key+}?restore", - } - - if input == nil { - input = &RestoreObjectInput{} - } - - output = &RestoreObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreObject API operation for Amazon Simple Storage Service. -// -// Restores an archived copy of an object back into Amazon S3 -// -// 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 Amazon Simple Storage Service's -// API operation RestoreObject for usage and error information. -// -// Returned Error Codes: -// * ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError" -// This operation is not allowed against this storage tier -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject -func (c *S3) RestoreObject(input *RestoreObjectInput) (*RestoreObjectOutput, error) { - req, out := c.RestoreObjectRequest(input) - return out, req.Send() -} - -// RestoreObjectWithContext is the same as RestoreObject with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreObject 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 *S3) RestoreObjectWithContext(ctx aws.Context, input *RestoreObjectInput, opts ...request.Option) (*RestoreObjectOutput, error) { - req, out := c.RestoreObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUploadPart = "UploadPart" - -// UploadPartRequest generates a "aws/request.Request" representing the -// client's request for the UploadPart operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadPart for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadPart method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadPartRequest method. -// req, resp := client.UploadPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart -func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, output *UploadPartOutput) { - op := &request.Operation{ - Name: opUploadPart, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &UploadPartInput{} - } - - output = &UploadPartOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadPart API operation for Amazon Simple Storage Service. -// -// Uploads a part in a multipart upload. -// -// Note: After you initiate multipart upload and upload one or more parts, you -// must either complete or abort multipart upload in order to stop getting charged -// for storage of the uploaded parts. Only after you either complete or abort -// multipart upload, Amazon S3 frees up the parts storage and stops charging -// you for the parts storage. -// -// 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 Amazon Simple Storage Service's -// API operation UploadPart for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart -func (c *S3) UploadPart(input *UploadPartInput) (*UploadPartOutput, error) { - req, out := c.UploadPartRequest(input) - return out, req.Send() -} - -// UploadPartWithContext is the same as UploadPart with the addition of -// the ability to pass a context and additional request options. -// -// See UploadPart 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 *S3) UploadPartWithContext(ctx aws.Context, input *UploadPartInput, opts ...request.Option) (*UploadPartOutput, error) { - req, out := c.UploadPartRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUploadPartCopy = "UploadPartCopy" - -// UploadPartCopyRequest generates a "aws/request.Request" representing the -// client's request for the UploadPartCopy operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See UploadPartCopy for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the UploadPartCopy method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the UploadPartCopyRequest method. -// req, resp := client.UploadPartCopyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy -func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Request, output *UploadPartCopyOutput) { - op := &request.Operation{ - Name: opUploadPartCopy, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &UploadPartCopyInput{} - } - - output = &UploadPartCopyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadPartCopy API operation for Amazon Simple Storage Service. -// -// Uploads a part by copying data from an existing object as data source. -// -// 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 Amazon Simple Storage Service's -// API operation UploadPartCopy for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy -func (c *S3) UploadPartCopy(input *UploadPartCopyInput) (*UploadPartCopyOutput, error) { - req, out := c.UploadPartCopyRequest(input) - return out, req.Send() -} - -// UploadPartCopyWithContext is the same as UploadPartCopy with the addition of -// the ability to pass a context and additional request options. -// -// See UploadPartCopy 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 *S3) UploadPartCopyWithContext(ctx aws.Context, input *UploadPartCopyInput, opts ...request.Option) (*UploadPartCopyOutput, error) { - req, out := c.UploadPartCopyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Specifies the days since the initiation of an Incomplete Multipart Upload -// that Lifecycle will wait before permanently removing all parts of the upload. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortIncompleteMultipartUpload -type AbortIncompleteMultipartUpload struct { - _ struct{} `type:"structure"` - - // Indicates the number of days that must pass since initiation for Lifecycle - // to abort an Incomplete Multipart Upload. - DaysAfterInitiation *int64 `type:"integer"` -} - -// String returns the string representation -func (s AbortIncompleteMultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AbortIncompleteMultipartUpload) GoString() string { - return s.String() -} - -// SetDaysAfterInitiation sets the DaysAfterInitiation field's value. -func (s *AbortIncompleteMultipartUpload) SetDaysAfterInitiation(v int64) *AbortIncompleteMultipartUpload { - s.DaysAfterInitiation = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUploadRequest -type AbortMultipartUploadInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation -func (s AbortMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AbortMultipartUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AbortMultipartUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AbortMultipartUploadInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *AbortMultipartUploadInput) SetBucket(v string) *AbortMultipartUploadInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *AbortMultipartUploadInput) SetKey(v string) *AbortMultipartUploadInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *AbortMultipartUploadInput) SetRequestPayer(v string) *AbortMultipartUploadInput { - s.RequestPayer = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *AbortMultipartUploadInput) SetUploadId(v string) *AbortMultipartUploadInput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUploadOutput -type AbortMultipartUploadOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation -func (s AbortMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AbortMultipartUploadOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *AbortMultipartUploadOutput) SetRequestCharged(v string) *AbortMultipartUploadOutput { - s.RequestCharged = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AccelerateConfiguration -type AccelerateConfiguration struct { - _ struct{} `type:"structure"` - - // The accelerate configuration of the bucket. - Status *string `type:"string" enum:"BucketAccelerateStatus"` -} - -// String returns the string representation -func (s AccelerateConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccelerateConfiguration) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *AccelerateConfiguration) SetStatus(v string) *AccelerateConfiguration { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AccessControlPolicy -type AccessControlPolicy struct { - _ struct{} `type:"structure"` - - // A list of grants. - Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` - - Owner *Owner `type:"structure"` -} - -// String returns the string representation -func (s AccessControlPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccessControlPolicy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AccessControlPolicy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AccessControlPolicy"} - if s.Grants != nil { - for i, v := range s.Grants { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Grants", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrants sets the Grants field's value. -func (s *AccessControlPolicy) SetGrants(v []*Grant) *AccessControlPolicy { - s.Grants = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *AccessControlPolicy) SetOwner(v *Owner) *AccessControlPolicy { - s.Owner = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsAndOperator -type AnalyticsAndOperator struct { - _ struct{} `type:"structure"` - - // The prefix to use when evaluating an AND predicate. - Prefix *string `type:"string"` - - // The list of tags to use when evaluating an AND predicate. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s AnalyticsAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AnalyticsAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *AnalyticsAndOperator) SetPrefix(v string) *AnalyticsAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AnalyticsAndOperator) SetTags(v []*Tag) *AnalyticsAndOperator { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsConfiguration -type AnalyticsConfiguration struct { - _ struct{} `type:"structure"` - - // The filter used to describe a set of objects for analyses. A filter must - // have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). - // If no filter is provided, all objects will be considered in any analysis. - Filter *AnalyticsFilter `type:"structure"` - - // The identifier used to represent an analytics configuration. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // If present, it indicates that data related to access patterns will be collected - // and made available to analyze the tradeoffs between different storage classes. - // - // StorageClassAnalysis is a required field - StorageClassAnalysis *StorageClassAnalysis `type:"structure" required:"true"` -} - -// String returns the string representation -func (s AnalyticsConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AnalyticsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsConfiguration"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.StorageClassAnalysis == nil { - invalidParams.Add(request.NewErrParamRequired("StorageClassAnalysis")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.StorageClassAnalysis != nil { - if err := s.StorageClassAnalysis.Validate(); err != nil { - invalidParams.AddNested("StorageClassAnalysis", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *AnalyticsConfiguration) SetFilter(v *AnalyticsFilter) *AnalyticsConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *AnalyticsConfiguration) SetId(v string) *AnalyticsConfiguration { - s.Id = &v - return s -} - -// SetStorageClassAnalysis sets the StorageClassAnalysis field's value. -func (s *AnalyticsConfiguration) SetStorageClassAnalysis(v *StorageClassAnalysis) *AnalyticsConfiguration { - s.StorageClassAnalysis = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsExportDestination -type AnalyticsExportDestination struct { - _ struct{} `type:"structure"` - - // A destination signifying output to an S3 bucket. - // - // S3BucketDestination is a required field - S3BucketDestination *AnalyticsS3BucketDestination `type:"structure" required:"true"` -} - -// String returns the string representation -func (s AnalyticsExportDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AnalyticsExportDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsExportDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsExportDestination"} - if s.S3BucketDestination == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) - } - if s.S3BucketDestination != nil { - if err := s.S3BucketDestination.Validate(); err != nil { - invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3BucketDestination sets the S3BucketDestination field's value. -func (s *AnalyticsExportDestination) SetS3BucketDestination(v *AnalyticsS3BucketDestination) *AnalyticsExportDestination { - s.S3BucketDestination = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsFilter -type AnalyticsFilter struct { - _ struct{} `type:"structure"` - - // A conjunction (logical AND) of predicates, which is used in evaluating an - // analytics filter. The operator must have at least two predicates. - And *AnalyticsAndOperator `type:"structure"` - - // The prefix to use when evaluating an analytics filter. - Prefix *string `type:"string"` - - // The tag to use when evaluating an analytics filter. - Tag *Tag `type:"structure"` -} - -// String returns the string representation -func (s AnalyticsFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AnalyticsFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *AnalyticsFilter) SetAnd(v *AnalyticsAndOperator) *AnalyticsFilter { - s.And = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *AnalyticsFilter) SetPrefix(v string) *AnalyticsFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *AnalyticsFilter) SetTag(v *Tag) *AnalyticsFilter { - s.Tag = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsS3BucketDestination -type AnalyticsS3BucketDestination struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) of the bucket to which data is exported. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // The account ID that owns the destination bucket. If no account ID is provided, - // the owner will not be validated prior to exporting data. - BucketAccountId *string `type:"string"` - - // The file format used when exporting data to Amazon S3. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"AnalyticsS3ExportFileFormat"` - - // The prefix to use when exporting data. The exported data begins with this - // prefix. - Prefix *string `type:"string"` -} - -// String returns the string representation -func (s AnalyticsS3BucketDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AnalyticsS3BucketDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsS3BucketDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsS3BucketDestination"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *AnalyticsS3BucketDestination) SetBucket(v string) *AnalyticsS3BucketDestination { - s.Bucket = &v - return s -} - -// SetBucketAccountId sets the BucketAccountId field's value. -func (s *AnalyticsS3BucketDestination) SetBucketAccountId(v string) *AnalyticsS3BucketDestination { - s.BucketAccountId = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *AnalyticsS3BucketDestination) SetFormat(v string) *AnalyticsS3BucketDestination { - s.Format = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *AnalyticsS3BucketDestination) SetPrefix(v string) *AnalyticsS3BucketDestination { - s.Prefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Bucket -type Bucket struct { - _ struct{} `type:"structure"` - - // Date the bucket was created. - CreationDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The name of the bucket. - Name *string `type:"string"` -} - -// String returns the string representation -func (s Bucket) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Bucket) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *Bucket) SetCreationDate(v time.Time) *Bucket { - s.CreationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *Bucket) SetName(v string) *Bucket { - s.Name = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/BucketLifecycleConfiguration -type BucketLifecycleConfiguration struct { - _ struct{} `type:"structure"` - - // Rules is a required field - Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s BucketLifecycleConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BucketLifecycleConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BucketLifecycleConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BucketLifecycleConfiguration"} - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRules sets the Rules field's value. -func (s *BucketLifecycleConfiguration) SetRules(v []*LifecycleRule) *BucketLifecycleConfiguration { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/BucketLoggingStatus -type BucketLoggingStatus struct { - _ struct{} `type:"structure"` - - LoggingEnabled *LoggingEnabled `type:"structure"` -} - -// String returns the string representation -func (s BucketLoggingStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BucketLoggingStatus) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BucketLoggingStatus) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BucketLoggingStatus"} - if s.LoggingEnabled != nil { - if err := s.LoggingEnabled.Validate(); err != nil { - invalidParams.AddNested("LoggingEnabled", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoggingEnabled sets the LoggingEnabled field's value. -func (s *BucketLoggingStatus) SetLoggingEnabled(v *LoggingEnabled) *BucketLoggingStatus { - s.LoggingEnabled = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CORSConfiguration -type CORSConfiguration struct { - _ struct{} `type:"structure"` - - // CORSRules is a required field - CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s CORSConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CORSConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CORSConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CORSConfiguration"} - if s.CORSRules == nil { - invalidParams.Add(request.NewErrParamRequired("CORSRules")) - } - if s.CORSRules != nil { - for i, v := range s.CORSRules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CORSRules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCORSRules sets the CORSRules field's value. -func (s *CORSConfiguration) SetCORSRules(v []*CORSRule) *CORSConfiguration { - s.CORSRules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CORSRule -type CORSRule struct { - _ struct{} `type:"structure"` - - // Specifies which headers are allowed in a pre-flight OPTIONS request. - AllowedHeaders []*string `locationName:"AllowedHeader" type:"list" flattened:"true"` - - // Identifies HTTP methods that the domain/origin specified in the rule is allowed - // to execute. - // - // AllowedMethods is a required field - AllowedMethods []*string `locationName:"AllowedMethod" type:"list" flattened:"true" required:"true"` - - // One or more origins you want customers to be able to access the bucket from. - // - // AllowedOrigins is a required field - AllowedOrigins []*string `locationName:"AllowedOrigin" type:"list" flattened:"true" required:"true"` - - // One or more headers in the response that you want customers to be able to - // access from their applications (for example, from a JavaScript XMLHttpRequest - // object). - ExposeHeaders []*string `locationName:"ExposeHeader" type:"list" flattened:"true"` - - // The time in seconds that your browser is to cache the preflight response - // for the specified resource. - MaxAgeSeconds *int64 `type:"integer"` -} - -// String returns the string representation -func (s CORSRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CORSRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CORSRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CORSRule"} - if s.AllowedMethods == nil { - invalidParams.Add(request.NewErrParamRequired("AllowedMethods")) - } - if s.AllowedOrigins == nil { - invalidParams.Add(request.NewErrParamRequired("AllowedOrigins")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedHeaders sets the AllowedHeaders field's value. -func (s *CORSRule) SetAllowedHeaders(v []*string) *CORSRule { - s.AllowedHeaders = v - return s -} - -// SetAllowedMethods sets the AllowedMethods field's value. -func (s *CORSRule) SetAllowedMethods(v []*string) *CORSRule { - s.AllowedMethods = v - return s -} - -// SetAllowedOrigins sets the AllowedOrigins field's value. -func (s *CORSRule) SetAllowedOrigins(v []*string) *CORSRule { - s.AllowedOrigins = v - return s -} - -// SetExposeHeaders sets the ExposeHeaders field's value. -func (s *CORSRule) SetExposeHeaders(v []*string) *CORSRule { - s.ExposeHeaders = v - return s -} - -// SetMaxAgeSeconds sets the MaxAgeSeconds field's value. -func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule { - s.MaxAgeSeconds = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CloudFunctionConfiguration -type CloudFunctionConfiguration struct { - _ struct{} `type:"structure"` - - CloudFunction *string `type:"string"` - - // Bucket event for which to send notifications. - Event *string `deprecated:"true" type:"string" enum:"Event"` - - Events []*string `locationName:"Event" type:"list" flattened:"true"` - - // Optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - InvocationRole *string `type:"string"` -} - -// String returns the string representation -func (s CloudFunctionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CloudFunctionConfiguration) GoString() string { - return s.String() -} - -// SetCloudFunction sets the CloudFunction field's value. -func (s *CloudFunctionConfiguration) SetCloudFunction(v string) *CloudFunctionConfiguration { - s.CloudFunction = &v - return s -} - -// SetEvent sets the Event field's value. -func (s *CloudFunctionConfiguration) SetEvent(v string) *CloudFunctionConfiguration { - s.Event = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *CloudFunctionConfiguration) SetEvents(v []*string) *CloudFunctionConfiguration { - s.Events = v - return s -} - -// SetId sets the Id field's value. -func (s *CloudFunctionConfiguration) SetId(v string) *CloudFunctionConfiguration { - s.Id = &v - return s -} - -// SetInvocationRole sets the InvocationRole field's value. -func (s *CloudFunctionConfiguration) SetInvocationRole(v string) *CloudFunctionConfiguration { - s.InvocationRole = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CommonPrefix -type CommonPrefix struct { - _ struct{} `type:"structure"` - - Prefix *string `type:"string"` -} - -// String returns the string representation -func (s CommonPrefix) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CommonPrefix) GoString() string { - return s.String() -} - -// SetPrefix sets the Prefix field's value. -func (s *CommonPrefix) SetPrefix(v string) *CommonPrefix { - s.Prefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUploadRequest -type CompleteMultipartUploadInput struct { - _ struct{} `type:"structure" payload:"MultipartUpload"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation -func (s CompleteMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteMultipartUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompleteMultipartUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompleteMultipartUploadInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *CompleteMultipartUploadInput) SetBucket(v string) *CompleteMultipartUploadInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CompleteMultipartUploadInput) SetKey(v string) *CompleteMultipartUploadInput { - s.Key = &v - return s -} - -// SetMultipartUpload sets the MultipartUpload field's value. -func (s *CompleteMultipartUploadInput) SetMultipartUpload(v *CompletedMultipartUpload) *CompleteMultipartUploadInput { - s.MultipartUpload = v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *CompleteMultipartUploadInput) SetRequestPayer(v string) *CompleteMultipartUploadInput { - s.RequestPayer = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CompleteMultipartUploadInput) SetUploadId(v string) *CompleteMultipartUploadInput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUploadOutput -type CompleteMultipartUploadOutput struct { - _ struct{} `type:"structure"` - - Bucket *string `type:"string"` - - // Entity tag of the object. - ETag *string `type:"string"` - - // If the object expiration is configured, this will contain the expiration - // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - Key *string `min:"1" type:"string"` - - Location *string `type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Version of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation -func (s CompleteMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteMultipartUploadOutput) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *CompleteMultipartUploadOutput) SetBucket(v string) *CompleteMultipartUploadOutput { - s.Bucket = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *CompleteMultipartUploadOutput) SetETag(v string) *CompleteMultipartUploadOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *CompleteMultipartUploadOutput) SetExpiration(v string) *CompleteMultipartUploadOutput { - s.Expiration = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CompleteMultipartUploadOutput) SetKey(v string) *CompleteMultipartUploadOutput { - s.Key = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *CompleteMultipartUploadOutput) SetLocation(v string) *CompleteMultipartUploadOutput { - s.Location = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *CompleteMultipartUploadOutput) SetRequestCharged(v string) *CompleteMultipartUploadOutput { - s.RequestCharged = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CompleteMultipartUploadOutput) SetSSEKMSKeyId(v string) *CompleteMultipartUploadOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CompleteMultipartUploadOutput) SetServerSideEncryption(v string) *CompleteMultipartUploadOutput { - s.ServerSideEncryption = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *CompleteMultipartUploadOutput) SetVersionId(v string) *CompleteMultipartUploadOutput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompletedMultipartUpload -type CompletedMultipartUpload struct { - _ struct{} `type:"structure"` - - Parts []*CompletedPart `locationName:"Part" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s CompletedMultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompletedMultipartUpload) GoString() string { - return s.String() -} - -// SetParts sets the Parts field's value. -func (s *CompletedMultipartUpload) SetParts(v []*CompletedPart) *CompletedMultipartUpload { - s.Parts = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompletedPart -type CompletedPart struct { - _ struct{} `type:"structure"` - - // Entity tag returned when the part was uploaded. - ETag *string `type:"string"` - - // Part number that identifies the part. This is a positive integer between - // 1 and 10,000. - PartNumber *int64 `type:"integer"` -} - -// String returns the string representation -func (s CompletedPart) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompletedPart) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *CompletedPart) SetETag(v string) *CompletedPart { - s.ETag = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *CompletedPart) SetPartNumber(v int64) *CompletedPart { - s.PartNumber = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Condition -type Condition struct { - _ struct{} `type:"structure"` - - // The HTTP error code when the redirect is applied. In the event of an error, - // if the error code equals this value, then the specified redirect is applied. - // Required when parent element Condition is specified and sibling KeyPrefixEquals - // is not specified. If both are specified, then both must be true for the redirect - // to be applied. - HttpErrorCodeReturnedEquals *string `type:"string"` - - // The object key name prefix when the redirect is applied. For example, to - // redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. - // To redirect request for all pages with the prefix docs/, the key prefix will - // be /docs, which identifies all objects in the docs/ folder. Required when - // the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals - // is not specified. If both conditions are specified, both must be true for - // the redirect to be applied. - KeyPrefixEquals *string `type:"string"` -} - -// String returns the string representation -func (s Condition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Condition) GoString() string { - return s.String() -} - -// SetHttpErrorCodeReturnedEquals sets the HttpErrorCodeReturnedEquals field's value. -func (s *Condition) SetHttpErrorCodeReturnedEquals(v string) *Condition { - s.HttpErrorCodeReturnedEquals = &v - return s -} - -// SetKeyPrefixEquals sets the KeyPrefixEquals field's value. -func (s *Condition) SetKeyPrefixEquals(v string) *Condition { - s.KeyPrefixEquals = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectRequest -type CopyObjectInput struct { - _ struct{} `type:"structure"` - - // The canned ACL to apply to the object. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The name of the source bucket and key name of the source object, separated - // by a slash (/). Must be URL-encoded. - // - // CopySource is a required field - CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` - - // Copies the object if its entity tag (ETag) matches the specified tag. - CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` - - // Copies the object if it has been modified since the specified time. - CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp" timestampFormat:"rfc822"` - - // Copies the object if its entity tag (ETag) is different than the specified - // ETag. - CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` - - // Copies the object if it hasn't been modified since the specified time. - CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp" timestampFormat:"rfc822"` - - // Specifies the algorithm to use when decrypting the source object (e.g., AES256). - CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt - // the source object. The encryption key provided in this header must be one - // that was used when the source object was created. - CopySourceSSECustomerKey *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` - - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to read the object data and its metadata. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the object ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to write the ACL for the applicable object. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // Specifies whether the metadata is copied from the source object or replaced - // with metadata provided in the request. - MetadataDirective *string `location:"header" locationName:"x-amz-metadata-directive" type:"string" enum:"MetadataDirective"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // 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. Documentation on configuring any of the officially supported - // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // The type of storage to use for the object. Defaults to 'STANDARD'. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The tag-set for the object destination object this value must be used in - // conjunction with the TaggingDirective. The tag-set must be encoded as URL - // Query parameters - Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` - - // Specifies whether the object tag-set are copied from the source object or - // replaced with tag-set provided in the request. - TaggingDirective *string `location:"header" locationName:"x-amz-tagging-directive" type:"string" enum:"TaggingDirective"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation -func (s CopyObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.CopySource == nil { - invalidParams.Add(request.NewErrParamRequired("CopySource")) - } - 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 -} - -// SetACL sets the ACL field's value. -func (s *CopyObjectInput) SetACL(v string) *CopyObjectInput { - s.ACL = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CopyObjectInput) SetBucket(v string) *CopyObjectInput { - s.Bucket = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *CopyObjectInput) SetCacheControl(v string) *CopyObjectInput { - s.CacheControl = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *CopyObjectInput) SetContentDisposition(v string) *CopyObjectInput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *CopyObjectInput) SetContentEncoding(v string) *CopyObjectInput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *CopyObjectInput) SetContentLanguage(v string) *CopyObjectInput { - s.ContentLanguage = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *CopyObjectInput) SetContentType(v string) *CopyObjectInput { - s.ContentType = &v - return s -} - -// SetCopySource sets the CopySource field's value. -func (s *CopyObjectInput) SetCopySource(v string) *CopyObjectInput { - s.CopySource = &v - return s -} - -// SetCopySourceIfMatch sets the CopySourceIfMatch field's value. -func (s *CopyObjectInput) SetCopySourceIfMatch(v string) *CopyObjectInput { - s.CopySourceIfMatch = &v - return s -} - -// SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. -func (s *CopyObjectInput) SetCopySourceIfModifiedSince(v time.Time) *CopyObjectInput { - s.CopySourceIfModifiedSince = &v - return s -} - -// SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. -func (s *CopyObjectInput) SetCopySourceIfNoneMatch(v string) *CopyObjectInput { - s.CopySourceIfNoneMatch = &v - return s -} - -// SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. -func (s *CopyObjectInput) SetCopySourceIfUnmodifiedSince(v time.Time) *CopyObjectInput { - s.CopySourceIfUnmodifiedSince = &v - return s -} - -// SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. -func (s *CopyObjectInput) SetCopySourceSSECustomerAlgorithm(v string) *CopyObjectInput { - s.CopySourceSSECustomerAlgorithm = &v - return s -} - -// SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. -func (s *CopyObjectInput) SetCopySourceSSECustomerKey(v string) *CopyObjectInput { - s.CopySourceSSECustomerKey = &v - return s -} - -// SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. -func (s *CopyObjectInput) SetCopySourceSSECustomerKeyMD5(v string) *CopyObjectInput { - s.CopySourceSSECustomerKeyMD5 = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *CopyObjectInput) SetExpires(v time.Time) *CopyObjectInput { - s.Expires = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *CopyObjectInput) SetGrantFullControl(v string) *CopyObjectInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *CopyObjectInput) SetGrantRead(v string) *CopyObjectInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *CopyObjectInput) SetGrantReadACP(v string) *CopyObjectInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *CopyObjectInput) SetGrantWriteACP(v string) *CopyObjectInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CopyObjectInput) SetKey(v string) *CopyObjectInput { - s.Key = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *CopyObjectInput) SetMetadata(v map[string]*string) *CopyObjectInput { - s.Metadata = v - return s -} - -// SetMetadataDirective sets the MetadataDirective field's value. -func (s *CopyObjectInput) SetMetadataDirective(v string) *CopyObjectInput { - s.MetadataDirective = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *CopyObjectInput) SetRequestPayer(v string) *CopyObjectInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CopyObjectInput) SetSSECustomerAlgorithm(v string) *CopyObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *CopyObjectInput) SetSSECustomerKey(v string) *CopyObjectInput { - s.SSECustomerKey = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CopyObjectInput) SetSSECustomerKeyMD5(v string) *CopyObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CopyObjectInput) SetSSEKMSKeyId(v string) *CopyObjectInput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CopyObjectInput) SetServerSideEncryption(v string) *CopyObjectInput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *CopyObjectInput) SetStorageClass(v string) *CopyObjectInput { - s.StorageClass = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *CopyObjectInput) SetTagging(v string) *CopyObjectInput { - s.Tagging = &v - return s -} - -// SetTaggingDirective sets the TaggingDirective field's value. -func (s *CopyObjectInput) SetTaggingDirective(v string) *CopyObjectInput { - s.TaggingDirective = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *CopyObjectInput) SetWebsiteRedirectLocation(v string) *CopyObjectInput { - s.WebsiteRedirectLocation = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectOutput -type CopyObjectOutput struct { - _ struct{} `type:"structure" payload:"CopyObjectResult"` - - CopyObjectResult *CopyObjectResult `type:"structure"` - - CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` - - // If the object expiration is configured, the response includes this header. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity - // verification of the customer-provided encryption key. - 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 (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Version ID of the newly created copy. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation -func (s CopyObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyObjectOutput) GoString() string { - return s.String() -} - -// SetCopyObjectResult sets the CopyObjectResult field's value. -func (s *CopyObjectOutput) SetCopyObjectResult(v *CopyObjectResult) *CopyObjectOutput { - s.CopyObjectResult = v - return s -} - -// SetCopySourceVersionId sets the CopySourceVersionId field's value. -func (s *CopyObjectOutput) SetCopySourceVersionId(v string) *CopyObjectOutput { - s.CopySourceVersionId = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *CopyObjectOutput) SetExpiration(v string) *CopyObjectOutput { - s.Expiration = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *CopyObjectOutput) SetRequestCharged(v string) *CopyObjectOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CopyObjectOutput) SetSSECustomerAlgorithm(v string) *CopyObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CopyObjectOutput) SetSSECustomerKeyMD5(v string) *CopyObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CopyObjectOutput) SetSSEKMSKeyId(v string) *CopyObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CopyObjectOutput) SetServerSideEncryption(v string) *CopyObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *CopyObjectOutput) SetVersionId(v string) *CopyObjectOutput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectResult -type CopyObjectResult struct { - _ struct{} `type:"structure"` - - ETag *string `type:"string"` - - LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s CopyObjectResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyObjectResult) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *CopyObjectResult) SetETag(v string) *CopyObjectResult { - s.ETag = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *CopyObjectResult) SetLastModified(v time.Time) *CopyObjectResult { - s.LastModified = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyPartResult -type CopyPartResult struct { - _ struct{} `type:"structure"` - - // Entity tag of the object. - ETag *string `type:"string"` - - // Date and time at which the object was uploaded. - LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation -func (s CopyPartResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CopyPartResult) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *CopyPartResult) SetETag(v string) *CopyPartResult { - s.ETag = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *CopyPartResult) SetLastModified(v time.Time) *CopyPartResult { - s.LastModified = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketConfiguration -type CreateBucketConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies the region where the bucket will be created. If you don't specify - // a region, the bucket will be created in US Standard. - LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` -} - -// String returns the string representation -func (s CreateBucketConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBucketConfiguration) GoString() string { - return s.String() -} - -// SetLocationConstraint sets the LocationConstraint field's value. -func (s *CreateBucketConfiguration) SetLocationConstraint(v string) *CreateBucketConfiguration { - s.LocationConstraint = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketRequest -type CreateBucketInput struct { - _ struct{} `type:"structure" payload:"CreateBucketConfiguration"` - - // The canned ACL to apply to the bucket. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - CreateBucketConfiguration *CreateBucketConfiguration `locationName:"CreateBucketConfiguration" type:"structure"` - - // Allows grantee the read, write, read ACP, and write ACP permissions on the - // bucket. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to list the objects in the bucket. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the bucket ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to create, overwrite, and delete any object in the bucket. - GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` - - // Allows grantee to write the ACL for the applicable bucket. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` -} - -// String returns the string representation -func (s CreateBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBucketInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateBucketInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateBucketInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *CreateBucketInput) SetACL(v string) *CreateBucketInput { - s.ACL = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CreateBucketInput) SetBucket(v string) *CreateBucketInput { - s.Bucket = &v - return s -} - -// SetCreateBucketConfiguration sets the CreateBucketConfiguration field's value. -func (s *CreateBucketInput) SetCreateBucketConfiguration(v *CreateBucketConfiguration) *CreateBucketInput { - s.CreateBucketConfiguration = v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *CreateBucketInput) SetGrantFullControl(v string) *CreateBucketInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *CreateBucketInput) SetGrantRead(v string) *CreateBucketInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *CreateBucketInput) SetGrantReadACP(v string) *CreateBucketInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWrite sets the GrantWrite field's value. -func (s *CreateBucketInput) SetGrantWrite(v string) *CreateBucketInput { - s.GrantWrite = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *CreateBucketInput) SetGrantWriteACP(v string) *CreateBucketInput { - s.GrantWriteACP = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketOutput -type CreateBucketOutput struct { - _ struct{} `type:"structure"` - - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation -func (s CreateBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateBucketOutput) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *CreateBucketOutput) SetLocation(v string) *CreateBucketOutput { - s.Location = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUploadRequest -type CreateMultipartUploadInput struct { - _ struct{} `type:"structure"` - - // The canned ACL to apply to the object. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` - - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to read the object data and its metadata. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the object ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to write the ACL for the applicable object. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // 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. Documentation on configuring any of the officially supported - // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // The type of storage to use for the object. Defaults to 'STANDARD'. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation -func (s CreateMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateMultipartUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMultipartUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMultipartUploadInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 -} - -// SetACL sets the ACL field's value. -func (s *CreateMultipartUploadInput) SetACL(v string) *CreateMultipartUploadInput { - s.ACL = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CreateMultipartUploadInput) SetBucket(v string) *CreateMultipartUploadInput { - s.Bucket = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *CreateMultipartUploadInput) SetCacheControl(v string) *CreateMultipartUploadInput { - s.CacheControl = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *CreateMultipartUploadInput) SetContentDisposition(v string) *CreateMultipartUploadInput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *CreateMultipartUploadInput) SetContentEncoding(v string) *CreateMultipartUploadInput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *CreateMultipartUploadInput) SetContentLanguage(v string) *CreateMultipartUploadInput { - s.ContentLanguage = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *CreateMultipartUploadInput) SetContentType(v string) *CreateMultipartUploadInput { - s.ContentType = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *CreateMultipartUploadInput) SetExpires(v time.Time) *CreateMultipartUploadInput { - s.Expires = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *CreateMultipartUploadInput) SetGrantFullControl(v string) *CreateMultipartUploadInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *CreateMultipartUploadInput) SetGrantRead(v string) *CreateMultipartUploadInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *CreateMultipartUploadInput) SetGrantReadACP(v string) *CreateMultipartUploadInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *CreateMultipartUploadInput) SetGrantWriteACP(v string) *CreateMultipartUploadInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CreateMultipartUploadInput) SetKey(v string) *CreateMultipartUploadInput { - s.Key = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *CreateMultipartUploadInput) SetMetadata(v map[string]*string) *CreateMultipartUploadInput { - s.Metadata = v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *CreateMultipartUploadInput) SetRequestPayer(v string) *CreateMultipartUploadInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CreateMultipartUploadInput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *CreateMultipartUploadInput) SetSSECustomerKey(v string) *CreateMultipartUploadInput { - s.SSECustomerKey = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CreateMultipartUploadInput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CreateMultipartUploadInput) SetSSEKMSKeyId(v string) *CreateMultipartUploadInput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CreateMultipartUploadInput) SetServerSideEncryption(v string) *CreateMultipartUploadInput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *CreateMultipartUploadInput) SetStorageClass(v string) *CreateMultipartUploadInput { - s.StorageClass = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *CreateMultipartUploadInput) SetWebsiteRedirectLocation(v string) *CreateMultipartUploadInput { - s.WebsiteRedirectLocation = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUploadOutput -type CreateMultipartUploadOutput struct { - _ struct{} `type:"structure"` - - // Date when multipart upload will become eligible for abort operation by lifecycle. - AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp" timestampFormat:"rfc822"` - - // Id of the lifecycle rule that makes a multipart upload eligible for abort - // operation. - AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` - - // Name of the bucket to which the multipart upload was initiated. - Bucket *string `locationName:"Bucket" type:"string"` - - // Object key for which the multipart upload was initiated. - Key *string `min:"1" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity - // verification of the customer-provided encryption key. - 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 (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // ID for the initiated multipart upload. - UploadId *string `type:"string"` -} - -// String returns the string representation -func (s CreateMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateMultipartUploadOutput) GoString() string { - return s.String() -} - -// SetAbortDate sets the AbortDate field's value. -func (s *CreateMultipartUploadOutput) SetAbortDate(v time.Time) *CreateMultipartUploadOutput { - s.AbortDate = &v - return s -} - -// SetAbortRuleId sets the AbortRuleId field's value. -func (s *CreateMultipartUploadOutput) SetAbortRuleId(v string) *CreateMultipartUploadOutput { - s.AbortRuleId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CreateMultipartUploadOutput) SetBucket(v string) *CreateMultipartUploadOutput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CreateMultipartUploadOutput) SetKey(v string) *CreateMultipartUploadOutput { - s.Key = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *CreateMultipartUploadOutput) SetRequestCharged(v string) *CreateMultipartUploadOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CreateMultipartUploadOutput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CreateMultipartUploadOutput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CreateMultipartUploadOutput) SetSSEKMSKeyId(v string) *CreateMultipartUploadOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CreateMultipartUploadOutput) SetServerSideEncryption(v string) *CreateMultipartUploadOutput { - s.ServerSideEncryption = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CreateMultipartUploadOutput) SetUploadId(v string) *CreateMultipartUploadOutput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Delete -type Delete struct { - _ struct{} `type:"structure"` - - // Objects is a required field - Objects []*ObjectIdentifier `locationName:"Object" type:"list" flattened:"true" required:"true"` - - // Element to enable quiet mode for the request. When you add this element, - // you must set its value to true. - Quiet *bool `type:"boolean"` -} - -// String returns the string representation -func (s Delete) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Delete) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Delete) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Delete"} - if s.Objects == nil { - invalidParams.Add(request.NewErrParamRequired("Objects")) - } - if s.Objects != nil { - for i, v := range s.Objects { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Objects", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetObjects sets the Objects field's value. -func (s *Delete) SetObjects(v []*ObjectIdentifier) *Delete { - s.Objects = v - return s -} - -// SetQuiet sets the Quiet field's value. -func (s *Delete) SetQuiet(v bool) *Delete { - s.Quiet = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfigurationRequest -type DeleteBucketAnalyticsConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket from which an analytics configuration is deleted. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The identifier used to represent an analytics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketAnalyticsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketAnalyticsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketAnalyticsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketAnalyticsConfigurationInput) SetBucket(v string) *DeleteBucketAnalyticsConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteBucketAnalyticsConfigurationInput) SetId(v string) *DeleteBucketAnalyticsConfigurationInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfigurationOutput -type DeleteBucketAnalyticsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketAnalyticsConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCorsRequest -type DeleteBucketCorsInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketCorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketCorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketCorsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketCorsInput) SetBucket(v string) *DeleteBucketCorsInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCorsOutput -type DeleteBucketCorsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketCorsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketRequest -type DeleteBucketInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketInput) SetBucket(v string) *DeleteBucketInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfigurationRequest -type DeleteBucketInventoryConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket containing the inventory configuration to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketInventoryConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketInventoryConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInventoryConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketInventoryConfigurationInput) SetBucket(v string) *DeleteBucketInventoryConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteBucketInventoryConfigurationInput) SetId(v string) *DeleteBucketInventoryConfigurationInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfigurationOutput -type DeleteBucketInventoryConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketInventoryConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycleRequest -type DeleteBucketLifecycleInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketLifecycleInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketLifecycleInput) SetBucket(v string) *DeleteBucketLifecycleInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycleOutput -type DeleteBucketLifecycleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketLifecycleOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfigurationRequest -type DeleteBucketMetricsConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket containing the metrics configuration to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketMetricsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketMetricsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketMetricsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketMetricsConfigurationInput) SetBucket(v string) *DeleteBucketMetricsConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteBucketMetricsConfigurationInput) SetId(v string) *DeleteBucketMetricsConfigurationInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfigurationOutput -type DeleteBucketMetricsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketMetricsConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketOutput -type DeleteBucketOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicyRequest -type DeleteBucketPolicyInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketPolicyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketPolicyInput) SetBucket(v string) *DeleteBucketPolicyInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicyOutput -type DeleteBucketPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplicationRequest -type DeleteBucketReplicationInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketReplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketReplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketReplicationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketReplicationInput) SetBucket(v string) *DeleteBucketReplicationInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplicationOutput -type DeleteBucketReplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketReplicationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTaggingRequest -type DeleteBucketTaggingInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketTaggingInput) SetBucket(v string) *DeleteBucketTaggingInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTaggingOutput -type DeleteBucketTaggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketTaggingOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsiteRequest -type DeleteBucketWebsiteInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketWebsiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketWebsiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketWebsiteInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketWebsiteInput) SetBucket(v string) *DeleteBucketWebsiteInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsiteOutput -type DeleteBucketWebsiteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteBucketWebsiteOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteMarkerEntry -type DeleteMarkerEntry struct { - _ struct{} `type:"structure"` - - // Specifies whether the object is (true) or is not (false) the latest version - // of an object. - IsLatest *bool `type:"boolean"` - - // The object key. - Key *string `min:"1" type:"string"` - - // Date and time the object was last modified. - LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - Owner *Owner `type:"structure"` - - // Version ID of an object. - VersionId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteMarkerEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMarkerEntry) GoString() string { - return s.String() -} - -// SetIsLatest sets the IsLatest field's value. -func (s *DeleteMarkerEntry) SetIsLatest(v bool) *DeleteMarkerEntry { - s.IsLatest = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteMarkerEntry) SetKey(v string) *DeleteMarkerEntry { - s.Key = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *DeleteMarkerEntry) SetLastModified(v time.Time) *DeleteMarkerEntry { - s.LastModified = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *DeleteMarkerEntry) SetOwner(v *Owner) *DeleteMarkerEntry { - s.Owner = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteMarkerEntry) SetVersionId(v string) *DeleteMarkerEntry { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectRequest -type DeleteObjectInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The concatenation of the authentication device's serial number, a space, - // and the value that is displayed on your authentication device. - 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s DeleteObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 *DeleteObjectInput) SetBucket(v string) *DeleteObjectInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteObjectInput) SetKey(v string) *DeleteObjectInput { - s.Key = &v - return s -} - -// SetMFA sets the MFA field's value. -func (s *DeleteObjectInput) SetMFA(v string) *DeleteObjectInput { - s.MFA = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *DeleteObjectInput) SetRequestPayer(v string) *DeleteObjectInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectInput) SetVersionId(v string) *DeleteObjectInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectOutput -type DeleteObjectOutput struct { - _ struct{} `type:"structure"` - - // Specifies whether the versioned object that was permanently deleted was (true) - // or was not (false) a delete marker. - DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Returns the version ID of the delete marker created as a result of the DELETE - // operation. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation -func (s DeleteObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteObjectOutput) GoString() string { - return s.String() -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *DeleteObjectOutput) SetDeleteMarker(v bool) *DeleteObjectOutput { - s.DeleteMarker = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *DeleteObjectOutput) SetRequestCharged(v string) *DeleteObjectOutput { - s.RequestCharged = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectOutput) SetVersionId(v string) *DeleteObjectOutput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTaggingRequest -type DeleteObjectTaggingInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The versionId of the object that the tag-set will be removed from. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s DeleteObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteObjectTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteObjectTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteObjectTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 *DeleteObjectTaggingInput) SetBucket(v string) *DeleteObjectTaggingInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteObjectTaggingInput) SetKey(v string) *DeleteObjectTaggingInput { - s.Key = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectTaggingInput) SetVersionId(v string) *DeleteObjectTaggingInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTaggingOutput -type DeleteObjectTaggingOutput struct { - _ struct{} `type:"structure"` - - // The versionId of the object the tag-set was removed from. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation -func (s DeleteObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteObjectTaggingOutput) GoString() string { - return s.String() -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectTaggingOutput) SetVersionId(v string) *DeleteObjectTaggingOutput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectsRequest -type DeleteObjectsInput struct { - _ struct{} `type:"structure" payload:"Delete"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Delete is a required field - Delete *Delete `locationName:"Delete" type:"structure" required:"true"` - - // The concatenation of the authentication device's serial number, a space, - // and the value that is displayed on your authentication device. - 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation -func (s DeleteObjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteObjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteObjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteObjectsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Delete == nil { - invalidParams.Add(request.NewErrParamRequired("Delete")) - } - if s.Delete != nil { - if err := s.Delete.Validate(); err != nil { - invalidParams.AddNested("Delete", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteObjectsInput) SetBucket(v string) *DeleteObjectsInput { - s.Bucket = &v - return s -} - -// SetDelete sets the Delete field's value. -func (s *DeleteObjectsInput) SetDelete(v *Delete) *DeleteObjectsInput { - s.Delete = v - return s -} - -// SetMFA sets the MFA field's value. -func (s *DeleteObjectsInput) SetMFA(v string) *DeleteObjectsInput { - s.MFA = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *DeleteObjectsInput) SetRequestPayer(v string) *DeleteObjectsInput { - s.RequestPayer = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectsOutput -type DeleteObjectsOutput struct { - _ struct{} `type:"structure"` - - Deleted []*DeletedObject `type:"list" flattened:"true"` - - Errors []*Error `locationName:"Error" type:"list" flattened:"true"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation -func (s DeleteObjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteObjectsOutput) GoString() string { - return s.String() -} - -// SetDeleted sets the Deleted field's value. -func (s *DeleteObjectsOutput) SetDeleted(v []*DeletedObject) *DeleteObjectsOutput { - s.Deleted = v - return s -} - -// SetErrors sets the Errors field's value. -func (s *DeleteObjectsOutput) SetErrors(v []*Error) *DeleteObjectsOutput { - s.Errors = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *DeleteObjectsOutput) SetRequestCharged(v string) *DeleteObjectsOutput { - s.RequestCharged = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletedObject -type DeletedObject struct { - _ struct{} `type:"structure"` - - DeleteMarker *bool `type:"boolean"` - - DeleteMarkerVersionId *string `type:"string"` - - Key *string `min:"1" type:"string"` - - VersionId *string `type:"string"` -} - -// String returns the string representation -func (s DeletedObject) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeletedObject) GoString() string { - return s.String() -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *DeletedObject) SetDeleteMarker(v bool) *DeletedObject { - s.DeleteMarker = &v - return s -} - -// SetDeleteMarkerVersionId sets the DeleteMarkerVersionId field's value. -func (s *DeletedObject) SetDeleteMarkerVersionId(v string) *DeletedObject { - s.DeleteMarkerVersionId = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeletedObject) SetKey(v string) *DeletedObject { - s.Key = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeletedObject) SetVersionId(v string) *DeletedObject { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Destination -type Destination struct { - _ struct{} `type:"structure"` - - // Amazon resource name (ARN) of the bucket where you want Amazon S3 to store - // replicas of the object identified by the rule. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"StorageClass"` -} - -// String returns the string representation -func (s Destination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Destination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Destination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Destination"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *Destination) SetBucket(v string) *Destination { - s.Bucket = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *Destination) SetStorageClass(v string) *Destination { - s.StorageClass = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Error -type Error struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Key *string `min:"1" type:"string"` - - Message *string `type:"string"` - - VersionId *string `type:"string"` -} - -// String returns the string representation -func (s Error) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Error) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *Error) SetCode(v string) *Error { - s.Code = &v - return s -} - -// SetKey sets the Key field's value. -func (s *Error) SetKey(v string) *Error { - s.Key = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *Error) SetMessage(v string) *Error { - s.Message = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *Error) SetVersionId(v string) *Error { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ErrorDocument -type ErrorDocument struct { - _ struct{} `type:"structure"` - - // The object key name to use when a 4XX class error occurs. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s ErrorDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorDocument) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ErrorDocument) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ErrorDocument"} - 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 -} - -// SetKey sets the Key field's value. -func (s *ErrorDocument) SetKey(v string) *ErrorDocument { - s.Key = &v - return s -} - -// Container for key value pair that defines the criteria for the filter rule. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/FilterRule -type FilterRule struct { - _ struct{} `type:"structure"` - - // Object key name prefix or suffix identifying one or more objects to which - // the filtering rule applies. Maximum prefix length can be up to 1,024 characters. - // Overlapping prefixes and suffixes are not supported. For more information, - // go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - Name *string `type:"string" enum:"FilterRuleName"` - - Value *string `type:"string"` -} - -// String returns the string representation -func (s FilterRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s FilterRule) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *FilterRule) SetName(v string) *FilterRule { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *FilterRule) SetValue(v string) *FilterRule { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfigurationRequest -type GetBucketAccelerateConfigurationInput struct { - _ struct{} `type:"structure"` - - // Name of the bucket for which the accelerate configuration is retrieved. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketAccelerateConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketAccelerateConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketAccelerateConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketAccelerateConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketAccelerateConfigurationInput) SetBucket(v string) *GetBucketAccelerateConfigurationInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfigurationOutput -type GetBucketAccelerateConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The accelerate configuration of the bucket. - Status *string `type:"string" enum:"BucketAccelerateStatus"` -} - -// String returns the string representation -func (s GetBucketAccelerateConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketAccelerateConfigurationOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *GetBucketAccelerateConfigurationOutput) SetStatus(v string) *GetBucketAccelerateConfigurationOutput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAclRequest -type GetBucketAclInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketAclInput) SetBucket(v string) *GetBucketAclInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAclOutput -type GetBucketAclOutput struct { - _ struct{} `type:"structure"` - - // A list of grants. - Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` - - Owner *Owner `type:"structure"` -} - -// String returns the string representation -func (s GetBucketAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketAclOutput) GoString() string { - return s.String() -} - -// SetGrants sets the Grants field's value. -func (s *GetBucketAclOutput) SetGrants(v []*Grant) *GetBucketAclOutput { - s.Grants = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *GetBucketAclOutput) SetOwner(v *Owner) *GetBucketAclOutput { - s.Owner = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfigurationRequest -type GetBucketAnalyticsConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket from which an analytics configuration is retrieved. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The identifier used to represent an analytics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketAnalyticsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketAnalyticsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketAnalyticsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketAnalyticsConfigurationInput) SetBucket(v string) *GetBucketAnalyticsConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfigurationOutput -type GetBucketAnalyticsConfigurationOutput struct { - _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` - - // The configuration and any analyses for the analytics filter. - AnalyticsConfiguration *AnalyticsConfiguration `type:"structure"` -} - -// String returns the string representation -func (s GetBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketAnalyticsConfigurationOutput) GoString() string { - return s.String() -} - -// SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. -func (s *GetBucketAnalyticsConfigurationOutput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *GetBucketAnalyticsConfigurationOutput { - s.AnalyticsConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCorsRequest -type GetBucketCorsInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketCorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketCorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketCorsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketCorsInput) SetBucket(v string) *GetBucketCorsInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCorsOutput -type GetBucketCorsOutput struct { - _ struct{} `type:"structure"` - - CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s GetBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketCorsOutput) GoString() string { - return s.String() -} - -// SetCORSRules sets the CORSRules field's value. -func (s *GetBucketCorsOutput) SetCORSRules(v []*CORSRule) *GetBucketCorsOutput { - s.CORSRules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfigurationRequest -type GetBucketInventoryConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket containing the inventory configuration to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketInventoryConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketInventoryConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketInventoryConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketInventoryConfigurationInput) SetBucket(v string) *GetBucketInventoryConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetBucketInventoryConfigurationInput) SetId(v string) *GetBucketInventoryConfigurationInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfigurationOutput -type GetBucketInventoryConfigurationOutput struct { - _ struct{} `type:"structure" payload:"InventoryConfiguration"` - - // Specifies the inventory configuration. - InventoryConfiguration *InventoryConfiguration `type:"structure"` -} - -// String returns the string representation -func (s GetBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketInventoryConfigurationOutput) GoString() string { - return s.String() -} - -// SetInventoryConfiguration sets the InventoryConfiguration field's value. -func (s *GetBucketInventoryConfigurationOutput) SetInventoryConfiguration(v *InventoryConfiguration) *GetBucketInventoryConfigurationOutput { - s.InventoryConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfigurationRequest -type GetBucketLifecycleConfigurationInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketLifecycleConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLifecycleConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLifecycleConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLifecycleConfigurationInput) SetBucket(v string) *GetBucketLifecycleConfigurationInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfigurationOutput -type GetBucketLifecycleConfigurationOutput struct { - _ struct{} `type:"structure"` - - Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s GetBucketLifecycleConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLifecycleConfigurationOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *GetBucketLifecycleConfigurationOutput) SetRules(v []*LifecycleRule) *GetBucketLifecycleConfigurationOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleRequest -type GetBucketLifecycleInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLifecycleInput) SetBucket(v string) *GetBucketLifecycleInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleOutput -type GetBucketLifecycleOutput struct { - _ struct{} `type:"structure"` - - Rules []*Rule `locationName:"Rule" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s GetBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLifecycleOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *GetBucketLifecycleOutput) SetRules(v []*Rule) *GetBucketLifecycleOutput { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationRequest -type GetBucketLocationInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketLocationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLocationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLocationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLocationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLocationInput) SetBucket(v string) *GetBucketLocationInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationOutput -type GetBucketLocationOutput struct { - _ struct{} `type:"structure"` - - LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` -} - -// String returns the string representation -func (s GetBucketLocationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLocationOutput) GoString() string { - return s.String() -} - -// SetLocationConstraint sets the LocationConstraint field's value. -func (s *GetBucketLocationOutput) SetLocationConstraint(v string) *GetBucketLocationOutput { - s.LocationConstraint = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLoggingRequest -type GetBucketLoggingInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLoggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLoggingInput) SetBucket(v string) *GetBucketLoggingInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLoggingOutput -type GetBucketLoggingOutput struct { - _ struct{} `type:"structure"` - - LoggingEnabled *LoggingEnabled `type:"structure"` -} - -// String returns the string representation -func (s GetBucketLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketLoggingOutput) GoString() string { - return s.String() -} - -// SetLoggingEnabled sets the LoggingEnabled field's value. -func (s *GetBucketLoggingOutput) SetLoggingEnabled(v *LoggingEnabled) *GetBucketLoggingOutput { - s.LoggingEnabled = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfigurationRequest -type GetBucketMetricsConfigurationInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket containing the metrics configuration to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketMetricsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketMetricsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketMetricsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketMetricsConfigurationInput) SetBucket(v string) *GetBucketMetricsConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetBucketMetricsConfigurationInput) SetId(v string) *GetBucketMetricsConfigurationInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfigurationOutput -type GetBucketMetricsConfigurationOutput struct { - _ struct{} `type:"structure" payload:"MetricsConfiguration"` - - // Specifies the metrics configuration. - MetricsConfiguration *MetricsConfiguration `type:"structure"` -} - -// String returns the string representation -func (s GetBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketMetricsConfigurationOutput) GoString() string { - return s.String() -} - -// SetMetricsConfiguration sets the MetricsConfiguration field's value. -func (s *GetBucketMetricsConfigurationOutput) SetMetricsConfiguration(v *MetricsConfiguration) *GetBucketMetricsConfigurationOutput { - s.MetricsConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfigurationRequest -type GetBucketNotificationConfigurationRequest struct { - _ struct{} `type:"structure"` - - // Name of the bucket to get the notification configuration for. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketNotificationConfigurationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketNotificationConfigurationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketNotificationConfigurationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketNotificationConfigurationRequest"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketNotificationConfigurationRequest) SetBucket(v string) *GetBucketNotificationConfigurationRequest { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyRequest -type GetBucketPolicyInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketPolicyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketPolicyInput) SetBucket(v string) *GetBucketPolicyInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyOutput -type GetBucketPolicyOutput struct { - _ struct{} `type:"structure" payload:"Policy"` - - // The bucket policy as a JSON document. - Policy *string `type:"string"` -} - -// String returns the string representation -func (s GetBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetBucketPolicyOutput) SetPolicy(v string) *GetBucketPolicyOutput { - s.Policy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplicationRequest -type GetBucketReplicationInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketReplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketReplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketReplicationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketReplicationInput) SetBucket(v string) *GetBucketReplicationInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplicationOutput -type GetBucketReplicationOutput struct { - _ struct{} `type:"structure" payload:"ReplicationConfiguration"` - - // Container for replication rules. You can add as many as 1,000 rules. Total - // replication configuration size can be up to 2 MB. - ReplicationConfiguration *ReplicationConfiguration `type:"structure"` -} - -// String returns the string representation -func (s GetBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketReplicationOutput) GoString() string { - return s.String() -} - -// SetReplicationConfiguration sets the ReplicationConfiguration field's value. -func (s *GetBucketReplicationOutput) SetReplicationConfiguration(v *ReplicationConfiguration) *GetBucketReplicationOutput { - s.ReplicationConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPaymentRequest -type GetBucketRequestPaymentInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketRequestPaymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketRequestPaymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketRequestPaymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketRequestPaymentInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketRequestPaymentInput) SetBucket(v string) *GetBucketRequestPaymentInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPaymentOutput -type GetBucketRequestPaymentOutput struct { - _ struct{} `type:"structure"` - - // Specifies who pays for the download and request fees. - Payer *string `type:"string" enum:"Payer"` -} - -// String returns the string representation -func (s GetBucketRequestPaymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketRequestPaymentOutput) GoString() string { - return s.String() -} - -// SetPayer sets the Payer field's value. -func (s *GetBucketRequestPaymentOutput) SetPayer(v string) *GetBucketRequestPaymentOutput { - s.Payer = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTaggingRequest -type GetBucketTaggingInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketTaggingInput) SetBucket(v string) *GetBucketTaggingInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTaggingOutput -type GetBucketTaggingOutput struct { - _ struct{} `type:"structure"` - - // TagSet is a required field - TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` -} - -// String returns the string representation -func (s GetBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketTaggingOutput) GoString() string { - return s.String() -} - -// SetTagSet sets the TagSet field's value. -func (s *GetBucketTaggingOutput) SetTagSet(v []*Tag) *GetBucketTaggingOutput { - s.TagSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioningRequest -type GetBucketVersioningInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketVersioningInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketVersioningInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketVersioningInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketVersioningInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketVersioningInput) SetBucket(v string) *GetBucketVersioningInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioningOutput -type GetBucketVersioningOutput struct { - _ struct{} `type:"structure"` - - // Specifies whether MFA delete is enabled in the bucket versioning configuration. - // This element is only returned if the bucket has been configured with MFA - // delete. If the bucket has never been so configured, this element is not returned. - MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADeleteStatus"` - - // The versioning state of the bucket. - Status *string `type:"string" enum:"BucketVersioningStatus"` -} - -// String returns the string representation -func (s GetBucketVersioningOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketVersioningOutput) GoString() string { - return s.String() -} - -// SetMFADelete sets the MFADelete field's value. -func (s *GetBucketVersioningOutput) SetMFADelete(v string) *GetBucketVersioningOutput { - s.MFADelete = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetBucketVersioningOutput) SetStatus(v string) *GetBucketVersioningOutput { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsiteRequest -type GetBucketWebsiteInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketWebsiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketWebsiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketWebsiteInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketWebsiteInput) SetBucket(v string) *GetBucketWebsiteInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsiteOutput -type GetBucketWebsiteOutput struct { - _ struct{} `type:"structure"` - - ErrorDocument *ErrorDocument `type:"structure"` - - IndexDocument *IndexDocument `type:"structure"` - - RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` - - RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` -} - -// String returns the string representation -func (s GetBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetBucketWebsiteOutput) GoString() string { - return s.String() -} - -// SetErrorDocument sets the ErrorDocument field's value. -func (s *GetBucketWebsiteOutput) SetErrorDocument(v *ErrorDocument) *GetBucketWebsiteOutput { - s.ErrorDocument = v - return s -} - -// SetIndexDocument sets the IndexDocument field's value. -func (s *GetBucketWebsiteOutput) SetIndexDocument(v *IndexDocument) *GetBucketWebsiteOutput { - s.IndexDocument = v - return s -} - -// SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. -func (s *GetBucketWebsiteOutput) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *GetBucketWebsiteOutput { - s.RedirectAllRequestsTo = v - return s -} - -// SetRoutingRules sets the RoutingRules field's value. -func (s *GetBucketWebsiteOutput) SetRoutingRules(v []*RoutingRule) *GetBucketWebsiteOutput { - s.RoutingRules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAclRequest -type GetObjectAclInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s GetObjectAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 *GetObjectAclInput) SetBucket(v string) *GetObjectAclInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectAclInput) SetKey(v string) *GetObjectAclInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectAclInput) SetRequestPayer(v string) *GetObjectAclInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectAclInput) SetVersionId(v string) *GetObjectAclInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAclOutput -type GetObjectAclOutput struct { - _ struct{} `type:"structure"` - - // A list of grants. - Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` - - Owner *Owner `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation -func (s GetObjectAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectAclOutput) GoString() string { - return s.String() -} - -// SetGrants sets the Grants field's value. -func (s *GetObjectAclOutput) SetGrants(v []*Grant) *GetObjectAclOutput { - s.Grants = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *GetObjectAclOutput) SetOwner(v *Owner) *GetObjectAclOutput { - s.Owner = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *GetObjectAclOutput) SetRequestCharged(v string) *GetObjectAclOutput { - s.RequestCharged = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRequest -type GetObjectInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Return the object only if its entity tag (ETag) is the same as the one specified, - // otherwise return a 412 (precondition failed). - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` - - // Return the object only if it has been modified since the specified time, - // otherwise return a 304 (not modified). - IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp" timestampFormat:"rfc822"` - - // Return the object only if its entity tag (ETag) is different from the one - // specified, otherwise return a 304 (not modified). - IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` - - // Return the object only if it has not been modified since the specified time, - // otherwise return a 412 (precondition failed). - IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp" timestampFormat:"rfc822"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of the object being read. This is a positive integer between - // 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. - // Useful for downloading just a part of an object. - PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` - - // Downloads the specified range bytes of an object. For more information about - // the HTTP Range header, go to 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Sets the Cache-Control header of the response. - ResponseCacheControl *string `location:"querystring" locationName:"response-cache-control" type:"string"` - - // Sets the Content-Disposition header of the response - ResponseContentDisposition *string `location:"querystring" locationName:"response-content-disposition" type:"string"` - - // Sets the Content-Encoding header of the response. - ResponseContentEncoding *string `location:"querystring" locationName:"response-content-encoding" type:"string"` - - // Sets the Content-Language header of the response. - ResponseContentLanguage *string `location:"querystring" locationName:"response-content-language" type:"string"` - - // Sets the Content-Type header of the response. - ResponseContentType *string `location:"querystring" locationName:"response-content-type" type:"string"` - - // Sets the Expires header of the response. - ResponseExpires *time.Time `location:"querystring" locationName:"response-expires" type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s GetObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 *GetObjectInput) SetBucket(v string) *GetObjectInput { - s.Bucket = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *GetObjectInput) SetIfMatch(v string) *GetObjectInput { - s.IfMatch = &v - return s -} - -// SetIfModifiedSince sets the IfModifiedSince field's value. -func (s *GetObjectInput) SetIfModifiedSince(v time.Time) *GetObjectInput { - s.IfModifiedSince = &v - return s -} - -// SetIfNoneMatch sets the IfNoneMatch field's value. -func (s *GetObjectInput) SetIfNoneMatch(v string) *GetObjectInput { - s.IfNoneMatch = &v - return s -} - -// SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. -func (s *GetObjectInput) SetIfUnmodifiedSince(v time.Time) *GetObjectInput { - s.IfUnmodifiedSince = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectInput) SetKey(v string) *GetObjectInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *GetObjectInput) SetPartNumber(v int64) *GetObjectInput { - s.PartNumber = &v - return s -} - -// SetRange sets the Range field's value. -func (s *GetObjectInput) SetRange(v string) *GetObjectInput { - s.Range = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectInput) SetRequestPayer(v string) *GetObjectInput { - s.RequestPayer = &v - return s -} - -// SetResponseCacheControl sets the ResponseCacheControl field's value. -func (s *GetObjectInput) SetResponseCacheControl(v string) *GetObjectInput { - s.ResponseCacheControl = &v - return s -} - -// SetResponseContentDisposition sets the ResponseContentDisposition field's value. -func (s *GetObjectInput) SetResponseContentDisposition(v string) *GetObjectInput { - s.ResponseContentDisposition = &v - return s -} - -// SetResponseContentEncoding sets the ResponseContentEncoding field's value. -func (s *GetObjectInput) SetResponseContentEncoding(v string) *GetObjectInput { - s.ResponseContentEncoding = &v - return s -} - -// SetResponseContentLanguage sets the ResponseContentLanguage field's value. -func (s *GetObjectInput) SetResponseContentLanguage(v string) *GetObjectInput { - s.ResponseContentLanguage = &v - return s -} - -// SetResponseContentType sets the ResponseContentType field's value. -func (s *GetObjectInput) SetResponseContentType(v string) *GetObjectInput { - s.ResponseContentType = &v - return s -} - -// SetResponseExpires sets the ResponseExpires field's value. -func (s *GetObjectInput) SetResponseExpires(v time.Time) *GetObjectInput { - s.ResponseExpires = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *GetObjectInput) SetSSECustomerAlgorithm(v string) *GetObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *GetObjectInput) SetSSECustomerKey(v string) *GetObjectInput { - s.SSECustomerKey = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *GetObjectInput) SetSSECustomerKeyMD5(v string) *GetObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectInput) SetVersionId(v string) *GetObjectInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectOutput -type GetObjectOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` - - // Object data. - Body io.ReadCloser `type:"blob"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // Size of the body in bytes. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // The portion of the object returned in the response. - ContentRange *string `location:"header" locationName:"Content-Range" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // Specifies whether the object retrieved was (true) or was not (false) a Delete - // Marker. If false, this response header does not appear in the response. - DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` - - // An ETag is an opaque identifier assigned by a web server to a specific version - // of a resource found at a URL - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key value pairs - // providing object expiration information. The value of the rule-id is URL - // encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *string `location:"header" locationName:"Expires" type:"string"` - - // Last modified date of the object - LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp" timestampFormat:"rfc822"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // This is set to the number of metadata entries not returned in x-amz-meta - // headers. This can happen if you create metadata using an API like SOAP that - // supports more flexible metadata than the REST API. For example, using SOAP, - // you can create metadata whose values are not legal HTTP headers. - MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` - - // The count of parts this object has. - PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` - - ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Provides information about object restoration operation and expiration time - // of the restored object copy. - Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity - // verification of the customer-provided encryption key. - 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 (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The number of tags, if any, on the object. - TagCount *int64 `location:"header" locationName:"x-amz-tagging-count" type:"integer"` - - // Version of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation -func (s GetObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectOutput) GoString() string { - return s.String() -} - -// SetAcceptRanges sets the AcceptRanges field's value. -func (s *GetObjectOutput) SetAcceptRanges(v string) *GetObjectOutput { - s.AcceptRanges = &v - return s -} - -// SetBody sets the Body field's value. -func (s *GetObjectOutput) SetBody(v io.ReadCloser) *GetObjectOutput { - s.Body = v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *GetObjectOutput) SetCacheControl(v string) *GetObjectOutput { - s.CacheControl = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *GetObjectOutput) SetContentDisposition(v string) *GetObjectOutput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *GetObjectOutput) SetContentEncoding(v string) *GetObjectOutput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *GetObjectOutput) SetContentLanguage(v string) *GetObjectOutput { - s.ContentLanguage = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *GetObjectOutput) SetContentLength(v int64) *GetObjectOutput { - s.ContentLength = &v - return s -} - -// SetContentRange sets the ContentRange field's value. -func (s *GetObjectOutput) SetContentRange(v string) *GetObjectOutput { - s.ContentRange = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *GetObjectOutput) SetContentType(v string) *GetObjectOutput { - s.ContentType = &v - return s -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *GetObjectOutput) SetDeleteMarker(v bool) *GetObjectOutput { - s.DeleteMarker = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *GetObjectOutput) SetETag(v string) *GetObjectOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *GetObjectOutput) SetExpiration(v string) *GetObjectOutput { - s.Expiration = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *GetObjectOutput) SetExpires(v string) *GetObjectOutput { - s.Expires = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetObjectOutput) SetLastModified(v time.Time) *GetObjectOutput { - s.LastModified = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetObjectOutput) SetMetadata(v map[string]*string) *GetObjectOutput { - s.Metadata = v - return s -} - -// SetMissingMeta sets the MissingMeta field's value. -func (s *GetObjectOutput) SetMissingMeta(v int64) *GetObjectOutput { - s.MissingMeta = &v - return s -} - -// SetPartsCount sets the PartsCount field's value. -func (s *GetObjectOutput) SetPartsCount(v int64) *GetObjectOutput { - s.PartsCount = &v - return s -} - -// SetReplicationStatus sets the ReplicationStatus field's value. -func (s *GetObjectOutput) SetReplicationStatus(v string) *GetObjectOutput { - s.ReplicationStatus = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *GetObjectOutput) SetRequestCharged(v string) *GetObjectOutput { - s.RequestCharged = &v - return s -} - -// SetRestore sets the Restore field's value. -func (s *GetObjectOutput) SetRestore(v string) *GetObjectOutput { - s.Restore = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *GetObjectOutput) SetSSECustomerAlgorithm(v string) *GetObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *GetObjectOutput) SetSSECustomerKeyMD5(v string) *GetObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *GetObjectOutput) SetSSEKMSKeyId(v string) *GetObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *GetObjectOutput) SetServerSideEncryption(v string) *GetObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *GetObjectOutput) SetStorageClass(v string) *GetObjectOutput { - s.StorageClass = &v - return s -} - -// SetTagCount sets the TagCount field's value. -func (s *GetObjectOutput) SetTagCount(v int64) *GetObjectOutput { - s.TagCount = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectOutput) SetVersionId(v string) *GetObjectOutput { - s.VersionId = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *GetObjectOutput) SetWebsiteRedirectLocation(v string) *GetObjectOutput { - s.WebsiteRedirectLocation = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTaggingRequest -type GetObjectTaggingInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s GetObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 *GetObjectTaggingInput) SetBucket(v string) *GetObjectTaggingInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectTaggingInput) SetKey(v string) *GetObjectTaggingInput { - s.Key = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectTaggingInput) SetVersionId(v string) *GetObjectTaggingInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTaggingOutput -type GetObjectTaggingOutput struct { - _ struct{} `type:"structure"` - - // TagSet is a required field - TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` - - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation -func (s GetObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectTaggingOutput) GoString() string { - return s.String() -} - -// SetTagSet sets the TagSet field's value. -func (s *GetObjectTaggingOutput) SetTagSet(v []*Tag) *GetObjectTaggingOutput { - s.TagSet = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectTaggingOutput) SetVersionId(v string) *GetObjectTaggingOutput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrentRequest -type GetObjectTorrentInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation -func (s GetObjectTorrentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectTorrentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectTorrentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectTorrentInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 *GetObjectTorrentInput) SetBucket(v string) *GetObjectTorrentInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectTorrentInput) SetKey(v string) *GetObjectTorrentInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectTorrentInput) SetRequestPayer(v string) *GetObjectTorrentInput { - s.RequestPayer = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrentOutput -type GetObjectTorrentOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - Body io.ReadCloser `type:"blob"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation -func (s GetObjectTorrentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetObjectTorrentOutput) GoString() string { - return s.String() -} - -// SetBody sets the Body field's value. -func (s *GetObjectTorrentOutput) SetBody(v io.ReadCloser) *GetObjectTorrentOutput { - s.Body = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *GetObjectTorrentOutput) SetRequestCharged(v string) *GetObjectTorrentOutput { - s.RequestCharged = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GlacierJobParameters -type GlacierJobParameters struct { - _ struct{} `type:"structure"` - - // Glacier retrieval tier at which the restore will be processed. - // - // Tier is a required field - Tier *string `type:"string" required:"true" enum:"Tier"` -} - -// String returns the string representation -func (s GlacierJobParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GlacierJobParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlacierJobParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlacierJobParameters"} - if s.Tier == nil { - invalidParams.Add(request.NewErrParamRequired("Tier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTier sets the Tier field's value. -func (s *GlacierJobParameters) SetTier(v string) *GlacierJobParameters { - s.Tier = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Grant -type Grant struct { - _ struct{} `type:"structure"` - - Grantee *Grantee `type:"structure"` - - // Specifies the permission given to the grantee. - Permission *string `type:"string" enum:"Permission"` -} - -// String returns the string representation -func (s Grant) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Grant) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Grant) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Grant"} - if s.Grantee != nil { - if err := s.Grantee.Validate(); err != nil { - invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrantee sets the Grantee field's value. -func (s *Grant) SetGrantee(v *Grantee) *Grant { - s.Grantee = v - return s -} - -// SetPermission sets the Permission field's value. -func (s *Grant) SetPermission(v string) *Grant { - s.Permission = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Grantee -type Grantee struct { - _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - - // Screen name of the grantee. - DisplayName *string `type:"string"` - - // Email address of the grantee. - EmailAddress *string `type:"string"` - - // The canonical user ID of the grantee. - ID *string `type:"string"` - - // Type of grantee - // - // Type is a required field - Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true" required:"true" enum:"Type"` - - // URI of the grantee group. - URI *string `type:"string"` -} - -// String returns the string representation -func (s Grantee) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Grantee) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Grantee) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Grantee"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Grantee) SetDisplayName(v string) *Grantee { - s.DisplayName = &v - return s -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *Grantee) SetEmailAddress(v string) *Grantee { - s.EmailAddress = &v - return s -} - -// SetID sets the ID field's value. -func (s *Grantee) SetID(v string) *Grantee { - s.ID = &v - return s -} - -// SetType sets the Type field's value. -func (s *Grantee) SetType(v string) *Grantee { - s.Type = &v - return s -} - -// SetURI sets the URI field's value. -func (s *Grantee) SetURI(v string) *Grantee { - s.URI = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucketRequest -type HeadBucketInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s HeadBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HeadBucketInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HeadBucketInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HeadBucketInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *HeadBucketInput) SetBucket(v string) *HeadBucketInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucketOutput -type HeadBucketOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s HeadBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HeadBucketOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObjectRequest -type HeadObjectInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Return the object only if its entity tag (ETag) is the same as the one specified, - // otherwise return a 412 (precondition failed). - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` - - // Return the object only if it has been modified since the specified time, - // otherwise return a 304 (not modified). - IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp" timestampFormat:"rfc822"` - - // Return the object only if its entity tag (ETag) is different from the one - // specified, otherwise return a 304 (not modified). - IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` - - // Return the object only if it has not been modified since the specified time, - // otherwise return a 412 (precondition failed). - IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp" timestampFormat:"rfc822"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of the object being read. This is a positive integer between - // 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. - // Useful querying about the size of the part and the number of parts in this - // object. - PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` - - // Downloads the specified range bytes of an object. For more information about - // the HTTP Range header, go to 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s HeadObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HeadObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HeadObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HeadObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 *HeadObjectInput) SetBucket(v string) *HeadObjectInput { - s.Bucket = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *HeadObjectInput) SetIfMatch(v string) *HeadObjectInput { - s.IfMatch = &v - return s -} - -// SetIfModifiedSince sets the IfModifiedSince field's value. -func (s *HeadObjectInput) SetIfModifiedSince(v time.Time) *HeadObjectInput { - s.IfModifiedSince = &v - return s -} - -// SetIfNoneMatch sets the IfNoneMatch field's value. -func (s *HeadObjectInput) SetIfNoneMatch(v string) *HeadObjectInput { - s.IfNoneMatch = &v - return s -} - -// SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. -func (s *HeadObjectInput) SetIfUnmodifiedSince(v time.Time) *HeadObjectInput { - s.IfUnmodifiedSince = &v - return s -} - -// SetKey sets the Key field's value. -func (s *HeadObjectInput) SetKey(v string) *HeadObjectInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *HeadObjectInput) SetPartNumber(v int64) *HeadObjectInput { - s.PartNumber = &v - return s -} - -// SetRange sets the Range field's value. -func (s *HeadObjectInput) SetRange(v string) *HeadObjectInput { - s.Range = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *HeadObjectInput) SetRequestPayer(v string) *HeadObjectInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *HeadObjectInput) SetSSECustomerAlgorithm(v string) *HeadObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *HeadObjectInput) SetSSECustomerKey(v string) *HeadObjectInput { - s.SSECustomerKey = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *HeadObjectInput) SetSSECustomerKeyMD5(v string) *HeadObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *HeadObjectInput) SetVersionId(v string) *HeadObjectInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObjectOutput -type HeadObjectOutput struct { - _ struct{} `type:"structure"` - - AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // Size of the body in bytes. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // Specifies whether the object retrieved was (true) or was not (false) a Delete - // Marker. If false, this response header does not appear in the response. - DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` - - // An ETag is an opaque identifier assigned by a web server to a specific version - // of a resource found at a URL - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key value pairs - // providing object expiration information. The value of the rule-id is URL - // encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *string `location:"header" locationName:"Expires" type:"string"` - - // Last modified date of the object - LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp" timestampFormat:"rfc822"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // This is set to the number of metadata entries not returned in x-amz-meta - // headers. This can happen if you create metadata using an API like SOAP that - // supports more flexible metadata than the REST API. For example, using SOAP, - // you can create metadata whose values are not legal HTTP headers. - MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` - - // The count of parts this object has. - PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` - - ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Provides information about object restoration operation and expiration time - // of the restored object copy. - Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity - // verification of the customer-provided encryption key. - 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 (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // Version of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation -func (s HeadObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s HeadObjectOutput) GoString() string { - return s.String() -} - -// SetAcceptRanges sets the AcceptRanges field's value. -func (s *HeadObjectOutput) SetAcceptRanges(v string) *HeadObjectOutput { - s.AcceptRanges = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *HeadObjectOutput) SetCacheControl(v string) *HeadObjectOutput { - s.CacheControl = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *HeadObjectOutput) SetContentDisposition(v string) *HeadObjectOutput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *HeadObjectOutput) SetContentEncoding(v string) *HeadObjectOutput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *HeadObjectOutput) SetContentLanguage(v string) *HeadObjectOutput { - s.ContentLanguage = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *HeadObjectOutput) SetContentLength(v int64) *HeadObjectOutput { - s.ContentLength = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *HeadObjectOutput) SetContentType(v string) *HeadObjectOutput { - s.ContentType = &v - return s -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *HeadObjectOutput) SetDeleteMarker(v bool) *HeadObjectOutput { - s.DeleteMarker = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *HeadObjectOutput) SetETag(v string) *HeadObjectOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *HeadObjectOutput) SetExpiration(v string) *HeadObjectOutput { - s.Expiration = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *HeadObjectOutput) SetExpires(v string) *HeadObjectOutput { - s.Expires = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *HeadObjectOutput) SetLastModified(v time.Time) *HeadObjectOutput { - s.LastModified = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *HeadObjectOutput) SetMetadata(v map[string]*string) *HeadObjectOutput { - s.Metadata = v - return s -} - -// SetMissingMeta sets the MissingMeta field's value. -func (s *HeadObjectOutput) SetMissingMeta(v int64) *HeadObjectOutput { - s.MissingMeta = &v - return s -} - -// SetPartsCount sets the PartsCount field's value. -func (s *HeadObjectOutput) SetPartsCount(v int64) *HeadObjectOutput { - s.PartsCount = &v - return s -} - -// SetReplicationStatus sets the ReplicationStatus field's value. -func (s *HeadObjectOutput) SetReplicationStatus(v string) *HeadObjectOutput { - s.ReplicationStatus = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *HeadObjectOutput) SetRequestCharged(v string) *HeadObjectOutput { - s.RequestCharged = &v - return s -} - -// SetRestore sets the Restore field's value. -func (s *HeadObjectOutput) SetRestore(v string) *HeadObjectOutput { - s.Restore = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *HeadObjectOutput) SetSSECustomerAlgorithm(v string) *HeadObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *HeadObjectOutput) SetSSECustomerKeyMD5(v string) *HeadObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *HeadObjectOutput) SetSSEKMSKeyId(v string) *HeadObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *HeadObjectOutput) SetServerSideEncryption(v string) *HeadObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *HeadObjectOutput) SetStorageClass(v string) *HeadObjectOutput { - s.StorageClass = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *HeadObjectOutput) SetVersionId(v string) *HeadObjectOutput { - s.VersionId = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *HeadObjectOutput) SetWebsiteRedirectLocation(v string) *HeadObjectOutput { - s.WebsiteRedirectLocation = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/IndexDocument -type IndexDocument struct { - _ struct{} `type:"structure"` - - // A suffix that is appended to a request that is for a directory on the website - // endpoint (e.g. if the suffix is index.html and you make a request to samplebucket/images/ - // the data that is returned will be for the object with the key name images/index.html) - // The suffix must not be empty and must not include a slash character. - // - // Suffix is a required field - Suffix *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s IndexDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s IndexDocument) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IndexDocument) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IndexDocument"} - if s.Suffix == nil { - invalidParams.Add(request.NewErrParamRequired("Suffix")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSuffix sets the Suffix field's value. -func (s *IndexDocument) SetSuffix(v string) *IndexDocument { - s.Suffix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Initiator -type Initiator struct { - _ struct{} `type:"structure"` - - // Name of the Principal. - DisplayName *string `type:"string"` - - // If the principal is an AWS account, it provides the Canonical User ID. If - // the principal is an IAM User, it provides a user ARN value. - ID *string `type:"string"` -} - -// String returns the string representation -func (s Initiator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Initiator) GoString() string { - return s.String() -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Initiator) SetDisplayName(v string) *Initiator { - s.DisplayName = &v - return s -} - -// SetID sets the ID field's value. -func (s *Initiator) SetID(v string) *Initiator { - s.ID = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryConfiguration -type InventoryConfiguration struct { - _ struct{} `type:"structure"` - - // Contains information about where to publish the inventory results. - // - // Destination is a required field - Destination *InventoryDestination `type:"structure" required:"true"` - - // Specifies an inventory filter. The inventory only includes objects that meet - // the filter's criteria. - Filter *InventoryFilter `type:"structure"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // Specifies which object version(s) to included in the inventory results. - // - // IncludedObjectVersions is a required field - IncludedObjectVersions *string `type:"string" required:"true" enum:"InventoryIncludedObjectVersions"` - - // Specifies whether the inventory is enabled or disabled. - // - // IsEnabled is a required field - IsEnabled *bool `type:"boolean" required:"true"` - - // Contains the optional fields that are included in the inventory results. - OptionalFields []*string `locationNameList:"Field" type:"list"` - - // Specifies the schedule for generating inventory results. - // - // Schedule is a required field - Schedule *InventorySchedule `type:"structure" required:"true"` -} - -// String returns the string representation -func (s InventoryConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryConfiguration"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.IncludedObjectVersions == nil { - invalidParams.Add(request.NewErrParamRequired("IncludedObjectVersions")) - } - if s.IsEnabled == nil { - invalidParams.Add(request.NewErrParamRequired("IsEnabled")) - } - if s.Schedule == nil { - invalidParams.Add(request.NewErrParamRequired("Schedule")) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.Schedule != nil { - if err := s.Schedule.Validate(); err != nil { - invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *InventoryConfiguration) SetDestination(v *InventoryDestination) *InventoryConfiguration { - s.Destination = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *InventoryConfiguration) SetFilter(v *InventoryFilter) *InventoryConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *InventoryConfiguration) SetId(v string) *InventoryConfiguration { - s.Id = &v - return s -} - -// SetIncludedObjectVersions sets the IncludedObjectVersions field's value. -func (s *InventoryConfiguration) SetIncludedObjectVersions(v string) *InventoryConfiguration { - s.IncludedObjectVersions = &v - return s -} - -// SetIsEnabled sets the IsEnabled field's value. -func (s *InventoryConfiguration) SetIsEnabled(v bool) *InventoryConfiguration { - s.IsEnabled = &v - return s -} - -// SetOptionalFields sets the OptionalFields field's value. -func (s *InventoryConfiguration) SetOptionalFields(v []*string) *InventoryConfiguration { - s.OptionalFields = v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *InventoryConfiguration) SetSchedule(v *InventorySchedule) *InventoryConfiguration { - s.Schedule = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryDestination -type InventoryDestination struct { - _ struct{} `type:"structure"` - - // Contains the bucket name, file format, bucket owner (optional), and prefix - // (optional) where inventory results are published. - // - // S3BucketDestination is a required field - S3BucketDestination *InventoryS3BucketDestination `type:"structure" required:"true"` -} - -// String returns the string representation -func (s InventoryDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryDestination"} - if s.S3BucketDestination == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) - } - if s.S3BucketDestination != nil { - if err := s.S3BucketDestination.Validate(); err != nil { - invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3BucketDestination sets the S3BucketDestination field's value. -func (s *InventoryDestination) SetS3BucketDestination(v *InventoryS3BucketDestination) *InventoryDestination { - s.S3BucketDestination = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryFilter -type InventoryFilter struct { - _ struct{} `type:"structure"` - - // The prefix that an object must have to be included in the inventory results. - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s InventoryFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryFilter"} - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *InventoryFilter) SetPrefix(v string) *InventoryFilter { - s.Prefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryS3BucketDestination -type InventoryS3BucketDestination struct { - _ struct{} `type:"structure"` - - // The ID of the account that owns the destination bucket. - AccountId *string `type:"string"` - - // The Amazon resource name (ARN) of the bucket where inventory results will - // be published. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // Specifies the output format of the inventory results. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"InventoryFormat"` - - // The prefix that is prepended to all inventory results. - Prefix *string `type:"string"` -} - -// String returns the string representation -func (s InventoryS3BucketDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventoryS3BucketDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryS3BucketDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryS3BucketDestination"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *InventoryS3BucketDestination) SetAccountId(v string) *InventoryS3BucketDestination { - s.AccountId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *InventoryS3BucketDestination) SetBucket(v string) *InventoryS3BucketDestination { - s.Bucket = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *InventoryS3BucketDestination) SetFormat(v string) *InventoryS3BucketDestination { - s.Format = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *InventoryS3BucketDestination) SetPrefix(v string) *InventoryS3BucketDestination { - s.Prefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventorySchedule -type InventorySchedule struct { - _ struct{} `type:"structure"` - - // Specifies how frequently inventory results are produced. - // - // Frequency is a required field - Frequency *string `type:"string" required:"true" enum:"InventoryFrequency"` -} - -// String returns the string representation -func (s InventorySchedule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s InventorySchedule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventorySchedule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventorySchedule"} - if s.Frequency == nil { - invalidParams.Add(request.NewErrParamRequired("Frequency")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFrequency sets the Frequency field's value. -func (s *InventorySchedule) SetFrequency(v string) *InventorySchedule { - s.Frequency = &v - return s -} - -// Container for object key name prefix and suffix filtering rules. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/S3KeyFilter -type KeyFilter struct { - _ struct{} `type:"structure"` - - // A list of containers for key value pair that defines the criteria for the - // filter rule. - FilterRules []*FilterRule `locationName:"FilterRule" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s KeyFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyFilter) GoString() string { - return s.String() -} - -// SetFilterRules sets the FilterRules field's value. -func (s *KeyFilter) SetFilterRules(v []*FilterRule) *KeyFilter { - s.FilterRules = v - return s -} - -// Container for specifying the AWS Lambda notification configuration. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LambdaFunctionConfiguration -type LambdaFunctionConfiguration struct { - _ struct{} `type:"structure"` - - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - - // Container for object key name filtering rules. For information about key - // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - Filter *NotificationConfigurationFilter `type:"structure"` - - // Optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // Lambda cloud function ARN that Amazon S3 can invoke when it detects events - // of the specified type. - // - // LambdaFunctionArn is a required field - LambdaFunctionArn *string `locationName:"CloudFunction" type:"string" required:"true"` -} - -// String returns the string representation -func (s LambdaFunctionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LambdaFunctionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LambdaFunctionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LambdaFunctionConfiguration"} - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) - } - if s.LambdaFunctionArn == nil { - invalidParams.Add(request.NewErrParamRequired("LambdaFunctionArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvents sets the Events field's value. -func (s *LambdaFunctionConfiguration) SetEvents(v []*string) *LambdaFunctionConfiguration { - s.Events = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *LambdaFunctionConfiguration) SetFilter(v *NotificationConfigurationFilter) *LambdaFunctionConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *LambdaFunctionConfiguration) SetId(v string) *LambdaFunctionConfiguration { - s.Id = &v - return s -} - -// SetLambdaFunctionArn sets the LambdaFunctionArn field's value. -func (s *LambdaFunctionConfiguration) SetLambdaFunctionArn(v string) *LambdaFunctionConfiguration { - s.LambdaFunctionArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleConfiguration -type LifecycleConfiguration struct { - _ struct{} `type:"structure"` - - // Rules is a required field - Rules []*Rule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s LifecycleConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleConfiguration"} - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRules sets the Rules field's value. -func (s *LifecycleConfiguration) SetRules(v []*Rule) *LifecycleConfiguration { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleExpiration -type LifecycleExpiration struct { - _ struct{} `type:"structure"` - - // Indicates at what date the object is to be moved or deleted. Should be in - // GMT ISO 8601 Format. - Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the lifetime, in days, of the objects that are subject to the rule. - // The value must be a non-zero positive integer. - Days *int64 `type:"integer"` - - // Indicates whether Amazon S3 will remove a delete marker with no noncurrent - // versions. If set to true, the delete marker will be expired; if set to false - // the policy takes no action. This cannot be specified with Days or Date in - // a Lifecycle Expiration Policy. - ExpiredObjectDeleteMarker *bool `type:"boolean"` -} - -// String returns the string representation -func (s LifecycleExpiration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleExpiration) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *LifecycleExpiration) SetDate(v time.Time) *LifecycleExpiration { - s.Date = &v - return s -} - -// SetDays sets the Days field's value. -func (s *LifecycleExpiration) SetDays(v int64) *LifecycleExpiration { - s.Days = &v - return s -} - -// SetExpiredObjectDeleteMarker sets the ExpiredObjectDeleteMarker field's value. -func (s *LifecycleExpiration) SetExpiredObjectDeleteMarker(v bool) *LifecycleExpiration { - s.ExpiredObjectDeleteMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRule -type LifecycleRule struct { - _ struct{} `type:"structure"` - - // Specifies the days since the initiation of an Incomplete Multipart Upload - // that Lifecycle will wait before permanently removing all parts of the upload. - AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` - - Expiration *LifecycleExpiration `type:"structure"` - - // The Filter is used to identify objects that a Lifecycle Rule applies to. - // A Filter must have exactly one of Prefix, Tag, or And specified. - Filter *LifecycleRuleFilter `type:"structure"` - - // Unique identifier for the rule. The value cannot be longer than 255 characters. - ID *string `type:"string"` - - // Specifies when noncurrent object versions expire. Upon expiration, Amazon - // S3 permanently deletes the noncurrent object versions. You set this lifecycle - // configuration action on a bucket that has versioning enabled (or suspended) - // to request that Amazon S3 delete noncurrent object versions at a specific - // period in the object's lifetime. - NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` - - NoncurrentVersionTransitions []*NoncurrentVersionTransition `locationName:"NoncurrentVersionTransition" type:"list" flattened:"true"` - - // Prefix identifying one or more objects to which the rule applies. This is - // deprecated; use Filter instead. - Prefix *string `deprecated:"true" type:"string"` - - // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule - // is not currently being applied. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ExpirationStatus"` - - Transitions []*Transition `locationName:"Transition" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s LifecycleRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleRule"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. -func (s *LifecycleRule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *LifecycleRule { - s.AbortIncompleteMultipartUpload = v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *LifecycleRule) SetExpiration(v *LifecycleExpiration) *LifecycleRule { - s.Expiration = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule { - s.Filter = v - return s -} - -// SetID sets the ID field's value. -func (s *LifecycleRule) SetID(v string) *LifecycleRule { - s.ID = &v - return s -} - -// SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. -func (s *LifecycleRule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *LifecycleRule { - s.NoncurrentVersionExpiration = v - return s -} - -// SetNoncurrentVersionTransitions sets the NoncurrentVersionTransitions field's value. -func (s *LifecycleRule) SetNoncurrentVersionTransitions(v []*NoncurrentVersionTransition) *LifecycleRule { - s.NoncurrentVersionTransitions = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *LifecycleRule) SetPrefix(v string) *LifecycleRule { - s.Prefix = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *LifecycleRule) SetStatus(v string) *LifecycleRule { - s.Status = &v - return s -} - -// SetTransitions sets the Transitions field's value. -func (s *LifecycleRule) SetTransitions(v []*Transition) *LifecycleRule { - s.Transitions = v - return s -} - -// This is used in a Lifecycle Rule Filter to apply a logical AND to two or -// more predicates. The Lifecycle Rule will apply to any object matching all -// of the predicates configured inside the And operator. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRuleAndOperator -type LifecycleRuleAndOperator struct { - _ struct{} `type:"structure"` - - Prefix *string `type:"string"` - - // All of these tags must exist in the object's tag set in order for the rule - // to apply. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s LifecycleRuleAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleRuleAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleRuleAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *LifecycleRuleAndOperator) SetPrefix(v string) *LifecycleRuleAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *LifecycleRuleAndOperator) SetTags(v []*Tag) *LifecycleRuleAndOperator { - s.Tags = v - return s -} - -// The Filter is used to identify objects that a Lifecycle Rule applies to. -// A Filter must have exactly one of Prefix, Tag, or And specified. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRuleFilter -type LifecycleRuleFilter struct { - _ struct{} `type:"structure"` - - // This is used in a Lifecycle Rule Filter to apply a logical AND to two or - // more predicates. The Lifecycle Rule will apply to any object matching all - // of the predicates configured inside the And operator. - And *LifecycleRuleAndOperator `type:"structure"` - - // Prefix identifying one or more objects to which the rule applies. - Prefix *string `type:"string"` - - // This tag must exist in the object's tag set in order for the rule to apply. - Tag *Tag `type:"structure"` -} - -// String returns the string representation -func (s LifecycleRuleFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleRuleFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleRuleFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *LifecycleRuleFilter) SetAnd(v *LifecycleRuleAndOperator) *LifecycleRuleFilter { - s.And = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *LifecycleRuleFilter) SetPrefix(v string) *LifecycleRuleFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *LifecycleRuleFilter) SetTag(v *Tag) *LifecycleRuleFilter { - s.Tag = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurationsRequest -type ListBucketAnalyticsConfigurationsInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket from which analytics configurations are retrieved. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ContinuationToken that represents a placeholder from where this request - // should begin. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` -} - -// String returns the string representation -func (s ListBucketAnalyticsConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketAnalyticsConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBucketAnalyticsConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBucketAnalyticsConfigurationsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListBucketAnalyticsConfigurationsInput) SetBucket(v string) *ListBucketAnalyticsConfigurationsInput { - s.Bucket = &v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketAnalyticsConfigurationsInput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsInput { - s.ContinuationToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurationsOutput -type ListBucketAnalyticsConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The list of analytics configurations for a bucket. - AnalyticsConfigurationList []*AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"list" flattened:"true"` - - // The ContinuationToken that represents where this request began. - ContinuationToken *string `type:"string"` - - // Indicates whether the returned list of analytics configurations is complete. - // A value of true indicates that the list is not complete and the NextContinuationToken - // will be provided for a subsequent request. - IsTruncated *bool `type:"boolean"` - - // NextContinuationToken is sent when isTruncated is true, which indicates that - // there are more analytics configurations to list. The next request must include - // this NextContinuationToken. The token is obfuscated and is not a usable value. - NextContinuationToken *string `type:"string"` -} - -// String returns the string representation -func (s ListBucketAnalyticsConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketAnalyticsConfigurationsOutput) GoString() string { - return s.String() -} - -// SetAnalyticsConfigurationList sets the AnalyticsConfigurationList field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetAnalyticsConfigurationList(v []*AnalyticsConfiguration) *ListBucketAnalyticsConfigurationsOutput { - s.AnalyticsConfigurationList = v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { - s.ContinuationToken = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketAnalyticsConfigurationsOutput { - s.IsTruncated = &v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { - s.NextContinuationToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurationsRequest -type ListBucketInventoryConfigurationsInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket containing the inventory configurations to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The marker used to continue an inventory configuration listing that has been - // truncated. Use the NextContinuationToken from a previously truncated list - // response to continue the listing. The continuation token is an opaque value - // that Amazon S3 understands. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` -} - -// String returns the string representation -func (s ListBucketInventoryConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketInventoryConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBucketInventoryConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBucketInventoryConfigurationsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListBucketInventoryConfigurationsInput) SetBucket(v string) *ListBucketInventoryConfigurationsInput { - s.Bucket = &v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketInventoryConfigurationsInput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsInput { - s.ContinuationToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurationsOutput -type ListBucketInventoryConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // If sent in the request, the marker that is used as a starting point for this - // inventory configuration list response. - ContinuationToken *string `type:"string"` - - // The list of inventory configurations for a bucket. - InventoryConfigurationList []*InventoryConfiguration `locationName:"InventoryConfiguration" type:"list" flattened:"true"` - - // Indicates whether the returned list of inventory configurations is truncated - // in this response. A value of true indicates that the list is truncated. - IsTruncated *bool `type:"boolean"` - - // The marker used to continue this inventory configuration listing. Use the - // NextContinuationToken from this response to continue the listing in a subsequent - // request. The continuation token is an opaque value that Amazon S3 understands. - NextContinuationToken *string `type:"string"` -} - -// String returns the string representation -func (s ListBucketInventoryConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketInventoryConfigurationsOutput) GoString() string { - return s.String() -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { - s.ContinuationToken = &v - return s -} - -// SetInventoryConfigurationList sets the InventoryConfigurationList field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetInventoryConfigurationList(v []*InventoryConfiguration) *ListBucketInventoryConfigurationsOutput { - s.InventoryConfigurationList = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetIsTruncated(v bool) *ListBucketInventoryConfigurationsOutput { - s.IsTruncated = &v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { - s.NextContinuationToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurationsRequest -type ListBucketMetricsConfigurationsInput struct { - _ struct{} `type:"structure"` - - // The name of the bucket containing the metrics configurations to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The marker that is used to continue a metrics configuration listing that - // has been truncated. Use the NextContinuationToken from a previously truncated - // list response to continue the listing. The continuation token is an opaque - // value that Amazon S3 understands. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` -} - -// String returns the string representation -func (s ListBucketMetricsConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketMetricsConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBucketMetricsConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBucketMetricsConfigurationsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListBucketMetricsConfigurationsInput) SetBucket(v string) *ListBucketMetricsConfigurationsInput { - s.Bucket = &v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketMetricsConfigurationsInput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsInput { - s.ContinuationToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurationsOutput -type ListBucketMetricsConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The marker that is used as a starting point for this metrics configuration - // list response. This value is present if it was sent in the request. - ContinuationToken *string `type:"string"` - - // Indicates whether the returned list of metrics configurations is complete. - // A value of true indicates that the list is not complete and the NextContinuationToken - // will be provided for a subsequent request. - IsTruncated *bool `type:"boolean"` - - // The list of metrics configurations for a bucket. - MetricsConfigurationList []*MetricsConfiguration `locationName:"MetricsConfiguration" type:"list" flattened:"true"` - - // The marker used to continue a metrics configuration listing that has been - // truncated. Use the NextContinuationToken from a previously truncated list - // response to continue the listing. The continuation token is an opaque value - // that Amazon S3 understands. - NextContinuationToken *string `type:"string"` -} - -// String returns the string representation -func (s ListBucketMetricsConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketMetricsConfigurationsOutput) GoString() string { - return s.String() -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { - s.ContinuationToken = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketMetricsConfigurationsOutput { - s.IsTruncated = &v - return s -} - -// SetMetricsConfigurationList sets the MetricsConfigurationList field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetMetricsConfigurationList(v []*MetricsConfiguration) *ListBucketMetricsConfigurationsOutput { - s.MetricsConfigurationList = v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { - s.NextContinuationToken = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketsInput -type ListBucketsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ListBucketsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketsInput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketsOutput -type ListBucketsOutput struct { - _ struct{} `type:"structure"` - - Buckets []*Bucket `locationNameList:"Bucket" type:"list"` - - Owner *Owner `type:"structure"` -} - -// String returns the string representation -func (s ListBucketsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListBucketsOutput) GoString() string { - return s.String() -} - -// SetBuckets sets the Buckets field's value. -func (s *ListBucketsOutput) SetBuckets(v []*Bucket) *ListBucketsOutput { - s.Buckets = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ListBucketsOutput) SetOwner(v *Owner) *ListBucketsOutput { - s.Owner = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploadsRequest -type ListMultipartUploadsInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Character you use to group keys. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Requests Amazon S3 to encode the object keys in the response and specifies - // the encoding method to use. An object key may contain any Unicode character; - // however, XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in - // XML 1.0, you can add this parameter to request that Amazon S3 encode the - // keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // Together with upload-id-marker, this parameter specifies the multipart upload - // after which listing should begin. - KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` - - // Sets the maximum number of multipart uploads, from 1 to 1,000, to return - // in the response body. 1,000 is the maximum number of uploads that can be - // returned in a response. - MaxUploads *int64 `location:"querystring" locationName:"max-uploads" type:"integer"` - - // Lists in-progress uploads only for those keys that begin with the specified - // prefix. - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Together with key-marker, specifies the multipart upload after which listing - // should begin. If key-marker is not specified, the upload-id-marker parameter - // is ignored. - UploadIdMarker *string `location:"querystring" locationName:"upload-id-marker" type:"string"` -} - -// String returns the string representation -func (s ListMultipartUploadsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListMultipartUploadsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMultipartUploadsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMultipartUploadsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListMultipartUploadsInput) SetBucket(v string) *ListMultipartUploadsInput { - s.Bucket = &v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListMultipartUploadsInput) SetDelimiter(v string) *ListMultipartUploadsInput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListMultipartUploadsInput) SetEncodingType(v string) *ListMultipartUploadsInput { - s.EncodingType = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListMultipartUploadsInput) SetKeyMarker(v string) *ListMultipartUploadsInput { - s.KeyMarker = &v - return s -} - -// SetMaxUploads sets the MaxUploads field's value. -func (s *ListMultipartUploadsInput) SetMaxUploads(v int64) *ListMultipartUploadsInput { - s.MaxUploads = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListMultipartUploadsInput) SetPrefix(v string) *ListMultipartUploadsInput { - s.Prefix = &v - return s -} - -// SetUploadIdMarker sets the UploadIdMarker field's value. -func (s *ListMultipartUploadsInput) SetUploadIdMarker(v string) *ListMultipartUploadsInput { - s.UploadIdMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploadsOutput -type ListMultipartUploadsOutput struct { - _ struct{} `type:"structure"` - - // Name of the bucket to which the multipart upload was initiated. - Bucket *string `type:"string"` - - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - EncodingType *string `type:"string" enum:"EncodingType"` - - // Indicates whether the returned list of multipart uploads is truncated. A - // value of true indicates that the list was truncated. The list can be truncated - // if the number of multipart uploads exceeds the limit allowed or specified - // by max uploads. - IsTruncated *bool `type:"boolean"` - - // The key at or after which the listing began. - KeyMarker *string `type:"string"` - - // Maximum number of multipart uploads that could have been included in the - // response. - MaxUploads *int64 `type:"integer"` - - // When a list is truncated, this element specifies the value that should be - // used for the key-marker request parameter in a subsequent request. - NextKeyMarker *string `type:"string"` - - // When a list is truncated, this element specifies the value that should be - // used for the upload-id-marker request parameter in a subsequent request. - NextUploadIdMarker *string `type:"string"` - - // When a prefix is provided in the request, this field contains the specified - // prefix. The result contains only keys starting with the specified prefix. - Prefix *string `type:"string"` - - // Upload ID after which listing began. - UploadIdMarker *string `type:"string"` - - Uploads []*MultipartUpload `locationName:"Upload" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s ListMultipartUploadsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListMultipartUploadsOutput) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *ListMultipartUploadsOutput) SetBucket(v string) *ListMultipartUploadsOutput { - s.Bucket = &v - return s -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListMultipartUploadsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListMultipartUploadsOutput { - s.CommonPrefixes = v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListMultipartUploadsOutput) SetDelimiter(v string) *ListMultipartUploadsOutput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListMultipartUploadsOutput) SetEncodingType(v string) *ListMultipartUploadsOutput { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListMultipartUploadsOutput) SetIsTruncated(v bool) *ListMultipartUploadsOutput { - s.IsTruncated = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListMultipartUploadsOutput) SetKeyMarker(v string) *ListMultipartUploadsOutput { - s.KeyMarker = &v - return s -} - -// SetMaxUploads sets the MaxUploads field's value. -func (s *ListMultipartUploadsOutput) SetMaxUploads(v int64) *ListMultipartUploadsOutput { - s.MaxUploads = &v - return s -} - -// SetNextKeyMarker sets the NextKeyMarker field's value. -func (s *ListMultipartUploadsOutput) SetNextKeyMarker(v string) *ListMultipartUploadsOutput { - s.NextKeyMarker = &v - return s -} - -// SetNextUploadIdMarker sets the NextUploadIdMarker field's value. -func (s *ListMultipartUploadsOutput) SetNextUploadIdMarker(v string) *ListMultipartUploadsOutput { - s.NextUploadIdMarker = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListMultipartUploadsOutput) SetPrefix(v string) *ListMultipartUploadsOutput { - s.Prefix = &v - return s -} - -// SetUploadIdMarker sets the UploadIdMarker field's value. -func (s *ListMultipartUploadsOutput) SetUploadIdMarker(v string) *ListMultipartUploadsOutput { - s.UploadIdMarker = &v - return s -} - -// SetUploads sets the Uploads field's value. -func (s *ListMultipartUploadsOutput) SetUploads(v []*MultipartUpload) *ListMultipartUploadsOutput { - s.Uploads = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersionsRequest -type ListObjectVersionsInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // A delimiter is a character you use to group keys. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Requests Amazon S3 to encode the object keys in the response and specifies - // the encoding method to use. An object key may contain any Unicode character; - // however, XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in - // XML 1.0, you can add this parameter to request that Amazon S3 encode the - // keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // Specifies the key to start with when listing objects in a bucket. - KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` - - // Sets the maximum number of keys returned in the response. The response might - // contain fewer keys but will never contain more. - MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` - - // Limits the response to keys that begin with the specified prefix. - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Specifies the object version you want to start listing from. - VersionIdMarker *string `location:"querystring" locationName:"version-id-marker" type:"string"` -} - -// String returns the string representation -func (s ListObjectVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListObjectVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListObjectVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListObjectVersionsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListObjectVersionsInput) SetBucket(v string) *ListObjectVersionsInput { - s.Bucket = &v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectVersionsInput) SetDelimiter(v string) *ListObjectVersionsInput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectVersionsInput) SetEncodingType(v string) *ListObjectVersionsInput { - s.EncodingType = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListObjectVersionsInput) SetKeyMarker(v string) *ListObjectVersionsInput { - s.KeyMarker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectVersionsInput) SetMaxKeys(v int64) *ListObjectVersionsInput { - s.MaxKeys = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectVersionsInput) SetPrefix(v string) *ListObjectVersionsInput { - s.Prefix = &v - return s -} - -// SetVersionIdMarker sets the VersionIdMarker field's value. -func (s *ListObjectVersionsInput) SetVersionIdMarker(v string) *ListObjectVersionsInput { - s.VersionIdMarker = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersionsOutput -type ListObjectVersionsOutput struct { - _ struct{} `type:"structure"` - - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - DeleteMarkers []*DeleteMarkerEntry `locationName:"DeleteMarker" type:"list" flattened:"true"` - - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - EncodingType *string `type:"string" enum:"EncodingType"` - - // A flag that indicates whether or not Amazon S3 returned all of the results - // that satisfied the search criteria. If your results were truncated, you can - // make a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker - // response parameters as a starting place in another request to return the - // rest of the results. - IsTruncated *bool `type:"boolean"` - - // Marks the last Key returned in a truncated response. - KeyMarker *string `type:"string"` - - MaxKeys *int64 `type:"integer"` - - Name *string `type:"string"` - - // Use this value for the key marker request parameter in a subsequent request. - NextKeyMarker *string `type:"string"` - - // Use this value for the next version id marker parameter in a subsequent request. - NextVersionIdMarker *string `type:"string"` - - Prefix *string `type:"string"` - - VersionIdMarker *string `type:"string"` - - Versions []*ObjectVersion `locationName:"Version" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s ListObjectVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListObjectVersionsOutput) GoString() string { - return s.String() -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListObjectVersionsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectVersionsOutput { - s.CommonPrefixes = v - return s -} - -// SetDeleteMarkers sets the DeleteMarkers field's value. -func (s *ListObjectVersionsOutput) SetDeleteMarkers(v []*DeleteMarkerEntry) *ListObjectVersionsOutput { - s.DeleteMarkers = v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectVersionsOutput) SetDelimiter(v string) *ListObjectVersionsOutput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectVersionsOutput) SetEncodingType(v string) *ListObjectVersionsOutput { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListObjectVersionsOutput) SetIsTruncated(v bool) *ListObjectVersionsOutput { - s.IsTruncated = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListObjectVersionsOutput) SetKeyMarker(v string) *ListObjectVersionsOutput { - s.KeyMarker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectVersionsOutput) SetMaxKeys(v int64) *ListObjectVersionsOutput { - s.MaxKeys = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListObjectVersionsOutput) SetName(v string) *ListObjectVersionsOutput { - s.Name = &v - return s -} - -// SetNextKeyMarker sets the NextKeyMarker field's value. -func (s *ListObjectVersionsOutput) SetNextKeyMarker(v string) *ListObjectVersionsOutput { - s.NextKeyMarker = &v - return s -} - -// SetNextVersionIdMarker sets the NextVersionIdMarker field's value. -func (s *ListObjectVersionsOutput) SetNextVersionIdMarker(v string) *ListObjectVersionsOutput { - s.NextVersionIdMarker = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectVersionsOutput) SetPrefix(v string) *ListObjectVersionsOutput { - s.Prefix = &v - return s -} - -// SetVersionIdMarker sets the VersionIdMarker field's value. -func (s *ListObjectVersionsOutput) SetVersionIdMarker(v string) *ListObjectVersionsOutput { - s.VersionIdMarker = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *ListObjectVersionsOutput) SetVersions(v []*ObjectVersion) *ListObjectVersionsOutput { - s.Versions = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsRequest -type ListObjectsInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // A delimiter is a character you use to group keys. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Requests Amazon S3 to encode the object keys in the response and specifies - // the encoding method to use. An object key may contain any Unicode character; - // however, XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in - // XML 1.0, you can add this parameter to request that Amazon S3 encode the - // keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // Specifies the key to start with when listing objects in a bucket. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // Sets the maximum number of keys returned in the response. The response might - // contain fewer keys but will never contain more. - MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` - - // Limits the response to keys that begin with the specified prefix. - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Confirms that the requester knows that she or he will be charged for the - // list objects request. Bucket owners need not specify this parameter in their - // requests. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation -func (s ListObjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListObjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListObjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListObjectsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListObjectsInput) SetBucket(v string) *ListObjectsInput { - s.Bucket = &v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsInput) SetDelimiter(v string) *ListObjectsInput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsInput) SetEncodingType(v string) *ListObjectsInput { - s.EncodingType = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListObjectsInput) SetMarker(v string) *ListObjectsInput { - s.Marker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsInput) SetMaxKeys(v int64) *ListObjectsInput { - s.MaxKeys = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsInput) SetPrefix(v string) *ListObjectsInput { - s.Prefix = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *ListObjectsInput) SetRequestPayer(v string) *ListObjectsInput { - s.RequestPayer = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsOutput -type ListObjectsOutput struct { - _ struct{} `type:"structure"` - - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - Contents []*Object `type:"list" flattened:"true"` - - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - EncodingType *string `type:"string" enum:"EncodingType"` - - // A flag that indicates whether or not Amazon S3 returned all of the results - // that satisfied the search criteria. - IsTruncated *bool `type:"boolean"` - - Marker *string `type:"string"` - - MaxKeys *int64 `type:"integer"` - - Name *string `type:"string"` - - // When response is truncated (the IsTruncated element value in the response - // is true), you can use the key name in this field as marker in the subsequent - // request to get next set of objects. Amazon S3 lists objects in alphabetical - // order Note: This element is returned only if you have delimiter request parameter - // specified. If response does not include the NextMaker and it is truncated, - // you can use the value of the last Key in the response as the marker in the - // subsequent request to get the next set of object keys. - NextMarker *string `type:"string"` - - Prefix *string `type:"string"` -} - -// String returns the string representation -func (s ListObjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListObjectsOutput) GoString() string { - return s.String() -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListObjectsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsOutput { - s.CommonPrefixes = v - return s -} - -// SetContents sets the Contents field's value. -func (s *ListObjectsOutput) SetContents(v []*Object) *ListObjectsOutput { - s.Contents = v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsOutput) SetDelimiter(v string) *ListObjectsOutput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsOutput) SetEncodingType(v string) *ListObjectsOutput { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListObjectsOutput) SetIsTruncated(v bool) *ListObjectsOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListObjectsOutput) SetMarker(v string) *ListObjectsOutput { - s.Marker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsOutput) SetMaxKeys(v int64) *ListObjectsOutput { - s.MaxKeys = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListObjectsOutput) SetName(v string) *ListObjectsOutput { - s.Name = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListObjectsOutput) SetNextMarker(v string) *ListObjectsOutput { - s.NextMarker = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsOutput) SetPrefix(v string) *ListObjectsOutput { - s.Prefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2Request -type ListObjectsV2Input struct { - _ struct{} `type:"structure"` - - // Name of the bucket to list. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // ContinuationToken indicates Amazon S3 that the list is being continued on - // this bucket with a token. ContinuationToken is obfuscated and is not a real - // key - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - - // A delimiter is a character you use to group keys. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // The owner field is not present in listV2 by default, if you want to return - // owner field with each key in the result then set the fetch owner field to - // true - FetchOwner *bool `location:"querystring" locationName:"fetch-owner" type:"boolean"` - - // Sets the maximum number of keys returned in the response. The response might - // contain fewer keys but will never contain more. - MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` - - // Limits the response to keys that begin with the specified prefix. - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Confirms that the requester knows that she or he will be charged for the - // list objects request in V2 style. Bucket owners need not specify this parameter - // in their requests. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts - // listing after this specified key. StartAfter can be any key in the bucket - StartAfter *string `location:"querystring" locationName:"start-after" type:"string"` -} - -// String returns the string representation -func (s ListObjectsV2Input) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListObjectsV2Input) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListObjectsV2Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListObjectsV2Input"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListObjectsV2Input) SetBucket(v string) *ListObjectsV2Input { - s.Bucket = &v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListObjectsV2Input) SetContinuationToken(v string) *ListObjectsV2Input { - s.ContinuationToken = &v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsV2Input) SetDelimiter(v string) *ListObjectsV2Input { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsV2Input) SetEncodingType(v string) *ListObjectsV2Input { - s.EncodingType = &v - return s -} - -// SetFetchOwner sets the FetchOwner field's value. -func (s *ListObjectsV2Input) SetFetchOwner(v bool) *ListObjectsV2Input { - s.FetchOwner = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsV2Input) SetMaxKeys(v int64) *ListObjectsV2Input { - s.MaxKeys = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsV2Input) SetPrefix(v string) *ListObjectsV2Input { - s.Prefix = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *ListObjectsV2Input) SetRequestPayer(v string) *ListObjectsV2Input { - s.RequestPayer = &v - return s -} - -// SetStartAfter sets the StartAfter field's value. -func (s *ListObjectsV2Input) SetStartAfter(v string) *ListObjectsV2Input { - s.StartAfter = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2Output -type ListObjectsV2Output struct { - _ struct{} `type:"structure"` - - // CommonPrefixes contains all (if there are any) keys between Prefix and the - // next occurrence of the string specified by delimiter - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - // Metadata about each object returned. - Contents []*Object `type:"list" flattened:"true"` - - // ContinuationToken indicates Amazon S3 that the list is being continued on - // this bucket with a token. ContinuationToken is obfuscated and is not a real - // key - ContinuationToken *string `type:"string"` - - // A delimiter is a character you use to group keys. - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - EncodingType *string `type:"string" enum:"EncodingType"` - - // A flag that indicates whether or not Amazon S3 returned all of the results - // that satisfied the search criteria. - IsTruncated *bool `type:"boolean"` - - // KeyCount is the number of keys returned with this request. KeyCount will - // always be less than equals to MaxKeys field. Say you ask for 50 keys, your - // result will include less than equals 50 keys - KeyCount *int64 `type:"integer"` - - // Sets the maximum number of keys returned in the response. The response might - // contain fewer keys but will never contain more. - MaxKeys *int64 `type:"integer"` - - // Name of the bucket to list. - Name *string `type:"string"` - - // NextContinuationToken is sent when isTruncated is true which means there - // are more keys in the bucket that can be listed. The next list requests to - // Amazon S3 can be continued with this NextContinuationToken. NextContinuationToken - // is obfuscated and is not a real key - NextContinuationToken *string `type:"string"` - - // Limits the response to keys that begin with the specified prefix. - Prefix *string `type:"string"` - - // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts - // listing after this specified key. StartAfter can be any key in the bucket - StartAfter *string `type:"string"` -} - -// String returns the string representation -func (s ListObjectsV2Output) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListObjectsV2Output) GoString() string { - return s.String() -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListObjectsV2Output) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsV2Output { - s.CommonPrefixes = v - return s -} - -// SetContents sets the Contents field's value. -func (s *ListObjectsV2Output) SetContents(v []*Object) *ListObjectsV2Output { - s.Contents = v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListObjectsV2Output) SetContinuationToken(v string) *ListObjectsV2Output { - s.ContinuationToken = &v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsV2Output) SetDelimiter(v string) *ListObjectsV2Output { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsV2Output) SetEncodingType(v string) *ListObjectsV2Output { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListObjectsV2Output) SetIsTruncated(v bool) *ListObjectsV2Output { - s.IsTruncated = &v - return s -} - -// SetKeyCount sets the KeyCount field's value. -func (s *ListObjectsV2Output) SetKeyCount(v int64) *ListObjectsV2Output { - s.KeyCount = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsV2Output) SetMaxKeys(v int64) *ListObjectsV2Output { - s.MaxKeys = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListObjectsV2Output) SetName(v string) *ListObjectsV2Output { - s.Name = &v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListObjectsV2Output) SetNextContinuationToken(v string) *ListObjectsV2Output { - s.NextContinuationToken = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsV2Output) SetPrefix(v string) *ListObjectsV2Output { - s.Prefix = &v - return s -} - -// SetStartAfter sets the StartAfter field's value. -func (s *ListObjectsV2Output) SetStartAfter(v string) *ListObjectsV2Output { - s.StartAfter = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListPartsRequest -type ListPartsInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Sets the maximum number of parts to return. - MaxParts *int64 `location:"querystring" locationName:"max-parts" type:"integer"` - - // Specifies the part after which listing should begin. Only parts with higher - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Upload ID identifying the multipart upload whose parts are being listed. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation -func (s ListPartsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPartsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPartsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPartsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListPartsInput) SetBucket(v string) *ListPartsInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *ListPartsInput) SetKey(v string) *ListPartsInput { - s.Key = &v - return s -} - -// SetMaxParts sets the MaxParts field's value. -func (s *ListPartsInput) SetMaxParts(v int64) *ListPartsInput { - s.MaxParts = &v - return s -} - -// SetPartNumberMarker sets the PartNumberMarker field's value. -func (s *ListPartsInput) SetPartNumberMarker(v int64) *ListPartsInput { - s.PartNumberMarker = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *ListPartsInput) SetRequestPayer(v string) *ListPartsInput { - s.RequestPayer = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ListPartsInput) SetUploadId(v string) *ListPartsInput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListPartsOutput -type ListPartsOutput struct { - _ struct{} `type:"structure"` - - // Date when multipart upload will become eligible for abort operation by lifecycle. - AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp" timestampFormat:"rfc822"` - - // Id of the lifecycle rule that makes a multipart upload eligible for abort - // operation. - AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` - - // Name of the bucket to which the multipart upload was initiated. - Bucket *string `type:"string"` - - // Identifies who initiated the multipart upload. - Initiator *Initiator `type:"structure"` - - // Indicates whether the returned list of parts is truncated. - IsTruncated *bool `type:"boolean"` - - // Object key for which the multipart upload was initiated. - Key *string `min:"1" type:"string"` - - // Maximum number of parts that were allowed in the response. - MaxParts *int64 `type:"integer"` - - // When a list is truncated, this element specifies the last part in the list, - // as well as the value to use for the part-number-marker request parameter - // in a subsequent request. - NextPartNumberMarker *int64 `type:"integer"` - - Owner *Owner `type:"structure"` - - // Part number after which listing begins. - PartNumberMarker *int64 `type:"integer"` - - Parts []*Part `locationName:"Part" type:"list" flattened:"true"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"StorageClass"` - - // Upload ID identifying the multipart upload whose parts are being listed. - UploadId *string `type:"string"` -} - -// String returns the string representation -func (s ListPartsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListPartsOutput) GoString() string { - return s.String() -} - -// SetAbortDate sets the AbortDate field's value. -func (s *ListPartsOutput) SetAbortDate(v time.Time) *ListPartsOutput { - s.AbortDate = &v - return s -} - -// SetAbortRuleId sets the AbortRuleId field's value. -func (s *ListPartsOutput) SetAbortRuleId(v string) *ListPartsOutput { - s.AbortRuleId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *ListPartsOutput) SetBucket(v string) *ListPartsOutput { - s.Bucket = &v - return s -} - -// SetInitiator sets the Initiator field's value. -func (s *ListPartsOutput) SetInitiator(v *Initiator) *ListPartsOutput { - s.Initiator = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListPartsOutput) SetIsTruncated(v bool) *ListPartsOutput { - s.IsTruncated = &v - return s -} - -// SetKey sets the Key field's value. -func (s *ListPartsOutput) SetKey(v string) *ListPartsOutput { - s.Key = &v - return s -} - -// SetMaxParts sets the MaxParts field's value. -func (s *ListPartsOutput) SetMaxParts(v int64) *ListPartsOutput { - s.MaxParts = &v - return s -} - -// SetNextPartNumberMarker sets the NextPartNumberMarker field's value. -func (s *ListPartsOutput) SetNextPartNumberMarker(v int64) *ListPartsOutput { - s.NextPartNumberMarker = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ListPartsOutput) SetOwner(v *Owner) *ListPartsOutput { - s.Owner = v - return s -} - -// SetPartNumberMarker sets the PartNumberMarker field's value. -func (s *ListPartsOutput) SetPartNumberMarker(v int64) *ListPartsOutput { - s.PartNumberMarker = &v - return s -} - -// SetParts sets the Parts field's value. -func (s *ListPartsOutput) SetParts(v []*Part) *ListPartsOutput { - s.Parts = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *ListPartsOutput) SetRequestCharged(v string) *ListPartsOutput { - s.RequestCharged = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *ListPartsOutput) SetStorageClass(v string) *ListPartsOutput { - s.StorageClass = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ListPartsOutput) SetUploadId(v string) *ListPartsOutput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LoggingEnabled -type LoggingEnabled struct { - _ struct{} `type:"structure"` - - // Specifies the bucket where you want Amazon S3 to store server access logs. - // You can have your logs delivered to any bucket that you own, including the - // same bucket that is being logged. You can also configure multiple buckets - // to deliver their logs to the same target bucket. In this case you should - // choose a different TargetPrefix for each source bucket so that the delivered - // log files can be distinguished by key. - TargetBucket *string `type:"string"` - - TargetGrants []*TargetGrant `locationNameList:"Grant" type:"list"` - - // This element lets you specify a prefix for the keys that the log files will - // be stored under. - TargetPrefix *string `type:"string"` -} - -// String returns the string representation -func (s LoggingEnabled) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s LoggingEnabled) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoggingEnabled) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoggingEnabled"} - if s.TargetGrants != nil { - for i, v := range s.TargetGrants { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetGrants", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetBucket sets the TargetBucket field's value. -func (s *LoggingEnabled) SetTargetBucket(v string) *LoggingEnabled { - s.TargetBucket = &v - return s -} - -// SetTargetGrants sets the TargetGrants field's value. -func (s *LoggingEnabled) SetTargetGrants(v []*TargetGrant) *LoggingEnabled { - s.TargetGrants = v - return s -} - -// SetTargetPrefix sets the TargetPrefix field's value. -func (s *LoggingEnabled) SetTargetPrefix(v string) *LoggingEnabled { - s.TargetPrefix = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsAndOperator -type MetricsAndOperator struct { - _ struct{} `type:"structure"` - - // The prefix used when evaluating an AND predicate. - Prefix *string `type:"string"` - - // The list of tags used when evaluating an AND predicate. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s MetricsAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricsAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricsAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricsAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *MetricsAndOperator) SetPrefix(v string) *MetricsAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *MetricsAndOperator) SetTags(v []*Tag) *MetricsAndOperator { - s.Tags = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsConfiguration -type MetricsConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies a metrics configuration filter. The metrics configuration will - // only include objects that meet the filter's criteria. A filter must be a - // prefix, a tag, or a conjunction (MetricsAndOperator). - Filter *MetricsFilter `type:"structure"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s MetricsConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricsConfiguration"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *MetricsConfiguration) SetFilter(v *MetricsFilter) *MetricsConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *MetricsConfiguration) SetId(v string) *MetricsConfiguration { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsFilter -type MetricsFilter struct { - _ struct{} `type:"structure"` - - // A conjunction (logical AND) of predicates, which is used in evaluating a - // metrics filter. The operator must have at least two predicates, and an object - // must match all of the predicates in order for the filter to apply. - And *MetricsAndOperator `type:"structure"` - - // The prefix used when evaluating a metrics filter. - Prefix *string `type:"string"` - - // The tag used when evaluating a metrics filter. - Tag *Tag `type:"structure"` -} - -// String returns the string representation -func (s MetricsFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MetricsFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricsFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricsFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *MetricsFilter) SetAnd(v *MetricsAndOperator) *MetricsFilter { - s.And = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *MetricsFilter) SetPrefix(v string) *MetricsFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *MetricsFilter) SetTag(v *Tag) *MetricsFilter { - s.Tag = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MultipartUpload -type MultipartUpload struct { - _ struct{} `type:"structure"` - - // Date and time at which the multipart upload was initiated. - Initiated *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Identifies who initiated the multipart upload. - Initiator *Initiator `type:"structure"` - - // Key of the object for which the multipart upload was initiated. - Key *string `min:"1" type:"string"` - - Owner *Owner `type:"structure"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"StorageClass"` - - // Upload ID that identifies the multipart upload. - UploadId *string `type:"string"` -} - -// String returns the string representation -func (s MultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MultipartUpload) GoString() string { - return s.String() -} - -// SetInitiated sets the Initiated field's value. -func (s *MultipartUpload) SetInitiated(v time.Time) *MultipartUpload { - s.Initiated = &v - return s -} - -// SetInitiator sets the Initiator field's value. -func (s *MultipartUpload) SetInitiator(v *Initiator) *MultipartUpload { - s.Initiator = v - return s -} - -// SetKey sets the Key field's value. -func (s *MultipartUpload) SetKey(v string) *MultipartUpload { - s.Key = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *MultipartUpload) SetOwner(v *Owner) *MultipartUpload { - s.Owner = v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *MultipartUpload) SetStorageClass(v string) *MultipartUpload { - s.StorageClass = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *MultipartUpload) SetUploadId(v string) *MultipartUpload { - s.UploadId = &v - return s -} - -// Specifies when noncurrent object versions expire. Upon expiration, Amazon -// S3 permanently deletes the noncurrent object versions. You set this lifecycle -// configuration action on a bucket that has versioning enabled (or suspended) -// to request that Amazon S3 delete noncurrent object versions at a specific -// period in the object's lifetime. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NoncurrentVersionExpiration -type NoncurrentVersionExpiration struct { - _ struct{} `type:"structure"` - - // Specifies the number of days an object is noncurrent before Amazon S3 can - // perform the associated action. For information about the noncurrent days - // calculations, see How Amazon S3 Calculates When an Object Became Noncurrent - // (http://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) - NoncurrentDays *int64 `type:"integer"` -} - -// String returns the string representation -func (s NoncurrentVersionExpiration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NoncurrentVersionExpiration) GoString() string { - return s.String() -} - -// SetNoncurrentDays sets the NoncurrentDays field's value. -func (s *NoncurrentVersionExpiration) SetNoncurrentDays(v int64) *NoncurrentVersionExpiration { - s.NoncurrentDays = &v - return s -} - -// Container for the transition rule that describes when noncurrent objects -// transition to the STANDARD_IA or GLACIER storage class. If your bucket is -// versioning-enabled (or versioning is suspended), you can set this action -// to request that Amazon S3 transition noncurrent object versions to the STANDARD_IA -// or GLACIER storage class at a specific period in the object's lifetime. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NoncurrentVersionTransition -type NoncurrentVersionTransition struct { - _ struct{} `type:"structure"` - - // Specifies the number of days an object is noncurrent before Amazon S3 can - // perform the associated action. For information about the noncurrent days - // calculations, see How Amazon S3 Calculates When an Object Became Noncurrent - // (http://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) - NoncurrentDays *int64 `type:"integer"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"TransitionStorageClass"` -} - -// String returns the string representation -func (s NoncurrentVersionTransition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NoncurrentVersionTransition) GoString() string { - return s.String() -} - -// SetNoncurrentDays sets the NoncurrentDays field's value. -func (s *NoncurrentVersionTransition) SetNoncurrentDays(v int64) *NoncurrentVersionTransition { - s.NoncurrentDays = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *NoncurrentVersionTransition) SetStorageClass(v string) *NoncurrentVersionTransition { - s.StorageClass = &v - return s -} - -// Container for specifying the notification configuration of the bucket. If -// this element is empty, notifications are turned off on the bucket. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfiguration -type NotificationConfiguration struct { - _ struct{} `type:"structure"` - - LambdaFunctionConfigurations []*LambdaFunctionConfiguration `locationName:"CloudFunctionConfiguration" type:"list" flattened:"true"` - - QueueConfigurations []*QueueConfiguration `locationName:"QueueConfiguration" type:"list" flattened:"true"` - - TopicConfigurations []*TopicConfiguration `locationName:"TopicConfiguration" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s NotificationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NotificationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NotificationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotificationConfiguration"} - if s.LambdaFunctionConfigurations != nil { - for i, v := range s.LambdaFunctionConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LambdaFunctionConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.QueueConfigurations != nil { - for i, v := range s.QueueConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueueConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TopicConfigurations != nil { - for i, v := range s.TopicConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TopicConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLambdaFunctionConfigurations sets the LambdaFunctionConfigurations field's value. -func (s *NotificationConfiguration) SetLambdaFunctionConfigurations(v []*LambdaFunctionConfiguration) *NotificationConfiguration { - s.LambdaFunctionConfigurations = v - return s -} - -// SetQueueConfigurations sets the QueueConfigurations field's value. -func (s *NotificationConfiguration) SetQueueConfigurations(v []*QueueConfiguration) *NotificationConfiguration { - s.QueueConfigurations = v - return s -} - -// SetTopicConfigurations sets the TopicConfigurations field's value. -func (s *NotificationConfiguration) SetTopicConfigurations(v []*TopicConfiguration) *NotificationConfiguration { - s.TopicConfigurations = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfigurationDeprecated -type NotificationConfigurationDeprecated struct { - _ struct{} `type:"structure"` - - CloudFunctionConfiguration *CloudFunctionConfiguration `type:"structure"` - - QueueConfiguration *QueueConfigurationDeprecated `type:"structure"` - - TopicConfiguration *TopicConfigurationDeprecated `type:"structure"` -} - -// String returns the string representation -func (s NotificationConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NotificationConfigurationDeprecated) GoString() string { - return s.String() -} - -// SetCloudFunctionConfiguration sets the CloudFunctionConfiguration field's value. -func (s *NotificationConfigurationDeprecated) SetCloudFunctionConfiguration(v *CloudFunctionConfiguration) *NotificationConfigurationDeprecated { - s.CloudFunctionConfiguration = v - return s -} - -// SetQueueConfiguration sets the QueueConfiguration field's value. -func (s *NotificationConfigurationDeprecated) SetQueueConfiguration(v *QueueConfigurationDeprecated) *NotificationConfigurationDeprecated { - s.QueueConfiguration = v - return s -} - -// SetTopicConfiguration sets the TopicConfiguration field's value. -func (s *NotificationConfigurationDeprecated) SetTopicConfiguration(v *TopicConfigurationDeprecated) *NotificationConfigurationDeprecated { - s.TopicConfiguration = v - return s -} - -// Container for object key name filtering rules. For information about key -// name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfigurationFilter -type NotificationConfigurationFilter struct { - _ struct{} `type:"structure"` - - // Container for object key name prefix and suffix filtering rules. - Key *KeyFilter `locationName:"S3Key" type:"structure"` -} - -// String returns the string representation -func (s NotificationConfigurationFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s NotificationConfigurationFilter) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *NotificationConfigurationFilter) SetKey(v *KeyFilter) *NotificationConfigurationFilter { - s.Key = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Object -type Object struct { - _ struct{} `type:"structure"` - - ETag *string `type:"string"` - - Key *string `min:"1" type:"string"` - - LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - Owner *Owner `type:"structure"` - - Size *int64 `type:"integer"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"ObjectStorageClass"` -} - -// String returns the string representation -func (s Object) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Object) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *Object) SetETag(v string) *Object { - s.ETag = &v - return s -} - -// SetKey sets the Key field's value. -func (s *Object) SetKey(v string) *Object { - s.Key = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *Object) SetLastModified(v time.Time) *Object { - s.LastModified = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *Object) SetOwner(v *Owner) *Object { - s.Owner = v - return s -} - -// SetSize sets the Size field's value. -func (s *Object) SetSize(v int64) *Object { - s.Size = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *Object) SetStorageClass(v string) *Object { - s.StorageClass = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectIdentifier -type ObjectIdentifier struct { - _ struct{} `type:"structure"` - - // Key name of the object to delete. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // VersionId for the specific version of the object to delete. - VersionId *string `type:"string"` -} - -// String returns the string representation -func (s ObjectIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ObjectIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ObjectIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ObjectIdentifier"} - 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 -} - -// SetKey sets the Key field's value. -func (s *ObjectIdentifier) SetKey(v string) *ObjectIdentifier { - s.Key = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *ObjectIdentifier) SetVersionId(v string) *ObjectIdentifier { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectVersion -type ObjectVersion struct { - _ struct{} `type:"structure"` - - ETag *string `type:"string"` - - // Specifies whether the object is (true) or is not (false) the latest version - // of an object. - IsLatest *bool `type:"boolean"` - - // The object key. - Key *string `min:"1" type:"string"` - - // Date and time the object was last modified. - LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - Owner *Owner `type:"structure"` - - // Size in bytes of the object. - Size *int64 `type:"integer"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"ObjectVersionStorageClass"` - - // Version ID of an object. - VersionId *string `type:"string"` -} - -// String returns the string representation -func (s ObjectVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ObjectVersion) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *ObjectVersion) SetETag(v string) *ObjectVersion { - s.ETag = &v - return s -} - -// SetIsLatest sets the IsLatest field's value. -func (s *ObjectVersion) SetIsLatest(v bool) *ObjectVersion { - s.IsLatest = &v - return s -} - -// SetKey sets the Key field's value. -func (s *ObjectVersion) SetKey(v string) *ObjectVersion { - s.Key = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *ObjectVersion) SetLastModified(v time.Time) *ObjectVersion { - s.LastModified = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ObjectVersion) SetOwner(v *Owner) *ObjectVersion { - s.Owner = v - return s -} - -// SetSize sets the Size field's value. -func (s *ObjectVersion) SetSize(v int64) *ObjectVersion { - s.Size = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *ObjectVersion) SetStorageClass(v string) *ObjectVersion { - s.StorageClass = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *ObjectVersion) SetVersionId(v string) *ObjectVersion { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Owner -type Owner struct { - _ struct{} `type:"structure"` - - DisplayName *string `type:"string"` - - ID *string `type:"string"` -} - -// String returns the string representation -func (s Owner) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Owner) GoString() string { - return s.String() -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Owner) SetDisplayName(v string) *Owner { - s.DisplayName = &v - return s -} - -// SetID sets the ID field's value. -func (s *Owner) SetID(v string) *Owner { - s.ID = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Part -type Part struct { - _ struct{} `type:"structure"` - - // Entity tag returned when the part was uploaded. - ETag *string `type:"string"` - - // Date and time at which the part was uploaded. - LastModified *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Part number identifying the part. This is a positive integer between 1 and - // 10,000. - PartNumber *int64 `type:"integer"` - - // Size of the uploaded part data. - Size *int64 `type:"integer"` -} - -// String returns the string representation -func (s Part) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Part) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *Part) SetETag(v string) *Part { - s.ETag = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *Part) SetLastModified(v time.Time) *Part { - s.LastModified = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *Part) SetPartNumber(v int64) *Part { - s.PartNumber = &v - return s -} - -// SetSize sets the Size field's value. -func (s *Part) SetSize(v int64) *Part { - s.Size = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfigurationRequest -type PutBucketAccelerateConfigurationInput struct { - _ struct{} `type:"structure" payload:"AccelerateConfiguration"` - - // Specifies the Accelerate Configuration you want to set for the bucket. - // - // AccelerateConfiguration is a required field - AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true"` - - // Name of the bucket for which the accelerate configuration is set. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutBucketAccelerateConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketAccelerateConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketAccelerateConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketAccelerateConfigurationInput"} - if s.AccelerateConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("AccelerateConfiguration")) - } - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccelerateConfiguration sets the AccelerateConfiguration field's value. -func (s *PutBucketAccelerateConfigurationInput) SetAccelerateConfiguration(v *AccelerateConfiguration) *PutBucketAccelerateConfigurationInput { - s.AccelerateConfiguration = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketAccelerateConfigurationInput) SetBucket(v string) *PutBucketAccelerateConfigurationInput { - s.Bucket = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfigurationOutput -type PutBucketAccelerateConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketAccelerateConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketAccelerateConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAclRequest -type PutBucketAclInput struct { - _ struct{} `type:"structure" payload:"AccessControlPolicy"` - - // The canned ACL to apply to the bucket. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` - - AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Allows grantee the read, write, read ACP, and write ACP permissions on the - // bucket. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to list the objects in the bucket. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the bucket ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to create, overwrite, and delete any object in the bucket. - GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` - - // Allows grantee to write the ACL for the applicable bucket. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` -} - -// String returns the string representation -func (s PutBucketAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.AccessControlPolicy != nil { - if err := s.AccessControlPolicy.Validate(); err != nil { - invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *PutBucketAclInput) SetACL(v string) *PutBucketAclInput { - s.ACL = &v - return s -} - -// SetAccessControlPolicy sets the AccessControlPolicy field's value. -func (s *PutBucketAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutBucketAclInput { - s.AccessControlPolicy = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketAclInput) SetBucket(v string) *PutBucketAclInput { - s.Bucket = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *PutBucketAclInput) SetGrantFullControl(v string) *PutBucketAclInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *PutBucketAclInput) SetGrantRead(v string) *PutBucketAclInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *PutBucketAclInput) SetGrantReadACP(v string) *PutBucketAclInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWrite sets the GrantWrite field's value. -func (s *PutBucketAclInput) SetGrantWrite(v string) *PutBucketAclInput { - s.GrantWrite = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *PutBucketAclInput) SetGrantWriteACP(v string) *PutBucketAclInput { - s.GrantWriteACP = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAclOutput -type PutBucketAclOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketAclOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfigurationRequest -type PutBucketAnalyticsConfigurationInput struct { - _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` - - // The configuration and any analyses for the analytics filter. - // - // AnalyticsConfiguration is a required field - AnalyticsConfiguration *AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"structure" required:"true"` - - // The name of the bucket to which an analytics configuration is stored. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The identifier used to represent an analytics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation -func (s PutBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketAnalyticsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketAnalyticsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketAnalyticsConfigurationInput"} - if s.AnalyticsConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("AnalyticsConfiguration")) - } - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.AnalyticsConfiguration != nil { - if err := s.AnalyticsConfiguration.Validate(); err != nil { - invalidParams.AddNested("AnalyticsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. -func (s *PutBucketAnalyticsConfigurationInput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *PutBucketAnalyticsConfigurationInput { - s.AnalyticsConfiguration = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketAnalyticsConfigurationInput) SetBucket(v string) *PutBucketAnalyticsConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyticsConfigurationInput { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfigurationOutput -type PutBucketAnalyticsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketAnalyticsConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCorsRequest -type PutBucketCorsInput struct { - _ struct{} `type:"structure" payload:"CORSConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // CORSConfiguration is a required field - CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketCorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketCorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketCorsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.CORSConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("CORSConfiguration")) - } - if s.CORSConfiguration != nil { - if err := s.CORSConfiguration.Validate(); err != nil { - invalidParams.AddNested("CORSConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketCorsInput) SetBucket(v string) *PutBucketCorsInput { - s.Bucket = &v - return s -} - -// SetCORSConfiguration sets the CORSConfiguration field's value. -func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBucketCorsInput { - s.CORSConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCorsOutput -type PutBucketCorsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketCorsOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfigurationRequest -type PutBucketInventoryConfigurationInput struct { - _ struct{} `type:"structure" payload:"InventoryConfiguration"` - - // The name of the bucket where the inventory configuration will be stored. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` - - // Specifies the inventory configuration. - // - // InventoryConfiguration is a required field - InventoryConfiguration *InventoryConfiguration `locationName:"InventoryConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketInventoryConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketInventoryConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketInventoryConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.InventoryConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("InventoryConfiguration")) - } - if s.InventoryConfiguration != nil { - if err := s.InventoryConfiguration.Validate(); err != nil { - invalidParams.AddNested("InventoryConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketInventoryConfigurationInput) SetBucket(v string) *PutBucketInventoryConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *PutBucketInventoryConfigurationInput) SetId(v string) *PutBucketInventoryConfigurationInput { - s.Id = &v - return s -} - -// SetInventoryConfiguration sets the InventoryConfiguration field's value. -func (s *PutBucketInventoryConfigurationInput) SetInventoryConfiguration(v *InventoryConfiguration) *PutBucketInventoryConfigurationInput { - s.InventoryConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfigurationOutput -type PutBucketInventoryConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketInventoryConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfigurationRequest -type PutBucketLifecycleConfigurationInput struct { - _ struct{} `type:"structure" payload:"LifecycleConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure"` -} - -// String returns the string representation -func (s PutBucketLifecycleConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketLifecycleConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketLifecycleConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.LifecycleConfiguration != nil { - if err := s.LifecycleConfiguration.Validate(); err != nil { - invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketLifecycleConfigurationInput) SetBucket(v string) *PutBucketLifecycleConfigurationInput { - s.Bucket = &v - return s -} - -// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. -func (s *PutBucketLifecycleConfigurationInput) SetLifecycleConfiguration(v *BucketLifecycleConfiguration) *PutBucketLifecycleConfigurationInput { - s.LifecycleConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfigurationOutput -type PutBucketLifecycleConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketLifecycleConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketLifecycleConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleRequest -type PutBucketLifecycleInput struct { - _ struct{} `type:"structure" payload:"LifecycleConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure"` -} - -// String returns the string representation -func (s PutBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.LifecycleConfiguration != nil { - if err := s.LifecycleConfiguration.Validate(); err != nil { - invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketLifecycleInput) SetBucket(v string) *PutBucketLifecycleInput { - s.Bucket = &v - return s -} - -// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. -func (s *PutBucketLifecycleInput) SetLifecycleConfiguration(v *LifecycleConfiguration) *PutBucketLifecycleInput { - s.LifecycleConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleOutput -type PutBucketLifecycleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketLifecycleOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLoggingRequest -type PutBucketLoggingInput struct { - _ struct{} `type:"structure" payload:"BucketLoggingStatus"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // BucketLoggingStatus is a required field - BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketLoggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.BucketLoggingStatus == nil { - invalidParams.Add(request.NewErrParamRequired("BucketLoggingStatus")) - } - if s.BucketLoggingStatus != nil { - if err := s.BucketLoggingStatus.Validate(); err != nil { - invalidParams.AddNested("BucketLoggingStatus", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketLoggingInput) SetBucket(v string) *PutBucketLoggingInput { - s.Bucket = &v - return s -} - -// SetBucketLoggingStatus sets the BucketLoggingStatus field's value. -func (s *PutBucketLoggingInput) SetBucketLoggingStatus(v *BucketLoggingStatus) *PutBucketLoggingInput { - s.BucketLoggingStatus = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLoggingOutput -type PutBucketLoggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketLoggingOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfigurationRequest -type PutBucketMetricsConfigurationInput struct { - _ struct{} `type:"structure" payload:"MetricsConfiguration"` - - // The name of the bucket for which the metrics configuration is set. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` - - // Specifies the metrics configuration. - // - // MetricsConfiguration is a required field - MetricsConfiguration *MetricsConfiguration `locationName:"MetricsConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketMetricsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketMetricsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketMetricsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.MetricsConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("MetricsConfiguration")) - } - if s.MetricsConfiguration != nil { - if err := s.MetricsConfiguration.Validate(); err != nil { - invalidParams.AddNested("MetricsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketMetricsConfigurationInput) SetBucket(v string) *PutBucketMetricsConfigurationInput { - s.Bucket = &v - return s -} - -// SetId sets the Id field's value. -func (s *PutBucketMetricsConfigurationInput) SetId(v string) *PutBucketMetricsConfigurationInput { - s.Id = &v - return s -} - -// SetMetricsConfiguration sets the MetricsConfiguration field's value. -func (s *PutBucketMetricsConfigurationInput) SetMetricsConfiguration(v *MetricsConfiguration) *PutBucketMetricsConfigurationInput { - s.MetricsConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfigurationOutput -type PutBucketMetricsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketMetricsConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfigurationRequest -type PutBucketNotificationConfigurationInput struct { - _ struct{} `type:"structure" payload:"NotificationConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Container for specifying the notification configuration of the bucket. If - // this element is empty, notifications are turned off on the bucket. - // - // NotificationConfiguration is a required field - NotificationConfiguration *NotificationConfiguration `locationName:"NotificationConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketNotificationConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketNotificationConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketNotificationConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.NotificationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) - } - if s.NotificationConfiguration != nil { - if err := s.NotificationConfiguration.Validate(); err != nil { - invalidParams.AddNested("NotificationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketNotificationConfigurationInput) SetBucket(v string) *PutBucketNotificationConfigurationInput { - s.Bucket = &v - return s -} - -// SetNotificationConfiguration sets the NotificationConfiguration field's value. -func (s *PutBucketNotificationConfigurationInput) SetNotificationConfiguration(v *NotificationConfiguration) *PutBucketNotificationConfigurationInput { - s.NotificationConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfigurationOutput -type PutBucketNotificationConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketNotificationConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketNotificationConfigurationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationRequest -type PutBucketNotificationInput struct { - _ struct{} `type:"structure" payload:"NotificationConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // NotificationConfiguration is a required field - NotificationConfiguration *NotificationConfigurationDeprecated `locationName:"NotificationConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketNotificationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketNotificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.NotificationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketNotificationInput) SetBucket(v string) *PutBucketNotificationInput { - s.Bucket = &v - return s -} - -// SetNotificationConfiguration sets the NotificationConfiguration field's value. -func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *NotificationConfigurationDeprecated) *PutBucketNotificationInput { - s.NotificationConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationOutput -type PutBucketNotificationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketNotificationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketNotificationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicyRequest -type PutBucketPolicyInput struct { - _ struct{} `type:"structure" payload:"Policy"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The bucket policy as a JSON document. - // - // Policy is a required field - Policy *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PutBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketPolicyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketPolicyInput) SetBucket(v string) *PutBucketPolicyInput { - s.Bucket = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *PutBucketPolicyInput) SetPolicy(v string) *PutBucketPolicyInput { - s.Policy = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicyOutput -type PutBucketPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketPolicyOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationRequest -type PutBucketReplicationInput struct { - _ struct{} `type:"structure" payload:"ReplicationConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Container for replication rules. You can add as many as 1,000 rules. Total - // replication configuration size can be up to 2 MB. - // - // ReplicationConfiguration is a required field - ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketReplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketReplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketReplicationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.ReplicationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationConfiguration")) - } - if s.ReplicationConfiguration != nil { - if err := s.ReplicationConfiguration.Validate(); err != nil { - invalidParams.AddNested("ReplicationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketReplicationInput) SetBucket(v string) *PutBucketReplicationInput { - s.Bucket = &v - return s -} - -// SetReplicationConfiguration sets the ReplicationConfiguration field's value. -func (s *PutBucketReplicationInput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutBucketReplicationInput { - s.ReplicationConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationOutput -type PutBucketReplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketReplicationOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPaymentRequest -type PutBucketRequestPaymentInput struct { - _ struct{} `type:"structure" payload:"RequestPaymentConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // RequestPaymentConfiguration is a required field - RequestPaymentConfiguration *RequestPaymentConfiguration `locationName:"RequestPaymentConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketRequestPaymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketRequestPaymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketRequestPaymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketRequestPaymentInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.RequestPaymentConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("RequestPaymentConfiguration")) - } - if s.RequestPaymentConfiguration != nil { - if err := s.RequestPaymentConfiguration.Validate(); err != nil { - invalidParams.AddNested("RequestPaymentConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketRequestPaymentInput) SetBucket(v string) *PutBucketRequestPaymentInput { - s.Bucket = &v - return s -} - -// SetRequestPaymentConfiguration sets the RequestPaymentConfiguration field's value. -func (s *PutBucketRequestPaymentInput) SetRequestPaymentConfiguration(v *RequestPaymentConfiguration) *PutBucketRequestPaymentInput { - s.RequestPaymentConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPaymentOutput -type PutBucketRequestPaymentOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketRequestPaymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketRequestPaymentOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTaggingRequest -type PutBucketTaggingInput struct { - _ struct{} `type:"structure" payload:"Tagging"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Tagging is a required field - Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Tagging == nil { - invalidParams.Add(request.NewErrParamRequired("Tagging")) - } - if s.Tagging != nil { - if err := s.Tagging.Validate(); err != nil { - invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketTaggingInput) SetBucket(v string) *PutBucketTaggingInput { - s.Bucket = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *PutBucketTaggingInput) SetTagging(v *Tagging) *PutBucketTaggingInput { - s.Tagging = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTaggingOutput -type PutBucketTaggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketTaggingOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioningRequest -type PutBucketVersioningInput struct { - _ struct{} `type:"structure" payload:"VersioningConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The concatenation of the authentication device's serial number, a space, - // and the value that is displayed on your authentication device. - MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - - // VersioningConfiguration is a required field - VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketVersioningInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketVersioningInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketVersioningInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketVersioningInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.VersioningConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("VersioningConfiguration")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketVersioningInput) SetBucket(v string) *PutBucketVersioningInput { - s.Bucket = &v - return s -} - -// SetMFA sets the MFA field's value. -func (s *PutBucketVersioningInput) SetMFA(v string) *PutBucketVersioningInput { - s.MFA = &v - return s -} - -// SetVersioningConfiguration sets the VersioningConfiguration field's value. -func (s *PutBucketVersioningInput) SetVersioningConfiguration(v *VersioningConfiguration) *PutBucketVersioningInput { - s.VersioningConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioningOutput -type PutBucketVersioningOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketVersioningOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketVersioningOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsiteRequest -type PutBucketWebsiteInput struct { - _ struct{} `type:"structure" payload:"WebsiteConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // WebsiteConfiguration is a required field - WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true"` -} - -// String returns the string representation -func (s PutBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketWebsiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketWebsiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketWebsiteInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.WebsiteConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("WebsiteConfiguration")) - } - if s.WebsiteConfiguration != nil { - if err := s.WebsiteConfiguration.Validate(); err != nil { - invalidParams.AddNested("WebsiteConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketWebsiteInput) SetBucket(v string) *PutBucketWebsiteInput { - s.Bucket = &v - return s -} - -// SetWebsiteConfiguration sets the WebsiteConfiguration field's value. -func (s *PutBucketWebsiteInput) SetWebsiteConfiguration(v *WebsiteConfiguration) *PutBucketWebsiteInput { - s.WebsiteConfiguration = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsiteOutput -type PutBucketWebsiteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PutBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutBucketWebsiteOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAclRequest -type PutObjectAclInput struct { - _ struct{} `type:"structure" payload:"AccessControlPolicy"` - - // The canned ACL to apply to the object. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Allows grantee the read, write, read ACP, and write ACP permissions on the - // bucket. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to list the objects in the bucket. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the bucket ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to create, overwrite, and delete any object in the bucket. - GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` - - // Allows grantee to write the ACL for the applicable bucket. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s PutObjectAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutObjectAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.AccessControlPolicy != nil { - if err := s.AccessControlPolicy.Validate(); err != nil { - invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *PutObjectAclInput) SetACL(v string) *PutObjectAclInput { - s.ACL = &v - return s -} - -// SetAccessControlPolicy sets the AccessControlPolicy field's value. -func (s *PutObjectAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutObjectAclInput { - s.AccessControlPolicy = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectAclInput) SetBucket(v string) *PutObjectAclInput { - s.Bucket = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *PutObjectAclInput) SetGrantFullControl(v string) *PutObjectAclInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *PutObjectAclInput) SetGrantRead(v string) *PutObjectAclInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *PutObjectAclInput) SetGrantReadACP(v string) *PutObjectAclInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWrite sets the GrantWrite field's value. -func (s *PutObjectAclInput) SetGrantWrite(v string) *PutObjectAclInput { - s.GrantWrite = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *PutObjectAclInput) SetGrantWriteACP(v string) *PutObjectAclInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectAclInput) SetKey(v string) *PutObjectAclInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectAclInput) SetRequestPayer(v string) *PutObjectAclInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectAclInput) SetVersionId(v string) *PutObjectAclInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAclOutput -type PutObjectAclOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation -func (s PutObjectAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutObjectAclOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *PutObjectAclOutput) SetRequestCharged(v string) *PutObjectAclOutput { - s.RequestCharged = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRequest -type PutObjectInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The canned ACL to apply to the object. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - // Object data. - Body io.ReadSeeker `type:"blob"` - - // Name of the bucket to which the PUT operation was initiated. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // Size of the body in bytes. This parameter is useful when the size of the - // body cannot be determined automatically. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp" timestampFormat:"rfc822"` - - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to read the object data and its metadata. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the object ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to write the ACL for the applicable object. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // Object key for which the PUT operation was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // 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. Documentation on configuring any of the officially supported - // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // The type of storage to use for the object. Defaults to 'STANDARD'. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The tag-set for the object. The tag-set must be encoded as URL Query parameters - Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation -func (s PutObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - 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 -} - -// SetACL sets the ACL field's value. -func (s *PutObjectInput) SetACL(v string) *PutObjectInput { - s.ACL = &v - return s -} - -// SetBody sets the Body field's value. -func (s *PutObjectInput) SetBody(v io.ReadSeeker) *PutObjectInput { - s.Body = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectInput) SetBucket(v string) *PutObjectInput { - s.Bucket = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *PutObjectInput) SetCacheControl(v string) *PutObjectInput { - s.CacheControl = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *PutObjectInput) SetContentDisposition(v string) *PutObjectInput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *PutObjectInput) SetContentEncoding(v string) *PutObjectInput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *PutObjectInput) SetContentLanguage(v string) *PutObjectInput { - s.ContentLanguage = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *PutObjectInput) SetContentLength(v int64) *PutObjectInput { - s.ContentLength = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *PutObjectInput) SetContentType(v string) *PutObjectInput { - s.ContentType = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *PutObjectInput) SetExpires(v time.Time) *PutObjectInput { - s.Expires = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *PutObjectInput) SetGrantFullControl(v string) *PutObjectInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *PutObjectInput) SetGrantRead(v string) *PutObjectInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *PutObjectInput) SetGrantReadACP(v string) *PutObjectInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *PutObjectInput) SetGrantWriteACP(v string) *PutObjectInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectInput) SetKey(v string) *PutObjectInput { - s.Key = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *PutObjectInput) SetMetadata(v map[string]*string) *PutObjectInput { - s.Metadata = v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectInput) SetRequestPayer(v string) *PutObjectInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *PutObjectInput) SetSSECustomerAlgorithm(v string) *PutObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *PutObjectInput) SetSSECustomerKey(v string) *PutObjectInput { - s.SSECustomerKey = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *PutObjectInput) SetSSEKMSKeyId(v string) *PutObjectInput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *PutObjectInput) SetServerSideEncryption(v string) *PutObjectInput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *PutObjectInput) SetStorageClass(v string) *PutObjectInput { - s.StorageClass = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *PutObjectInput) SetTagging(v string) *PutObjectInput { - s.Tagging = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput { - s.WebsiteRedirectLocation = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectOutput -type PutObjectOutput struct { - _ struct{} `type:"structure"` - - // Entity tag for the uploaded object. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If the object expiration is configured, this will contain the expiration - // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity - // verification of the customer-provided encryption key. - 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 (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Version of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation -func (s PutObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutObjectOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *PutObjectOutput) SetETag(v string) *PutObjectOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *PutObjectOutput) SetExpiration(v string) *PutObjectOutput { - s.Expiration = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *PutObjectOutput) SetRequestCharged(v string) *PutObjectOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *PutObjectOutput) SetSSECustomerAlgorithm(v string) *PutObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *PutObjectOutput) SetSSECustomerKeyMD5(v string) *PutObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *PutObjectOutput) SetSSEKMSKeyId(v string) *PutObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *PutObjectOutput) SetServerSideEncryption(v string) *PutObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectOutput) SetVersionId(v string) *PutObjectOutput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTaggingRequest -type PutObjectTaggingInput struct { - _ struct{} `type:"structure" payload:"Tagging"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Tagging is a required field - Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true"` - - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s PutObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutObjectTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Tagging == nil { - invalidParams.Add(request.NewErrParamRequired("Tagging")) - } - if s.Tagging != nil { - if err := s.Tagging.Validate(); err != nil { - invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectTaggingInput) SetBucket(v string) *PutObjectTaggingInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput { - s.Key = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *PutObjectTaggingInput) SetTagging(v *Tagging) *PutObjectTaggingInput { - s.Tagging = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectTaggingInput) SetVersionId(v string) *PutObjectTaggingInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTaggingOutput -type PutObjectTaggingOutput struct { - _ struct{} `type:"structure"` - - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation -func (s PutObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PutObjectTaggingOutput) GoString() string { - return s.String() -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectTaggingOutput) SetVersionId(v string) *PutObjectTaggingOutput { - s.VersionId = &v - return s -} - -// Container for specifying an configuration when you want Amazon S3 to publish -// events to an Amazon Simple Queue Service (Amazon SQS) queue. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/QueueConfiguration -type QueueConfiguration struct { - _ struct{} `type:"structure"` - - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - - // Container for object key name filtering rules. For information about key - // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - Filter *NotificationConfigurationFilter `type:"structure"` - - // Optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // Amazon SQS queue ARN to which Amazon S3 will publish a message when it detects - // events of specified type. - // - // QueueArn is a required field - QueueArn *string `locationName:"Queue" type:"string" required:"true"` -} - -// String returns the string representation -func (s QueueConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QueueConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueueConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueueConfiguration"} - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) - } - if s.QueueArn == nil { - invalidParams.Add(request.NewErrParamRequired("QueueArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvents sets the Events field's value. -func (s *QueueConfiguration) SetEvents(v []*string) *QueueConfiguration { - s.Events = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *QueueConfiguration) SetFilter(v *NotificationConfigurationFilter) *QueueConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *QueueConfiguration) SetId(v string) *QueueConfiguration { - s.Id = &v - return s -} - -// SetQueueArn sets the QueueArn field's value. -func (s *QueueConfiguration) SetQueueArn(v string) *QueueConfiguration { - s.QueueArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/QueueConfigurationDeprecated -type QueueConfigurationDeprecated struct { - _ struct{} `type:"structure"` - - // Bucket event for which to send notifications. - Event *string `deprecated:"true" type:"string" enum:"Event"` - - Events []*string `locationName:"Event" type:"list" flattened:"true"` - - // Optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - Queue *string `type:"string"` -} - -// String returns the string representation -func (s QueueConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s QueueConfigurationDeprecated) GoString() string { - return s.String() -} - -// SetEvent sets the Event field's value. -func (s *QueueConfigurationDeprecated) SetEvent(v string) *QueueConfigurationDeprecated { - s.Event = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *QueueConfigurationDeprecated) SetEvents(v []*string) *QueueConfigurationDeprecated { - s.Events = v - return s -} - -// SetId sets the Id field's value. -func (s *QueueConfigurationDeprecated) SetId(v string) *QueueConfigurationDeprecated { - s.Id = &v - return s -} - -// SetQueue sets the Queue field's value. -func (s *QueueConfigurationDeprecated) SetQueue(v string) *QueueConfigurationDeprecated { - s.Queue = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Redirect -type Redirect struct { - _ struct{} `type:"structure"` - - // The host name to use in the redirect request. - HostName *string `type:"string"` - - // The HTTP redirect code to use on the response. Not required if one of the - // siblings is present. - HttpRedirectCode *string `type:"string"` - - // Protocol to use (http, https) when redirecting requests. The default is the - // protocol that is used in the original request. - Protocol *string `type:"string" enum:"Protocol"` - - // The object key prefix to use in the redirect request. For example, to redirect - // requests for all pages with prefix docs/ (objects in the docs/ folder) to - // documents/, you can set a condition block with KeyPrefixEquals set to docs/ - // and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required - // if one of the siblings is present. Can be present only if ReplaceKeyWith - // is not provided. - ReplaceKeyPrefixWith *string `type:"string"` - - // The specific object key to use in the redirect request. For example, redirect - // request to error.html. Not required if one of the sibling is present. Can - // be present only if ReplaceKeyPrefixWith is not provided. - ReplaceKeyWith *string `type:"string"` -} - -// String returns the string representation -func (s Redirect) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Redirect) GoString() string { - return s.String() -} - -// SetHostName sets the HostName field's value. -func (s *Redirect) SetHostName(v string) *Redirect { - s.HostName = &v - return s -} - -// SetHttpRedirectCode sets the HttpRedirectCode field's value. -func (s *Redirect) SetHttpRedirectCode(v string) *Redirect { - s.HttpRedirectCode = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *Redirect) SetProtocol(v string) *Redirect { - s.Protocol = &v - return s -} - -// SetReplaceKeyPrefixWith sets the ReplaceKeyPrefixWith field's value. -func (s *Redirect) SetReplaceKeyPrefixWith(v string) *Redirect { - s.ReplaceKeyPrefixWith = &v - return s -} - -// SetReplaceKeyWith sets the ReplaceKeyWith field's value. -func (s *Redirect) SetReplaceKeyWith(v string) *Redirect { - s.ReplaceKeyWith = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RedirectAllRequestsTo -type RedirectAllRequestsTo struct { - _ struct{} `type:"structure"` - - // Name of the host where requests will be redirected. - // - // HostName is a required field - HostName *string `type:"string" required:"true"` - - // Protocol to use (http, https) when redirecting requests. The default is the - // protocol that is used in the original request. - Protocol *string `type:"string" enum:"Protocol"` -} - -// String returns the string representation -func (s RedirectAllRequestsTo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RedirectAllRequestsTo) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedirectAllRequestsTo) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedirectAllRequestsTo"} - if s.HostName == nil { - invalidParams.Add(request.NewErrParamRequired("HostName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostName sets the HostName field's value. -func (s *RedirectAllRequestsTo) SetHostName(v string) *RedirectAllRequestsTo { - s.HostName = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *RedirectAllRequestsTo) SetProtocol(v string) *RedirectAllRequestsTo { - s.Protocol = &v - return s -} - -// Container for replication rules. You can add as many as 1,000 rules. Total -// replication configuration size can be up to 2 MB. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationConfiguration -type ReplicationConfiguration struct { - _ struct{} `type:"structure"` - - // Amazon Resource Name (ARN) of an IAM role for Amazon S3 to assume when replicating - // the objects. - // - // Role is a required field - Role *string `type:"string" required:"true"` - - // Container for information about a particular replication rule. Replication - // configuration must have at least one rule and can contain up to 1,000 rules. - // - // Rules is a required field - Rules []*ReplicationRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s ReplicationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicationConfiguration"} - if s.Role == nil { - invalidParams.Add(request.NewErrParamRequired("Role")) - } - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRole sets the Role field's value. -func (s *ReplicationConfiguration) SetRole(v string) *ReplicationConfiguration { - s.Role = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *ReplicationConfiguration) SetRules(v []*ReplicationRule) *ReplicationConfiguration { - s.Rules = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationRule -type ReplicationRule struct { - _ struct{} `type:"structure"` - - // Destination is a required field - Destination *Destination `type:"structure" required:"true"` - - // Unique identifier for the rule. The value cannot be longer than 255 characters. - ID *string `type:"string"` - - // Object keyname prefix identifying one or more objects to which the rule applies. - // Maximum prefix length can be up to 1,024 characters. Overlapping prefixes - // are not supported. - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` - - // The rule is ignored if status is not Enabled. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ReplicationRuleStatus"` -} - -// String returns the string representation -func (s ReplicationRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplicationRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicationRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicationRule"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *ReplicationRule) SetDestination(v *Destination) *ReplicationRule { - s.Destination = v - return s -} - -// SetID sets the ID field's value. -func (s *ReplicationRule) SetID(v string) *ReplicationRule { - s.ID = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ReplicationRule) SetPrefix(v string) *ReplicationRule { - s.Prefix = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReplicationRule) SetStatus(v string) *ReplicationRule { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RequestPaymentConfiguration -type RequestPaymentConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies who pays for the download and request fees. - // - // Payer is a required field - Payer *string `type:"string" required:"true" enum:"Payer"` -} - -// String returns the string representation -func (s RequestPaymentConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RequestPaymentConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestPaymentConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestPaymentConfiguration"} - if s.Payer == nil { - invalidParams.Add(request.NewErrParamRequired("Payer")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPayer sets the Payer field's value. -func (s *RequestPaymentConfiguration) SetPayer(v string) *RequestPaymentConfiguration { - s.Payer = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObjectRequest -type RestoreObjectInput struct { - _ struct{} `type:"structure" payload:"RestoreRequest"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - RestoreRequest *RestoreRequest `locationName:"RestoreRequest" type:"structure"` - - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation -func (s RestoreObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.RestoreRequest != nil { - if err := s.RestoreRequest.Validate(); err != nil { - invalidParams.AddNested("RestoreRequest", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *RestoreObjectInput) SetBucket(v string) *RestoreObjectInput { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *RestoreObjectInput) SetKey(v string) *RestoreObjectInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *RestoreObjectInput) SetRequestPayer(v string) *RestoreObjectInput { - s.RequestPayer = &v - return s -} - -// SetRestoreRequest sets the RestoreRequest field's value. -func (s *RestoreObjectInput) SetRestoreRequest(v *RestoreRequest) *RestoreObjectInput { - s.RestoreRequest = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *RestoreObjectInput) SetVersionId(v string) *RestoreObjectInput { - s.VersionId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObjectOutput -type RestoreObjectOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation -func (s RestoreObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreObjectOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *RestoreObjectOutput) SetRequestCharged(v string) *RestoreObjectOutput { - s.RequestCharged = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreRequest -type RestoreRequest struct { - _ struct{} `type:"structure"` - - // Lifetime of the active copy in days - // - // Days is a required field - Days *int64 `type:"integer" required:"true"` - - // Glacier related prameters pertaining to this job. - GlacierJobParameters *GlacierJobParameters `type:"structure"` -} - -// String returns the string representation -func (s RestoreRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RestoreRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreRequest"} - if s.Days == nil { - invalidParams.Add(request.NewErrParamRequired("Days")) - } - if s.GlacierJobParameters != nil { - if err := s.GlacierJobParameters.Validate(); err != nil { - invalidParams.AddNested("GlacierJobParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDays sets the Days field's value. -func (s *RestoreRequest) SetDays(v int64) *RestoreRequest { - s.Days = &v - return s -} - -// SetGlacierJobParameters sets the GlacierJobParameters field's value. -func (s *RestoreRequest) SetGlacierJobParameters(v *GlacierJobParameters) *RestoreRequest { - s.GlacierJobParameters = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RoutingRule -type RoutingRule struct { - _ struct{} `type:"structure"` - - // A container for describing a condition that must be met for the specified - // redirect to apply. For example, 1. If request is for pages in the /docs folder, - // redirect to the /documents folder. 2. If request results in HTTP error 4xx, - // redirect request to another host where you might process the error. - Condition *Condition `type:"structure"` - - // Container for redirect information. You can redirect requests to another - // host, to another page, or with another protocol. In the event of an error, - // you can can specify a different error code to return. - // - // Redirect is a required field - Redirect *Redirect `type:"structure" required:"true"` -} - -// String returns the string representation -func (s RoutingRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RoutingRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RoutingRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RoutingRule"} - if s.Redirect == nil { - invalidParams.Add(request.NewErrParamRequired("Redirect")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCondition sets the Condition field's value. -func (s *RoutingRule) SetCondition(v *Condition) *RoutingRule { - s.Condition = v - return s -} - -// SetRedirect sets the Redirect field's value. -func (s *RoutingRule) SetRedirect(v *Redirect) *RoutingRule { - s.Redirect = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Rule -type Rule struct { - _ struct{} `type:"structure"` - - // Specifies the days since the initiation of an Incomplete Multipart Upload - // that Lifecycle will wait before permanently removing all parts of the upload. - AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` - - Expiration *LifecycleExpiration `type:"structure"` - - // Unique identifier for the rule. The value cannot be longer than 255 characters. - ID *string `type:"string"` - - // Specifies when noncurrent object versions expire. Upon expiration, Amazon - // S3 permanently deletes the noncurrent object versions. You set this lifecycle - // configuration action on a bucket that has versioning enabled (or suspended) - // to request that Amazon S3 delete noncurrent object versions at a specific - // period in the object's lifetime. - NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` - - // Container for the transition rule that describes when noncurrent objects - // transition to the STANDARD_IA or GLACIER storage class. If your bucket is - // versioning-enabled (or versioning is suspended), you can set this action - // to request that Amazon S3 transition noncurrent object versions to the STANDARD_IA - // or GLACIER storage class at a specific period in the object's lifetime. - NoncurrentVersionTransition *NoncurrentVersionTransition `type:"structure"` - - // Prefix identifying one or more objects to which the rule applies. - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` - - // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule - // is not currently being applied. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ExpirationStatus"` - - Transition *Transition `type:"structure"` -} - -// String returns the string representation -func (s Rule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Rule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Rule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Rule"} - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. -func (s *Rule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *Rule { - s.AbortIncompleteMultipartUpload = v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *Rule) SetExpiration(v *LifecycleExpiration) *Rule { - s.Expiration = v - return s -} - -// SetID sets the ID field's value. -func (s *Rule) SetID(v string) *Rule { - s.ID = &v - return s -} - -// SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. -func (s *Rule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *Rule { - s.NoncurrentVersionExpiration = v - return s -} - -// SetNoncurrentVersionTransition sets the NoncurrentVersionTransition field's value. -func (s *Rule) SetNoncurrentVersionTransition(v *NoncurrentVersionTransition) *Rule { - s.NoncurrentVersionTransition = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *Rule) SetPrefix(v string) *Rule { - s.Prefix = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Rule) SetStatus(v string) *Rule { - s.Status = &v - return s -} - -// SetTransition sets the Transition field's value. -func (s *Rule) SetTransition(v *Transition) *Rule { - s.Transition = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/StorageClassAnalysis -type StorageClassAnalysis struct { - _ struct{} `type:"structure"` - - // A container used to describe how data related to the storage class analysis - // should be exported. - DataExport *StorageClassAnalysisDataExport `type:"structure"` -} - -// String returns the string representation -func (s StorageClassAnalysis) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StorageClassAnalysis) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StorageClassAnalysis) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysis"} - if s.DataExport != nil { - if err := s.DataExport.Validate(); err != nil { - invalidParams.AddNested("DataExport", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataExport sets the DataExport field's value. -func (s *StorageClassAnalysis) SetDataExport(v *StorageClassAnalysisDataExport) *StorageClassAnalysis { - s.DataExport = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/StorageClassAnalysisDataExport -type StorageClassAnalysisDataExport struct { - _ struct{} `type:"structure"` - - // The place to store the data for an analysis. - // - // Destination is a required field - Destination *AnalyticsExportDestination `type:"structure" required:"true"` - - // The version of the output schema to use when exporting data. Must be V_1. - // - // OutputSchemaVersion is a required field - OutputSchemaVersion *string `type:"string" required:"true" enum:"StorageClassAnalysisSchemaVersion"` -} - -// String returns the string representation -func (s StorageClassAnalysisDataExport) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StorageClassAnalysisDataExport) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StorageClassAnalysisDataExport) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysisDataExport"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.OutputSchemaVersion == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSchemaVersion")) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *StorageClassAnalysisDataExport) SetDestination(v *AnalyticsExportDestination) *StorageClassAnalysisDataExport { - s.Destination = v - return s -} - -// SetOutputSchemaVersion sets the OutputSchemaVersion field's value. -func (s *StorageClassAnalysisDataExport) SetOutputSchemaVersion(v string) *StorageClassAnalysisDataExport { - s.OutputSchemaVersion = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Tag -type Tag struct { - _ struct{} `type:"structure"` - - // Name of the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Value of the tag. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Tagging -type Tagging struct { - _ struct{} `type:"structure"` - - // TagSet is a required field - TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` -} - -// String returns the string representation -func (s Tagging) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Tagging) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tagging) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tagging"} - if s.TagSet == nil { - invalidParams.Add(request.NewErrParamRequired("TagSet")) - } - if s.TagSet != nil { - for i, v := range s.TagSet { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagSet", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTagSet sets the TagSet field's value. -func (s *Tagging) SetTagSet(v []*Tag) *Tagging { - s.TagSet = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TargetGrant -type TargetGrant struct { - _ struct{} `type:"structure"` - - Grantee *Grantee `type:"structure"` - - // Logging permissions assigned to the Grantee for the bucket. - Permission *string `type:"string" enum:"BucketLogsPermission"` -} - -// String returns the string representation -func (s TargetGrant) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TargetGrant) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetGrant) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetGrant"} - if s.Grantee != nil { - if err := s.Grantee.Validate(); err != nil { - invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrantee sets the Grantee field's value. -func (s *TargetGrant) SetGrantee(v *Grantee) *TargetGrant { - s.Grantee = v - return s -} - -// SetPermission sets the Permission field's value. -func (s *TargetGrant) SetPermission(v string) *TargetGrant { - s.Permission = &v - return s -} - -// Container for specifying the configuration when you want Amazon S3 to publish -// events to an Amazon Simple Notification Service (Amazon SNS) topic. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TopicConfiguration -type TopicConfiguration struct { - _ struct{} `type:"structure"` - - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` - - // Container for object key name filtering rules. For information about key - // name filtering, go to Configuring Event Notifications (http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - Filter *NotificationConfigurationFilter `type:"structure"` - - // Optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // Amazon SNS topic ARN to which Amazon S3 will publish a message when it detects - // events of specified type. - // - // TopicArn is a required field - TopicArn *string `locationName:"Topic" type:"string" required:"true"` -} - -// String returns the string representation -func (s TopicConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TopicConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TopicConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TopicConfiguration"} - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) - } - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvents sets the Events field's value. -func (s *TopicConfiguration) SetEvents(v []*string) *TopicConfiguration { - s.Events = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *TopicConfiguration) SetFilter(v *NotificationConfigurationFilter) *TopicConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *TopicConfiguration) SetId(v string) *TopicConfiguration { - s.Id = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *TopicConfiguration) SetTopicArn(v string) *TopicConfiguration { - s.TopicArn = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TopicConfigurationDeprecated -type TopicConfigurationDeprecated struct { - _ struct{} `type:"structure"` - - // Bucket event for which to send notifications. - Event *string `deprecated:"true" type:"string" enum:"Event"` - - Events []*string `locationName:"Event" type:"list" flattened:"true"` - - // Optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // Amazon SNS topic to which Amazon S3 will publish a message to report the - // specified events for the bucket. - Topic *string `type:"string"` -} - -// String returns the string representation -func (s TopicConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s TopicConfigurationDeprecated) GoString() string { - return s.String() -} - -// SetEvent sets the Event field's value. -func (s *TopicConfigurationDeprecated) SetEvent(v string) *TopicConfigurationDeprecated { - s.Event = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *TopicConfigurationDeprecated) SetEvents(v []*string) *TopicConfigurationDeprecated { - s.Events = v - return s -} - -// SetId sets the Id field's value. -func (s *TopicConfigurationDeprecated) SetId(v string) *TopicConfigurationDeprecated { - s.Id = &v - return s -} - -// SetTopic sets the Topic field's value. -func (s *TopicConfigurationDeprecated) SetTopic(v string) *TopicConfigurationDeprecated { - s.Topic = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Transition -type Transition struct { - _ struct{} `type:"structure"` - - // Indicates at what date the object is to be moved or deleted. Should be in - // GMT ISO 8601 Format. - Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the lifetime, in days, of the objects that are subject to the rule. - // The value must be a non-zero positive integer. - Days *int64 `type:"integer"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"TransitionStorageClass"` -} - -// String returns the string representation -func (s Transition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Transition) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *Transition) SetDate(v time.Time) *Transition { - s.Date = &v - return s -} - -// SetDays sets the Days field's value. -func (s *Transition) SetDays(v int64) *Transition { - s.Days = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *Transition) SetStorageClass(v string) *Transition { - s.StorageClass = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopyRequest -type UploadPartCopyInput struct { - _ struct{} `type:"structure"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The name of the source bucket and key name of the source object, separated - // by a slash (/). Must be URL-encoded. - // - // CopySource is a required field - CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` - - // Copies the object if its entity tag (ETag) matches the specified tag. - CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` - - // Copies the object if it has been modified since the specified time. - CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp" timestampFormat:"rfc822"` - - // Copies the object if its entity tag (ETag) is different than the specified - // ETag. - CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` - - // Copies the object if it hasn't been modified since the specified time. - CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp" timestampFormat:"rfc822"` - - // The range of bytes to copy from the source object. The range value must use - // the form bytes=first-last, where the first and last are the zero-based byte - // offsets to copy. For example, bytes=0-9 indicates that you want to copy the - // first ten bytes of the source. You can copy a range only if the source object - // is greater than 5 GB. - CopySourceRange *string `location:"header" locationName:"x-amz-copy-source-range" type:"string"` - - // Specifies the algorithm to use when decrypting the source object (e.g., AES256). - CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt - // the source object. The encryption key provided in this header must be one - // that was used when the source object was created. - CopySourceSSECustomerKey *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` - - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of part being copied. This is a positive integer between 1 and - // 10,000. - // - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. This must be the same encryption key specified in the initiate multipart - // upload request. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Upload ID identifying the multipart upload whose part is being copied. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation -func (s UploadPartCopyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadPartCopyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadPartCopyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadPartCopyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.CopySource == nil { - invalidParams.Add(request.NewErrParamRequired("CopySource")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *UploadPartCopyInput) SetBucket(v string) *UploadPartCopyInput { - s.Bucket = &v - return s -} - -// SetCopySource sets the CopySource field's value. -func (s *UploadPartCopyInput) SetCopySource(v string) *UploadPartCopyInput { - s.CopySource = &v - return s -} - -// SetCopySourceIfMatch sets the CopySourceIfMatch field's value. -func (s *UploadPartCopyInput) SetCopySourceIfMatch(v string) *UploadPartCopyInput { - s.CopySourceIfMatch = &v - return s -} - -// SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. -func (s *UploadPartCopyInput) SetCopySourceIfModifiedSince(v time.Time) *UploadPartCopyInput { - s.CopySourceIfModifiedSince = &v - return s -} - -// SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. -func (s *UploadPartCopyInput) SetCopySourceIfNoneMatch(v string) *UploadPartCopyInput { - s.CopySourceIfNoneMatch = &v - return s -} - -// SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. -func (s *UploadPartCopyInput) SetCopySourceIfUnmodifiedSince(v time.Time) *UploadPartCopyInput { - s.CopySourceIfUnmodifiedSince = &v - return s -} - -// SetCopySourceRange sets the CopySourceRange field's value. -func (s *UploadPartCopyInput) SetCopySourceRange(v string) *UploadPartCopyInput { - s.CopySourceRange = &v - return s -} - -// SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. -func (s *UploadPartCopyInput) SetCopySourceSSECustomerAlgorithm(v string) *UploadPartCopyInput { - s.CopySourceSSECustomerAlgorithm = &v - return s -} - -// SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. -func (s *UploadPartCopyInput) SetCopySourceSSECustomerKey(v string) *UploadPartCopyInput { - s.CopySourceSSECustomerKey = &v - return s -} - -// SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. -func (s *UploadPartCopyInput) SetCopySourceSSECustomerKeyMD5(v string) *UploadPartCopyInput { - s.CopySourceSSECustomerKeyMD5 = &v - return s -} - -// SetKey sets the Key field's value. -func (s *UploadPartCopyInput) SetKey(v string) *UploadPartCopyInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *UploadPartCopyInput) SetPartNumber(v int64) *UploadPartCopyInput { - s.PartNumber = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *UploadPartCopyInput) SetRequestPayer(v string) *UploadPartCopyInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartCopyInput) SetSSECustomerAlgorithm(v string) *UploadPartCopyInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *UploadPartCopyInput) SetSSECustomerKey(v string) *UploadPartCopyInput { - s.SSECustomerKey = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartCopyInput) SetSSECustomerKeyMD5(v string) *UploadPartCopyInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadPartCopyInput) SetUploadId(v string) *UploadPartCopyInput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopyOutput -type UploadPartCopyOutput struct { - _ struct{} `type:"structure" payload:"CopyPartResult"` - - CopyPartResult *CopyPartResult `type:"structure"` - - // The version of the source object that was copied, if you have enabled versioning - // on the source bucket. - CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity - // verification of the customer-provided encryption key. - 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 (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` -} - -// String returns the string representation -func (s UploadPartCopyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadPartCopyOutput) GoString() string { - return s.String() -} - -// SetCopyPartResult sets the CopyPartResult field's value. -func (s *UploadPartCopyOutput) SetCopyPartResult(v *CopyPartResult) *UploadPartCopyOutput { - s.CopyPartResult = v - return s -} - -// SetCopySourceVersionId sets the CopySourceVersionId field's value. -func (s *UploadPartCopyOutput) SetCopySourceVersionId(v string) *UploadPartCopyOutput { - s.CopySourceVersionId = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *UploadPartCopyOutput) SetRequestCharged(v string) *UploadPartCopyOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartCopyOutput) SetSSECustomerAlgorithm(v string) *UploadPartCopyOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartCopyOutput) SetSSECustomerKeyMD5(v string) *UploadPartCopyOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *UploadPartCopyOutput) SetSSEKMSKeyId(v string) *UploadPartCopyOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *UploadPartCopyOutput) SetServerSideEncryption(v string) *UploadPartCopyOutput { - s.ServerSideEncryption = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartRequest -type UploadPartInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // Object data. - Body io.ReadSeeker `type:"blob"` - - // Name of the bucket to which the multipart upload was initiated. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Size of the body in bytes. This parameter is useful when the size of the - // body cannot be determined automatically. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // Object key for which the multipart upload was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of part being uploaded. This is a positive integer between 1 - // and 10,000. - // - // 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. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm - // header. This must be the same encryption key specified in the initiate multipart - // upload request. - SSECustomerKey *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Upload ID identifying the multipart upload whose part is being uploaded. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation -func (s UploadPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadPartInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *UploadPartInput) SetBody(v io.ReadSeeker) *UploadPartInput { - s.Body = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *UploadPartInput) SetBucket(v string) *UploadPartInput { - s.Bucket = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *UploadPartInput) SetContentLength(v int64) *UploadPartInput { - s.ContentLength = &v - return s -} - -// SetKey sets the Key field's value. -func (s *UploadPartInput) SetKey(v string) *UploadPartInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *UploadPartInput) SetPartNumber(v int64) *UploadPartInput { - s.PartNumber = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *UploadPartInput) SetRequestPayer(v string) *UploadPartInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartInput) SetSSECustomerAlgorithm(v string) *UploadPartInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *UploadPartInput) SetSSECustomerKey(v string) *UploadPartInput { - s.SSECustomerKey = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartInput) SetSSECustomerKeyMD5(v string) *UploadPartInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadPartInput) SetUploadId(v string) *UploadPartInput { - s.UploadId = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartOutput -type UploadPartOutput struct { - _ struct{} `type:"structure"` - - // Entity tag for the uploaded object. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity - // verification of the customer-provided encryption key. - 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 (KMS) master - // encryption key that was used for the object. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string"` - - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` -} - -// String returns the string representation -func (s UploadPartOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UploadPartOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *UploadPartOutput) SetETag(v string) *UploadPartOutput { - s.ETag = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *UploadPartOutput) SetRequestCharged(v string) *UploadPartOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartOutput) SetSSECustomerAlgorithm(v string) *UploadPartOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartOutput) SetSSECustomerKeyMD5(v string) *UploadPartOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *UploadPartOutput) SetSSEKMSKeyId(v string) *UploadPartOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *UploadPartOutput) SetServerSideEncryption(v string) *UploadPartOutput { - s.ServerSideEncryption = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/VersioningConfiguration -type VersioningConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies whether MFA delete is enabled in the bucket versioning configuration. - // This element is only returned if the bucket has been configured with MFA - // delete. If the bucket has never been so configured, this element is not returned. - MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADelete"` - - // The versioning state of the bucket. - Status *string `type:"string" enum:"BucketVersioningStatus"` -} - -// String returns the string representation -func (s VersioningConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s VersioningConfiguration) GoString() string { - return s.String() -} - -// SetMFADelete sets the MFADelete field's value. -func (s *VersioningConfiguration) SetMFADelete(v string) *VersioningConfiguration { - s.MFADelete = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VersioningConfiguration) SetStatus(v string) *VersioningConfiguration { - s.Status = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/WebsiteConfiguration -type WebsiteConfiguration struct { - _ struct{} `type:"structure"` - - ErrorDocument *ErrorDocument `type:"structure"` - - IndexDocument *IndexDocument `type:"structure"` - - RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` - - RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` -} - -// String returns the string representation -func (s WebsiteConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s WebsiteConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WebsiteConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WebsiteConfiguration"} - if s.ErrorDocument != nil { - if err := s.ErrorDocument.Validate(); err != nil { - invalidParams.AddNested("ErrorDocument", err.(request.ErrInvalidParams)) - } - } - if s.IndexDocument != nil { - if err := s.IndexDocument.Validate(); err != nil { - invalidParams.AddNested("IndexDocument", err.(request.ErrInvalidParams)) - } - } - if s.RedirectAllRequestsTo != nil { - if err := s.RedirectAllRequestsTo.Validate(); err != nil { - invalidParams.AddNested("RedirectAllRequestsTo", err.(request.ErrInvalidParams)) - } - } - if s.RoutingRules != nil { - for i, v := range s.RoutingRules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RoutingRules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetErrorDocument sets the ErrorDocument field's value. -func (s *WebsiteConfiguration) SetErrorDocument(v *ErrorDocument) *WebsiteConfiguration { - s.ErrorDocument = v - return s -} - -// SetIndexDocument sets the IndexDocument field's value. -func (s *WebsiteConfiguration) SetIndexDocument(v *IndexDocument) *WebsiteConfiguration { - s.IndexDocument = v - return s -} - -// SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. -func (s *WebsiteConfiguration) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *WebsiteConfiguration { - s.RedirectAllRequestsTo = v - return s -} - -// SetRoutingRules sets the RoutingRules field's value. -func (s *WebsiteConfiguration) SetRoutingRules(v []*RoutingRule) *WebsiteConfiguration { - s.RoutingRules = v - return s -} - -const ( - // AnalyticsS3ExportFileFormatCsv is a AnalyticsS3ExportFileFormat enum value - AnalyticsS3ExportFileFormatCsv = "CSV" -) - -const ( - // BucketAccelerateStatusEnabled is a BucketAccelerateStatus enum value - BucketAccelerateStatusEnabled = "Enabled" - - // BucketAccelerateStatusSuspended is a BucketAccelerateStatus enum value - BucketAccelerateStatusSuspended = "Suspended" -) - -const ( - // BucketCannedACLPrivate is a BucketCannedACL enum value - BucketCannedACLPrivate = "private" - - // BucketCannedACLPublicRead is a BucketCannedACL enum value - BucketCannedACLPublicRead = "public-read" - - // BucketCannedACLPublicReadWrite is a BucketCannedACL enum value - BucketCannedACLPublicReadWrite = "public-read-write" - - // BucketCannedACLAuthenticatedRead is a BucketCannedACL enum value - BucketCannedACLAuthenticatedRead = "authenticated-read" -) - -const ( - // BucketLocationConstraintEu is a BucketLocationConstraint enum value - BucketLocationConstraintEu = "EU" - - // BucketLocationConstraintEuWest1 is a BucketLocationConstraint enum value - BucketLocationConstraintEuWest1 = "eu-west-1" - - // BucketLocationConstraintUsWest1 is a BucketLocationConstraint enum value - BucketLocationConstraintUsWest1 = "us-west-1" - - // BucketLocationConstraintUsWest2 is a BucketLocationConstraint enum value - BucketLocationConstraintUsWest2 = "us-west-2" - - // BucketLocationConstraintApSouth1 is a BucketLocationConstraint enum value - BucketLocationConstraintApSouth1 = "ap-south-1" - - // BucketLocationConstraintApSoutheast1 is a BucketLocationConstraint enum value - BucketLocationConstraintApSoutheast1 = "ap-southeast-1" - - // BucketLocationConstraintApSoutheast2 is a BucketLocationConstraint enum value - BucketLocationConstraintApSoutheast2 = "ap-southeast-2" - - // BucketLocationConstraintApNortheast1 is a BucketLocationConstraint enum value - BucketLocationConstraintApNortheast1 = "ap-northeast-1" - - // BucketLocationConstraintSaEast1 is a BucketLocationConstraint enum value - BucketLocationConstraintSaEast1 = "sa-east-1" - - // BucketLocationConstraintCnNorth1 is a BucketLocationConstraint enum value - BucketLocationConstraintCnNorth1 = "cn-north-1" - - // BucketLocationConstraintEuCentral1 is a BucketLocationConstraint enum value - BucketLocationConstraintEuCentral1 = "eu-central-1" -) - -const ( - // BucketLogsPermissionFullControl is a BucketLogsPermission enum value - BucketLogsPermissionFullControl = "FULL_CONTROL" - - // BucketLogsPermissionRead is a BucketLogsPermission enum value - BucketLogsPermissionRead = "READ" - - // BucketLogsPermissionWrite is a BucketLogsPermission enum value - BucketLogsPermissionWrite = "WRITE" -) - -const ( - // BucketVersioningStatusEnabled is a BucketVersioningStatus enum value - BucketVersioningStatusEnabled = "Enabled" - - // BucketVersioningStatusSuspended is a BucketVersioningStatus enum value - BucketVersioningStatusSuspended = "Suspended" -) - -// Requests Amazon S3 to encode the object keys in the response and specifies -// the encoding method to use. An object key may contain any Unicode character; -// however, XML 1.0 parser cannot parse some characters, such as characters -// with an ASCII value from 0 to 10. For characters that are not supported in -// XML 1.0, you can add this parameter to request that Amazon S3 encode the -// keys in the response. -const ( - // EncodingTypeUrl is a EncodingType enum value - EncodingTypeUrl = "url" -) - -// Bucket event for which to send notifications. -const ( - // EventS3ReducedRedundancyLostObject is a Event enum value - EventS3ReducedRedundancyLostObject = "s3:ReducedRedundancyLostObject" - - // EventS3ObjectCreated is a Event enum value - EventS3ObjectCreated = "s3:ObjectCreated:*" - - // EventS3ObjectCreatedPut is a Event enum value - EventS3ObjectCreatedPut = "s3:ObjectCreated:Put" - - // EventS3ObjectCreatedPost is a Event enum value - EventS3ObjectCreatedPost = "s3:ObjectCreated:Post" - - // EventS3ObjectCreatedCopy is a Event enum value - EventS3ObjectCreatedCopy = "s3:ObjectCreated:Copy" - - // EventS3ObjectCreatedCompleteMultipartUpload is a Event enum value - EventS3ObjectCreatedCompleteMultipartUpload = "s3:ObjectCreated:CompleteMultipartUpload" - - // EventS3ObjectRemoved is a Event enum value - EventS3ObjectRemoved = "s3:ObjectRemoved:*" - - // EventS3ObjectRemovedDelete is a Event enum value - EventS3ObjectRemovedDelete = "s3:ObjectRemoved:Delete" - - // EventS3ObjectRemovedDeleteMarkerCreated is a Event enum value - EventS3ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated" -) - -const ( - // ExpirationStatusEnabled is a ExpirationStatus enum value - ExpirationStatusEnabled = "Enabled" - - // ExpirationStatusDisabled is a ExpirationStatus enum value - ExpirationStatusDisabled = "Disabled" -) - -const ( - // FilterRuleNamePrefix is a FilterRuleName enum value - FilterRuleNamePrefix = "prefix" - - // FilterRuleNameSuffix is a FilterRuleName enum value - FilterRuleNameSuffix = "suffix" -) - -const ( - // InventoryFormatCsv is a InventoryFormat enum value - InventoryFormatCsv = "CSV" -) - -const ( - // InventoryFrequencyDaily is a InventoryFrequency enum value - InventoryFrequencyDaily = "Daily" - - // InventoryFrequencyWeekly is a InventoryFrequency enum value - InventoryFrequencyWeekly = "Weekly" -) - -const ( - // InventoryIncludedObjectVersionsAll is a InventoryIncludedObjectVersions enum value - InventoryIncludedObjectVersionsAll = "All" - - // InventoryIncludedObjectVersionsCurrent is a InventoryIncludedObjectVersions enum value - InventoryIncludedObjectVersionsCurrent = "Current" -) - -const ( - // InventoryOptionalFieldSize is a InventoryOptionalField enum value - InventoryOptionalFieldSize = "Size" - - // InventoryOptionalFieldLastModifiedDate is a InventoryOptionalField enum value - InventoryOptionalFieldLastModifiedDate = "LastModifiedDate" - - // InventoryOptionalFieldStorageClass is a InventoryOptionalField enum value - InventoryOptionalFieldStorageClass = "StorageClass" - - // InventoryOptionalFieldEtag is a InventoryOptionalField enum value - InventoryOptionalFieldEtag = "ETag" - - // InventoryOptionalFieldIsMultipartUploaded is a InventoryOptionalField enum value - InventoryOptionalFieldIsMultipartUploaded = "IsMultipartUploaded" - - // InventoryOptionalFieldReplicationStatus is a InventoryOptionalField enum value - InventoryOptionalFieldReplicationStatus = "ReplicationStatus" -) - -const ( - // MFADeleteEnabled is a MFADelete enum value - MFADeleteEnabled = "Enabled" - - // MFADeleteDisabled is a MFADelete enum value - MFADeleteDisabled = "Disabled" -) - -const ( - // MFADeleteStatusEnabled is a MFADeleteStatus enum value - MFADeleteStatusEnabled = "Enabled" - - // MFADeleteStatusDisabled is a MFADeleteStatus enum value - MFADeleteStatusDisabled = "Disabled" -) - -const ( - // MetadataDirectiveCopy is a MetadataDirective enum value - MetadataDirectiveCopy = "COPY" - - // MetadataDirectiveReplace is a MetadataDirective enum value - MetadataDirectiveReplace = "REPLACE" -) - -const ( - // ObjectCannedACLPrivate is a ObjectCannedACL enum value - ObjectCannedACLPrivate = "private" - - // ObjectCannedACLPublicRead is a ObjectCannedACL enum value - ObjectCannedACLPublicRead = "public-read" - - // ObjectCannedACLPublicReadWrite is a ObjectCannedACL enum value - ObjectCannedACLPublicReadWrite = "public-read-write" - - // ObjectCannedACLAuthenticatedRead is a ObjectCannedACL enum value - ObjectCannedACLAuthenticatedRead = "authenticated-read" - - // ObjectCannedACLAwsExecRead is a ObjectCannedACL enum value - ObjectCannedACLAwsExecRead = "aws-exec-read" - - // ObjectCannedACLBucketOwnerRead is a ObjectCannedACL enum value - ObjectCannedACLBucketOwnerRead = "bucket-owner-read" - - // ObjectCannedACLBucketOwnerFullControl is a ObjectCannedACL enum value - ObjectCannedACLBucketOwnerFullControl = "bucket-owner-full-control" -) - -const ( - // ObjectStorageClassStandard is a ObjectStorageClass enum value - ObjectStorageClassStandard = "STANDARD" - - // ObjectStorageClassReducedRedundancy is a ObjectStorageClass enum value - ObjectStorageClassReducedRedundancy = "REDUCED_REDUNDANCY" - - // ObjectStorageClassGlacier is a ObjectStorageClass enum value - ObjectStorageClassGlacier = "GLACIER" -) - -const ( - // ObjectVersionStorageClassStandard is a ObjectVersionStorageClass enum value - ObjectVersionStorageClassStandard = "STANDARD" -) - -const ( - // PayerRequester is a Payer enum value - PayerRequester = "Requester" - - // PayerBucketOwner is a Payer enum value - PayerBucketOwner = "BucketOwner" -) - -const ( - // PermissionFullControl is a Permission enum value - PermissionFullControl = "FULL_CONTROL" - - // PermissionWrite is a Permission enum value - PermissionWrite = "WRITE" - - // PermissionWriteAcp is a Permission enum value - PermissionWriteAcp = "WRITE_ACP" - - // PermissionRead is a Permission enum value - PermissionRead = "READ" - - // PermissionReadAcp is a Permission enum value - PermissionReadAcp = "READ_ACP" -) - -const ( - // ProtocolHttp is a Protocol enum value - ProtocolHttp = "http" - - // ProtocolHttps is a Protocol enum value - ProtocolHttps = "https" -) - -const ( - // ReplicationRuleStatusEnabled is a ReplicationRuleStatus enum value - ReplicationRuleStatusEnabled = "Enabled" - - // ReplicationRuleStatusDisabled is a ReplicationRuleStatus enum value - ReplicationRuleStatusDisabled = "Disabled" -) - -const ( - // ReplicationStatusComplete is a ReplicationStatus enum value - ReplicationStatusComplete = "COMPLETE" - - // ReplicationStatusPending is a ReplicationStatus enum value - ReplicationStatusPending = "PENDING" - - // ReplicationStatusFailed is a ReplicationStatus enum value - ReplicationStatusFailed = "FAILED" - - // ReplicationStatusReplica is a ReplicationStatus enum value - ReplicationStatusReplica = "REPLICA" -) - -// If present, indicates that the requester was successfully charged for the -// request. -const ( - // RequestChargedRequester is a RequestCharged enum value - 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. -// Documentation on downloading objects from requester pays buckets can be found -// at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html -const ( - // RequestPayerRequester is a RequestPayer enum value - RequestPayerRequester = "requester" -) - -const ( - // ServerSideEncryptionAes256 is a ServerSideEncryption enum value - ServerSideEncryptionAes256 = "AES256" - - // ServerSideEncryptionAwsKms is a ServerSideEncryption enum value - ServerSideEncryptionAwsKms = "aws:kms" -) - -const ( - // StorageClassStandard is a StorageClass enum value - StorageClassStandard = "STANDARD" - - // StorageClassReducedRedundancy is a StorageClass enum value - StorageClassReducedRedundancy = "REDUCED_REDUNDANCY" - - // StorageClassStandardIa is a StorageClass enum value - StorageClassStandardIa = "STANDARD_IA" -) - -const ( - // StorageClassAnalysisSchemaVersionV1 is a StorageClassAnalysisSchemaVersion enum value - StorageClassAnalysisSchemaVersionV1 = "V_1" -) - -const ( - // TaggingDirectiveCopy is a TaggingDirective enum value - TaggingDirectiveCopy = "COPY" - - // TaggingDirectiveReplace is a TaggingDirective enum value - TaggingDirectiveReplace = "REPLACE" -) - -const ( - // TierStandard is a Tier enum value - TierStandard = "Standard" - - // TierBulk is a Tier enum value - TierBulk = "Bulk" - - // TierExpedited is a Tier enum value - TierExpedited = "Expedited" -) - -const ( - // TransitionStorageClassGlacier is a TransitionStorageClass enum value - TransitionStorageClassGlacier = "GLACIER" - - // TransitionStorageClassStandardIa is a TransitionStorageClass enum value - TransitionStorageClassStandardIa = "STANDARD_IA" -) - -const ( - // TypeCanonicalUser is a Type enum value - TypeCanonicalUser = "CanonicalUser" - - // TypeAmazonCustomerByEmail is a Type enum value - TypeAmazonCustomerByEmail = "AmazonCustomerByEmail" - - // TypeGroup is a Type enum value - TypeGroup = "Group" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go b/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go deleted file mode 100644 index c3a2702..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go +++ /dev/null @@ -1,43 +0,0 @@ -package s3 - -import ( - "io/ioutil" - "regexp" - - "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" -) - -var reBucketLocation = regexp.MustCompile(`>([^<>]+)<\/Location`) - -func buildGetBucketLocation(r *request.Request) { - if r.DataFilled() { - out := r.Data.(*GetBucketLocationOutput) - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.New("SerializationError", "failed reading response body", err) - return - } - - match := reBucketLocation.FindSubmatch(b) - if len(match) > 1 { - loc := string(match[1]) - out.LocationConstraint = &loc - } - } -} - -func populateLocationConstraint(r *request.Request) { - if r.ParamsFilled() && aws.StringValue(r.Config.Region) != "us-east-1" { - in := r.Params.(*CreateBucketInput) - if in.CreateBucketConfiguration == nil { - r.Params = awsutil.CopyOf(r.Params) - in = r.Params.(*CreateBucketInput) - in.CreateBucketConfiguration = &CreateBucketConfiguration{ - LocationConstraint: r.Config.Region, - } - } - } -} 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 8ef61b0..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location_test.go +++ /dev/null @@ -1,78 +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" - "github.com/stretchr/testify/assert" -) - -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")}) - assert.NoError(t, err) - if test.loc == "" { - assert.Nil(t, resp.LocationConstraint) - } else { - assert.Equal(t, test.loc, *resp.LocationConstraint) - } - } -} - -func TestPopulateLocationConstraint(t *testing.T) { - s := s3.New(unit.Session) - in := &s3.CreateBucketInput{ - Bucket: aws.String("bucket"), - } - req, _ := s.CreateBucketRequest(in) - err := req.Build() - assert.NoError(t, err) - v, _ := awsutil.ValuesAtPath(req.Params, "CreateBucketConfiguration.LocationConstraint") - assert.Equal(t, "mock-region", *(v[0].(*string))) - assert.Nil(t, in.CreateBucketConfiguration) // don't modify original params -} - -func TestNoPopulateLocationConstraintIfProvided(t *testing.T) { - s := s3.New(unit.Session) - req, _ := s.CreateBucketRequest(&s3.CreateBucketInput{ - Bucket: aws.String("bucket"), - CreateBucketConfiguration: &s3.CreateBucketConfiguration{}, - }) - err := req.Build() - assert.NoError(t, err) - v, _ := awsutil.ValuesAtPath(req.Params, "CreateBucketConfiguration.LocationConstraint") - assert.Equal(t, 0, len(v)) -} - -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"), - }) - err := req.Build() - assert.NoError(t, err) - v, _ := awsutil.ValuesAtPath(req.Params, "CreateBucketConfiguration.LocationConstraint") - assert.Equal(t, 0, len(v)) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/content_md5.go b/vendor/github.com/aws/aws-sdk-go/service/s3/content_md5.go deleted file mode 100644 index 9fc5df9..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/content_md5.go +++ /dev/null @@ -1,36 +0,0 @@ -package s3 - -import ( - "crypto/md5" - "encoding/base64" - "io" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -// contentMD5 computes and sets the HTTP Content-MD5 header for requests that -// require it. -func contentMD5(r *request.Request) { - h := md5.New() - - // hash the body. seek back to the first position after reading to reset - // the body for transmission. copy errors may be assumed to be from the - // body. - _, err := io.Copy(h, r.Body) - if err != nil { - r.Error = awserr.New("ContentMD5", "failed to read body", err) - return - } - _, err = r.Body.Seek(0, 0) - if err != nil { - r.Error = awserr.New("ContentMD5", "failed to seek body", err) - return - } - - // encode the md5 checksum in base64 and set the request header. - sum := h.Sum(nil) - sum64 := make([]byte, base64.StdEncoding.EncodedLen(len(sum))) - base64.StdEncoding.Encode(sum64, sum) - r.HTTPRequest.Header.Set("Content-MD5", string(sum64)) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go deleted file mode 100644 index 8463347..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go +++ /dev/null @@ -1,46 +0,0 @@ -package s3 - -import ( - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" -) - -func init() { - initClient = defaultInitClientFn - initRequest = defaultInitRequestFn -} - -func defaultInitClientFn(c *client.Client) { - // Support building custom endpoints based on config - c.Handlers.Build.PushFront(updateEndpointForS3Config) - - // Require SSL when using SSE keys - c.Handlers.Validate.PushBack(validateSSERequiresSSL) - c.Handlers.Build.PushBack(computeSSEKeys) - - // S3 uses custom error unmarshaling logic - c.Handlers.UnmarshalError.Clear() - c.Handlers.UnmarshalError.PushBack(unmarshalError) -} - -func defaultInitRequestFn(r *request.Request) { - // Add reuest handlers for specific platforms. - // e.g. 100-continue support for PUT requests using Go 1.6 - platformRequestHandlers(r) - - switch r.Operation.Name { - case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy, - opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration, - opPutBucketReplication: - // These S3 operations require Content-MD5 to be set - r.Handlers.Build.PushBack(contentMD5) - case opGetBucketLocation: - // GetBucketLocation has custom parsing logic - r.Handlers.Unmarshal.PushFront(buildGetBucketLocation) - case opCreateBucket: - // Auto-populate LocationConstraint with current region - r.Handlers.Validate.PushFront(populateLocationConstraint) - case opCopyObject, opUploadPartCopy, opCompleteMultipartUpload: - r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError) - } -} 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 85dfe78..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations_test.go +++ /dev/null @@ -1,158 +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" - "github.com/stretchr/testify/assert" -) - -func assertMD5(t *testing.T, req *request.Request) { - err := req.Build() - assert.NoError(t, err) - - b, _ := ioutil.ReadAll(req.HTTPRequest.Body) - out := md5.Sum(b) - assert.NotEmpty(t, b) - assert.Equal(t, base64.StdEncoding.EncodeToString(out[:]), req.HTTPRequest.Header.Get("Content-MD5")) -} - -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) { - assert.Equal(t, utf8Value, r.Header.Get(metaKeyPrefix+utf8KeySuffix)) - })) - 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 - }(), - }) - - assert.NoError(t, err) -} - -func TestGetObjectMetadataWithUnicode(t *testing.T) { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set(metaKeyPrefix+utf8KeySuffix, utf8Value) - })) - 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"), - }) - - assert.NoError(t, err) - resp.Body.Close() - - assert.Equal(t, utf8Value, *resp.Metadata[utf8KeySuffix]) - -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go deleted file mode 100644 index 931cb17..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3 - -const ( - - // ErrCodeBucketAlreadyExists for service response error code - // "BucketAlreadyExists". - // - // The requested bucket name is not available. The bucket namespace is shared - // by all users of the system. Please select a different name and try again. - ErrCodeBucketAlreadyExists = "BucketAlreadyExists" - - // ErrCodeBucketAlreadyOwnedByYou for service response error code - // "BucketAlreadyOwnedByYou". - ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou" - - // ErrCodeNoSuchBucket for service response error code - // "NoSuchBucket". - // - // The specified bucket does not exist. - ErrCodeNoSuchBucket = "NoSuchBucket" - - // ErrCodeNoSuchKey for service response error code - // "NoSuchKey". - // - // The specified key does not exist. - ErrCodeNoSuchKey = "NoSuchKey" - - // ErrCodeNoSuchUpload for service response error code - // "NoSuchUpload". - // - // The specified multipart upload does not exist. - ErrCodeNoSuchUpload = "NoSuchUpload" - - // ErrCodeObjectAlreadyInActiveTierError for service response error code - // "ObjectAlreadyInActiveTierError". - // - // This operation is not allowed against this storage tier - ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError" - - // ErrCodeObjectNotInActiveTierError for service response error code - // "ObjectNotInActiveTierError". - // - // The source object of the COPY operation is not in the active tier and is - // only stored in Amazon Glacier. - ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError" -) 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 4472990..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/examples_test.go +++ /dev/null @@ -1,2238 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleS3_AbortMultipartUpload() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.AbortMultipartUploadInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - UploadId: aws.String("MultipartUploadId"), // Required - RequestPayer: aws.String("RequestPayer"), - } - resp, err := svc.AbortMultipartUpload(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_CompleteMultipartUpload() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.CompleteMultipartUploadInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - UploadId: aws.String("MultipartUploadId"), // Required - MultipartUpload: &s3.CompletedMultipartUpload{ - Parts: []*s3.CompletedPart{ - { // Required - ETag: aws.String("ETag"), - PartNumber: aws.Int64(1), - }, - // More values... - }, - }, - RequestPayer: aws.String("RequestPayer"), - } - resp, err := svc.CompleteMultipartUpload(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_CopyObject() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.CopyObjectInput{ - Bucket: aws.String("BucketName"), // Required - CopySource: aws.String("CopySource"), // Required - Key: aws.String("ObjectKey"), // Required - ACL: aws.String("ObjectCannedACL"), - CacheControl: aws.String("CacheControl"), - ContentDisposition: aws.String("ContentDisposition"), - ContentEncoding: aws.String("ContentEncoding"), - ContentLanguage: aws.String("ContentLanguage"), - ContentType: aws.String("ContentType"), - CopySourceIfMatch: aws.String("CopySourceIfMatch"), - CopySourceIfModifiedSince: aws.Time(time.Now()), - CopySourceIfNoneMatch: aws.String("CopySourceIfNoneMatch"), - CopySourceIfUnmodifiedSince: aws.Time(time.Now()), - CopySourceSSECustomerAlgorithm: aws.String("CopySourceSSECustomerAlgorithm"), - CopySourceSSECustomerKey: aws.String("CopySourceSSECustomerKey"), - CopySourceSSECustomerKeyMD5: aws.String("CopySourceSSECustomerKeyMD5"), - Expires: aws.Time(time.Now()), - GrantFullControl: aws.String("GrantFullControl"), - GrantRead: aws.String("GrantRead"), - GrantReadACP: aws.String("GrantReadACP"), - GrantWriteACP: aws.String("GrantWriteACP"), - Metadata: map[string]*string{ - "Key": aws.String("MetadataValue"), // Required - // More values... - }, - MetadataDirective: aws.String("MetadataDirective"), - RequestPayer: aws.String("RequestPayer"), - SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), - SSECustomerKey: aws.String("SSECustomerKey"), - SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), - SSEKMSKeyId: aws.String("SSEKMSKeyId"), - ServerSideEncryption: aws.String("ServerSideEncryption"), - StorageClass: aws.String("StorageClass"), - Tagging: aws.String("TaggingHeader"), - TaggingDirective: aws.String("TaggingDirective"), - WebsiteRedirectLocation: aws.String("WebsiteRedirectLocation"), - } - resp, err := svc.CopyObject(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_CreateBucket() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.CreateBucketInput{ - Bucket: aws.String("BucketName"), // Required - ACL: aws.String("BucketCannedACL"), - CreateBucketConfiguration: &s3.CreateBucketConfiguration{ - LocationConstraint: aws.String("BucketLocationConstraint"), - }, - GrantFullControl: aws.String("GrantFullControl"), - GrantRead: aws.String("GrantRead"), - GrantReadACP: aws.String("GrantReadACP"), - GrantWrite: aws.String("GrantWrite"), - GrantWriteACP: aws.String("GrantWriteACP"), - } - resp, err := svc.CreateBucket(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_CreateMultipartUpload() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.CreateMultipartUploadInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - ACL: aws.String("ObjectCannedACL"), - CacheControl: aws.String("CacheControl"), - ContentDisposition: aws.String("ContentDisposition"), - ContentEncoding: aws.String("ContentEncoding"), - ContentLanguage: aws.String("ContentLanguage"), - ContentType: aws.String("ContentType"), - Expires: aws.Time(time.Now()), - GrantFullControl: aws.String("GrantFullControl"), - GrantRead: aws.String("GrantRead"), - GrantReadACP: aws.String("GrantReadACP"), - GrantWriteACP: aws.String("GrantWriteACP"), - Metadata: map[string]*string{ - "Key": aws.String("MetadataValue"), // Required - // More values... - }, - RequestPayer: aws.String("RequestPayer"), - SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), - SSECustomerKey: aws.String("SSECustomerKey"), - SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), - SSEKMSKeyId: aws.String("SSEKMSKeyId"), - ServerSideEncryption: aws.String("ServerSideEncryption"), - StorageClass: aws.String("StorageClass"), - WebsiteRedirectLocation: aws.String("WebsiteRedirectLocation"), - } - resp, err := svc.CreateMultipartUpload(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucket() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.DeleteBucket(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketAnalyticsConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketAnalyticsConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("AnalyticsId"), // Required - } - resp, err := svc.DeleteBucketAnalyticsConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketCors() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketCorsInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.DeleteBucketCors(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketInventoryConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketInventoryConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("InventoryId"), // Required - } - resp, err := svc.DeleteBucketInventoryConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketLifecycle() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketLifecycleInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.DeleteBucketLifecycle(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketMetricsConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketMetricsConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("MetricsId"), // Required - } - resp, err := svc.DeleteBucketMetricsConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketPolicy() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketPolicyInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.DeleteBucketPolicy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketReplication() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketReplicationInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.DeleteBucketReplication(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketTagging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketTaggingInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.DeleteBucketTagging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteBucketWebsite() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteBucketWebsiteInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.DeleteBucketWebsite(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteObject() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteObjectInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - MFA: aws.String("MFA"), - RequestPayer: aws.String("RequestPayer"), - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.DeleteObject(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteObjectTagging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteObjectTaggingInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.DeleteObjectTagging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_DeleteObjects() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.DeleteObjectsInput{ - Bucket: aws.String("BucketName"), // Required - Delete: &s3.Delete{ // Required - Objects: []*s3.ObjectIdentifier{ // Required - { // Required - Key: aws.String("ObjectKey"), // Required - VersionId: aws.String("ObjectVersionId"), - }, - // More values... - }, - Quiet: aws.Bool(true), - }, - MFA: aws.String("MFA"), - RequestPayer: aws.String("RequestPayer"), - } - resp, err := svc.DeleteObjects(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketAccelerateConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketAccelerateConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketAccelerateConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketAcl() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketAclInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketAcl(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketAnalyticsConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketAnalyticsConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("AnalyticsId"), // Required - } - resp, err := svc.GetBucketAnalyticsConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketCors() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketCorsInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketCors(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketInventoryConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketInventoryConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("InventoryId"), // Required - } - resp, err := svc.GetBucketInventoryConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketLifecycle() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketLifecycleInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketLifecycle(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketLifecycleConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketLifecycleConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketLifecycleConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketLocation() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketLocationInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketLocation(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketLogging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketLoggingInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketLogging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketMetricsConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketMetricsConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("MetricsId"), // Required - } - resp, err := svc.GetBucketMetricsConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketNotification() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketNotificationConfigurationRequest{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketNotification(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketNotificationConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketNotificationConfigurationRequest{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketNotificationConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketPolicy() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketPolicyInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketPolicy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketReplication() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketReplicationInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketReplication(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketRequestPayment() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketRequestPaymentInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketRequestPayment(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketTagging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketTaggingInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketTagging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketVersioning() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketVersioningInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketVersioning(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetBucketWebsite() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetBucketWebsiteInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.GetBucketWebsite(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetObject() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetObjectInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - IfMatch: aws.String("IfMatch"), - IfModifiedSince: aws.Time(time.Now()), - IfNoneMatch: aws.String("IfNoneMatch"), - IfUnmodifiedSince: aws.Time(time.Now()), - PartNumber: aws.Int64(1), - Range: aws.String("Range"), - RequestPayer: aws.String("RequestPayer"), - ResponseCacheControl: aws.String("ResponseCacheControl"), - ResponseContentDisposition: aws.String("ResponseContentDisposition"), - ResponseContentEncoding: aws.String("ResponseContentEncoding"), - ResponseContentLanguage: aws.String("ResponseContentLanguage"), - ResponseContentType: aws.String("ResponseContentType"), - ResponseExpires: aws.Time(time.Now()), - SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), - SSECustomerKey: aws.String("SSECustomerKey"), - SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.GetObject(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetObjectAcl() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetObjectAclInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - RequestPayer: aws.String("RequestPayer"), - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.GetObjectAcl(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetObjectTagging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetObjectTaggingInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.GetObjectTagging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_GetObjectTorrent() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.GetObjectTorrentInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - RequestPayer: aws.String("RequestPayer"), - } - resp, err := svc.GetObjectTorrent(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_HeadBucket() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.HeadBucketInput{ - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.HeadBucket(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_HeadObject() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.HeadObjectInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - IfMatch: aws.String("IfMatch"), - IfModifiedSince: aws.Time(time.Now()), - IfNoneMatch: aws.String("IfNoneMatch"), - IfUnmodifiedSince: aws.Time(time.Now()), - PartNumber: aws.Int64(1), - Range: aws.String("Range"), - RequestPayer: aws.String("RequestPayer"), - SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), - SSECustomerKey: aws.String("SSECustomerKey"), - SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.HeadObject(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListBucketAnalyticsConfigurations() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListBucketAnalyticsConfigurationsInput{ - Bucket: aws.String("BucketName"), // Required - ContinuationToken: aws.String("Token"), - } - resp, err := svc.ListBucketAnalyticsConfigurations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListBucketInventoryConfigurations() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListBucketInventoryConfigurationsInput{ - Bucket: aws.String("BucketName"), // Required - ContinuationToken: aws.String("Token"), - } - resp, err := svc.ListBucketInventoryConfigurations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListBucketMetricsConfigurations() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListBucketMetricsConfigurationsInput{ - Bucket: aws.String("BucketName"), // Required - ContinuationToken: aws.String("Token"), - } - resp, err := svc.ListBucketMetricsConfigurations(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListBuckets() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - var params *s3.ListBucketsInput - resp, err := svc.ListBuckets(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListMultipartUploads() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListMultipartUploadsInput{ - Bucket: aws.String("BucketName"), // Required - Delimiter: aws.String("Delimiter"), - EncodingType: aws.String("EncodingType"), - KeyMarker: aws.String("KeyMarker"), - MaxUploads: aws.Int64(1), - Prefix: aws.String("Prefix"), - UploadIdMarker: aws.String("UploadIdMarker"), - } - resp, err := svc.ListMultipartUploads(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListObjectVersions() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListObjectVersionsInput{ - Bucket: aws.String("BucketName"), // Required - Delimiter: aws.String("Delimiter"), - EncodingType: aws.String("EncodingType"), - KeyMarker: aws.String("KeyMarker"), - MaxKeys: aws.Int64(1), - Prefix: aws.String("Prefix"), - VersionIdMarker: aws.String("VersionIdMarker"), - } - resp, err := svc.ListObjectVersions(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListObjects() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListObjectsInput{ - Bucket: aws.String("BucketName"), // Required - Delimiter: aws.String("Delimiter"), - EncodingType: aws.String("EncodingType"), - Marker: aws.String("Marker"), - MaxKeys: aws.Int64(1), - Prefix: aws.String("Prefix"), - RequestPayer: aws.String("RequestPayer"), - } - resp, err := svc.ListObjects(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListObjectsV2() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListObjectsV2Input{ - Bucket: aws.String("BucketName"), // Required - ContinuationToken: aws.String("Token"), - Delimiter: aws.String("Delimiter"), - EncodingType: aws.String("EncodingType"), - FetchOwner: aws.Bool(true), - MaxKeys: aws.Int64(1), - Prefix: aws.String("Prefix"), - RequestPayer: aws.String("RequestPayer"), - StartAfter: aws.String("StartAfter"), - } - resp, err := svc.ListObjectsV2(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_ListParts() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.ListPartsInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - UploadId: aws.String("MultipartUploadId"), // Required - MaxParts: aws.Int64(1), - PartNumberMarker: aws.Int64(1), - RequestPayer: aws.String("RequestPayer"), - } - resp, err := svc.ListParts(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketAccelerateConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketAccelerateConfigurationInput{ - AccelerateConfiguration: &s3.AccelerateConfiguration{ // Required - Status: aws.String("BucketAccelerateStatus"), - }, - Bucket: aws.String("BucketName"), // Required - } - resp, err := svc.PutBucketAccelerateConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketAcl() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketAclInput{ - Bucket: aws.String("BucketName"), // Required - ACL: aws.String("BucketCannedACL"), - AccessControlPolicy: &s3.AccessControlPolicy{ - Grants: []*s3.Grant{ - { // Required - Grantee: &s3.Grantee{ - Type: aws.String("Type"), // Required - DisplayName: aws.String("DisplayName"), - EmailAddress: aws.String("EmailAddress"), - ID: aws.String("ID"), - URI: aws.String("URI"), - }, - Permission: aws.String("Permission"), - }, - // More values... - }, - Owner: &s3.Owner{ - DisplayName: aws.String("DisplayName"), - ID: aws.String("ID"), - }, - }, - GrantFullControl: aws.String("GrantFullControl"), - GrantRead: aws.String("GrantRead"), - GrantReadACP: aws.String("GrantReadACP"), - GrantWrite: aws.String("GrantWrite"), - GrantWriteACP: aws.String("GrantWriteACP"), - } - resp, err := svc.PutBucketAcl(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketAnalyticsConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketAnalyticsConfigurationInput{ - AnalyticsConfiguration: &s3.AnalyticsConfiguration{ // Required - Id: aws.String("AnalyticsId"), // Required - StorageClassAnalysis: &s3.StorageClassAnalysis{ // Required - DataExport: &s3.StorageClassAnalysisDataExport{ - Destination: &s3.AnalyticsExportDestination{ // Required - S3BucketDestination: &s3.AnalyticsS3BucketDestination{ // Required - Bucket: aws.String("BucketName"), // Required - Format: aws.String("AnalyticsS3ExportFileFormat"), // Required - BucketAccountId: aws.String("AccountId"), - Prefix: aws.String("Prefix"), - }, - }, - OutputSchemaVersion: aws.String("StorageClassAnalysisSchemaVersion"), // Required - }, - }, - Filter: &s3.AnalyticsFilter{ - And: &s3.AnalyticsAndOperator{ - Prefix: aws.String("Prefix"), - Tags: []*s3.Tag{ - { // Required - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - // More values... - }, - }, - Prefix: aws.String("Prefix"), - Tag: &s3.Tag{ - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - }, - }, - Bucket: aws.String("BucketName"), // Required - Id: aws.String("AnalyticsId"), // Required - } - resp, err := svc.PutBucketAnalyticsConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketCors() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketCorsInput{ - Bucket: aws.String("BucketName"), // Required - CORSConfiguration: &s3.CORSConfiguration{ // Required - CORSRules: []*s3.CORSRule{ // Required - { // Required - AllowedMethods: []*string{ // Required - aws.String("AllowedMethod"), // Required - // More values... - }, - AllowedOrigins: []*string{ // Required - aws.String("AllowedOrigin"), // Required - // More values... - }, - AllowedHeaders: []*string{ - aws.String("AllowedHeader"), // Required - // More values... - }, - ExposeHeaders: []*string{ - aws.String("ExposeHeader"), // Required - // More values... - }, - MaxAgeSeconds: aws.Int64(1), - }, - // More values... - }, - }, - } - resp, err := svc.PutBucketCors(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketInventoryConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketInventoryConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("InventoryId"), // Required - InventoryConfiguration: &s3.InventoryConfiguration{ // Required - Destination: &s3.InventoryDestination{ // Required - S3BucketDestination: &s3.InventoryS3BucketDestination{ // Required - Bucket: aws.String("BucketName"), // Required - Format: aws.String("InventoryFormat"), // Required - AccountId: aws.String("AccountId"), - Prefix: aws.String("Prefix"), - }, - }, - Id: aws.String("InventoryId"), // Required - IncludedObjectVersions: aws.String("InventoryIncludedObjectVersions"), // Required - IsEnabled: aws.Bool(true), // Required - Schedule: &s3.InventorySchedule{ // Required - Frequency: aws.String("InventoryFrequency"), // Required - }, - Filter: &s3.InventoryFilter{ - Prefix: aws.String("Prefix"), // Required - }, - OptionalFields: []*string{ - aws.String("InventoryOptionalField"), // Required - // More values... - }, - }, - } - resp, err := svc.PutBucketInventoryConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketLifecycle() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketLifecycleInput{ - Bucket: aws.String("BucketName"), // Required - LifecycleConfiguration: &s3.LifecycleConfiguration{ - Rules: []*s3.Rule{ // Required - { // Required - Prefix: aws.String("Prefix"), // Required - Status: aws.String("ExpirationStatus"), // Required - AbortIncompleteMultipartUpload: &s3.AbortIncompleteMultipartUpload{ - DaysAfterInitiation: aws.Int64(1), - }, - Expiration: &s3.LifecycleExpiration{ - Date: aws.Time(time.Now()), - Days: aws.Int64(1), - ExpiredObjectDeleteMarker: aws.Bool(true), - }, - ID: aws.String("ID"), - NoncurrentVersionExpiration: &s3.NoncurrentVersionExpiration{ - NoncurrentDays: aws.Int64(1), - }, - NoncurrentVersionTransition: &s3.NoncurrentVersionTransition{ - NoncurrentDays: aws.Int64(1), - StorageClass: aws.String("TransitionStorageClass"), - }, - Transition: &s3.Transition{ - Date: aws.Time(time.Now()), - Days: aws.Int64(1), - StorageClass: aws.String("TransitionStorageClass"), - }, - }, - // More values... - }, - }, - } - resp, err := svc.PutBucketLifecycle(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketLifecycleConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketLifecycleConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - LifecycleConfiguration: &s3.BucketLifecycleConfiguration{ - Rules: []*s3.LifecycleRule{ // Required - { // Required - Status: aws.String("ExpirationStatus"), // Required - AbortIncompleteMultipartUpload: &s3.AbortIncompleteMultipartUpload{ - DaysAfterInitiation: aws.Int64(1), - }, - Expiration: &s3.LifecycleExpiration{ - Date: aws.Time(time.Now()), - Days: aws.Int64(1), - ExpiredObjectDeleteMarker: aws.Bool(true), - }, - Filter: &s3.LifecycleRuleFilter{ - And: &s3.LifecycleRuleAndOperator{ - Prefix: aws.String("Prefix"), - Tags: []*s3.Tag{ - { // Required - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - // More values... - }, - }, - Prefix: aws.String("Prefix"), - Tag: &s3.Tag{ - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - }, - ID: aws.String("ID"), - NoncurrentVersionExpiration: &s3.NoncurrentVersionExpiration{ - NoncurrentDays: aws.Int64(1), - }, - NoncurrentVersionTransitions: []*s3.NoncurrentVersionTransition{ - { // Required - NoncurrentDays: aws.Int64(1), - StorageClass: aws.String("TransitionStorageClass"), - }, - // More values... - }, - Prefix: aws.String("Prefix"), - Transitions: []*s3.Transition{ - { // Required - Date: aws.Time(time.Now()), - Days: aws.Int64(1), - StorageClass: aws.String("TransitionStorageClass"), - }, - // More values... - }, - }, - // More values... - }, - }, - } - resp, err := svc.PutBucketLifecycleConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketLogging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketLoggingInput{ - Bucket: aws.String("BucketName"), // Required - BucketLoggingStatus: &s3.BucketLoggingStatus{ // Required - LoggingEnabled: &s3.LoggingEnabled{ - TargetBucket: aws.String("TargetBucket"), - TargetGrants: []*s3.TargetGrant{ - { // Required - Grantee: &s3.Grantee{ - Type: aws.String("Type"), // Required - DisplayName: aws.String("DisplayName"), - EmailAddress: aws.String("EmailAddress"), - ID: aws.String("ID"), - URI: aws.String("URI"), - }, - Permission: aws.String("BucketLogsPermission"), - }, - // More values... - }, - TargetPrefix: aws.String("TargetPrefix"), - }, - }, - } - resp, err := svc.PutBucketLogging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketMetricsConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketMetricsConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - Id: aws.String("MetricsId"), // Required - MetricsConfiguration: &s3.MetricsConfiguration{ // Required - Id: aws.String("MetricsId"), // Required - Filter: &s3.MetricsFilter{ - And: &s3.MetricsAndOperator{ - Prefix: aws.String("Prefix"), - Tags: []*s3.Tag{ - { // Required - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - // More values... - }, - }, - Prefix: aws.String("Prefix"), - Tag: &s3.Tag{ - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - }, - }, - } - resp, err := svc.PutBucketMetricsConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketNotification() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketNotificationInput{ - Bucket: aws.String("BucketName"), // Required - NotificationConfiguration: &s3.NotificationConfigurationDeprecated{ // Required - CloudFunctionConfiguration: &s3.CloudFunctionConfiguration{ - CloudFunction: aws.String("CloudFunction"), - Event: aws.String("Event"), - Events: []*string{ - aws.String("Event"), // Required - // More values... - }, - Id: aws.String("NotificationId"), - InvocationRole: aws.String("CloudFunctionInvocationRole"), - }, - QueueConfiguration: &s3.QueueConfigurationDeprecated{ - Event: aws.String("Event"), - Events: []*string{ - aws.String("Event"), // Required - // More values... - }, - Id: aws.String("NotificationId"), - Queue: aws.String("QueueArn"), - }, - TopicConfiguration: &s3.TopicConfigurationDeprecated{ - Event: aws.String("Event"), - Events: []*string{ - aws.String("Event"), // Required - // More values... - }, - Id: aws.String("NotificationId"), - Topic: aws.String("TopicArn"), - }, - }, - } - resp, err := svc.PutBucketNotification(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketNotificationConfiguration() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketNotificationConfigurationInput{ - Bucket: aws.String("BucketName"), // Required - NotificationConfiguration: &s3.NotificationConfiguration{ // Required - LambdaFunctionConfigurations: []*s3.LambdaFunctionConfiguration{ - { // Required - Events: []*string{ // Required - aws.String("Event"), // Required - // More values... - }, - LambdaFunctionArn: aws.String("LambdaFunctionArn"), // Required - Filter: &s3.NotificationConfigurationFilter{ - Key: &s3.KeyFilter{ - FilterRules: []*s3.FilterRule{ - { // Required - Name: aws.String("FilterRuleName"), - Value: aws.String("FilterRuleValue"), - }, - // More values... - }, - }, - }, - Id: aws.String("NotificationId"), - }, - // More values... - }, - QueueConfigurations: []*s3.QueueConfiguration{ - { // Required - Events: []*string{ // Required - aws.String("Event"), // Required - // More values... - }, - QueueArn: aws.String("QueueArn"), // Required - Filter: &s3.NotificationConfigurationFilter{ - Key: &s3.KeyFilter{ - FilterRules: []*s3.FilterRule{ - { // Required - Name: aws.String("FilterRuleName"), - Value: aws.String("FilterRuleValue"), - }, - // More values... - }, - }, - }, - Id: aws.String("NotificationId"), - }, - // More values... - }, - TopicConfigurations: []*s3.TopicConfiguration{ - { // Required - Events: []*string{ // Required - aws.String("Event"), // Required - // More values... - }, - TopicArn: aws.String("TopicArn"), // Required - Filter: &s3.NotificationConfigurationFilter{ - Key: &s3.KeyFilter{ - FilterRules: []*s3.FilterRule{ - { // Required - Name: aws.String("FilterRuleName"), - Value: aws.String("FilterRuleValue"), - }, - // More values... - }, - }, - }, - Id: aws.String("NotificationId"), - }, - // More values... - }, - }, - } - resp, err := svc.PutBucketNotificationConfiguration(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketPolicy() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketPolicyInput{ - Bucket: aws.String("BucketName"), // Required - Policy: aws.String("Policy"), // Required - } - resp, err := svc.PutBucketPolicy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketReplication() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketReplicationInput{ - Bucket: aws.String("BucketName"), // Required - ReplicationConfiguration: &s3.ReplicationConfiguration{ // Required - Role: aws.String("Role"), // Required - Rules: []*s3.ReplicationRule{ // Required - { // Required - Destination: &s3.Destination{ // Required - Bucket: aws.String("BucketName"), // Required - StorageClass: aws.String("StorageClass"), - }, - Prefix: aws.String("Prefix"), // Required - Status: aws.String("ReplicationRuleStatus"), // Required - ID: aws.String("ID"), - }, - // More values... - }, - }, - } - resp, err := svc.PutBucketReplication(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketRequestPayment() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketRequestPaymentInput{ - Bucket: aws.String("BucketName"), // Required - RequestPaymentConfiguration: &s3.RequestPaymentConfiguration{ // Required - Payer: aws.String("Payer"), // Required - }, - } - resp, err := svc.PutBucketRequestPayment(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketTagging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketTaggingInput{ - Bucket: aws.String("BucketName"), // Required - Tagging: &s3.Tagging{ // Required - TagSet: []*s3.Tag{ // Required - { // Required - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - // More values... - }, - }, - } - resp, err := svc.PutBucketTagging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketVersioning() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketVersioningInput{ - Bucket: aws.String("BucketName"), // Required - VersioningConfiguration: &s3.VersioningConfiguration{ // Required - MFADelete: aws.String("MFADelete"), - Status: aws.String("BucketVersioningStatus"), - }, - MFA: aws.String("MFA"), - } - resp, err := svc.PutBucketVersioning(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutBucketWebsite() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutBucketWebsiteInput{ - Bucket: aws.String("BucketName"), // Required - WebsiteConfiguration: &s3.WebsiteConfiguration{ // Required - ErrorDocument: &s3.ErrorDocument{ - Key: aws.String("ObjectKey"), // Required - }, - IndexDocument: &s3.IndexDocument{ - Suffix: aws.String("Suffix"), // Required - }, - RedirectAllRequestsTo: &s3.RedirectAllRequestsTo{ - HostName: aws.String("HostName"), // Required - Protocol: aws.String("Protocol"), - }, - RoutingRules: []*s3.RoutingRule{ - { // Required - Redirect: &s3.Redirect{ // Required - HostName: aws.String("HostName"), - HttpRedirectCode: aws.String("HttpRedirectCode"), - Protocol: aws.String("Protocol"), - ReplaceKeyPrefixWith: aws.String("ReplaceKeyPrefixWith"), - ReplaceKeyWith: aws.String("ReplaceKeyWith"), - }, - Condition: &s3.Condition{ - HttpErrorCodeReturnedEquals: aws.String("HttpErrorCodeReturnedEquals"), - KeyPrefixEquals: aws.String("KeyPrefixEquals"), - }, - }, - // More values... - }, - }, - } - resp, err := svc.PutBucketWebsite(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutObject() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutObjectInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - ACL: aws.String("ObjectCannedACL"), - Body: bytes.NewReader([]byte("PAYLOAD")), - CacheControl: aws.String("CacheControl"), - ContentDisposition: aws.String("ContentDisposition"), - ContentEncoding: aws.String("ContentEncoding"), - ContentLanguage: aws.String("ContentLanguage"), - ContentLength: aws.Int64(1), - ContentType: aws.String("ContentType"), - Expires: aws.Time(time.Now()), - GrantFullControl: aws.String("GrantFullControl"), - GrantRead: aws.String("GrantRead"), - GrantReadACP: aws.String("GrantReadACP"), - GrantWriteACP: aws.String("GrantWriteACP"), - Metadata: map[string]*string{ - "Key": aws.String("MetadataValue"), // Required - // More values... - }, - RequestPayer: aws.String("RequestPayer"), - SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), - SSECustomerKey: aws.String("SSECustomerKey"), - SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), - SSEKMSKeyId: aws.String("SSEKMSKeyId"), - ServerSideEncryption: aws.String("ServerSideEncryption"), - StorageClass: aws.String("StorageClass"), - Tagging: aws.String("TaggingHeader"), - WebsiteRedirectLocation: aws.String("WebsiteRedirectLocation"), - } - resp, err := svc.PutObject(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutObjectAcl() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutObjectAclInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - ACL: aws.String("ObjectCannedACL"), - AccessControlPolicy: &s3.AccessControlPolicy{ - Grants: []*s3.Grant{ - { // Required - Grantee: &s3.Grantee{ - Type: aws.String("Type"), // Required - DisplayName: aws.String("DisplayName"), - EmailAddress: aws.String("EmailAddress"), - ID: aws.String("ID"), - URI: aws.String("URI"), - }, - Permission: aws.String("Permission"), - }, - // More values... - }, - Owner: &s3.Owner{ - DisplayName: aws.String("DisplayName"), - ID: aws.String("ID"), - }, - }, - GrantFullControl: aws.String("GrantFullControl"), - GrantRead: aws.String("GrantRead"), - GrantReadACP: aws.String("GrantReadACP"), - GrantWrite: aws.String("GrantWrite"), - GrantWriteACP: aws.String("GrantWriteACP"), - RequestPayer: aws.String("RequestPayer"), - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.PutObjectAcl(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_PutObjectTagging() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.PutObjectTaggingInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - Tagging: &s3.Tagging{ // Required - TagSet: []*s3.Tag{ // Required - { // Required - Key: aws.String("ObjectKey"), // Required - Value: aws.String("Value"), // Required - }, - // More values... - }, - }, - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.PutObjectTagging(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_RestoreObject() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.RestoreObjectInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - RequestPayer: aws.String("RequestPayer"), - RestoreRequest: &s3.RestoreRequest{ - Days: aws.Int64(1), // Required - GlacierJobParameters: &s3.GlacierJobParameters{ - Tier: aws.String("Tier"), // Required - }, - }, - VersionId: aws.String("ObjectVersionId"), - } - resp, err := svc.RestoreObject(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_UploadPart() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.UploadPartInput{ - Bucket: aws.String("BucketName"), // Required - Key: aws.String("ObjectKey"), // Required - PartNumber: aws.Int64(1), // Required - UploadId: aws.String("MultipartUploadId"), // Required - Body: bytes.NewReader([]byte("PAYLOAD")), - ContentLength: aws.Int64(1), - RequestPayer: aws.String("RequestPayer"), - SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), - SSECustomerKey: aws.String("SSECustomerKey"), - SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), - } - resp, err := svc.UploadPart(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleS3_UploadPartCopy() { - sess := session.Must(session.NewSession()) - - svc := s3.New(sess) - - params := &s3.UploadPartCopyInput{ - Bucket: aws.String("BucketName"), // Required - CopySource: aws.String("CopySource"), // Required - Key: aws.String("ObjectKey"), // Required - PartNumber: aws.Int64(1), // Required - UploadId: aws.String("MultipartUploadId"), // Required - CopySourceIfMatch: aws.String("CopySourceIfMatch"), - CopySourceIfModifiedSince: aws.Time(time.Now()), - CopySourceIfNoneMatch: aws.String("CopySourceIfNoneMatch"), - CopySourceIfUnmodifiedSince: aws.Time(time.Now()), - CopySourceRange: aws.String("CopySourceRange"), - CopySourceSSECustomerAlgorithm: aws.String("CopySourceSSECustomerAlgorithm"), - CopySourceSSECustomerKey: aws.String("CopySourceSSECustomerKey"), - CopySourceSSECustomerKeyMD5: aws.String("CopySourceSSECustomerKeyMD5"), - RequestPayer: aws.String("RequestPayer"), - SSECustomerAlgorithm: aws.String("SSECustomerAlgorithm"), - SSECustomerKey: aws.String("SSECustomerKey"), - SSECustomerKeyMD5: aws.String("SSECustomerKeyMD5"), - } - resp, err := svc.UploadPartCopy(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go deleted file mode 100644 index ec3ffe4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go +++ /dev/null @@ -1,162 +0,0 @@ -package s3 - -import ( - "fmt" - "net/url" - "regexp" - "strings" - - "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" -) - -// an operationBlacklist is a list of operation names that should a -// request handler should not be executed with. -type operationBlacklist []string - -// Continue will return true of the Request's operation name is not -// in the blacklist. False otherwise. -func (b operationBlacklist) Continue(r *request.Request) bool { - for i := 0; i < len(b); i++ { - if b[i] == r.Operation.Name { - return false - } - } - return true -} - -var accelerateOpBlacklist = operationBlacklist{ - opListBuckets, opCreateBucket, opDeleteBucket, -} - -// Request handler to automatically add the bucket name to the endpoint domain -// if possible. This style of bucket is valid for all bucket names which are -// DNS compatible and do not contain "." -func updateEndpointForS3Config(r *request.Request) { - forceHostStyle := aws.BoolValue(r.Config.S3ForcePathStyle) - accelerate := aws.BoolValue(r.Config.S3UseAccelerate) - - if accelerate && accelerateOpBlacklist.Continue(r) { - if forceHostStyle { - if r.Config.Logger != nil { - r.Config.Logger.Log("ERROR: aws.Config.S3UseAccelerate is not compatible with aws.Config.S3ForcePathStyle, ignoring S3ForcePathStyle.") - } - } - updateEndpointForAccelerate(r) - } else if !forceHostStyle && r.Operation.Name != opGetBucketLocation { - updateEndpointForHostStyle(r) - } -} - -func updateEndpointForHostStyle(r *request.Request) { - bucket, ok := bucketNameFromReqParams(r.Params) - if !ok { - // Ignore operation requests if the bucketname was not provided - // if this is an input validation error the validation handler - // will report it. - return - } - - if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { - // bucket name must be valid to put into the host - return - } - - moveBucketToHost(r.HTTPRequest.URL, bucket) -} - -var ( - accelElem = []byte("s3-accelerate.dualstack.") -) - -func updateEndpointForAccelerate(r *request.Request) { - bucket, ok := bucketNameFromReqParams(r.Params) - if !ok { - // Ignore operation requests if the bucketname was not provided - // if this is an input validation error the validation handler - // will report it. - return - } - - if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { - r.Error = awserr.New("InvalidParameterException", - fmt.Sprintf("bucket name %s is not compatible with S3 Accelerate", bucket), - nil) - return - } - - parts := strings.Split(r.HTTPRequest.URL.Host, ".") - if len(parts) < 3 { - r.Error = awserr.New("InvalidParameterExecption", - fmt.Sprintf("unable to update endpoint host for S3 accelerate, hostname invalid, %s", - r.HTTPRequest.URL.Host), nil) - return - } - - if parts[0] == "s3" || strings.HasPrefix(parts[0], "s3-") { - parts[0] = "s3-accelerate" - } - for i := 1; i+1 < len(parts); i++ { - if parts[i] == aws.StringValue(r.Config.Region) { - parts = append(parts[:i], parts[i+1:]...) - break - } - } - - r.HTTPRequest.URL.Host = strings.Join(parts, ".") - - moveBucketToHost(r.HTTPRequest.URL, bucket) -} - -// Attempts to retrieve the bucket name from the request input parameters. -// If no bucket is found, or the field is empty "", false will be returned. -func bucketNameFromReqParams(params interface{}) (string, bool) { - b, _ := awsutil.ValuesAtPath(params, "Bucket") - if len(b) == 0 { - return "", false - } - - if bucket, ok := b[0].(*string); ok { - if bucketStr := aws.StringValue(bucket); bucketStr != "" { - return bucketStr, true - } - } - - return "", false -} - -// hostCompatibleBucketName returns true if the request should -// put the bucket in the host. This is false if S3ForcePathStyle is -// explicitly set or if the bucket is not DNS compatible. -func hostCompatibleBucketName(u *url.URL, bucket string) bool { - // Bucket might be DNS compatible but dots in the hostname will fail - // certificate validation, so do not use host-style. - if u.Scheme == "https" && strings.Contains(bucket, ".") { - return false - } - - // if the bucket is DNS compatible - return dnsCompatibleBucketName(bucket) -} - -var reDomain = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`) -var reIPAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`) - -// dnsCompatibleBucketName returns true if the bucket name is DNS compatible. -// Buckets created outside of the classic region MUST be DNS compatible. -func dnsCompatibleBucketName(bucket string) bool { - return reDomain.MatchString(bucket) && - !reIPAddress.MatchString(bucket) && - !strings.Contains(bucket, "..") -} - -// moveBucketToHost moves the bucket name from the URI path to URL host. -func moveBucketToHost(u *url.URL, bucket string) { - u.Host = bucket + "." + u.Host - u.Path = strings.Replace(u.Path, "/{Bucket}", "", -1) - if u.Path == "" { - u.Path = "/" - } -} 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 094fa65..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket_test.go +++ /dev/null @@ -1,127 +0,0 @@ -package s3_test - -import ( - "net/url" - "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" -) - -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) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go deleted file mode 100644 index 8e6f330..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go +++ /dev/null @@ -1,8 +0,0 @@ -// +build !go1.6 - -package s3 - -import "github.com/aws/aws-sdk-go/aws/request" - -func platformRequestHandlers(r *request.Request) { -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go deleted file mode 100644 index 14d05f7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go +++ /dev/null @@ -1,28 +0,0 @@ -// +build go1.6 - -package s3 - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -func platformRequestHandlers(r *request.Request) { - if r.Operation.HTTPMethod == "PUT" { - // 100-Continue should only be used on put requests. - r.Handlers.Sign.PushBack(add100Continue) - } -} - -func add100Continue(r *request.Request) { - if aws.BoolValue(r.Config.S3Disable100Continue) { - return - } - if r.HTTPRequest.ContentLength < 1024*1024*2 { - // Ignore requests smaller than 2MB. This helps prevent delaying - // requests unnecessarily. - return - } - - r.HTTPRequest.Header.Set("Expect", "100-Continue") -} 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 b119ce8..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6_test.go +++ /dev/null @@ -1,68 +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" - "github.com/stretchr/testify/assert" -) - -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() - - assert.NoError(t, err) - assert.Equal(t, "100-Continue", r.HTTPRequest.Header.Get("Expect")) -} - -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() - - assert.NoError(t, err) - assert.Empty(t, 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() - - assert.NoError(t, err) - assert.Empty(t, 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() - - assert.NoError(t, err) - assert.Empty(t, r.HTTPRequest.Header.Get("Expect")) -} 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 deleted file mode 100644 index 3fb5b3b..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3 - -import ( - "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/private/protocol/restxml" -) - -// S3 is a client for Amazon S3. -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01 -type S3 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "s3" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the S3 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: -// // Create a S3 client from just a session. -// svc := s3.New(mySession) -// -// // Create a S3 client with additional configuration -// svc := s3.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3 { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *S3 { - svc := &S3{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2006-03-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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a S3 operation and runs any -// custom request initialization. -func (c *S3) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go deleted file mode 100644 index 268ea2f..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go +++ /dev/null @@ -1,44 +0,0 @@ -package s3 - -import ( - "crypto/md5" - "encoding/base64" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil) - -func validateSSERequiresSSL(r *request.Request) { - if r.HTTPRequest.URL.Scheme != "https" { - p, _ := awsutil.ValuesAtPath(r.Params, "SSECustomerKey||CopySourceSSECustomerKey") - if len(p) > 0 { - r.Error = errSSERequiresSSL - } - } -} - -func computeSSEKeys(r *request.Request) { - headers := []string{ - "x-amz-server-side-encryption-customer-key", - "x-amz-copy-source-server-side-encryption-customer-key", - } - - for _, h := range headers { - md5h := h + "-md5" - if key := r.HTTPRequest.Header.Get(h); key != "" { - // Base64-encode the value - b64v := base64.StdEncoding.EncodeToString([]byte(key)) - r.HTTPRequest.Header.Set(h, b64v) - - // Add MD5 if it wasn't computed - if r.HTTPRequest.Header.Get(md5h) == "" { - sum := md5.Sum([]byte(key)) - b64sum := base64.StdEncoding.EncodeToString(sum[:]) - r.HTTPRequest.Header.Set(md5h, b64sum) - } - } - } -} 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 5f1ca64..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/sse_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package s3_test - -import ( - "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" - "github.com/stretchr/testify/assert" -) - -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() - - assert.Error(t, err) - assert.Equal(t, "ConfigError", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "cannot send SSE keys over HTTP") -} - -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() - - assert.Error(t, err) - assert.Equal(t, "ConfigError", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "cannot send SSE keys over HTTP") -} - -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() - - assert.NoError(t, err) - assert.Equal(t, "a2V5", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key")) - assert.Equal(t, "a2V5", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key")) - assert.Equal(t, "PG4LipwVIkqCKLmpjKFTHQ==", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key-md5")) - assert.Equal(t, "PG4LipwVIkqCKLmpjKFTHQ==", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key-md5")) -} - -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() - - assert.NoError(t, err) - assert.Equal(t, "a2V5", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key")) - assert.Equal(t, "a2V5", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key")) - assert.Equal(t, "MD5", req.HTTPRequest.Header.Get("x-amz-server-side-encryption-customer-key-md5")) - assert.Equal(t, "MD5", req.HTTPRequest.Header.Get("x-amz-copy-source-server-side-encryption-customer-key-md5")) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go deleted file mode 100644 index 5a78fd3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go +++ /dev/null @@ -1,35 +0,0 @@ -package s3 - -import ( - "bytes" - "io/ioutil" - "net/http" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -func copyMultipartStatusOKUnmarhsalError(r *request.Request) { - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.New("SerializationError", "unable to read response body", err) - return - } - body := bytes.NewReader(b) - r.HTTPResponse.Body = ioutil.NopCloser(body) - defer body.Seek(0, 0) - - if body.Len() == 0 { - // If there is no body don't attempt to parse the body. - return - } - - unmarshalError(r) - if err, ok := r.Error.(awserr.Error); ok && err != nil { - if err.Code() == "SerializationError" { - r.Error = nil - return - } - r.HTTPResponse.StatusCode = http.StatusServiceUnavailable - } -} 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 f508cd1..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error_test.go +++ /dev/null @@ -1,130 +0,0 @@ -package s3_test - -import ( - "fmt" - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "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" -) - -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"), - }) - - require.NoError(t, err) - - assert.Equal(t, fmt.Sprintf(`%q`, "1da64c7f13d1e8dbeaea40b905fd586c"), *res.CopyObjectResult.ETag) - assert.Equal(t, lastModifiedTime, *res.CopyObjectResult.LastModified) -} - -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"), - }) - - require.Error(t, err) - e := err.(awserr.Error) - - assert.Equal(t, "ErrorCode", e.Code()) - assert.Equal(t, "message body", e.Message()) -} - -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"), - }) - - require.NoError(t, err) - - assert.Equal(t, fmt.Sprintf(`%q`, "1da64c7f13d1e8dbeaea40b905fd586c"), *res.CopyPartResult.ETag) - assert.Equal(t, lastModifiedTime, *res.CopyPartResult.LastModified) -} - -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"), - }) - - require.Error(t, err) - e := err.(awserr.Error) - - assert.Equal(t, "ErrorCode", e.Code()) - assert.Equal(t, "message body", e.Message()) -} - -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"), - }) - - require.NoError(t, err) - - assert.Equal(t, `"etagVal"`, *res.ETag) - assert.Equal(t, "bucketName", *res.Bucket) - assert.Equal(t, "keyName", *res.Key) - assert.Equal(t, "locationName", *res.Location) -} - -func TestCompleteMultipartUploadError(t *testing.T) { - _, err := newCopyTestSvc(errMsg).CompleteMultipartUpload(&s3.CompleteMultipartUploadInput{ - Bucket: aws.String("bucketname"), - Key: aws.String("key"), - UploadId: aws.String("uploadID"), - }) - - require.Error(t, err) - e := err.(awserr.Error) - - assert.Equal(t, "ErrorCode", e.Code()) - assert.Equal(t, "message body", e.Message()) -} - -func newCopyTestSvc(errMsg string) *s3.S3 { - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - http.Error(w, errMsg, http.StatusOK) - })) - return s3.New(unit.Session, aws.NewConfig(). - WithEndpoint(server.URL). - WithDisableSSL(true). - WithMaxRetries(0). - WithS3ForcePathStyle(true)) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go deleted file mode 100644 index bcca862..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go +++ /dev/null @@ -1,103 +0,0 @@ -package s3 - -import ( - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -type xmlErrorResponse struct { - XMLName xml.Name `xml:"Error"` - Code string `xml:"Code"` - Message string `xml:"Message"` -} - -func unmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - defer io.Copy(ioutil.Discard, r.HTTPResponse.Body) - - hostID := r.HTTPResponse.Header.Get("X-Amz-Id-2") - - // Bucket exists in a different region, and request needs - // to be made to the correct region. - if r.HTTPResponse.StatusCode == http.StatusMovedPermanently { - r.Error = requestFailure{ - RequestFailure: awserr.NewRequestFailure( - awserr.New("BucketRegionError", - fmt.Sprintf("incorrect region, the bucket is not in '%s' region", - aws.StringValue(r.Config.Region)), - nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ), - hostID: hostID, - } - return - } - - var errCode, errMsg string - - // Attempt to parse error from body if it is known - resp := &xmlErrorResponse{} - err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp) - if err != nil && err != io.EOF { - errCode = "SerializationError" - errMsg = "failed to decode S3 XML error response" - } else { - errCode = resp.Code - errMsg = resp.Message - err = nil - } - - // Fallback to status code converted to message if still no error code - if len(errCode) == 0 { - statusText := http.StatusText(r.HTTPResponse.StatusCode) - errCode = strings.Replace(statusText, " ", "", -1) - errMsg = statusText - } - - r.Error = requestFailure{ - RequestFailure: awserr.NewRequestFailure( - awserr.New(errCode, errMsg, err), - r.HTTPResponse.StatusCode, - r.RequestID, - ), - hostID: hostID, - } -} - -// A RequestFailure provides access to the S3 Request ID and Host ID values -// returned from API operation errors. Getting the error as a string will -// return the formated error with the same information as awserr.RequestFailure, -// while also adding the HostID value from the response. -type RequestFailure interface { - awserr.RequestFailure - - // Host ID is the S3 Host ID needed for debug, and contacting support - HostID() string -} - -type requestFailure struct { - awserr.RequestFailure - - hostID string -} - -func (r requestFailure) Error() string { - extra := fmt.Sprintf("status code: %d, request id: %s, host id: %s", - r.StatusCode(), r.RequestID(), r.hostID) - return awserr.SprintError(r.Code(), r.Message(), extra, r.OrigErr()) -} -func (r requestFailure) String() string { - return r.Error() -} -func (r requestFailure) HostID() string { - return r.hostID -} 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 4496371..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_leak_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package s3 - -import ( - "github.com/stretchr/testify/assert" - "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) - - assert.NotNil(t, req.Error) - assert.Equal(t, reader.Closed, true) - assert.Equal(t, reader.Size, 0) -} 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 fc6a14d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error_test.go +++ /dev/null @@ -1,253 +0,0 @@ -package s3_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "strings" - "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/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(); e != a { - 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) { - 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(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 := "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/s3/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go deleted file mode 100644 index cccfa8c..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3 - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilBucketExists uses the Amazon S3 API operation -// HeadBucket to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error { - return c.WaitUntilBucketExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilBucketExistsWithContext is an extended version of WaitUntilBucketExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *S3) WaitUntilBucketExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilBucketExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 301, - }, - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 403, - }, - { - State: request.RetryWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadBucketInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadBucketRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilBucketNotExists uses the Amazon S3 API operation -// HeadBucket to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error { - return c.WaitUntilBucketNotExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilBucketNotExistsWithContext is an extended version of WaitUntilBucketNotExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *S3) WaitUntilBucketNotExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilBucketNotExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadBucketInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadBucketRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilObjectExists uses the Amazon S3 API operation -// HeadObject to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error { - return c.WaitUntilObjectExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilObjectExistsWithContext is an extended version of WaitUntilObjectExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *S3) WaitUntilObjectExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilObjectExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.RetryWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadObjectInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadObjectRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilObjectNotExists uses the Amazon S3 API operation -// HeadObject to wait for a condition to be met before returning. -// If the condition is not meet within the max attempt window an error will -// be returned. -func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error { - return c.WaitUntilObjectNotExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilObjectNotExistsWithContext is an extended version of WaitUntilObjectNotExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *S3) WaitUntilObjectNotExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilObjectNotExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadObjectInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadObjectRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go deleted file mode 100644 index 3fea468..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/api.go +++ /dev/null @@ -1,4456 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package sqs provides a client for Amazon Simple Queue Service. -package sqs - -import ( - "fmt" - - "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/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/query" -) - -const opAddPermission = "AddPermission" - -// AddPermissionRequest generates a "aws/request.Request" representing the -// client's request for the AddPermission operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See AddPermission for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AddPermission method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the AddPermissionRequest method. -// req, resp := client.AddPermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermission -func (c *SQS) AddPermissionRequest(input *AddPermissionInput) (req *request.Request, output *AddPermissionOutput) { - op := &request.Operation{ - Name: opAddPermission, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddPermissionInput{} - } - - output = &AddPermissionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddPermission API operation for Amazon Simple Queue Service. -// -// Adds a permission to a queue for a specific principal (http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P). -// This allows sharing access to the queue. -// -// When you create a queue, you have full control access rights for the queue. -// Only you, the owner of the queue, can grant or deny permissions to the queue. -// For more information about these permissions, see Shared Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html) -// in the Amazon SQS Developer Guide. -// -// AddPermission writes an Amazon-SQS-generated policy. If you want to write -// your own policy, use SetQueueAttributes to upload your policy. For more information -// about writing your own policy, see Using The Access Policy Language (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AccessPolicyLanguage.html) -// in the Amazon SQS Developer Guide. -// -// Some actions take lists of parameters. These lists are specified using the -// param.n notation. Values of n are integers starting from 1. For example, -// a parameter list with two elements looks like this: -// -// &Attribute.1=this -// -// &Attribute.2=that -// -// 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 Amazon Simple Queue Service's -// API operation AddPermission for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOverLimit "OverLimit" -// The action that you requested would violate a limit. For example, ReceiveMessage -// returns this error if the maximum number of inflight messages is reached. -// AddPermission returns this error if the maximum number of permissions for -// the queue is reached. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermission -func (c *SQS) AddPermission(input *AddPermissionInput) (*AddPermissionOutput, error) { - req, out := c.AddPermissionRequest(input) - return out, req.Send() -} - -// AddPermissionWithContext is the same as AddPermission with the addition of -// the ability to pass a context and additional request options. -// -// See AddPermission 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 *SQS) AddPermissionWithContext(ctx aws.Context, input *AddPermissionInput, opts ...request.Option) (*AddPermissionOutput, error) { - req, out := c.AddPermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opChangeMessageVisibility = "ChangeMessageVisibility" - -// ChangeMessageVisibilityRequest generates a "aws/request.Request" representing the -// client's request for the ChangeMessageVisibility operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ChangeMessageVisibility for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ChangeMessageVisibility method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ChangeMessageVisibilityRequest method. -// req, resp := client.ChangeMessageVisibilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibility -func (c *SQS) ChangeMessageVisibilityRequest(input *ChangeMessageVisibilityInput) (req *request.Request, output *ChangeMessageVisibilityOutput) { - op := &request.Operation{ - Name: opChangeMessageVisibility, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ChangeMessageVisibilityInput{} - } - - output = &ChangeMessageVisibilityOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// ChangeMessageVisibility API operation for Amazon Simple Queue Service. -// -// Changes the visibility timeout of a specified message in a queue to a new -// value. The maximum allowed timeout value is 12 hours. Thus, you can't extend -// the timeout of a message in an existing queue to more than a total visibility -// timeout of 12 hours. For more information, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) -// in the Amazon SQS Developer Guide. -// -// For example, you have a message and with the default visibility timeout of -// 5 minutes. After 3 minutes, you call ChangeMessageVisiblity with a timeout -// of 10 minutes. At that time, the timeout for the message is extended by 10 -// minutes beyond the time of the ChangeMessageVisibility action. This results -// in a total visibility timeout of 13 minutes. You can continue to call the -// ChangeMessageVisibility to extend the visibility timeout to a maximum of -// 12 hours. If you try to extend the visibility timeout beyond 12 hours, your -// request is rejected. -// -// A message is considered to be in flight after it's received from a queue -// by a consumer, but not yet deleted from the queue. -// -// For standard queues, there can be a maximum of 120,000 inflight messages -// per queue. If you reach this limit, Amazon SQS returns the OverLimit error -// message. To avoid reaching the limit, you should delete messages from the -// queue after they're processed. You can also increase the number of queues -// you use to process your messages. -// -// For FIFO queues, there can be a maximum of 20,000 inflight messages per queue. -// If you reach this limit, Amazon SQS returns no error messages. -// -// If you attempt to set the VisibilityTimeout to a value greater than the maximum -// time left, Amazon SQS returns an error. Amazon SQS doesn't automatically -// recalculate and increase the timeout to the maximum remaining time. -// -// Unlike with a queue, when you change the visibility timeout for a specific -// message the timeout value is applied immediately but isn't saved in memory -// for that message. If you don't delete a message after it is received, the -// visibility timeout for the message reverts to the original timeout value -// (not to the value you set using the ChangeMessageVisibility action) the next -// time the message is received. -// -// 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 Amazon Simple Queue Service's -// API operation ChangeMessageVisibility for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMessageNotInflight "AWS.SimpleQueueService.MessageNotInflight" -// The message referred to isn't in flight. -// -// * ErrCodeReceiptHandleIsInvalid "ReceiptHandleIsInvalid" -// The receipt handle provided isn't valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibility -func (c *SQS) ChangeMessageVisibility(input *ChangeMessageVisibilityInput) (*ChangeMessageVisibilityOutput, error) { - req, out := c.ChangeMessageVisibilityRequest(input) - return out, req.Send() -} - -// ChangeMessageVisibilityWithContext is the same as ChangeMessageVisibility with the addition of -// the ability to pass a context and additional request options. -// -// See ChangeMessageVisibility 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 *SQS) ChangeMessageVisibilityWithContext(ctx aws.Context, input *ChangeMessageVisibilityInput, opts ...request.Option) (*ChangeMessageVisibilityOutput, error) { - req, out := c.ChangeMessageVisibilityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opChangeMessageVisibilityBatch = "ChangeMessageVisibilityBatch" - -// ChangeMessageVisibilityBatchRequest generates a "aws/request.Request" representing the -// client's request for the ChangeMessageVisibilityBatch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ChangeMessageVisibilityBatch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ChangeMessageVisibilityBatch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ChangeMessageVisibilityBatchRequest method. -// req, resp := client.ChangeMessageVisibilityBatchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatch -func (c *SQS) ChangeMessageVisibilityBatchRequest(input *ChangeMessageVisibilityBatchInput) (req *request.Request, output *ChangeMessageVisibilityBatchOutput) { - op := &request.Operation{ - Name: opChangeMessageVisibilityBatch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ChangeMessageVisibilityBatchInput{} - } - - output = &ChangeMessageVisibilityBatchOutput{} - req = c.newRequest(op, input, output) - return -} - -// ChangeMessageVisibilityBatch API operation for Amazon Simple Queue Service. -// -// Changes the visibility timeout of multiple messages. This is a batch version -// of ChangeMessageVisibility. The result of the action on each message is reported -// individually in the response. You can send up to 10 ChangeMessageVisibility -// requests with each ChangeMessageVisibilityBatch action. -// -// Because the batch request can result in a combination of successful and unsuccessful -// actions, you should check for batch errors even when the call returns an -// HTTP status code of 200. -// -// Some actions take lists of parameters. These lists are specified using the -// param.n notation. Values of n are integers starting from 1. For example, -// a parameter list with two elements looks like this: -// -// &Attribute.1=this -// -// &Attribute.2=that -// -// 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 Amazon Simple Queue Service's -// API operation ChangeMessageVisibilityBatch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyEntriesInBatchRequest "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" -// The batch request contains more entries than permissible. -// -// * ErrCodeEmptyBatchRequest "AWS.SimpleQueueService.EmptyBatchRequest" -// The batch request doesn't contain any entries. -// -// * ErrCodeBatchEntryIdsNotDistinct "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" -// Two or more batch entries in the request have the same Id. -// -// * ErrCodeInvalidBatchEntryId "AWS.SimpleQueueService.InvalidBatchEntryId" -// The Id of a batch entry in a batch request doesn't abide by the specification. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatch -func (c *SQS) ChangeMessageVisibilityBatch(input *ChangeMessageVisibilityBatchInput) (*ChangeMessageVisibilityBatchOutput, error) { - req, out := c.ChangeMessageVisibilityBatchRequest(input) - return out, req.Send() -} - -// ChangeMessageVisibilityBatchWithContext is the same as ChangeMessageVisibilityBatch with the addition of -// the ability to pass a context and additional request options. -// -// See ChangeMessageVisibilityBatch 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 *SQS) ChangeMessageVisibilityBatchWithContext(ctx aws.Context, input *ChangeMessageVisibilityBatchInput, opts ...request.Option) (*ChangeMessageVisibilityBatchOutput, error) { - req, out := c.ChangeMessageVisibilityBatchRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateQueue = "CreateQueue" - -// CreateQueueRequest generates a "aws/request.Request" representing the -// client's request for the CreateQueue operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See CreateQueue for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the CreateQueue method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the CreateQueueRequest method. -// req, resp := client.CreateQueueRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueue -func (c *SQS) CreateQueueRequest(input *CreateQueueInput) (req *request.Request, output *CreateQueueOutput) { - op := &request.Operation{ - Name: opCreateQueue, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateQueueInput{} - } - - output = &CreateQueueOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateQueue API operation for Amazon Simple Queue Service. -// -// Creates a new standard or FIFO queue or returns the URL of an existing queue. -// You can pass one or more attributes in the request. Keep the following caveats -// in mind: -// -// * If you don't specify the FifoQueue attribute, Amazon SQS creates a standard -// queue. -// -// You can't change the queue type after you create it and you can't convert -// an existing standard queue into a FIFO queue. You must either create a -// new FIFO queue for your application or delete your existing standard queue -// and recreate it as a FIFO queue. For more information, see Moving From -// a Standard Queue to a FIFO Queue (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving) -// in the Amazon SQS Developer Guide. -// -// * If you don't provide a value for an attribute, the queue is created -// with the default value for the attribute. -// -// * If you delete a queue, you must wait at least 60 seconds before creating -// a queue with the same name. -// -// To successfully create a new queue, you must provide a queue name that adheres -// to the limits related to queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html) -// and is unique within the scope of your queues. -// -// To get the queue URL, use the GetQueueUrl action. GetQueueUrl requires only -// the QueueName parameter. be aware of existing queue names: -// -// * If you provide the name of an existing queue along with the exact names -// and values of all the queue's attributes, CreateQueue returns the queue -// URL for the existing queue. -// -// * If the queue name, attribute names, or attribute values don't match -// an existing queue, CreateQueue returns an error. -// -// Some actions take lists of parameters. These lists are specified using the -// param.n notation. Values of n are integers starting from 1. For example, -// a parameter list with two elements looks like this: -// -// &Attribute.1=this -// -// &Attribute.2=that -// -// 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 Amazon Simple Queue Service's -// API operation CreateQueue for usage and error information. -// -// Returned Error Codes: -// * ErrCodeQueueDeletedRecently "AWS.SimpleQueueService.QueueDeletedRecently" -// You must wait 60 seconds after deleting a queue before you can create another -// one with the same name. -// -// * ErrCodeQueueNameExists "QueueAlreadyExists" -// A queue already exists with this name. Amazon SQS returns this error only -// if the request includes attributes whose values differ from those of the -// existing queue. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueue -func (c *SQS) CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error) { - req, out := c.CreateQueueRequest(input) - return out, req.Send() -} - -// CreateQueueWithContext is the same as CreateQueue with the addition of -// the ability to pass a context and additional request options. -// -// See CreateQueue 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 *SQS) CreateQueueWithContext(ctx aws.Context, input *CreateQueueInput, opts ...request.Option) (*CreateQueueOutput, error) { - req, out := c.CreateQueueRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteMessage = "DeleteMessage" - -// DeleteMessageRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMessage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteMessage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteMessage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteMessageRequest method. -// req, resp := client.DeleteMessageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessage -func (c *SQS) DeleteMessageRequest(input *DeleteMessageInput) (req *request.Request, output *DeleteMessageOutput) { - op := &request.Operation{ - Name: opDeleteMessage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteMessageInput{} - } - - output = &DeleteMessageOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMessage API operation for Amazon Simple Queue Service. -// -// Deletes the specified message from the specified queue. You specify the message -// by using the message's receipt handle and not the MessageId you receive when -// you send the message. Even if the message is locked by another reader due -// to the visibility timeout setting, it is still deleted from the queue. If -// you leave a message in the queue for longer than the queue's configured retention -// period, Amazon SQS automatically deletes the message. -// -// The receipt handle is associated with a specific instance of receiving the -// message. If you receive a message more than once, the receipt handle you -// get each time you receive the message is different. If you don't provide -// the most recently received receipt handle for the message when you use the -// DeleteMessage action, the request succeeds, but the message might not be -// deleted. -// -// For standard queues, it is possible to receive a message even after you deleting -// it. This might happen on rare occasions if one of the servers storing a copy -// of the message is unavailable when you send the request to delete the message. -// The copy remains on the server and might be returned to you on a subsequent -// receive request. You should ensure that your application is idempotent, so -// that receiving a message more than once does not cause issues. -// -// 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 Amazon Simple Queue Service's -// API operation DeleteMessage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidIdFormat "InvalidIdFormat" -// The receipt handle isn't valid for the current version. -// -// * ErrCodeReceiptHandleIsInvalid "ReceiptHandleIsInvalid" -// The receipt handle provided isn't valid. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessage -func (c *SQS) DeleteMessage(input *DeleteMessageInput) (*DeleteMessageOutput, error) { - req, out := c.DeleteMessageRequest(input) - return out, req.Send() -} - -// DeleteMessageWithContext is the same as DeleteMessage with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteMessage 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 *SQS) DeleteMessageWithContext(ctx aws.Context, input *DeleteMessageInput, opts ...request.Option) (*DeleteMessageOutput, error) { - req, out := c.DeleteMessageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteMessageBatch = "DeleteMessageBatch" - -// DeleteMessageBatchRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMessageBatch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteMessageBatch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteMessageBatch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteMessageBatchRequest method. -// req, resp := client.DeleteMessageBatchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatch -func (c *SQS) DeleteMessageBatchRequest(input *DeleteMessageBatchInput) (req *request.Request, output *DeleteMessageBatchOutput) { - op := &request.Operation{ - Name: opDeleteMessageBatch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteMessageBatchInput{} - } - - output = &DeleteMessageBatchOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteMessageBatch API operation for Amazon Simple Queue Service. -// -// Deletes up to ten messages from the specified queue. This is a batch version -// of DeleteMessage. The result of the action on each message is reported individually -// in the response. -// -// Because the batch request can result in a combination of successful and unsuccessful -// actions, you should check for batch errors even when the call returns an -// HTTP status code of 200. -// -// Some actions take lists of parameters. These lists are specified using the -// param.n notation. Values of n are integers starting from 1. For example, -// a parameter list with two elements looks like this: -// -// &Attribute.1=this -// -// &Attribute.2=that -// -// 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 Amazon Simple Queue Service's -// API operation DeleteMessageBatch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyEntriesInBatchRequest "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" -// The batch request contains more entries than permissible. -// -// * ErrCodeEmptyBatchRequest "AWS.SimpleQueueService.EmptyBatchRequest" -// The batch request doesn't contain any entries. -// -// * ErrCodeBatchEntryIdsNotDistinct "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" -// Two or more batch entries in the request have the same Id. -// -// * ErrCodeInvalidBatchEntryId "AWS.SimpleQueueService.InvalidBatchEntryId" -// The Id of a batch entry in a batch request doesn't abide by the specification. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatch -func (c *SQS) DeleteMessageBatch(input *DeleteMessageBatchInput) (*DeleteMessageBatchOutput, error) { - req, out := c.DeleteMessageBatchRequest(input) - return out, req.Send() -} - -// DeleteMessageBatchWithContext is the same as DeleteMessageBatch with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteMessageBatch 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 *SQS) DeleteMessageBatchWithContext(ctx aws.Context, input *DeleteMessageBatchInput, opts ...request.Option) (*DeleteMessageBatchOutput, error) { - req, out := c.DeleteMessageBatchRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteQueue = "DeleteQueue" - -// DeleteQueueRequest generates a "aws/request.Request" representing the -// client's request for the DeleteQueue operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See DeleteQueue for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DeleteQueue method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the DeleteQueueRequest method. -// req, resp := client.DeleteQueueRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueue -func (c *SQS) DeleteQueueRequest(input *DeleteQueueInput) (req *request.Request, output *DeleteQueueOutput) { - op := &request.Operation{ - Name: opDeleteQueue, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteQueueInput{} - } - - output = &DeleteQueueOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteQueue API operation for Amazon Simple Queue Service. -// -// Deletes the queue specified by the QueueUrl, even if the queue is empty. -// If the specified queue doesn't exist, Amazon SQS returns a successful response. -// -// Be careful with the DeleteQueue action: When you delete a queue, any messages -// in the queue are no longer available. -// -// When you delete a queue, the deletion process takes up to 60 seconds. Requests -// you send involving that queue during the 60 seconds might succeed. For example, -// a SendMessage request might succeed, but after 60 seconds the queue and the -// message you sent no longer exist. -// -// When you delete a queue, you must wait at least 60 seconds before creating -// a queue with the same name. -// -// 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 Amazon Simple Queue Service's -// API operation DeleteQueue for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueue -func (c *SQS) DeleteQueue(input *DeleteQueueInput) (*DeleteQueueOutput, error) { - req, out := c.DeleteQueueRequest(input) - return out, req.Send() -} - -// DeleteQueueWithContext is the same as DeleteQueue with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteQueue 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 *SQS) DeleteQueueWithContext(ctx aws.Context, input *DeleteQueueInput, opts ...request.Option) (*DeleteQueueOutput, error) { - req, out := c.DeleteQueueRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetQueueAttributes = "GetQueueAttributes" - -// GetQueueAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetQueueAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetQueueAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetQueueAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetQueueAttributesRequest method. -// req, resp := client.GetQueueAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributes -func (c *SQS) GetQueueAttributesRequest(input *GetQueueAttributesInput) (req *request.Request, output *GetQueueAttributesOutput) { - op := &request.Operation{ - Name: opGetQueueAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetQueueAttributesInput{} - } - - output = &GetQueueAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetQueueAttributes API operation for Amazon Simple Queue Service. -// -// Gets attributes for the specified queue. -// -// Some actions take lists of parameters. These lists are specified using the -// param.n notation. Values of n are integers starting from 1. For example, -// a parameter list with two elements looks like this: -// -// &Attribute.1=this -// -// &Attribute.2=that -// -// 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 Amazon Simple Queue Service's -// API operation GetQueueAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidAttributeName "InvalidAttributeName" -// The attribute referred to doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributes -func (c *SQS) GetQueueAttributes(input *GetQueueAttributesInput) (*GetQueueAttributesOutput, error) { - req, out := c.GetQueueAttributesRequest(input) - return out, req.Send() -} - -// GetQueueAttributesWithContext is the same as GetQueueAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See GetQueueAttributes 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 *SQS) GetQueueAttributesWithContext(ctx aws.Context, input *GetQueueAttributesInput, opts ...request.Option) (*GetQueueAttributesOutput, error) { - req, out := c.GetQueueAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetQueueUrl = "GetQueueUrl" - -// GetQueueUrlRequest generates a "aws/request.Request" representing the -// client's request for the GetQueueUrl operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See GetQueueUrl for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetQueueUrl method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the GetQueueUrlRequest method. -// req, resp := client.GetQueueUrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrl -func (c *SQS) GetQueueUrlRequest(input *GetQueueUrlInput) (req *request.Request, output *GetQueueUrlOutput) { - op := &request.Operation{ - Name: opGetQueueUrl, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetQueueUrlInput{} - } - - output = &GetQueueUrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetQueueUrl API operation for Amazon Simple Queue Service. -// -// Returns the URL of an existing queue. This action provides a simple way to -// retrieve the URL of an Amazon SQS queue. -// -// To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId -// parameter to specify the account ID of the queue's owner. The queue's owner -// must grant you permission to access the queue. For more information about -// shared queue access, see AddPermission or see Shared Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html) -// in the Amazon SQS Developer Guide. -// -// 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 Amazon Simple Queue Service's -// API operation GetQueueUrl for usage and error information. -// -// Returned Error Codes: -// * ErrCodeQueueDoesNotExist "AWS.SimpleQueueService.NonExistentQueue" -// The queue referred to doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrl -func (c *SQS) GetQueueUrl(input *GetQueueUrlInput) (*GetQueueUrlOutput, error) { - req, out := c.GetQueueUrlRequest(input) - return out, req.Send() -} - -// GetQueueUrlWithContext is the same as GetQueueUrl with the addition of -// the ability to pass a context and additional request options. -// -// See GetQueueUrl 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 *SQS) GetQueueUrlWithContext(ctx aws.Context, input *GetQueueUrlInput, opts ...request.Option) (*GetQueueUrlOutput, error) { - req, out := c.GetQueueUrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListDeadLetterSourceQueues = "ListDeadLetterSourceQueues" - -// ListDeadLetterSourceQueuesRequest generates a "aws/request.Request" representing the -// client's request for the ListDeadLetterSourceQueues operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListDeadLetterSourceQueues for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListDeadLetterSourceQueues method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListDeadLetterSourceQueuesRequest method. -// req, resp := client.ListDeadLetterSourceQueuesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueues -func (c *SQS) ListDeadLetterSourceQueuesRequest(input *ListDeadLetterSourceQueuesInput) (req *request.Request, output *ListDeadLetterSourceQueuesOutput) { - op := &request.Operation{ - Name: opListDeadLetterSourceQueues, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListDeadLetterSourceQueuesInput{} - } - - output = &ListDeadLetterSourceQueuesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeadLetterSourceQueues API operation for Amazon Simple Queue Service. -// -// Returns a list of your queues that have the RedrivePolicy queue attribute -// configured with a dead letter queue. -// -// For more information about using dead letter queues, see Using Amazon SQS -// Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) -// in the Amazon SQS Developer Guide. -// -// 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 Amazon Simple Queue Service's -// API operation ListDeadLetterSourceQueues for usage and error information. -// -// Returned Error Codes: -// * ErrCodeQueueDoesNotExist "AWS.SimpleQueueService.NonExistentQueue" -// The queue referred to doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueues -func (c *SQS) ListDeadLetterSourceQueues(input *ListDeadLetterSourceQueuesInput) (*ListDeadLetterSourceQueuesOutput, error) { - req, out := c.ListDeadLetterSourceQueuesRequest(input) - return out, req.Send() -} - -// ListDeadLetterSourceQueuesWithContext is the same as ListDeadLetterSourceQueues with the addition of -// the ability to pass a context and additional request options. -// -// See ListDeadLetterSourceQueues 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 *SQS) ListDeadLetterSourceQueuesWithContext(ctx aws.Context, input *ListDeadLetterSourceQueuesInput, opts ...request.Option) (*ListDeadLetterSourceQueuesOutput, error) { - req, out := c.ListDeadLetterSourceQueuesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListQueues = "ListQueues" - -// ListQueuesRequest generates a "aws/request.Request" representing the -// client's request for the ListQueues operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ListQueues for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ListQueues method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ListQueuesRequest method. -// req, resp := client.ListQueuesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueues -func (c *SQS) ListQueuesRequest(input *ListQueuesInput) (req *request.Request, output *ListQueuesOutput) { - op := &request.Operation{ - Name: opListQueues, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListQueuesInput{} - } - - output = &ListQueuesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListQueues API operation for Amazon Simple Queue Service. -// -// Returns a list of your queues. The maximum number of queues that can be returned -// is 1,000. If you specify a value for the optional QueueNamePrefix parameter, -// only queues with a name that begins with the specified value are returned. -// -// 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 Amazon Simple Queue Service's -// API operation ListQueues for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueues -func (c *SQS) ListQueues(input *ListQueuesInput) (*ListQueuesOutput, error) { - req, out := c.ListQueuesRequest(input) - return out, req.Send() -} - -// ListQueuesWithContext is the same as ListQueues with the addition of -// the ability to pass a context and additional request options. -// -// See ListQueues 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 *SQS) ListQueuesWithContext(ctx aws.Context, input *ListQueuesInput, opts ...request.Option) (*ListQueuesOutput, error) { - req, out := c.ListQueuesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPurgeQueue = "PurgeQueue" - -// PurgeQueueRequest generates a "aws/request.Request" representing the -// client's request for the PurgeQueue operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See PurgeQueue for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the PurgeQueue method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the PurgeQueueRequest method. -// req, resp := client.PurgeQueueRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueue -func (c *SQS) PurgeQueueRequest(input *PurgeQueueInput) (req *request.Request, output *PurgeQueueOutput) { - op := &request.Operation{ - Name: opPurgeQueue, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PurgeQueueInput{} - } - - output = &PurgeQueueOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// PurgeQueue API operation for Amazon Simple Queue Service. -// -// Deletes the messages in a queue specified by the QueueURL parameter. -// -// When you use the PurgeQueue action, you can't retrieve a message deleted -// from a queue. -// -// When you purge a queue, the message deletion process takes up to 60 seconds. -// All messages sent to the queue before calling the PurgeQueue action are deleted. -// Messages sent to the queue while it is being purged might be deleted. While -// the queue is being purged, messages sent to the queue before PurgeQueue is -// called might be received, but are deleted within the next minute. -// -// 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 Amazon Simple Queue Service's -// API operation PurgeQueue for usage and error information. -// -// Returned Error Codes: -// * ErrCodeQueueDoesNotExist "AWS.SimpleQueueService.NonExistentQueue" -// The queue referred to doesn't exist. -// -// * ErrCodePurgeQueueInProgress "AWS.SimpleQueueService.PurgeQueueInProgress" -// Indicates that the specified queue previously received a PurgeQueue request -// within the last 60 seconds (the time it can take to delete the messages in -// the queue). -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueue -func (c *SQS) PurgeQueue(input *PurgeQueueInput) (*PurgeQueueOutput, error) { - req, out := c.PurgeQueueRequest(input) - return out, req.Send() -} - -// PurgeQueueWithContext is the same as PurgeQueue with the addition of -// the ability to pass a context and additional request options. -// -// See PurgeQueue 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 *SQS) PurgeQueueWithContext(ctx aws.Context, input *PurgeQueueInput, opts ...request.Option) (*PurgeQueueOutput, error) { - req, out := c.PurgeQueueRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReceiveMessage = "ReceiveMessage" - -// ReceiveMessageRequest generates a "aws/request.Request" representing the -// client's request for the ReceiveMessage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See ReceiveMessage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the ReceiveMessage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the ReceiveMessageRequest method. -// req, resp := client.ReceiveMessageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessage -func (c *SQS) ReceiveMessageRequest(input *ReceiveMessageInput) (req *request.Request, output *ReceiveMessageOutput) { - op := &request.Operation{ - Name: opReceiveMessage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ReceiveMessageInput{} - } - - output = &ReceiveMessageOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReceiveMessage API operation for Amazon Simple Queue Service. -// -// Retrieves one or more messages (up to 10), from the specified queue. Using -// the WaitTimeSeconds parameter enables long-poll support. For more information, -// see Amazon SQS Long Polling (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html) -// in the Amazon SQS Developer Guide. -// -// Short poll is the default behavior where a weighted random set of machines -// is sampled on a ReceiveMessage call. Thus, only the messages on the sampled -// machines are returned. If the number of messages in the queue is small (fewer -// than 1,000), you most likely get fewer messages than you requested per ReceiveMessage -// call. If the number of messages in the queue is extremely small, you might -// not receive any messages in a particular ReceiveMessage response. If this -// happens, repeat the request. -// -// For each message returned, the response includes the following: -// -// * The message body. -// -// * An MD5 digest of the message body. For information on MD5, see RFC1321 -// (https://www.ietf.org/rfc/rfc1321.txt). -// -// * The MessageId you received when you sent the message to the queue. -// -// * The receipt handle. -// -// * The message attributes. -// -// * An MD5 digest of the message attributes. -// -// The receipt handle is the identifier you must provide when deleting the message. -// For more information, see Queue and Message Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) -// in the Amazon SQS Developer Guide. -// -// You can provide the VisibilityTimeout parameter in your request. The parameter -// is applied to the messages that Amazon SQS returns in the response. If you -// don't include the parameter, the overall visibility timeout for the queue -// is used for the returned messages. For more information, see Visibility Timeout -// (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) -// in the Amazon SQS Developer Guide. -// -// A message that isn't deleted or a message whose visibility isn't extended -// before the visibility timeout expires counts as a failed receive. Depending -// on the configuration of the queue, the message might be sent to the dead -// letter queue. -// -// In the future, new attributes might be added. If you write code that calls -// this action, we recommend that you structure your code so that it can handle -// new attributes gracefully. -// -// 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 Amazon Simple Queue Service's -// API operation ReceiveMessage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeOverLimit "OverLimit" -// The action that you requested would violate a limit. For example, ReceiveMessage -// returns this error if the maximum number of inflight messages is reached. -// AddPermission returns this error if the maximum number of permissions for -// the queue is reached. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessage -func (c *SQS) ReceiveMessage(input *ReceiveMessageInput) (*ReceiveMessageOutput, error) { - req, out := c.ReceiveMessageRequest(input) - return out, req.Send() -} - -// ReceiveMessageWithContext is the same as ReceiveMessage with the addition of -// the ability to pass a context and additional request options. -// -// See ReceiveMessage 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 *SQS) ReceiveMessageWithContext(ctx aws.Context, input *ReceiveMessageInput, opts ...request.Option) (*ReceiveMessageOutput, error) { - req, out := c.ReceiveMessageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRemovePermission = "RemovePermission" - -// RemovePermissionRequest generates a "aws/request.Request" representing the -// client's request for the RemovePermission operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See RemovePermission for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the RemovePermission method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the RemovePermissionRequest method. -// req, resp := client.RemovePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermission -func (c *SQS) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) { - op := &request.Operation{ - Name: opRemovePermission, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemovePermissionInput{} - } - - output = &RemovePermissionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemovePermission API operation for Amazon Simple Queue Service. -// -// Revokes any permissions in the queue policy that matches the specified Label -// parameter. Only the owner of the queue can remove permissions. -// -// 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 Amazon Simple Queue Service's -// API operation RemovePermission for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermission -func (c *SQS) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { - req, out := c.RemovePermissionRequest(input) - return out, req.Send() -} - -// RemovePermissionWithContext is the same as RemovePermission with the addition of -// the ability to pass a context and additional request options. -// -// See RemovePermission 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 *SQS) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { - req, out := c.RemovePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSendMessage = "SendMessage" - -// SendMessageRequest generates a "aws/request.Request" representing the -// client's request for the SendMessage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendMessage for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendMessage method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendMessageRequest method. -// req, resp := client.SendMessageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessage -func (c *SQS) SendMessageRequest(input *SendMessageInput) (req *request.Request, output *SendMessageOutput) { - op := &request.Operation{ - Name: opSendMessage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendMessageInput{} - } - - output = &SendMessageOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendMessage API operation for Amazon Simple Queue Service. -// -// Delivers a message to the specified queue. -// -// The following list shows the characters (in Unicode) that are allowed in -// your message, according to the W3C XML specification: -// -// #x9 -// -// #xA -// -// #xD -// -// #x20 to #xD7FF -// -// #xE000 to #xFFFD -// -// #x10000 to #x10FFFF -// -// For more information, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). -// If you send any characters that aren't included in this list, your request -// is rejected. -// -// 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 Amazon Simple Queue Service's -// API operation SendMessage for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidMessageContents "InvalidMessageContents" -// The message contains characters outside the allowed set. -// -// * ErrCodeUnsupportedOperation "AWS.SimpleQueueService.UnsupportedOperation" -// Error code 400. Unsupported operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessage -func (c *SQS) SendMessage(input *SendMessageInput) (*SendMessageOutput, error) { - req, out := c.SendMessageRequest(input) - return out, req.Send() -} - -// SendMessageWithContext is the same as SendMessage with the addition of -// the ability to pass a context and additional request options. -// -// See SendMessage 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 *SQS) SendMessageWithContext(ctx aws.Context, input *SendMessageInput, opts ...request.Option) (*SendMessageOutput, error) { - req, out := c.SendMessageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSendMessageBatch = "SendMessageBatch" - -// SendMessageBatchRequest generates a "aws/request.Request" representing the -// client's request for the SendMessageBatch operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SendMessageBatch for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SendMessageBatch method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SendMessageBatchRequest method. -// req, resp := client.SendMessageBatchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatch -func (c *SQS) SendMessageBatchRequest(input *SendMessageBatchInput) (req *request.Request, output *SendMessageBatchOutput) { - op := &request.Operation{ - Name: opSendMessageBatch, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SendMessageBatchInput{} - } - - output = &SendMessageBatchOutput{} - req = c.newRequest(op, input, output) - return -} - -// SendMessageBatch API operation for Amazon Simple Queue Service. -// -// Delivers up to ten messages to the specified queue. This is a batch version -// of SendMessage. For a FIFO queue, multiple messages within a single batch -// are enqueued in the order they are sent. -// -// The result of sending each message is reported individually in the response. -// Because the batch request can result in a combination of successful and unsuccessful -// actions, you should check for batch errors even when the call returns an -// HTTP status code of 200. -// -// The maximum allowed individual message size and the maximum total payload -// size (the sum of the individual lengths of all of the batched messages) are -// both 256 KB (262,144 bytes). -// -// The following list shows the characters (in Unicode) that are allowed in -// your message, according to the W3C XML specification: -// -// #x9 -// -// #xA -// -// #xD -// -// #x20 to #xD7FF -// -// #xE000 to #xFFFD -// -// #x10000 to #x10FFFF -// -// For more information, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). -// If you send any characters that aren't included in this list, your request -// is rejected. -// -// If you don't specify the DelaySeconds parameter for an entry, Amazon SQS -// uses the default value for the queue. -// -// Some actions take lists of parameters. These lists are specified using the -// param.n notation. Values of n are integers starting from 1. For example, -// a parameter list with two elements looks like this: -// -// &Attribute.1=this -// -// &Attribute.2=that -// -// 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 Amazon Simple Queue Service's -// API operation SendMessageBatch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeTooManyEntriesInBatchRequest "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" -// The batch request contains more entries than permissible. -// -// * ErrCodeEmptyBatchRequest "AWS.SimpleQueueService.EmptyBatchRequest" -// The batch request doesn't contain any entries. -// -// * ErrCodeBatchEntryIdsNotDistinct "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" -// Two or more batch entries in the request have the same Id. -// -// * ErrCodeBatchRequestTooLong "AWS.SimpleQueueService.BatchRequestTooLong" -// The length of all the messages put together is more than the limit. -// -// * ErrCodeInvalidBatchEntryId "AWS.SimpleQueueService.InvalidBatchEntryId" -// The Id of a batch entry in a batch request doesn't abide by the specification. -// -// * ErrCodeUnsupportedOperation "AWS.SimpleQueueService.UnsupportedOperation" -// Error code 400. Unsupported operation. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatch -func (c *SQS) SendMessageBatch(input *SendMessageBatchInput) (*SendMessageBatchOutput, error) { - req, out := c.SendMessageBatchRequest(input) - return out, req.Send() -} - -// SendMessageBatchWithContext is the same as SendMessageBatch with the addition of -// the ability to pass a context and additional request options. -// -// See SendMessageBatch 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 *SQS) SendMessageBatchWithContext(ctx aws.Context, input *SendMessageBatchInput, opts ...request.Option) (*SendMessageBatchOutput, error) { - req, out := c.SendMessageBatchRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSetQueueAttributes = "SetQueueAttributes" - -// SetQueueAttributesRequest generates a "aws/request.Request" representing the -// client's request for the SetQueueAttributes operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. -// -// See SetQueueAttributes for usage and error information. -// -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the SetQueueAttributes method directly -// instead. -// -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. -// -// // Example sending a request using the SetQueueAttributesRequest method. -// req, resp := client.SetQueueAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributes -func (c *SQS) SetQueueAttributesRequest(input *SetQueueAttributesInput) (req *request.Request, output *SetQueueAttributesOutput) { - op := &request.Operation{ - Name: opSetQueueAttributes, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &SetQueueAttributesInput{} - } - - output = &SetQueueAttributesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Remove(query.UnmarshalHandler) - req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) - return -} - -// SetQueueAttributes API operation for Amazon Simple Queue Service. -// -// Sets the value of one or more queue attributes. When you change a queue's -// attributes, the change can take up to 60 seconds for most of the attributes -// to propagate throughout the Amazon SQS system. Changes made to the MessageRetentionPeriod -// attribute can take up to 15 minutes. -// -// In the future, new attributes might be added. If you write code that calls -// this action, we recommend that you structure your code so that it can handle -// new attributes gracefully. -// -// 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 Amazon Simple Queue Service's -// API operation SetQueueAttributes for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidAttributeName "InvalidAttributeName" -// The attribute referred to doesn't exist. -// -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributes -func (c *SQS) SetQueueAttributes(input *SetQueueAttributesInput) (*SetQueueAttributesOutput, error) { - req, out := c.SetQueueAttributesRequest(input) - return out, req.Send() -} - -// SetQueueAttributesWithContext is the same as SetQueueAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See SetQueueAttributes 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 *SQS) SetQueueAttributesWithContext(ctx aws.Context, input *SetQueueAttributesInput, opts ...request.Option) (*SetQueueAttributesOutput, error) { - req, out := c.SetQueueAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermissionRequest -type AddPermissionInput struct { - _ struct{} `type:"structure"` - - // The AWS account number of the principal (http://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P) - // who is given permission. The principal must have an AWS account, but does - // not need to be signed up for Amazon SQS. For information about locating the - // AWS account identification, see Your AWS Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AWSCredentials.html) - // in the Amazon SQS Developer Guide. - // - // AWSAccountIds is a required field - AWSAccountIds []*string `locationNameList:"AWSAccountId" type:"list" flattened:"true" required:"true"` - - // The action the client wants to allow for the specified principal. The following - // values are valid: - // - // * * - // - // * ChangeMessageVisibility - // - // * DeleteMessage - // - // * GetQueueAttributes - // - // * GetQueueUrl - // - // * ReceiveMessage - // - // * SendMessage - // - // For more information about these actions, see Understanding Permissions (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html#PermissionTypes) - // in the Amazon SQS Developer Guide. - // - // Specifying SendMessage, DeleteMessage, or ChangeMessageVisibility for ActionName.n - // also grants permissions for the corresponding batch versions of those actions: - // SendMessageBatch, DeleteMessageBatch, and ChangeMessageVisibilityBatch. - // - // Actions is a required field - Actions []*string `locationNameList:"ActionName" type:"list" flattened:"true" required:"true"` - - // The unique identification of the permission you're setting (for example, - // AliceSendMessage). Maximum 80 characters. Allowed characters include alphanumeric - // characters, hyphens (-), and underscores (_). - // - // Label is a required field - Label *string `type:"string" required:"true"` - - // The URL of the Amazon SQS queue to which permissions are added. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AddPermissionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddPermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddPermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddPermissionInput"} - if s.AWSAccountIds == nil { - invalidParams.Add(request.NewErrParamRequired("AWSAccountIds")) - } - if s.Actions == nil { - invalidParams.Add(request.NewErrParamRequired("Actions")) - } - if s.Label == nil { - invalidParams.Add(request.NewErrParamRequired("Label")) - } - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAWSAccountIds sets the AWSAccountIds field's value. -func (s *AddPermissionInput) SetAWSAccountIds(v []*string) *AddPermissionInput { - s.AWSAccountIds = v - return s -} - -// SetActions sets the Actions field's value. -func (s *AddPermissionInput) SetActions(v []*string) *AddPermissionInput { - s.Actions = v - return s -} - -// SetLabel sets the Label field's value. -func (s *AddPermissionInput) SetLabel(v string) *AddPermissionInput { - s.Label = &v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *AddPermissionInput) SetQueueUrl(v string) *AddPermissionInput { - s.QueueUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/AddPermissionOutput -type AddPermissionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s AddPermissionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AddPermissionOutput) GoString() string { - return s.String() -} - -// This is used in the responses of batch API to give a detailed description -// of the result of an action on each entry in the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/BatchResultErrorEntry -type BatchResultErrorEntry struct { - _ struct{} `type:"structure"` - - // An error code representing why the action failed on this entry. - // - // Code is a required field - Code *string `type:"string" required:"true"` - - // The Id of an entry in a batch request. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // A message explaining why the action failed on this entry. - Message *string `type:"string"` - - // Specifies whether the error happened due to the sender's fault. - // - // SenderFault is a required field - SenderFault *bool `type:"boolean" required:"true"` -} - -// String returns the string representation -func (s BatchResultErrorEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchResultErrorEntry) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *BatchResultErrorEntry) SetCode(v string) *BatchResultErrorEntry { - s.Code = &v - return s -} - -// SetId sets the Id field's value. -func (s *BatchResultErrorEntry) SetId(v string) *BatchResultErrorEntry { - s.Id = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *BatchResultErrorEntry) SetMessage(v string) *BatchResultErrorEntry { - s.Message = &v - return s -} - -// SetSenderFault sets the SenderFault field's value. -func (s *BatchResultErrorEntry) SetSenderFault(v bool) *BatchResultErrorEntry { - s.SenderFault = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchRequest -type ChangeMessageVisibilityBatchInput struct { - _ struct{} `type:"structure"` - - // A list of receipt handles of the messages for which the visibility timeout - // must be changed. - // - // Entries is a required field - Entries []*ChangeMessageVisibilityBatchRequestEntry `locationNameList:"ChangeMessageVisibilityBatchRequestEntry" type:"list" flattened:"true" required:"true"` - - // The URL of the Amazon SQS queue whose messages' visibility is changed. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ChangeMessageVisibilityBatchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeMessageVisibilityBatchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChangeMessageVisibilityBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchInput"} - if s.Entries == nil { - invalidParams.Add(request.NewErrParamRequired("Entries")) - } - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - if s.Entries != nil { - for i, v := range s.Entries { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntries sets the Entries field's value. -func (s *ChangeMessageVisibilityBatchInput) SetEntries(v []*ChangeMessageVisibilityBatchRequestEntry) *ChangeMessageVisibilityBatchInput { - s.Entries = v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *ChangeMessageVisibilityBatchInput) SetQueueUrl(v string) *ChangeMessageVisibilityBatchInput { - s.QueueUrl = &v - return s -} - -// For each message in the batch, the response contains a ChangeMessageVisibilityBatchResultEntry -// tag if the message succeeds or a BatchResultErrorEntry tag if the message -// fails. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchResult -type ChangeMessageVisibilityBatchOutput struct { - _ struct{} `type:"structure"` - - // A list of BatchResultErrorEntry items. - // - // Failed is a required field - Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` - - // A list of ChangeMessageVisibilityBatchResultEntry items. - // - // Successful is a required field - Successful []*ChangeMessageVisibilityBatchResultEntry `locationNameList:"ChangeMessageVisibilityBatchResultEntry" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s ChangeMessageVisibilityBatchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeMessageVisibilityBatchOutput) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *ChangeMessageVisibilityBatchOutput) SetFailed(v []*BatchResultErrorEntry) *ChangeMessageVisibilityBatchOutput { - s.Failed = v - return s -} - -// SetSuccessful sets the Successful field's value. -func (s *ChangeMessageVisibilityBatchOutput) SetSuccessful(v []*ChangeMessageVisibilityBatchResultEntry) *ChangeMessageVisibilityBatchOutput { - s.Successful = v - return s -} - -// Encloses a receipt handle and an entry id for each message in ChangeMessageVisibilityBatch. -// -// All of the following list parameters must be prefixed with ChangeMessageVisibilityBatchRequestEntry.n, -// where n is an integer value starting with 1. For example, a parameter list -// for this action might look like this: -// -// &ChangeMessageVisibilityBatchRequestEntry.1.Id=change_visibility_msg_2 -// -// &ChangeMessageVisibilityBatchRequestEntry.1.ReceiptHandle=Your_Receipt_Handle -// -// &ChangeMessageVisibilityBatchRequestEntry.1.VisibilityTimeout=45 -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchRequestEntry -type ChangeMessageVisibilityBatchRequestEntry struct { - _ struct{} `type:"structure"` - - // An identifier for this particular receipt handle used to communicate the - // result. - // - // The Ids of a batch request need to be unique within a request - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // A receipt handle. - // - // ReceiptHandle is a required field - ReceiptHandle *string `type:"string" required:"true"` - - // The new value (in seconds) for the message's visibility timeout. - VisibilityTimeout *int64 `type:"integer"` -} - -// String returns the string representation -func (s ChangeMessageVisibilityBatchRequestEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeMessageVisibilityBatchRequestEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChangeMessageVisibilityBatchRequestEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityBatchRequestEntry"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.ReceiptHandle == nil { - invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *ChangeMessageVisibilityBatchRequestEntry) SetId(v string) *ChangeMessageVisibilityBatchRequestEntry { - s.Id = &v - return s -} - -// SetReceiptHandle sets the ReceiptHandle field's value. -func (s *ChangeMessageVisibilityBatchRequestEntry) SetReceiptHandle(v string) *ChangeMessageVisibilityBatchRequestEntry { - s.ReceiptHandle = &v - return s -} - -// SetVisibilityTimeout sets the VisibilityTimeout field's value. -func (s *ChangeMessageVisibilityBatchRequestEntry) SetVisibilityTimeout(v int64) *ChangeMessageVisibilityBatchRequestEntry { - s.VisibilityTimeout = &v - return s -} - -// Encloses the Id of an entry in ChangeMessageVisibilityBatch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityBatchResultEntry -type ChangeMessageVisibilityBatchResultEntry struct { - _ struct{} `type:"structure"` - - // Represents a message whose visibility timeout has been changed successfully. - // - // Id is a required field - Id *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ChangeMessageVisibilityBatchResultEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeMessageVisibilityBatchResultEntry) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *ChangeMessageVisibilityBatchResultEntry) SetId(v string) *ChangeMessageVisibilityBatchResultEntry { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityRequest -type ChangeMessageVisibilityInput struct { - _ struct{} `type:"structure"` - - // The URL of the Amazon SQS queue whose message's visibility is changed. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` - - // The receipt handle associated with the message whose visibility timeout is - // changed. This parameter is returned by the ReceiveMessage action. - // - // ReceiptHandle is a required field - ReceiptHandle *string `type:"string" required:"true"` - - // The new value for the message's visibility timeout (in seconds). Values values: - // 0 to 43200. Maximum: 12 hours. - // - // VisibilityTimeout is a required field - VisibilityTimeout *int64 `type:"integer" required:"true"` -} - -// String returns the string representation -func (s ChangeMessageVisibilityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeMessageVisibilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChangeMessageVisibilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChangeMessageVisibilityInput"} - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - if s.ReceiptHandle == nil { - invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) - } - if s.VisibilityTimeout == nil { - invalidParams.Add(request.NewErrParamRequired("VisibilityTimeout")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *ChangeMessageVisibilityInput) SetQueueUrl(v string) *ChangeMessageVisibilityInput { - s.QueueUrl = &v - return s -} - -// SetReceiptHandle sets the ReceiptHandle field's value. -func (s *ChangeMessageVisibilityInput) SetReceiptHandle(v string) *ChangeMessageVisibilityInput { - s.ReceiptHandle = &v - return s -} - -// SetVisibilityTimeout sets the VisibilityTimeout field's value. -func (s *ChangeMessageVisibilityInput) SetVisibilityTimeout(v int64) *ChangeMessageVisibilityInput { - s.VisibilityTimeout = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ChangeMessageVisibilityOutput -type ChangeMessageVisibilityOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ChangeMessageVisibilityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChangeMessageVisibilityOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueueRequest -type CreateQueueInput struct { - _ struct{} `type:"structure"` - - // A map of attributes with their corresponding values. - // - // The following lists the names, descriptions, and values of the special request - // parameters that the CreateQueue action uses: - // - // * DelaySeconds - The number of seconds for which the delivery of all messages - // in the queue is delayed. Valid values: An integer from 0 to 900 seconds - // (15 minutes). The default is 0 (zero). - // - // * MaximumMessageSize - The limit of how many bytes a message can contain - // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes - // (1 KiB) to 262,144 bytes (256 KiB). The default is 262,144 (256 KiB). - // - // - // * MessageRetentionPeriod - The number of seconds for which Amazon SQS - // retains a message. Valid values: An integer from 60 seconds (1 minute) - // to 1,209,600 seconds (14 days). The default is 345,600 (4 days). - // - // * Policy - The queue's policy. A valid AWS policy. For more information - // about policy structure, see Overview of AWS IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) - // in the Amazon IAM User Guide. - // - // * ReceiveMessageWaitTimeSeconds - The number of seconds for which a ReceiveMessage - // action waits for a message to arrive. Valid values: An integer from 0 - // to 20 (seconds). The default is 0 (zero). - // - // * RedrivePolicy - The parameters for the dead letter queue functionality - // of the source queue. For more information about the redrive policy and - // dead letter queues, see Using Amazon SQS Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) - // in the Amazon SQS Developer Guide. - // - // The dead letter queue of a FIFO queue must also be a FIFO queue. Similarly, - // the dead letter queue of a standard queue must also be a standard queue. - // - // * VisibilityTimeout - The visibility timeout for the queue. Valid values: - // An integer from 0 to 43,200 (12 hours). The default is 30. For more information - // about the visibility timeout, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - // in the Amazon SQS Developer Guide. - // - // The following attributes apply only to FIFO (first-in-first-out) queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): - // - // * FifoQueue - Designates a queue as FIFO. You can provide this attribute - // only during queue creation. You can't change it for an existing queue. - // When you set this attribute, you must provide a MessageGroupId explicitly. - // - // For more information, see FIFO Queue Logic (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) - // in the Amazon SQS Developer Guide. - // - // * ContentBasedDeduplication - Enables content-based deduplication. For - // more information, see Exactly-Once Processing (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) - // in the Amazon SQS Developer Guide. - // - // Every message must have a unique MessageDeduplicationId, - // - // You may provide a MessageDeduplicationId explicitly. - // - // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication - // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId - // using the body of the message (but not the attributes of the message). - // - // - // If you don't provide a MessageDeduplicationId and the queue doesn't have - // ContentBasedDeduplication set, the action fails with an error. - // - // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId - // overrides the generated one. - // - // When ContentBasedDeduplication is in effect, messages with identical content - // sent within the deduplication interval are treated as duplicates and only - // one copy of the message is delivered. - // - // You can also use ContentBasedDeduplication for messages with identical content - // to be treated as duplicates. - // - // If you send one message with ContentBasedDeduplication enabled and then another - // message with a MessageDeduplicationId that is the same as the one generated - // for the first MessageDeduplicationId, the two messages are treated as - // duplicates and only one copy of the message is delivered. - // - // Any other valid special request parameters (such as the following) are ignored: - // - // * ApproximateNumberOfMessages - // - // * ApproximateNumberOfMessagesDelayed - // - // * ApproximateNumberOfMessagesNotVisible - // - // * CreatedTimestamp - // - // * LastModifiedTimestamp - // - // * QueueArn - Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` - - // The name of the new queue. The following limits apply to this name: - // - // * A queue name can have up to 80 characters. - // - // * Valid values: alphanumeric characters, hyphens (-), and underscores - // (_). - // - // * A FIFO queue name must end with the .fifo suffix. - // - // Queue names are case-sensitive. - // - // QueueName is a required field - QueueName *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateQueueInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateQueueInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateQueueInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateQueueInput"} - if s.QueueName == nil { - invalidParams.Add(request.NewErrParamRequired("QueueName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *CreateQueueInput) SetAttributes(v map[string]*string) *CreateQueueInput { - s.Attributes = v - return s -} - -// SetQueueName sets the QueueName field's value. -func (s *CreateQueueInput) SetQueueName(v string) *CreateQueueInput { - s.QueueName = &v - return s -} - -// Returns the QueueUrl attribute of the created queue. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/CreateQueueResult -type CreateQueueOutput struct { - _ struct{} `type:"structure"` - - // The URL of the created Amazon SQS queue. - QueueUrl *string `type:"string"` -} - -// String returns the string representation -func (s CreateQueueOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateQueueOutput) GoString() string { - return s.String() -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *CreateQueueOutput) SetQueueUrl(v string) *CreateQueueOutput { - s.QueueUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchRequest -type DeleteMessageBatchInput struct { - _ struct{} `type:"structure"` - - // A list of receipt handles for the messages to be deleted. - // - // Entries is a required field - Entries []*DeleteMessageBatchRequestEntry `locationNameList:"DeleteMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"` - - // The URL of the Amazon SQS queue from which messages are deleted. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMessageBatchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMessageBatchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMessageBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchInput"} - if s.Entries == nil { - invalidParams.Add(request.NewErrParamRequired("Entries")) - } - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - if s.Entries != nil { - for i, v := range s.Entries { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntries sets the Entries field's value. -func (s *DeleteMessageBatchInput) SetEntries(v []*DeleteMessageBatchRequestEntry) *DeleteMessageBatchInput { - s.Entries = v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *DeleteMessageBatchInput) SetQueueUrl(v string) *DeleteMessageBatchInput { - s.QueueUrl = &v - return s -} - -// For each message in the batch, the response contains a DeleteMessageBatchResultEntry -// tag if the message is deleted or a BatchResultErrorEntry tag if the message -// can't be deleted. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchResult -type DeleteMessageBatchOutput struct { - _ struct{} `type:"structure"` - - // A list of BatchResultErrorEntry items. - // - // Failed is a required field - Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` - - // A list of DeleteMessageBatchResultEntry items. - // - // Successful is a required field - Successful []*DeleteMessageBatchResultEntry `locationNameList:"DeleteMessageBatchResultEntry" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s DeleteMessageBatchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMessageBatchOutput) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *DeleteMessageBatchOutput) SetFailed(v []*BatchResultErrorEntry) *DeleteMessageBatchOutput { - s.Failed = v - return s -} - -// SetSuccessful sets the Successful field's value. -func (s *DeleteMessageBatchOutput) SetSuccessful(v []*DeleteMessageBatchResultEntry) *DeleteMessageBatchOutput { - s.Successful = v - return s -} - -// Encloses a receipt handle and an identifier for it. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchRequestEntry -type DeleteMessageBatchRequestEntry struct { - _ struct{} `type:"structure"` - - // An identifier for this particular receipt handle. This is used to communicate - // the result. - // - // The Ids of a batch request need to be unique within a request - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // A receipt handle. - // - // ReceiptHandle is a required field - ReceiptHandle *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMessageBatchRequestEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMessageBatchRequestEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMessageBatchRequestEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMessageBatchRequestEntry"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.ReceiptHandle == nil { - invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteMessageBatchRequestEntry) SetId(v string) *DeleteMessageBatchRequestEntry { - s.Id = &v - return s -} - -// SetReceiptHandle sets the ReceiptHandle field's value. -func (s *DeleteMessageBatchRequestEntry) SetReceiptHandle(v string) *DeleteMessageBatchRequestEntry { - s.ReceiptHandle = &v - return s -} - -// Encloses the Id of an entry in DeleteMessageBatch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageBatchResultEntry -type DeleteMessageBatchResultEntry struct { - _ struct{} `type:"structure"` - - // Represents a successfully deleted message. - // - // Id is a required field - Id *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMessageBatchResultEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMessageBatchResultEntry) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *DeleteMessageBatchResultEntry) SetId(v string) *DeleteMessageBatchResultEntry { - s.Id = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageRequest -type DeleteMessageInput struct { - _ struct{} `type:"structure"` - - // The URL of the Amazon SQS queue from which messages are deleted. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` - - // The receipt handle associated with the message to delete. - // - // ReceiptHandle is a required field - ReceiptHandle *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteMessageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMessageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMessageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMessageInput"} - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - if s.ReceiptHandle == nil { - invalidParams.Add(request.NewErrParamRequired("ReceiptHandle")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *DeleteMessageInput) SetQueueUrl(v string) *DeleteMessageInput { - s.QueueUrl = &v - return s -} - -// SetReceiptHandle sets the ReceiptHandle field's value. -func (s *DeleteMessageInput) SetReceiptHandle(v string) *DeleteMessageInput { - s.ReceiptHandle = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteMessageOutput -type DeleteMessageOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteMessageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteMessageOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueueRequest -type DeleteQueueInput struct { - _ struct{} `type:"structure"` - - // The URL of the Amazon SQS queue to delete. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteQueueInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteQueueInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteQueueInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteQueueInput"} - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *DeleteQueueInput) SetQueueUrl(v string) *DeleteQueueInput { - s.QueueUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/DeleteQueueOutput -type DeleteQueueOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteQueueOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteQueueOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributesRequest -type GetQueueAttributesInput struct { - _ struct{} `type:"structure"` - - // A list of attributes for which to retrieve information. - // - // In the future, new attributes might be added. If you write code that calls - // this action, we recommend that you structure your code so that it can handle - // new attributes gracefully. - // - // The following attributes are supported: - // - // * All - Returns all values. - // - // * ApproximateNumberOfMessages - Returns the approximate number of visible - // messages in a queue. For more information, see Resources Required to Process - // Messages (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-resources-required-process-messages.html) - // in the Amazon SQS Developer Guide. - // - // * ApproximateNumberOfMessagesDelayed - Returns the approximate number - // of messages that are waiting to be added to the queue. - // - // * ApproximateNumberOfMessagesNotVisible - Returns the approximate number - // of messages that have not timed-out and aren't deleted. For more information, - // see Resources Required to Process Messages (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-resources-required-process-messages.html) - // in the Amazon SQS Developer Guide. - // - // * CreatedTimestamp - Returns the time when the queue was created in seconds - // (epoch time (http://en.wikipedia.org/wiki/Unix_time)). - // - // * DelaySeconds - Returns the default delay on the queue in seconds. - // - // * LastModifiedTimestamp - Returns the time when the queue was last changed - // in seconds (epoch time (http://en.wikipedia.org/wiki/Unix_time)). - // - // * MaximumMessageSize - Returns the limit of how many bytes a message can - // contain before Amazon SQS rejects it. - // - // * MessageRetentionPeriod - Returns the number of seconds for which Amazon - // SQS retains a message. - // - // * Policy - Returns the policy of the queue. - // - // * QueueArn - Returns the Amazon resource name (ARN) of the queue. - // - // * ReceiveMessageWaitTimeSeconds - Returns the number of seconds for which - // the ReceiveMessage action waits for a message to arrive. - // - // * RedrivePolicy - Returns the parameters for dead letter queue functionality - // of the source queue. For more information about the redrive policy and - // dead letter queues, see Using Amazon SQS Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) - // in the Amazon SQS Developer Guide. - // - // * VisibilityTimeout - Returns the visibility timeout for the queue. For - // more information about the visibility timeout, see Visibility Timeout - // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - // in the Amazon SQS Developer Guide. - // - // The following attributes apply only to FIFO (first-in-first-out) queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): - // - // * FifoQueue - Returns whether the queue is FIFO. For more information, - // see FIFO Queue Logic (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) - // in the Amazon SQS Developer Guide. - // - // * ContentBasedDeduplication - Returns whether content-based deduplication - // is enabled for the queue. For more information, see Exactly-Once Processing - // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) - // in the Amazon SQS Developer Guide. - AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"` - - // The URL of the Amazon SQS queue whose attribute information is retrieved. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s GetQueueAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetQueueAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetQueueAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetQueueAttributesInput"} - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeNames sets the AttributeNames field's value. -func (s *GetQueueAttributesInput) SetAttributeNames(v []*string) *GetQueueAttributesInput { - s.AttributeNames = v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *GetQueueAttributesInput) SetQueueUrl(v string) *GetQueueAttributesInput { - s.QueueUrl = &v - return s -} - -// A list of returned queue attributes. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueAttributesResult -type GetQueueAttributesOutput struct { - _ struct{} `type:"structure"` - - // A map of attributes to their respective values. - Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` -} - -// String returns the string representation -func (s GetQueueAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetQueueAttributesOutput) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *GetQueueAttributesOutput) SetAttributes(v map[string]*string) *GetQueueAttributesOutput { - s.Attributes = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrlRequest -type GetQueueUrlInput struct { - _ struct{} `type:"structure"` - - // The name of the queue whose URL must be fetched. Maximum 80 characters. Valid - // values: alphanumeric characters, hyphens (-), and underscores (_). - // - // Queue names are case-sensitive. - // - // QueueName is a required field - QueueName *string `type:"string" required:"true"` - - // The AWS account ID of the account that created the queue. - QueueOwnerAWSAccountId *string `type:"string"` -} - -// String returns the string representation -func (s GetQueueUrlInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetQueueUrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetQueueUrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetQueueUrlInput"} - if s.QueueName == nil { - invalidParams.Add(request.NewErrParamRequired("QueueName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueueName sets the QueueName field's value. -func (s *GetQueueUrlInput) SetQueueName(v string) *GetQueueUrlInput { - s.QueueName = &v - return s -} - -// SetQueueOwnerAWSAccountId sets the QueueOwnerAWSAccountId field's value. -func (s *GetQueueUrlInput) SetQueueOwnerAWSAccountId(v string) *GetQueueUrlInput { - s.QueueOwnerAWSAccountId = &v - return s -} - -// For more information, see Responses (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/UnderstandingResponses.html) -// in the Amazon SQS Developer Guide. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/GetQueueUrlResult -type GetQueueUrlOutput struct { - _ struct{} `type:"structure"` - - // The URL of the queue. - QueueUrl *string `type:"string"` -} - -// String returns the string representation -func (s GetQueueUrlOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetQueueUrlOutput) GoString() string { - return s.String() -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *GetQueueUrlOutput) SetQueueUrl(v string) *GetQueueUrlOutput { - s.QueueUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueuesRequest -type ListDeadLetterSourceQueuesInput struct { - _ struct{} `type:"structure"` - - // The URL of a dead letter queue. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ListDeadLetterSourceQueuesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeadLetterSourceQueuesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeadLetterSourceQueuesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeadLetterSourceQueuesInput"} - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *ListDeadLetterSourceQueuesInput) SetQueueUrl(v string) *ListDeadLetterSourceQueuesInput { - s.QueueUrl = &v - return s -} - -// A list of your dead letter source queues. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListDeadLetterSourceQueuesResult -type ListDeadLetterSourceQueuesOutput struct { - _ struct{} `type:"structure"` - - // A list of source queue URLs that have the RedrivePolicy queue attribute configured - // with a dead letter queue. - // - // QueueUrls is a required field - QueueUrls []*string `locationName:"queueUrls" locationNameList:"QueueUrl" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s ListDeadLetterSourceQueuesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListDeadLetterSourceQueuesOutput) GoString() string { - return s.String() -} - -// SetQueueUrls sets the QueueUrls field's value. -func (s *ListDeadLetterSourceQueuesOutput) SetQueueUrls(v []*string) *ListDeadLetterSourceQueuesOutput { - s.QueueUrls = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueuesRequest -type ListQueuesInput struct { - _ struct{} `type:"structure"` - - // A string to use for filtering the list results. Only those queues whose name - // begins with the specified string are returned. - // - // Queue names are case-sensitive. - QueueNamePrefix *string `type:"string"` -} - -// String returns the string representation -func (s ListQueuesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListQueuesInput) GoString() string { - return s.String() -} - -// SetQueueNamePrefix sets the QueueNamePrefix field's value. -func (s *ListQueuesInput) SetQueueNamePrefix(v string) *ListQueuesInput { - s.QueueNamePrefix = &v - return s -} - -// A list of your queues. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ListQueuesResult -type ListQueuesOutput struct { - _ struct{} `type:"structure"` - - // A list of queue URLs, up to 1,000 entries. - QueueUrls []*string `locationNameList:"QueueUrl" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s ListQueuesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListQueuesOutput) GoString() string { - return s.String() -} - -// SetQueueUrls sets the QueueUrls field's value. -func (s *ListQueuesOutput) SetQueueUrls(v []*string) *ListQueuesOutput { - s.QueueUrls = v - return s -} - -// An Amazon SQS message. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/Message -type Message struct { - _ struct{} `type:"structure"` - - // SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. - // SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an - // integer representing the epoch time (http://en.wikipedia.org/wiki/Unix_time) - // in milliseconds. - Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` - - // The message's contents (not URL-encoded). - Body *string `type:"string"` - - // An MD5 digest of the non-URL-encoded message body string. - MD5OfBody *string `type:"string"` - - // An MD5 digest of the non-URL-encoded message attribute string. You can use - // this attribute to verify that Amazon SQS received the message correctly. - // Amazon SQS URL-decodes the message before creating the MD5 digest. For information - // on MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). - MD5OfMessageAttributes *string `type:"string"` - - // Each message attribute consists of a Name, Type, and Value. For more information, - // see Message Attribute Items and Validation (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation) - // in the Amazon SQS Developer Guide. - MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` - - // A unique identifier for the message. A MessageIdis considered unique across - // all AWS accounts for an extended period of time. - MessageId *string `type:"string"` - - // An identifier associated with the act of receiving the message. A new receipt - // handle is returned every time you receive a message. When deleting a message, - // you provide the last received receipt handle to delete the message. - ReceiptHandle *string `type:"string"` -} - -// String returns the string representation -func (s Message) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s Message) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *Message) SetAttributes(v map[string]*string) *Message { - s.Attributes = v - return s -} - -// SetBody sets the Body field's value. -func (s *Message) SetBody(v string) *Message { - s.Body = &v - return s -} - -// SetMD5OfBody sets the MD5OfBody field's value. -func (s *Message) SetMD5OfBody(v string) *Message { - s.MD5OfBody = &v - return s -} - -// SetMD5OfMessageAttributes sets the MD5OfMessageAttributes field's value. -func (s *Message) SetMD5OfMessageAttributes(v string) *Message { - s.MD5OfMessageAttributes = &v - return s -} - -// SetMessageAttributes sets the MessageAttributes field's value. -func (s *Message) SetMessageAttributes(v map[string]*MessageAttributeValue) *Message { - s.MessageAttributes = v - return s -} - -// SetMessageId sets the MessageId field's value. -func (s *Message) SetMessageId(v string) *Message { - s.MessageId = &v - return s -} - -// SetReceiptHandle sets the ReceiptHandle field's value. -func (s *Message) SetReceiptHandle(v string) *Message { - s.ReceiptHandle = &v - return s -} - -// The user-specified message attribute value. For string data types, the Value -// attribute has the same restrictions on the content as the message body. For -// more information, see SendMessage. -// -// Name, type, value and the message body must not be empty or null. All parts -// of the message attribute, including Name, Type, and Value, are part of the -// message size restriction (256 KB or 262,144 bytes). -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/MessageAttributeValue -type MessageAttributeValue struct { - _ struct{} `type:"structure"` - - // Not implemented. Reserved for future use. - BinaryListValues [][]byte `locationName:"BinaryListValue" locationNameList:"BinaryListValue" type:"list" flattened:"true"` - - // Binary type attributes can store any binary data, such as compressed data, - // encrypted data, or images. - // - // BinaryValue is automatically base64 encoded/decoded by the SDK. - BinaryValue []byte `type:"blob"` - - // Amazon SQS supports the following logical data types: String, Number, and - // Binary. For the Number data type, you must use StringValue. - // - // You can also append custom labels. For more information, see Message Attribute - // Data Types and Validation (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-data-types-validation) - // in the Amazon SQS Developer Guide. - // - // DataType is a required field - DataType *string `type:"string" required:"true"` - - // Not implemented. Reserved for future use. - StringListValues []*string `locationName:"StringListValue" locationNameList:"StringListValue" type:"list" flattened:"true"` - - // Strings are Unicode with UTF-8 binary encoding. For a list of code values, - // see ASCII Printable Characters (http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - StringValue *string `type:"string"` -} - -// String returns the string representation -func (s MessageAttributeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MessageAttributeValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MessageAttributeValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MessageAttributeValue"} - if s.DataType == nil { - invalidParams.Add(request.NewErrParamRequired("DataType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBinaryListValues sets the BinaryListValues field's value. -func (s *MessageAttributeValue) SetBinaryListValues(v [][]byte) *MessageAttributeValue { - s.BinaryListValues = v - return s -} - -// SetBinaryValue sets the BinaryValue field's value. -func (s *MessageAttributeValue) SetBinaryValue(v []byte) *MessageAttributeValue { - s.BinaryValue = v - return s -} - -// SetDataType sets the DataType field's value. -func (s *MessageAttributeValue) SetDataType(v string) *MessageAttributeValue { - s.DataType = &v - return s -} - -// SetStringListValues sets the StringListValues field's value. -func (s *MessageAttributeValue) SetStringListValues(v []*string) *MessageAttributeValue { - s.StringListValues = v - return s -} - -// SetStringValue sets the StringValue field's value. -func (s *MessageAttributeValue) SetStringValue(v string) *MessageAttributeValue { - s.StringValue = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueueRequest -type PurgeQueueInput struct { - _ struct{} `type:"structure"` - - // The URL of the queue from which the PurgeQueue action deletes messages. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s PurgeQueueInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurgeQueueInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PurgeQueueInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PurgeQueueInput"} - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *PurgeQueueInput) SetQueueUrl(v string) *PurgeQueueInput { - s.QueueUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/PurgeQueueOutput -type PurgeQueueOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s PurgeQueueOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s PurgeQueueOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessageRequest -type ReceiveMessageInput struct { - _ struct{} `type:"structure"` - - // A list of attributes that need to be returned along with each message. These - // attributes include: - // - // * All - Returns all values. - // - // * ApproximateFirstReceiveTimestamp - Returns the time the message was - // first received from the queue (epoch time (http://en.wikipedia.org/wiki/Unix_time) - // in milliseconds). - // - // * ApproximateReceiveCount - Returns the number of times a message has - // been received from the queue but not deleted. - // - // * SenderId - // - // For an IAM user, returns the IAM user ID, for example ABCDEFGHI1JKLMNOPQ23R. - // - // For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456. - // - // * SentTimestamp - Returns the time the message was sent to the queue (epoch - // time (http://en.wikipedia.org/wiki/Unix_time) in milliseconds). - // - // * MessageDeduplicationId - Returns the value provided by the sender that - // calls the SendMessage action. - // - // * MessageGroupId - Returns the value provided by the sender that calls - // the SendMessage action. Messages with the same MessageGroupId are returned - // in sequence. - // - // * SequenceNumber - Returns the value provided by Amazon SQS. - // - // Any other valid special request parameters (such as the following) are ignored: - // - // * ApproximateNumberOfMessages - // - // * ApproximateNumberOfMessagesDelayed - // - // * ApproximateNumberOfMessagesNotVisible - // - // * CreatedTimestamp - // - // * ContentBasedDeduplication - // - // * DelaySeconds - // - // * FifoQueue - // - // * LastModifiedTimestamp - // - // * MaximumMessageSize - // - // * MessageRetentionPeriod - // - // * Policy - // - // * QueueArn, - // - // * ReceiveMessageWaitTimeSeconds - // - // * RedrivePolicy - // - // * VisibilityTimeout - AttributeNames []*string `locationNameList:"AttributeName" type:"list" flattened:"true"` - - // The maximum number of messages to return. Amazon SQS never returns more messages - // than this value (however, fewer messages might be returned). Valid values - // are 1 to 10. Default is 1. - MaxNumberOfMessages *int64 `type:"integer"` - - // The name of the message attribute, where N is the index. - // - // * The name can contain alphanumeric characters and the underscore (_), - // hyphen (-), and period (.). - // - // * The name is case-sensitive and must be unique among all attribute names - // for the message. - // - // * The name must not start with AWS-reserved prefixes such as AWS. or Amazon. - // (or any casing variants). - // - // * The name must not start or end with a period (.), and it should not - // have periods in succession (..). - // - // * The name can be up to 256 characters long. - // - // When using ReceiveMessage, you can send a list of attribute names to receive, - // or you can return all of the attributes by specifying All or .* in your request. - // You can also use all message attributes starting with a prefix, for example - // bar.*. - MessageAttributeNames []*string `locationNameList:"MessageAttributeName" type:"list" flattened:"true"` - - // The URL of the Amazon SQS queue from which messages are received. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // The token used for deduplication of ReceiveMessage calls. If a networking - // issue occurs after a ReceiveMessage action, and instead of a response you - // receive a generic error, you can retry the same action with an identical - // ReceiveRequestAttemptId to retrieve the same set of messages, even if their - // visibility timeout has not yet expired. - // - // * You can use ReceiveRequestAttemptId only for 5 minutes after a ReceiveMessage - // action. - // - // * When you set FifoQueue, a caller of the ReceiveMessage action can provide - // a ReceiveRequestAttemptId explicitly. - // - // * If a caller of the ReceiveMessage action doesn't provide a ReceiveRequestAttemptId, - // Amazon SQS generates a ReceiveRequestAttemptId. - // - // * You can retry the ReceiveMessage action with the same ReceiveRequestAttemptId - // if none of the messages have been modified (deleted or had their visibility - // changes). - // - // * During a visibility timeout, subsequent calls with the same ReceiveRequestAttemptId - // return the same messages and receipt handles. If a retry occurs within - // the deduplication interval, it resets the visibility timeout. For more - // information, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - // in the Amazon Simple Queue Service Developer Guide. - // - // If a caller of the ReceiveMessage action is still processing messages when - // the visibility timeout expires and messages become visible, another worker - // reading from the same queue can receive the same messages and therefore - // process duplicates. Also, if a reader whose message processing time is - // longer than the visibility timeout tries to delete the processed messages, - // the action fails with an error. - // - // To mitigate this effect, ensure that your application observes a safe threshold - // before the visibility timeout expires and extend the visibility timeout - // as necessary. - // - // * While messages with a particular MessageGroupId are invisible, no more - // messages belonging to the same MessageGroupId are returned until the visibility - // timeout expires. You can still receive messages with another MessageGroupId - // as long as it is also visible. - // - // * If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId, - // no retries work until the original visibility timeout expires. As a result, - // delays might occur but the messages in the queue remain in a strict order. - // - // The length of ReceiveRequestAttemptId is 128 characters. ReceiveRequestAttemptId - // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). - // - // For best practices of using ReceiveRequestAttemptId, see Using the ReceiveRequestAttemptId - // Request Parameter (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-receiverequestattemptid-request-parameter) - // in the Amazon Simple Queue Service Developer Guide. - ReceiveRequestAttemptId *string `type:"string"` - - // The duration (in seconds) that the received messages are hidden from subsequent - // retrieve requests after being retrieved by a ReceiveMessage request. - VisibilityTimeout *int64 `type:"integer"` - - // The duration (in seconds) for which the call waits for a message to arrive - // in the queue before returning. If a message is available, the call returns - // sooner than WaitTimeSeconds. - WaitTimeSeconds *int64 `type:"integer"` -} - -// String returns the string representation -func (s ReceiveMessageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReceiveMessageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReceiveMessageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReceiveMessageInput"} - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeNames sets the AttributeNames field's value. -func (s *ReceiveMessageInput) SetAttributeNames(v []*string) *ReceiveMessageInput { - s.AttributeNames = v - return s -} - -// SetMaxNumberOfMessages sets the MaxNumberOfMessages field's value. -func (s *ReceiveMessageInput) SetMaxNumberOfMessages(v int64) *ReceiveMessageInput { - s.MaxNumberOfMessages = &v - return s -} - -// SetMessageAttributeNames sets the MessageAttributeNames field's value. -func (s *ReceiveMessageInput) SetMessageAttributeNames(v []*string) *ReceiveMessageInput { - s.MessageAttributeNames = v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *ReceiveMessageInput) SetQueueUrl(v string) *ReceiveMessageInput { - s.QueueUrl = &v - return s -} - -// SetReceiveRequestAttemptId sets the ReceiveRequestAttemptId field's value. -func (s *ReceiveMessageInput) SetReceiveRequestAttemptId(v string) *ReceiveMessageInput { - s.ReceiveRequestAttemptId = &v - return s -} - -// SetVisibilityTimeout sets the VisibilityTimeout field's value. -func (s *ReceiveMessageInput) SetVisibilityTimeout(v int64) *ReceiveMessageInput { - s.VisibilityTimeout = &v - return s -} - -// SetWaitTimeSeconds sets the WaitTimeSeconds field's value. -func (s *ReceiveMessageInput) SetWaitTimeSeconds(v int64) *ReceiveMessageInput { - s.WaitTimeSeconds = &v - return s -} - -// A list of received messages. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/ReceiveMessageResult -type ReceiveMessageOutput struct { - _ struct{} `type:"structure"` - - // A list of messages. - Messages []*Message `locationNameList:"Message" type:"list" flattened:"true"` -} - -// String returns the string representation -func (s ReceiveMessageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReceiveMessageOutput) GoString() string { - return s.String() -} - -// SetMessages sets the Messages field's value. -func (s *ReceiveMessageOutput) SetMessages(v []*Message) *ReceiveMessageOutput { - s.Messages = v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermissionRequest -type RemovePermissionInput struct { - _ struct{} `type:"structure"` - - // The identification of the permission to remove. This is the label added using - // the AddPermission action. - // - // Label is a required field - Label *string `type:"string" required:"true"` - - // The URL of the Amazon SQS queue from which permissions are removed. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s RemovePermissionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemovePermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemovePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemovePermissionInput"} - if s.Label == nil { - invalidParams.Add(request.NewErrParamRequired("Label")) - } - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLabel sets the Label field's value. -func (s *RemovePermissionInput) SetLabel(v string) *RemovePermissionInput { - s.Label = &v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *RemovePermissionInput) SetQueueUrl(v string) *RemovePermissionInput { - s.QueueUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/RemovePermissionOutput -type RemovePermissionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s RemovePermissionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemovePermissionOutput) GoString() string { - return s.String() -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchRequest -type SendMessageBatchInput struct { - _ struct{} `type:"structure"` - - // A list of SendMessageBatchRequestEntry items. - // - // Entries is a required field - Entries []*SendMessageBatchRequestEntry `locationNameList:"SendMessageBatchRequestEntry" type:"list" flattened:"true" required:"true"` - - // The URL of the Amazon SQS queue to which batched messages are sent. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SendMessageBatchInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendMessageBatchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendMessageBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchInput"} - if s.Entries == nil { - invalidParams.Add(request.NewErrParamRequired("Entries")) - } - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - if s.Entries != nil { - for i, v := range s.Entries { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Entries", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntries sets the Entries field's value. -func (s *SendMessageBatchInput) SetEntries(v []*SendMessageBatchRequestEntry) *SendMessageBatchInput { - s.Entries = v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *SendMessageBatchInput) SetQueueUrl(v string) *SendMessageBatchInput { - s.QueueUrl = &v - return s -} - -// For each message in the batch, the response contains a SendMessageBatchResultEntry -// tag if the message succeeds or a BatchResultErrorEntry tag if the message -// fails. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchResult -type SendMessageBatchOutput struct { - _ struct{} `type:"structure"` - - // A list of BatchResultErrorEntry items with error details about each message - // that can't be enqueued. - // - // Failed is a required field - Failed []*BatchResultErrorEntry `locationNameList:"BatchResultErrorEntry" type:"list" flattened:"true" required:"true"` - - // A list of SendMessageBatchResultEntry items. - // - // Successful is a required field - Successful []*SendMessageBatchResultEntry `locationNameList:"SendMessageBatchResultEntry" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation -func (s SendMessageBatchOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendMessageBatchOutput) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *SendMessageBatchOutput) SetFailed(v []*BatchResultErrorEntry) *SendMessageBatchOutput { - s.Failed = v - return s -} - -// SetSuccessful sets the Successful field's value. -func (s *SendMessageBatchOutput) SetSuccessful(v []*SendMessageBatchResultEntry) *SendMessageBatchOutput { - s.Successful = v - return s -} - -// Contains the details of a single Amazon SQS message along with an Id. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchRequestEntry -type SendMessageBatchRequestEntry struct { - _ struct{} `type:"structure"` - - // The number of seconds for which a specific message is delayed. Valid values: - // 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds value - // become available for processing after the delay period is finished. If you - // don't specify a value, the default value for the queue is applied. - // - // When you set FifoQueue, you can't set DelaySeconds per message. You can set - // this parameter only on a queue level. - DelaySeconds *int64 `type:"integer"` - - // An identifier for a message in this batch used to communicate the result. - // - // The Ids of a batch request need to be unique within a request - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // Each message attribute consists of a Name, Type, and Value. For more information, - // see Message Attribute Items and Validation (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation) - // in the Amazon SQS Developer Guide. - MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` - - // The body of the message. - // - // MessageBody is a required field - MessageBody *string `type:"string" required:"true"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // The token used for deduplication of messages within a 5-minute minimum deduplication - // interval. If a message with a particular MessageDeduplicationId is sent successfully, - // subsequent messages with the same MessageDeduplicationId are accepted successfully - // but aren't delivered. For more information, see Exactly-Once Processing - // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) - // in the Amazon SQS Developer Guide. - // - // * Every message must have a unique MessageDeduplicationId, - // - // You may provide a MessageDeduplicationId explicitly. - // - // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication - // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId - // using the body of the message (but not the attributes of the message). - // - // - // If you don't provide a MessageDeduplicationId and the queue doesn't have - // ContentBasedDeduplication set, the action fails with an error. - // - // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId - // overrides the generated one. - // - // * When ContentBasedDeduplication is in effect, messages with identical - // content sent within the deduplication interval are treated as duplicates - // and only one copy of the message is delivered. - // - // * You can also use ContentBasedDeduplication for messages with identical - // content to be treated as duplicates. - // - // * If you send one message with ContentBasedDeduplication enabled and then - // another message with a MessageDeduplicationId that is the same as the - // one generated for the first MessageDeduplicationId, the two messages are - // treated as duplicates and only one copy of the message is delivered. - // - // The MessageDeduplicationId is available to the recipient of the message (this - // can be useful for troubleshooting delivery issues). - // - // If a message is sent successfully but the acknowledgement is lost and the - // message is resent with the same MessageDeduplicationId after the deduplication - // interval, Amazon SQS can't detect duplicate messages. - // - // The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId - // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). - // - // For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId - // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-messagededuplicationid-property) - // in the Amazon Simple Queue Service Developer Guide. - MessageDeduplicationId *string `type:"string"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // The tag that specifies that a message belongs to a specific message group. - // Messages that belong to the same message group are processed in a FIFO manner - // (however, messages in different message groups might be processed out of - // order). To interleave multiple ordered streams within a single queue, use - // MessageGroupId values (for example, session data for multiple users). In - // this scenario, multiple readers can process the queue, but the session data - // of each user is processed in a FIFO fashion. - // - // * You must associate a non-empty MessageGroupId with a message. If you - // don't provide a MessageGroupId, the action fails. - // - // * ReceiveMessage might return messages with multiple MessageGroupId values. - // For each MessageGroupId, the messages are sorted by time sent. The caller - // can't specify a MessageGroupId. - // - // The length of MessageGroupId is 128 characters. Valid values are alphanumeric - // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). - // - // For best practices of using MessageGroupId, see Using the MessageGroupId - // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-messagegroupid-property) - // in the Amazon Simple Queue Service Developer Guide. - MessageGroupId *string `type:"string"` -} - -// String returns the string representation -func (s SendMessageBatchRequestEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendMessageBatchRequestEntry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendMessageBatchRequestEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendMessageBatchRequestEntry"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.MessageBody == nil { - invalidParams.Add(request.NewErrParamRequired("MessageBody")) - } - if s.MessageAttributes != nil { - for i, v := range s.MessageAttributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDelaySeconds sets the DelaySeconds field's value. -func (s *SendMessageBatchRequestEntry) SetDelaySeconds(v int64) *SendMessageBatchRequestEntry { - s.DelaySeconds = &v - return s -} - -// SetId sets the Id field's value. -func (s *SendMessageBatchRequestEntry) SetId(v string) *SendMessageBatchRequestEntry { - s.Id = &v - return s -} - -// SetMessageAttributes sets the MessageAttributes field's value. -func (s *SendMessageBatchRequestEntry) SetMessageAttributes(v map[string]*MessageAttributeValue) *SendMessageBatchRequestEntry { - s.MessageAttributes = v - return s -} - -// SetMessageBody sets the MessageBody field's value. -func (s *SendMessageBatchRequestEntry) SetMessageBody(v string) *SendMessageBatchRequestEntry { - s.MessageBody = &v - return s -} - -// SetMessageDeduplicationId sets the MessageDeduplicationId field's value. -func (s *SendMessageBatchRequestEntry) SetMessageDeduplicationId(v string) *SendMessageBatchRequestEntry { - s.MessageDeduplicationId = &v - return s -} - -// SetMessageGroupId sets the MessageGroupId field's value. -func (s *SendMessageBatchRequestEntry) SetMessageGroupId(v string) *SendMessageBatchRequestEntry { - s.MessageGroupId = &v - return s -} - -// Encloses a MessageId for a successfully-enqueued message in a SendMessageBatch. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageBatchResultEntry -type SendMessageBatchResultEntry struct { - _ struct{} `type:"structure"` - - // An identifier for the message in this batch. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // An MD5 digest of the non-URL-encoded message attribute string. You can use - // this attribute to verify that Amazon SQS received the message correctly. - // Amazon SQS URL-decodes the message before creating the MD5 digest. For information - // on MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). - MD5OfMessageAttributes *string `type:"string"` - - // An MD5 digest of the non-URL-encoded message attribute string. You can use - // this attribute to verify that Amazon SQS received the message correctly. - // Amazon SQS URL-decodes the message before creating the MD5 digest. For information - // on MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). - // - // MD5OfMessageBody is a required field - MD5OfMessageBody *string `type:"string" required:"true"` - - // An identifier for the message. - // - // MessageId is a required field - MessageId *string `type:"string" required:"true"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // A large, non-consecutive number that Amazon SQS assigns to each message. - // - // The length of SequenceNumber is 128 bits. As SequenceNumber continues to - // increase for a particular MessageGroupId. - SequenceNumber *string `type:"string"` -} - -// String returns the string representation -func (s SendMessageBatchResultEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendMessageBatchResultEntry) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *SendMessageBatchResultEntry) SetId(v string) *SendMessageBatchResultEntry { - s.Id = &v - return s -} - -// SetMD5OfMessageAttributes sets the MD5OfMessageAttributes field's value. -func (s *SendMessageBatchResultEntry) SetMD5OfMessageAttributes(v string) *SendMessageBatchResultEntry { - s.MD5OfMessageAttributes = &v - return s -} - -// SetMD5OfMessageBody sets the MD5OfMessageBody field's value. -func (s *SendMessageBatchResultEntry) SetMD5OfMessageBody(v string) *SendMessageBatchResultEntry { - s.MD5OfMessageBody = &v - return s -} - -// SetMessageId sets the MessageId field's value. -func (s *SendMessageBatchResultEntry) SetMessageId(v string) *SendMessageBatchResultEntry { - s.MessageId = &v - return s -} - -// SetSequenceNumber sets the SequenceNumber field's value. -func (s *SendMessageBatchResultEntry) SetSequenceNumber(v string) *SendMessageBatchResultEntry { - s.SequenceNumber = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageRequest -type SendMessageInput struct { - _ struct{} `type:"structure"` - - // The number of seconds to delay a specific message. Valid values: 0 to 900. - // Maximum: 15 minutes. Messages with a positive DelaySeconds value become available - // for processing after the delay period is finished. If you don't specify a - // value, the default value for the queue applies. - // - // When you set FifoQueue, you can't set DelaySeconds per message. You can set - // this parameter only on a queue level. - DelaySeconds *int64 `type:"integer"` - - // Each message attribute consists of a Name, Type, and Value. For more information, - // see Message Attribute Items and Validation (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html#message-attributes-items-validation) - // in the Amazon SQS Developer Guide. - MessageAttributes map[string]*MessageAttributeValue `locationName:"MessageAttribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true"` - - // The message to send. The maximum string size is 256 KB. - // - // The following list shows the characters (in Unicode) that are allowed in - // your message, according to the W3C XML specification: - // - // #x9 - // - // #xA - // - // #xD - // - // #x20 to #xD7FF - // - // #xE000 to #xFFFD - // - // #x10000 to #x10FFFF - // - // For more information, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). - // If you send any characters that aren't included in this list, your request - // is rejected. - // - // MessageBody is a required field - MessageBody *string `type:"string" required:"true"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // The token used for deduplication of sent messages. If a message with a particular - // MessageDeduplicationId is sent successfully, any messages sent with the same - // MessageDeduplicationId are accepted successfully but aren't delivered during - // the 5-minute deduplication interval. For more information, see Exactly-Once - // Processing (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) - // in the Amazon SQS Developer Guide. - // - // * Every message must have a unique MessageDeduplicationId, - // - // You may provide a MessageDeduplicationId explicitly. - // - // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication - // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId - // using the body of the message (but not the attributes of the message). - // - // - // If you don't provide a MessageDeduplicationId and the queue doesn't have - // ContentBasedDeduplication set, the action fails with an error. - // - // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId - // overrides the generated one. - // - // * When ContentBasedDeduplication is in effect, messages with identical - // content sent within the deduplication interval are treated as duplicates - // and only one copy of the message is delivered. - // - // * You can also use ContentBasedDeduplication for messages with identical - // content to be treated as duplicates. - // - // * If you send one message with ContentBasedDeduplication enabled and then - // another message with a MessageDeduplicationId that is the same as the - // one generated for the first MessageDeduplicationId, the two messages are - // treated as duplicates and only one copy of the message is delivered. - // - // The MessageDeduplicationId is available to the recipient of the message (this - // can be useful for troubleshooting delivery issues). - // - // If a message is sent successfully but the acknowledgement is lost and the - // message is resent with the same MessageDeduplicationId after the deduplication - // interval, Amazon SQS can't detect duplicate messages. - // - // The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId - // can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). - // - // For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId - // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-messagededuplicationid-property) - // in the Amazon Simple Queue Service Developer Guide. - MessageDeduplicationId *string `type:"string"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // The tag that specifies that a message belongs to a specific message group. - // Messages that belong to the same message group are processed in a FIFO manner - // (however, messages in different message groups might be processed out of - // order). To interleave multiple ordered streams within a single queue, use - // MessageGroupId values (for example, session data for multiple users). In - // this scenario, multiple readers can process the queue, but the session data - // of each user is processed in a FIFO fashion. - // - // * You must associate a non-empty MessageGroupId with a message. If you - // don't provide a MessageGroupId, the action fails. - // - // * ReceiveMessage might return messages with multiple MessageGroupId values. - // For each MessageGroupId, the messages are sorted by time sent. The caller - // can't specify a MessageGroupId. - // - // The length of MessageGroupId is 128 characters. Valid values are alphanumeric - // characters and punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). - // - // For best practices of using MessageGroupId, see Using the MessageGroupId - // Property (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queue-recommendations.html#using-messagegroupid-property) - // in the Amazon Simple Queue Service Developer Guide. - MessageGroupId *string `type:"string"` - - // The URL of the Amazon SQS queue to which a message is sent. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SendMessageInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendMessageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendMessageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendMessageInput"} - if s.MessageBody == nil { - invalidParams.Add(request.NewErrParamRequired("MessageBody")) - } - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - if s.MessageAttributes != nil { - for i, v := range s.MessageAttributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MessageAttributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDelaySeconds sets the DelaySeconds field's value. -func (s *SendMessageInput) SetDelaySeconds(v int64) *SendMessageInput { - s.DelaySeconds = &v - return s -} - -// SetMessageAttributes sets the MessageAttributes field's value. -func (s *SendMessageInput) SetMessageAttributes(v map[string]*MessageAttributeValue) *SendMessageInput { - s.MessageAttributes = v - return s -} - -// SetMessageBody sets the MessageBody field's value. -func (s *SendMessageInput) SetMessageBody(v string) *SendMessageInput { - s.MessageBody = &v - return s -} - -// SetMessageDeduplicationId sets the MessageDeduplicationId field's value. -func (s *SendMessageInput) SetMessageDeduplicationId(v string) *SendMessageInput { - s.MessageDeduplicationId = &v - return s -} - -// SetMessageGroupId sets the MessageGroupId field's value. -func (s *SendMessageInput) SetMessageGroupId(v string) *SendMessageInput { - s.MessageGroupId = &v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *SendMessageInput) SetQueueUrl(v string) *SendMessageInput { - s.QueueUrl = &v - return s -} - -// The MD5OfMessageBody and MessageId elements. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SendMessageResult -type SendMessageOutput struct { - _ struct{} `type:"structure"` - - // An MD5 digest of the non-URL-encoded message attribute string. You can use - // this attribute to verify that Amazon SQS received the message correctly. - // Amazon SQS URL-decodes the message before creating the MD5 digest. For information - // on MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). - MD5OfMessageAttributes *string `type:"string"` - - // An MD5 digest of the non-URL-encoded message attribute string. You can use - // this attribute to verify that Amazon SQS received the message correctly. - // Amazon SQS URL-decodes the message before creating the MD5 digest. For information - // on MD5, see RFC1321 (https://www.ietf.org/rfc/rfc1321.txt). - MD5OfMessageBody *string `type:"string"` - - // An attribute containing the MessageId of the message sent to the queue. For - // more information, see Queue and Message Identifiers (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) - // in the Amazon SQS Developer Guide. - MessageId *string `type:"string"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // A large, non-consecutive number that Amazon SQS assigns to each message. - // - // The length of SequenceNumber is 128 bits. SequenceNumber continues to increase - // for a particular MessageGroupId. - SequenceNumber *string `type:"string"` -} - -// String returns the string representation -func (s SendMessageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SendMessageOutput) GoString() string { - return s.String() -} - -// SetMD5OfMessageAttributes sets the MD5OfMessageAttributes field's value. -func (s *SendMessageOutput) SetMD5OfMessageAttributes(v string) *SendMessageOutput { - s.MD5OfMessageAttributes = &v - return s -} - -// SetMD5OfMessageBody sets the MD5OfMessageBody field's value. -func (s *SendMessageOutput) SetMD5OfMessageBody(v string) *SendMessageOutput { - s.MD5OfMessageBody = &v - return s -} - -// SetMessageId sets the MessageId field's value. -func (s *SendMessageOutput) SetMessageId(v string) *SendMessageOutput { - s.MessageId = &v - return s -} - -// SetSequenceNumber sets the SequenceNumber field's value. -func (s *SendMessageOutput) SetSequenceNumber(v string) *SendMessageOutput { - s.SequenceNumber = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributesRequest -type SetQueueAttributesInput struct { - _ struct{} `type:"structure"` - - // A map of attributes to set. - // - // The following lists the names, descriptions, and values of the special request - // parameters that the SetQueueAttributes action uses: - // - // * DelaySeconds - The number of seconds for which the delivery of all messages - // in the queue is delayed. Valid values: An integer from 0 to 900 (15 minutes). - // The default is 0 (zero). - // - // * MaximumMessageSize - The limit of how many bytes a message can contain - // before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes - // (1 KiB) up to 262,144 bytes (256 KiB). The default is 262,144 (256 KiB). - // - // - // * MessageRetentionPeriod - The number of seconds for which Amazon SQS - // retains a message. Valid values: An integer representing seconds, from - // 60 (1 minute) to 1,209,600 (14 days). The default is 345,600 (4 days). - // - // - // * Policy - The queue's policy. A valid AWS policy. For more information - // about policy structure, see Overview of AWS IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) - // in the Amazon IAM User Guide. - // - // * ReceiveMessageWaitTimeSeconds - The number of seconds for which a ReceiveMessage - // action waits for a message to arrive. Valid values: an integer from 0 - // to 20 (seconds). The default is 0. - // - // * RedrivePolicy - The parameters for the dead letter queue functionality - // of the source queue. For more information about the redrive policy and - // dead letter queues, see Using Amazon SQS Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) - // in the Amazon SQS Developer Guide. - // - // The dead letter queue of a FIFO queue must also be a FIFO queue. Similarly, - // the dead letter queue of a standard queue must also be a standard queue. - // - // * VisibilityTimeout - The visibility timeout for the queue. Valid values: - // an integer from 0 to 43,200 (12 hours). The default is 30. For more information - // about the visibility timeout, see Visibility Timeout (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - // in the Amazon SQS Developer Guide. - // - // The following attribute applies only to FIFO (first-in-first-out) queues - // (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): - // - // * ContentBasedDeduplication - Enables content-based deduplication. For - // more information, see Exactly-Once Processing (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) - // in the Amazon SQS Developer Guide. - // - // Every message must have a unique MessageDeduplicationId, - // - // You may provide a MessageDeduplicationId explicitly. - // - // If you aren't able to provide a MessageDeduplicationId and you enable ContentBasedDeduplication - // for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId - // using the body of the message (but not the attributes of the message). - // - // - // If you don't provide a MessageDeduplicationId and the queue doesn't have - // ContentBasedDeduplication set, the action fails with an error. - // - // If the queue has ContentBasedDeduplication set, your MessageDeduplicationId - // overrides the generated one. - // - // When ContentBasedDeduplication is in effect, messages with identical content - // sent within the deduplication interval are treated as duplicates and only - // one copy of the message is delivered. - // - // You can also use ContentBasedDeduplication for messages with identical content - // to be treated as duplicates. - // - // If you send one message with ContentBasedDeduplication enabled and then another - // message with a MessageDeduplicationId that is the same as the one generated - // for the first MessageDeduplicationId, the two messages are treated as - // duplicates and only one copy of the message is delivered. - // - // Any other valid special request parameters (such as the following) are ignored: - // - // * ApproximateNumberOfMessages - // - // * ApproximateNumberOfMessagesDelayed - // - // * ApproximateNumberOfMessagesNotVisible - // - // * CreatedTimestamp - // - // * LastModifiedTimestamp - // - // * QueueArn - // - // Attributes is a required field - Attributes map[string]*string `locationName:"Attribute" locationNameKey:"Name" locationNameValue:"Value" type:"map" flattened:"true" required:"true"` - - // The URL of the Amazon SQS queue whose attributes are set. - // - // Queue URLs are case-sensitive. - // - // QueueUrl is a required field - QueueUrl *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SetQueueAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetQueueAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetQueueAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetQueueAttributesInput"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.QueueUrl == nil { - invalidParams.Add(request.NewErrParamRequired("QueueUrl")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *SetQueueAttributesInput) SetAttributes(v map[string]*string) *SetQueueAttributesInput { - s.Attributes = v - return s -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *SetQueueAttributesInput) SetQueueUrl(v string) *SetQueueAttributesInput { - s.QueueUrl = &v - return s -} - -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05/SetQueueAttributesOutput -type SetQueueAttributesOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s SetQueueAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetQueueAttributesOutput) GoString() string { - return s.String() -} - -const ( - // MessageSystemAttributeNameSenderId is a MessageSystemAttributeName enum value - MessageSystemAttributeNameSenderId = "SenderId" - - // MessageSystemAttributeNameSentTimestamp is a MessageSystemAttributeName enum value - MessageSystemAttributeNameSentTimestamp = "SentTimestamp" - - // MessageSystemAttributeNameApproximateReceiveCount is a MessageSystemAttributeName enum value - MessageSystemAttributeNameApproximateReceiveCount = "ApproximateReceiveCount" - - // MessageSystemAttributeNameApproximateFirstReceiveTimestamp is a MessageSystemAttributeName enum value - MessageSystemAttributeNameApproximateFirstReceiveTimestamp = "ApproximateFirstReceiveTimestamp" - - // MessageSystemAttributeNameSequenceNumber is a MessageSystemAttributeName enum value - MessageSystemAttributeNameSequenceNumber = "SequenceNumber" - - // MessageSystemAttributeNameMessageDeduplicationId is a MessageSystemAttributeName enum value - MessageSystemAttributeNameMessageDeduplicationId = "MessageDeduplicationId" - - // MessageSystemAttributeNameMessageGroupId is a MessageSystemAttributeName enum value - MessageSystemAttributeNameMessageGroupId = "MessageGroupId" -) - -const ( - // QueueAttributeNameAll is a QueueAttributeName enum value - QueueAttributeNameAll = "All" - - // QueueAttributeNamePolicy is a QueueAttributeName enum value - QueueAttributeNamePolicy = "Policy" - - // QueueAttributeNameVisibilityTimeout is a QueueAttributeName enum value - QueueAttributeNameVisibilityTimeout = "VisibilityTimeout" - - // QueueAttributeNameMaximumMessageSize is a QueueAttributeName enum value - QueueAttributeNameMaximumMessageSize = "MaximumMessageSize" - - // QueueAttributeNameMessageRetentionPeriod is a QueueAttributeName enum value - QueueAttributeNameMessageRetentionPeriod = "MessageRetentionPeriod" - - // QueueAttributeNameApproximateNumberOfMessages is a QueueAttributeName enum value - QueueAttributeNameApproximateNumberOfMessages = "ApproximateNumberOfMessages" - - // QueueAttributeNameApproximateNumberOfMessagesNotVisible is a QueueAttributeName enum value - QueueAttributeNameApproximateNumberOfMessagesNotVisible = "ApproximateNumberOfMessagesNotVisible" - - // QueueAttributeNameCreatedTimestamp is a QueueAttributeName enum value - QueueAttributeNameCreatedTimestamp = "CreatedTimestamp" - - // QueueAttributeNameLastModifiedTimestamp is a QueueAttributeName enum value - QueueAttributeNameLastModifiedTimestamp = "LastModifiedTimestamp" - - // QueueAttributeNameQueueArn is a QueueAttributeName enum value - QueueAttributeNameQueueArn = "QueueArn" - - // QueueAttributeNameApproximateNumberOfMessagesDelayed is a QueueAttributeName enum value - QueueAttributeNameApproximateNumberOfMessagesDelayed = "ApproximateNumberOfMessagesDelayed" - - // QueueAttributeNameDelaySeconds is a QueueAttributeName enum value - QueueAttributeNameDelaySeconds = "DelaySeconds" - - // QueueAttributeNameReceiveMessageWaitTimeSeconds is a QueueAttributeName enum value - QueueAttributeNameReceiveMessageWaitTimeSeconds = "ReceiveMessageWaitTimeSeconds" - - // QueueAttributeNameRedrivePolicy is a QueueAttributeName enum value - QueueAttributeNameRedrivePolicy = "RedrivePolicy" - - // QueueAttributeNameFifoQueue is a QueueAttributeName enum value - QueueAttributeNameFifoQueue = "FifoQueue" - - // QueueAttributeNameContentBasedDeduplication is a QueueAttributeName enum value - QueueAttributeNameContentBasedDeduplication = "ContentBasedDeduplication" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/api_test.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/api_test.go deleted file mode 100644 index 4cec778..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/api_test.go +++ /dev/null @@ -1,30 +0,0 @@ -// +build integration - -package sqs_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/awstesting/unit" - "github.com/aws/aws-sdk-go/service/sqs" -) - -func TestFlattenedTraits(t *testing.T) { - s := sqs.New(unit.Session) - _, err := s.DeleteMessageBatch(&sqs.DeleteMessageBatchInput{ - QueueURL: aws.String("QUEUE"), - Entries: []*sqs.DeleteMessageBatchRequestEntry{ - { - ID: aws.String("TEST"), - ReceiptHandle: aws.String("RECEIPT"), - }, - }, - }) - - assert.Error(t, err) - assert.Equal(t, "InvalidAddress", err.Code()) - assert.Equal(t, "The address QUEUE is not valid for this endpoint.", err.Message()) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums.go deleted file mode 100644 index 5dd17c4..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums.go +++ /dev/null @@ -1,115 +0,0 @@ -package sqs - -import ( - "crypto/md5" - "encoding/hex" - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -var ( - errChecksumMissingBody = fmt.Errorf("cannot compute checksum. missing body") - errChecksumMissingMD5 = fmt.Errorf("cannot verify checksum. missing response MD5") -) - -func setupChecksumValidation(r *request.Request) { - if aws.BoolValue(r.Config.DisableComputeChecksums) { - return - } - - switch r.Operation.Name { - case opSendMessage: - r.Handlers.Unmarshal.PushBack(verifySendMessage) - case opSendMessageBatch: - r.Handlers.Unmarshal.PushBack(verifySendMessageBatch) - case opReceiveMessage: - r.Handlers.Unmarshal.PushBack(verifyReceiveMessage) - } -} - -func verifySendMessage(r *request.Request) { - if r.DataFilled() && r.ParamsFilled() { - in := r.Params.(*SendMessageInput) - out := r.Data.(*SendMessageOutput) - err := checksumsMatch(in.MessageBody, out.MD5OfMessageBody) - if err != nil { - setChecksumError(r, err.Error()) - } - } -} - -func verifySendMessageBatch(r *request.Request) { - if r.DataFilled() && r.ParamsFilled() { - entries := map[string]*SendMessageBatchResultEntry{} - ids := []string{} - - out := r.Data.(*SendMessageBatchOutput) - for _, entry := range out.Successful { - entries[*entry.Id] = entry - } - - in := r.Params.(*SendMessageBatchInput) - for _, entry := range in.Entries { - if e := entries[*entry.Id]; e != nil { - err := checksumsMatch(entry.MessageBody, e.MD5OfMessageBody) - if err != nil { - ids = append(ids, *e.MessageId) - } - } - } - if len(ids) > 0 { - setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", ")) - } - } -} - -func verifyReceiveMessage(r *request.Request) { - if r.DataFilled() && r.ParamsFilled() { - ids := []string{} - out := r.Data.(*ReceiveMessageOutput) - for i, msg := range out.Messages { - err := checksumsMatch(msg.Body, msg.MD5OfBody) - if err != nil { - if msg.MessageId == nil { - if r.Config.Logger != nil { - r.Config.Logger.Log(fmt.Sprintf( - "WARN: SQS.ReceiveMessage failed checksum request id: %s, message %d has no message ID.", - r.RequestID, i, - )) - } - continue - } - - ids = append(ids, *msg.MessageId) - } - } - if len(ids) > 0 { - setChecksumError(r, "invalid messages: %s", strings.Join(ids, ", ")) - } - } -} - -func checksumsMatch(body, expectedMD5 *string) error { - if body == nil { - return errChecksumMissingBody - } else if expectedMD5 == nil { - return errChecksumMissingMD5 - } - - msum := md5.Sum([]byte(*body)) - sum := hex.EncodeToString(msum[:]) - if sum != *expectedMD5 { - return fmt.Errorf("expected MD5 checksum '%s', got '%s'", *expectedMD5, sum) - } - - return nil -} - -func setChecksumError(r *request.Request, format string, args ...interface{}) { - r.Retryable = aws.Bool(true) - r.Error = awserr.New("InvalidChecksum", fmt.Sprintf(format, args...), nil) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums_test.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums_test.go deleted file mode 100644 index c7451c7..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/checksums_test.go +++ /dev/null @@ -1,208 +0,0 @@ -package sqs_test - -import ( - "bytes" - "io/ioutil" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - - "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/sqs" -) - -var svc = func() *sqs.SQS { - s := sqs.New(unit.Session, &aws.Config{ - DisableParamValidation: aws.Bool(true), - }) - s.Handlers.Send.Clear() - return s -}() - -func TestSendMessageChecksum(t *testing.T) { - req, _ := svc.SendMessageRequest(&sqs.SendMessageInput{ - MessageBody: aws.String("test"), - }) - req.Handlers.Send.PushBack(func(r *request.Request) { - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.SendMessageOutput{ - MD5OfMessageBody: aws.String("098f6bcd4621d373cade4e832627b4f6"), - MessageId: aws.String("12345"), - } - }) - err := req.Send() - assert.NoError(t, err) -} - -func TestSendMessageChecksumInvalid(t *testing.T) { - req, _ := svc.SendMessageRequest(&sqs.SendMessageInput{ - MessageBody: aws.String("test"), - }) - req.Handlers.Send.PushBack(func(r *request.Request) { - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.SendMessageOutput{ - MD5OfMessageBody: aws.String("000"), - MessageId: aws.String("12345"), - } - }) - err := req.Send() - assert.Error(t, err) - - assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "expected MD5 checksum '000', got '098f6bcd4621d373cade4e832627b4f6'") -} - -func TestSendMessageChecksumInvalidNoValidation(t *testing.T) { - s := sqs.New(unit.Session, &aws.Config{ - DisableParamValidation: aws.Bool(true), - DisableComputeChecksums: aws.Bool(true), - }) - s.Handlers.Send.Clear() - - req, _ := s.SendMessageRequest(&sqs.SendMessageInput{ - MessageBody: aws.String("test"), - }) - req.Handlers.Send.PushBack(func(r *request.Request) { - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.SendMessageOutput{ - MD5OfMessageBody: aws.String("000"), - MessageId: aws.String("12345"), - } - }) - err := req.Send() - assert.NoError(t, err) -} - -func TestSendMessageChecksumNoInput(t *testing.T) { - req, _ := svc.SendMessageRequest(&sqs.SendMessageInput{}) - req.Handlers.Send.PushBack(func(r *request.Request) { - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.SendMessageOutput{} - }) - err := req.Send() - assert.Error(t, err) - - assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "cannot compute checksum. missing body") -} - -func TestSendMessageChecksumNoOutput(t *testing.T) { - req, _ := svc.SendMessageRequest(&sqs.SendMessageInput{ - MessageBody: aws.String("test"), - }) - req.Handlers.Send.PushBack(func(r *request.Request) { - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.SendMessageOutput{} - }) - err := req.Send() - assert.Error(t, err) - - assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "cannot verify checksum. missing response MD5") -} - -func TestRecieveMessageChecksum(t *testing.T) { - req, _ := svc.ReceiveMessageRequest(&sqs.ReceiveMessageInput{}) - req.Handlers.Send.PushBack(func(r *request.Request) { - md5 := "098f6bcd4621d373cade4e832627b4f6" - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.ReceiveMessageOutput{ - Messages: []*sqs.Message{ - {Body: aws.String("test"), MD5OfBody: &md5}, - {Body: aws.String("test"), MD5OfBody: &md5}, - {Body: aws.String("test"), MD5OfBody: &md5}, - {Body: aws.String("test"), MD5OfBody: &md5}, - }, - } - }) - err := req.Send() - assert.NoError(t, err) -} - -func TestRecieveMessageChecksumInvalid(t *testing.T) { - req, _ := svc.ReceiveMessageRequest(&sqs.ReceiveMessageInput{}) - req.Handlers.Send.PushBack(func(r *request.Request) { - md5 := "098f6bcd4621d373cade4e832627b4f6" - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.ReceiveMessageOutput{ - Messages: []*sqs.Message{ - {Body: aws.String("test"), MD5OfBody: &md5}, - {Body: aws.String("test"), MD5OfBody: aws.String("000"), MessageId: aws.String("123")}, - {Body: aws.String("test"), MD5OfBody: aws.String("000"), MessageId: aws.String("456")}, - {Body: aws.String("test"), MD5OfBody: aws.String("000")}, - {Body: aws.String("test"), MD5OfBody: &md5}, - }, - } - }) - err := req.Send() - assert.Error(t, err) - - assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "invalid messages: 123, 456") -} - -func TestSendMessageBatchChecksum(t *testing.T) { - req, _ := svc.SendMessageBatchRequest(&sqs.SendMessageBatchInput{ - Entries: []*sqs.SendMessageBatchRequestEntry{ - {Id: aws.String("1"), MessageBody: aws.String("test")}, - {Id: aws.String("2"), MessageBody: aws.String("test")}, - {Id: aws.String("3"), MessageBody: aws.String("test")}, - {Id: aws.String("4"), MessageBody: aws.String("test")}, - }, - }) - req.Handlers.Send.PushBack(func(r *request.Request) { - md5 := "098f6bcd4621d373cade4e832627b4f6" - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.SendMessageBatchOutput{ - Successful: []*sqs.SendMessageBatchResultEntry{ - {MD5OfMessageBody: &md5, MessageId: aws.String("123"), Id: aws.String("1")}, - {MD5OfMessageBody: &md5, MessageId: aws.String("456"), Id: aws.String("2")}, - {MD5OfMessageBody: &md5, MessageId: aws.String("789"), Id: aws.String("3")}, - {MD5OfMessageBody: &md5, MessageId: aws.String("012"), Id: aws.String("4")}, - }, - } - }) - err := req.Send() - assert.NoError(t, err) -} - -func TestSendMessageBatchChecksumInvalid(t *testing.T) { - req, _ := svc.SendMessageBatchRequest(&sqs.SendMessageBatchInput{ - Entries: []*sqs.SendMessageBatchRequestEntry{ - {Id: aws.String("1"), MessageBody: aws.String("test")}, - {Id: aws.String("2"), MessageBody: aws.String("test")}, - {Id: aws.String("3"), MessageBody: aws.String("test")}, - {Id: aws.String("4"), MessageBody: aws.String("test")}, - }, - }) - req.Handlers.Send.PushBack(func(r *request.Request) { - md5 := "098f6bcd4621d373cade4e832627b4f6" - body := ioutil.NopCloser(bytes.NewReader([]byte(""))) - r.HTTPResponse = &http.Response{StatusCode: 200, Body: body} - r.Data = &sqs.SendMessageBatchOutput{ - Successful: []*sqs.SendMessageBatchResultEntry{ - {MD5OfMessageBody: &md5, MessageId: aws.String("123"), Id: aws.String("1")}, - {MD5OfMessageBody: aws.String("000"), MessageId: aws.String("456"), Id: aws.String("2")}, - {MD5OfMessageBody: aws.String("000"), MessageId: aws.String("789"), Id: aws.String("3")}, - {MD5OfMessageBody: &md5, MessageId: aws.String("012"), Id: aws.String("4")}, - }, - } - }) - err := req.Send() - assert.Error(t, err) - - assert.Equal(t, "InvalidChecksum", err.(awserr.Error).Code()) - assert.Contains(t, err.(awserr.Error).Message(), "invalid messages: 456, 789") -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/customizations.go deleted file mode 100644 index 7498363..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/customizations.go +++ /dev/null @@ -1,9 +0,0 @@ -package sqs - -import "github.com/aws/aws-sdk-go/aws/request" - -func init() { - initRequest = func(r *request.Request) { - setupChecksumValidation(r) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go deleted file mode 100644 index 722867d..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/errors.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sqs - -const ( - - // ErrCodeBatchEntryIdsNotDistinct for service response error code - // "AWS.SimpleQueueService.BatchEntryIdsNotDistinct". - // - // Two or more batch entries in the request have the same Id. - ErrCodeBatchEntryIdsNotDistinct = "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" - - // ErrCodeBatchRequestTooLong for service response error code - // "AWS.SimpleQueueService.BatchRequestTooLong". - // - // The length of all the messages put together is more than the limit. - ErrCodeBatchRequestTooLong = "AWS.SimpleQueueService.BatchRequestTooLong" - - // ErrCodeEmptyBatchRequest for service response error code - // "AWS.SimpleQueueService.EmptyBatchRequest". - // - // The batch request doesn't contain any entries. - ErrCodeEmptyBatchRequest = "AWS.SimpleQueueService.EmptyBatchRequest" - - // ErrCodeInvalidAttributeName for service response error code - // "InvalidAttributeName". - // - // The attribute referred to doesn't exist. - ErrCodeInvalidAttributeName = "InvalidAttributeName" - - // ErrCodeInvalidBatchEntryId for service response error code - // "AWS.SimpleQueueService.InvalidBatchEntryId". - // - // The Id of a batch entry in a batch request doesn't abide by the specification. - ErrCodeInvalidBatchEntryId = "AWS.SimpleQueueService.InvalidBatchEntryId" - - // ErrCodeInvalidIdFormat for service response error code - // "InvalidIdFormat". - // - // The receipt handle isn't valid for the current version. - ErrCodeInvalidIdFormat = "InvalidIdFormat" - - // ErrCodeInvalidMessageContents for service response error code - // "InvalidMessageContents". - // - // The message contains characters outside the allowed set. - ErrCodeInvalidMessageContents = "InvalidMessageContents" - - // ErrCodeMessageNotInflight for service response error code - // "AWS.SimpleQueueService.MessageNotInflight". - // - // The message referred to isn't in flight. - ErrCodeMessageNotInflight = "AWS.SimpleQueueService.MessageNotInflight" - - // ErrCodeOverLimit for service response error code - // "OverLimit". - // - // The action that you requested would violate a limit. For example, ReceiveMessage - // returns this error if the maximum number of inflight messages is reached. - // AddPermission returns this error if the maximum number of permissions for - // the queue is reached. - ErrCodeOverLimit = "OverLimit" - - // ErrCodePurgeQueueInProgress for service response error code - // "AWS.SimpleQueueService.PurgeQueueInProgress". - // - // Indicates that the specified queue previously received a PurgeQueue request - // within the last 60 seconds (the time it can take to delete the messages in - // the queue). - ErrCodePurgeQueueInProgress = "AWS.SimpleQueueService.PurgeQueueInProgress" - - // ErrCodeQueueDeletedRecently for service response error code - // "AWS.SimpleQueueService.QueueDeletedRecently". - // - // You must wait 60 seconds after deleting a queue before you can create another - // one with the same name. - ErrCodeQueueDeletedRecently = "AWS.SimpleQueueService.QueueDeletedRecently" - - // ErrCodeQueueDoesNotExist for service response error code - // "AWS.SimpleQueueService.NonExistentQueue". - // - // The queue referred to doesn't exist. - ErrCodeQueueDoesNotExist = "AWS.SimpleQueueService.NonExistentQueue" - - // ErrCodeQueueNameExists for service response error code - // "QueueAlreadyExists". - // - // A queue already exists with this name. Amazon SQS returns this error only - // if the request includes attributes whose values differ from those of the - // existing queue. - ErrCodeQueueNameExists = "QueueAlreadyExists" - - // ErrCodeReceiptHandleIsInvalid for service response error code - // "ReceiptHandleIsInvalid". - // - // The receipt handle provided isn't valid. - ErrCodeReceiptHandleIsInvalid = "ReceiptHandleIsInvalid" - - // ErrCodeTooManyEntriesInBatchRequest for service response error code - // "AWS.SimpleQueueService.TooManyEntriesInBatchRequest". - // - // The batch request contains more entries than permissible. - ErrCodeTooManyEntriesInBatchRequest = "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" - - // ErrCodeUnsupportedOperation for service response error code - // "AWS.SimpleQueueService.UnsupportedOperation". - // - // Error code 400. Unsupported operation. - ErrCodeUnsupportedOperation = "AWS.SimpleQueueService.UnsupportedOperation" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/examples_test.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/examples_test.go deleted file mode 100644 index d39e328..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/examples_test.go +++ /dev/null @@ -1,472 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sqs_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/sqs" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleSQS_AddPermission() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.AddPermissionInput{ - AWSAccountIds: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - Actions: []*string{ // Required - aws.String("String"), // Required - // More values... - }, - Label: aws.String("String"), // Required - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.AddPermission(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_ChangeMessageVisibility() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.ChangeMessageVisibilityInput{ - QueueUrl: aws.String("String"), // Required - ReceiptHandle: aws.String("String"), // Required - VisibilityTimeout: aws.Int64(1), // Required - } - resp, err := svc.ChangeMessageVisibility(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_ChangeMessageVisibilityBatch() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.ChangeMessageVisibilityBatchInput{ - Entries: []*sqs.ChangeMessageVisibilityBatchRequestEntry{ // Required - { // Required - Id: aws.String("String"), // Required - ReceiptHandle: aws.String("String"), // Required - VisibilityTimeout: aws.Int64(1), - }, - // More values... - }, - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.ChangeMessageVisibilityBatch(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_CreateQueue() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.CreateQueueInput{ - QueueName: aws.String("String"), // Required - Attributes: map[string]*string{ - "Key": aws.String("String"), // Required - // More values... - }, - } - resp, err := svc.CreateQueue(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_DeleteMessage() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.DeleteMessageInput{ - QueueUrl: aws.String("String"), // Required - ReceiptHandle: aws.String("String"), // Required - } - resp, err := svc.DeleteMessage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_DeleteMessageBatch() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.DeleteMessageBatchInput{ - Entries: []*sqs.DeleteMessageBatchRequestEntry{ // Required - { // Required - Id: aws.String("String"), // Required - ReceiptHandle: aws.String("String"), // Required - }, - // More values... - }, - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.DeleteMessageBatch(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_DeleteQueue() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.DeleteQueueInput{ - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.DeleteQueue(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_GetQueueAttributes() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.GetQueueAttributesInput{ - QueueUrl: aws.String("String"), // Required - AttributeNames: []*string{ - aws.String("QueueAttributeName"), // Required - // More values... - }, - } - resp, err := svc.GetQueueAttributes(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_GetQueueUrl() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.GetQueueUrlInput{ - QueueName: aws.String("String"), // Required - QueueOwnerAWSAccountId: aws.String("String"), - } - resp, err := svc.GetQueueUrl(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_ListDeadLetterSourceQueues() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.ListDeadLetterSourceQueuesInput{ - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.ListDeadLetterSourceQueues(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_ListQueues() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.ListQueuesInput{ - QueueNamePrefix: aws.String("String"), - } - resp, err := svc.ListQueues(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_PurgeQueue() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.PurgeQueueInput{ - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.PurgeQueue(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_ReceiveMessage() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.ReceiveMessageInput{ - QueueUrl: aws.String("String"), // Required - AttributeNames: []*string{ - aws.String("QueueAttributeName"), // Required - // More values... - }, - MaxNumberOfMessages: aws.Int64(1), - MessageAttributeNames: []*string{ - aws.String("MessageAttributeName"), // Required - // More values... - }, - ReceiveRequestAttemptId: aws.String("String"), - VisibilityTimeout: aws.Int64(1), - WaitTimeSeconds: aws.Int64(1), - } - resp, err := svc.ReceiveMessage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_RemovePermission() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.RemovePermissionInput{ - Label: aws.String("String"), // Required - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.RemovePermission(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_SendMessage() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.SendMessageInput{ - MessageBody: aws.String("String"), // Required - QueueUrl: aws.String("String"), // Required - DelaySeconds: aws.Int64(1), - MessageAttributes: map[string]*sqs.MessageAttributeValue{ - "Key": { // Required - DataType: aws.String("String"), // Required - BinaryListValues: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - BinaryValue: []byte("PAYLOAD"), - StringListValues: []*string{ - aws.String("String"), // Required - // More values... - }, - StringValue: aws.String("String"), - }, - // More values... - }, - MessageDeduplicationId: aws.String("String"), - MessageGroupId: aws.String("String"), - } - resp, err := svc.SendMessage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_SendMessageBatch() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.SendMessageBatchInput{ - Entries: []*sqs.SendMessageBatchRequestEntry{ // Required - { // Required - Id: aws.String("String"), // Required - MessageBody: aws.String("String"), // Required - DelaySeconds: aws.Int64(1), - MessageAttributes: map[string]*sqs.MessageAttributeValue{ - "Key": { // Required - DataType: aws.String("String"), // Required - BinaryListValues: [][]byte{ - []byte("PAYLOAD"), // Required - // More values... - }, - BinaryValue: []byte("PAYLOAD"), - StringListValues: []*string{ - aws.String("String"), // Required - // More values... - }, - StringValue: aws.String("String"), - }, - // More values... - }, - MessageDeduplicationId: aws.String("String"), - MessageGroupId: aws.String("String"), - }, - // More values... - }, - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.SendMessageBatch(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSQS_SetQueueAttributes() { - sess := session.Must(session.NewSession()) - - svc := sqs.New(sess) - - params := &sqs.SetQueueAttributesInput{ - Attributes: map[string]*string{ // Required - "Key": aws.String("String"), // Required - // More values... - }, - QueueUrl: aws.String("String"), // Required - } - resp, err := svc.SetQueueAttributes(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go b/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go deleted file mode 100644 index 0fee951..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sqs - -import ( - "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/private/protocol/query" -) - -// Welcome to the Amazon Simple Queue Service API Reference. -// -// Amazon Simple Queue Service (Amazon SQS) is a reliable, highly-scalable hosted -// queue for storing messages as they travel between applications or microservices. -// Amazon SQS moves data between distributed application components and helps -// you decouple these components. -// -// Standard queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) -// are available in all regions. FIFO queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html) -// are available in US West (Oregon) and US East (Ohio). -// -// You can use AWS SDKs (http://aws.amazon.com/tools/#sdk) to access Amazon -// SQS using your favorite programming language. The SDKs perform tasks such -// as the following automatically: -// -// * Cryptographically sign your service requests -// -// * Retry requests -// -// * Handle error responses -// -// Additional Information -// -// * Amazon SQS Product Page (http://aws.amazon.com/sqs/) -// -// * Amazon SQS Developer Guide -// -// Making API Requests (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MakingRequestsArticle.html) -// -// Using Amazon SQS Message Attributes (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html) -// -// Using Amazon SQS Dead Letter Queues (http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) -// -// * Amazon Web Services General Reference -// -// Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sqs_region) -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sqs-2012-11-05 -type SQS struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "sqs" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. -) - -// New creates a new instance of the SQS 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: -// // Create a SQS client from just a session. -// svc := sqs.New(mySession) -// -// // Create a SQS client with additional configuration -// svc := sqs.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SQS { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SQS { - svc := &SQS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2012-11-05", - }, - 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) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SQS operation and runs any -// custom request initialization. -func (c *SQS) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go index 19dd0bf..7f60d4a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go @@ -1,13 +1,14 @@ // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. -// Package sts provides a client for AWS Security Token Service. package sts import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" ) @@ -15,19 +16,18 @@ const opAssumeRole = "AssumeRole" // AssumeRoleRequest generates a "aws/request.Request" representing the // client's request for the AssumeRole operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. +// value will be populated with the request's response once the request completes +// successfully. // -// See AssumeRole for usage and error information. +// 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. // -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssumeRole method directly -// instead. +// See AssumeRole for more information on using the AssumeRole +// 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. // -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. // // // Example sending a request using the AssumeRoleRequest method. // req, resp := client.AssumeRoleRequest(params) @@ -37,7 +37,7 @@ const opAssumeRole = "AssumeRole" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) { op := &request.Operation{ Name: opAssumeRole, @@ -56,95 +56,123 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // AssumeRole API operation for AWS Security Token Service. // -// Returns a set of temporary security credentials (consisting of an access -// key ID, a secret access key, and a security token) that you can use to access -// AWS resources that you might not normally have access to. Typically, you -// use AssumeRole for cross-account access or federation. For a comparison of -// AssumeRole with the other APIs that produce temporary credentials, see Requesting -// Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// Returns a set of temporary security credentials that you can use to access +// AWS resources that you might not normally have access to. These temporary +// credentials consist of an access key ID, a secret access key, and a security +// token. Typically, you use AssumeRole within your account or for cross-account +// access. For a comparison of AssumeRole with other API operations that produce +// temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // -// Important: You cannot call AssumeRole by using AWS root account credentials; -// access is denied. You must use credentials for an IAM user or an IAM role -// to call AssumeRole. +// You cannot use AWS account root user credentials to call AssumeRole. You +// must use credentials for an IAM user or an IAM role to call AssumeRole. // // For cross-account access, imagine that you own multiple accounts and need // to access resources in each account. You could create long-term credentials // in each account to access those resources. However, managing all those credentials // and remembering which one can access which account can be time consuming. -// Instead, you can create one set of long-term credentials in one account and -// then use temporary security credentials to access all the other accounts +// Instead, you can create one set of long-term credentials in one account. +// Then use temporary security credentials to access all the other accounts // by assuming roles in those accounts. For more information about roles, see -// IAM Roles (Delegation and Federation) (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html) +// IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) // in the IAM User Guide. // -// For federation, you can, for example, grant single sign-on access to the -// AWS Management Console. If you already have an identity and authentication -// system in your corporate network, you don't have to recreate user identities -// in AWS in order to grant those user identities access to AWS. Instead, after -// a user has been authenticated, you call AssumeRole (and specify the role -// with the appropriate permissions) to get temporary security credentials for -// that user. With those temporary security credentials, you construct a sign-in -// URL that users can use to access the console. For more information, see Common -// Scenarios for Temporary Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction) +// Session Duration +// +// By default, the temporary security credentials created by AssumeRole last +// for one hour. However, you can use the optional DurationSeconds parameter +// to specify the duration of your session. You can provide a value from 900 +// seconds (15 minutes) up to the maximum session duration setting for the role. +// This setting can have a value from 1 hour to 12 hours. To learn how to view +// the maximum value for your role, see View the Maximum Session Duration Setting +// for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) +// in the IAM User Guide. The maximum session duration limit applies when you +// use the AssumeRole* API operations or the assume-role* CLI commands. However +// the limit does not apply when you use those operations to create a console +// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // -// The temporary security credentials are valid for the duration that you specified -// when calling AssumeRole, which can be from 900 seconds (15 minutes) to a -// maximum of 3600 seconds (1 hour). The default is 1 hour. +// Permissions // // The temporary security credentials created by AssumeRole can be used to make -// API calls to any AWS service with the following exception: you cannot call -// the STS service's GetFederationToken or GetSessionToken APIs. -// -// Optionally, you can pass an IAM access policy to this operation. If you choose -// not to pass a policy, the temporary security credentials that are returned -// by the operation have the permissions that are defined in the access policy -// of the role that is being assumed. If you pass a policy to this operation, -// the temporary security credentials that are returned by the operation have -// the permissions that are allowed by both the access policy of the role that -// is being assumed, and the policy that you pass. This gives you a way to further -// restrict the permissions for the resulting temporary security credentials. -// You cannot use the passed policy to grant permissions that are in excess -// of those allowed by the access policy of the role that is being assumed. -// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, -// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) +// API calls to any AWS service with the following exception: You cannot call +// the AWS STS GetFederationToken or GetSessionToken API operations. +// +// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policies to +// use as managed session policies. The plain text that you use for both inline +// and managed session policies can't exceed 2,048 characters. Passing policies +// to this operation returns new temporary credentials. The resulting session's +// permissions are the intersection of the role's identity-based policy and +// the session policies. You can use the role's temporary credentials in subsequent +// AWS API calls to access resources in the account that owns the role. You +// cannot use session policies to grant more permissions than those allowed +// by the identity-based policy of the role that is being assumed. For more +// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. +// +// To assume a role from a different account, your AWS account must be trusted +// by the role. The trust relationship is defined in the role's trust policy +// when the role is created. That trust policy states which accounts are allowed +// to delegate that access to users in the account. +// +// A user who wants to access a role in a different account must also have permissions +// that are delegated from the user account administrator. The administrator +// must attach a policy that allows the user to call AssumeRole for the ARN +// of the role in the other account. If the user is in the same account as the +// role, then you can do either of the following: +// +// * Attach a policy to the user (identical to the previous user in a different +// account). +// +// * Add the user as a principal directly in the role's trust policy. +// +// In this case, the trust policy acts as an IAM resource-based policy. Users +// in the same account as the role do not need explicit permission to assume +// the role. For more information about trust policies and resource-based policies, +// see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) +// in the IAM User Guide. +// +// Tags +// +// (Optional) You can pass tag key-value pairs to your session. These tags are +// called session tags. For more information about session tags, see Passing +// Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) // in the IAM User Guide. // -// To assume a role, your AWS account must be trusted by the role. The trust -// relationship is defined in the role's trust policy when the role is created. -// That trust policy states which accounts are allowed to delegate access to -// this account's role. +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. // -// The user who wants to access the role must also have permissions delegated -// from the role's administrator. If the user is in a different account than -// the role, then the user's administrator must attach a policy that allows -// the user to call AssumeRole on the ARN of the role in the other account. -// If the user is in the same account as the role, then you can either attach -// a policy to the user (identical to the previous different account user), -// or you can add the user as a principal directly in the role's trust policy +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. // // Using MFA with AssumeRole // -// You can optionally include multi-factor authentication (MFA) information -// when you call AssumeRole. This is useful for cross-account scenarios in which -// you want to make sure that the user who is assuming the role has been authenticated -// using an AWS MFA device. In that scenario, the trust policy of the role being -// assumed includes a condition that tests for MFA authentication; if the caller -// does not include valid MFA information, the request to assume the role is -// denied. The condition in a trust policy that tests for MFA authentication -// might look like the following example. +// (Optional) You can include multi-factor authentication (MFA) information +// when you call AssumeRole. This is useful for cross-account scenarios to ensure +// that the user that assumes the role has been authenticated with an AWS MFA +// device. In that scenario, the trust policy of the role being assumed includes +// a condition that tests for MFA authentication. If the caller does not include +// valid MFA information, the request to assume the role is denied. The condition +// in a trust policy that tests for MFA authentication might look like the following +// example. // // "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}} // -// For more information, see Configuring MFA-Protected API Access (http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) +// For more information, see Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) // in the IAM User Guide guide. // // To use MFA with AssumeRole, you pass values for the SerialNumber and TokenCode // parameters. The SerialNumber value identifies the user's hardware or virtual // MFA device. The TokenCode is the time-based one-time password (TOTP) that -// the MFA devices produces. +// the MFA device produces. // // 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 @@ -159,18 +187,27 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeRegionDisabledException "RegionDisabledException" // STS is not activated in the requested region for the account that is being // asked to generate credentials. The account administrator must use the IAM // console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the IAM User Guide. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) { req, out := c.AssumeRoleRequest(input) return out, req.Send() @@ -196,19 +233,18 @@ const opAssumeRoleWithSAML = "AssumeRoleWithSAML" // AssumeRoleWithSAMLRequest generates a "aws/request.Request" representing the // client's request for the AssumeRoleWithSAML operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. +// 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 AssumeRoleWithSAML for usage and error information. +// See AssumeRoleWithSAML for more information on using the AssumeRoleWithSAML +// API call, and error handling. // -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssumeRoleWithSAML method directly -// instead. +// 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. // -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. // // // Example sending a request using the AssumeRoleWithSAMLRequest method. // req, resp := client.AssumeRoleWithSAMLRequest(params) @@ -218,7 +254,7 @@ const opAssumeRoleWithSAML = "AssumeRoleWithSAML" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) { op := &request.Operation{ Name: opAssumeRoleWithSAML, @@ -232,6 +268,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re output = &AssumeRoleWithSAMLOutput{} req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials return } @@ -241,46 +278,52 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // via a SAML authentication response. This operation provides a mechanism for // tying an enterprise identity store or directory to role-based AWS access // without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML -// with the other APIs that produce temporary credentials, see Requesting Temporary -// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// with the other API operations that produce temporary credentials, see Requesting +// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // // The temporary security credentials returned by this operation consist of // an access key ID, a secret access key, and a security token. Applications // can use these temporary security credentials to sign calls to AWS services. // -// The temporary security credentials are valid for the duration that you specified -// when calling AssumeRole, or until the time specified in the SAML authentication -// response's SessionNotOnOrAfter value, whichever is shorter. The duration -// can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). -// The default is 1 hour. +// Session Duration +// +// By default, the temporary security credentials created by AssumeRoleWithSAML +// last for one hour. However, you can use the optional DurationSeconds parameter +// to specify the duration of your session. Your role session lasts for the +// duration that you specify, or until the time specified in the SAML authentication +// response's SessionNotOnOrAfter value, whichever is shorter. You can provide +// a DurationSeconds value from 900 seconds (15 minutes) up to the maximum session +// duration setting for the role. This setting can have a value from 1 hour +// to 12 hours. To learn how to view the maximum value for your role, see View +// the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) +// in the IAM User Guide. The maximum session duration limit applies when you +// use the AssumeRole* API operations or the assume-role* CLI commands. However +// the limit does not apply when you use those operations to create a console +// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) +// in the IAM User Guide. +// +// Permissions // // The temporary security credentials created by AssumeRoleWithSAML can be used // to make API calls to any AWS service with the following exception: you cannot -// call the STS service's GetFederationToken or GetSessionToken APIs. -// -// Optionally, you can pass an IAM access policy to this operation. If you choose -// not to pass a policy, the temporary security credentials that are returned -// by the operation have the permissions that are defined in the access policy -// of the role that is being assumed. If you pass a policy to this operation, -// the temporary security credentials that are returned by the operation have -// the permissions that are allowed by the intersection of both the access policy -// of the role that is being assumed, and the policy that you pass. This means -// that both policies must grant the permission for the action to be allowed. -// This gives you a way to further restrict the permissions for the resulting -// temporary security credentials. You cannot use the passed policy to grant -// permissions that are in excess of those allowed by the access policy of the -// role that is being assumed. For more information, see Permissions for AssumeRole, -// AssumeRoleWithSAML, and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) +// call the STS GetFederationToken or GetSessionToken API operations. +// +// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policies to +// use as managed session policies. The plain text that you use for both inline +// and managed session policies can't exceed 2,048 characters. Passing policies +// to this operation returns new temporary credentials. The resulting session's +// permissions are the intersection of the role's identity-based policy and +// the session policies. You can use the role's temporary credentials in subsequent +// AWS API calls to access resources in the account that owns the role. You +// cannot use session policies to grant more permissions than those allowed +// by the identity-based policy of the role that is being assumed. For more +// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // -// Before your application can call AssumeRoleWithSAML, you must configure your -// SAML identity provider (IdP) to issue the claims required by AWS. Additionally, -// you must use AWS Identity and Access Management (IAM) to create a SAML provider -// entity in your AWS account that represents your identity provider, and create -// an IAM role that specifies this SAML provider in its trust policy. -// // Calling AssumeRoleWithSAML does not require the use of AWS security credentials. // The identity of the caller is validated by using keys in the metadata document // that is uploaded for the SAML provider entity for your identity provider. @@ -288,21 +331,63 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail // logs. The entry includes the value in the NameID element of the SAML assertion. // We recommend that you use a NameIDType that is not associated with any personally -// identifiable information (PII). For example, you could instead use the Persistent -// Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). +// identifiable information (PII). For example, you could instead use the persistent +// identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). +// +// Tags +// +// (Optional) You can configure your IdP to pass attributes into your SAML assertion +// as session tags. Each session tag consists of a key name and an associated +// value. For more information about session tags, see Passing Session Tags +// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You can pass up to 50 session tags. The plain text session tag keys can’t +// exceed 128 characters and the values can’t exceed 256 characters. For these +// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. +// +// An AWS conversion compresses the passed session policies and session tags +// into a packed binary format that has a separate limit. Your request can fail +// for this limit even if your plain text meets the other requirements. The +// PackedPolicySize response element indicates by percentage how close the policies +// and tags for your request are to the upper size limit. +// +// You can pass a session tag with the same key as a tag that is attached to +// the role. When you do, session tags override the role's tags with the same +// key. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// +// SAML Configuration +// +// Before your application can call AssumeRoleWithSAML, you must configure your +// SAML identity provider (IdP) to issue the claims required by AWS. Additionally, +// you must use AWS Identity and Access Management (IAM) to create a SAML provider +// entity in your AWS account that represents your identity provider. You must +// also create an IAM role that specifies this SAML provider in its trust policy. // // For more information, see the following resources: // -// * About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) +// * About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) // in the IAM User Guide. // -// * Creating SAML Identity Providers (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) +// * Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html) // in the IAM User Guide. // -// * Configuring a Relying Party and Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) +// * Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html) // in the IAM User Guide. // -// * Creating a Role for SAML 2.0 Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) +// * Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html) // in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -318,9 +403,18 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" // The identity provider (IdP) reported that authentication failed. This might @@ -341,10 +435,10 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // STS is not activated in the requested region for the account that is being // asked to generate credentials. The account administrator must use the IAM // console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the IAM User Guide. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) { req, out := c.AssumeRoleWithSAMLRequest(input) return out, req.Send() @@ -370,19 +464,18 @@ const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" // AssumeRoleWithWebIdentityRequest generates a "aws/request.Request" representing the // client's request for the AssumeRoleWithWebIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. +// 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 AssumeRoleWithWebIdentity for usage and error information. +// See AssumeRoleWithWebIdentity for more information on using the AssumeRoleWithWebIdentity +// API call, and error handling. // -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the AssumeRoleWithWebIdentity method directly -// instead. +// 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. // -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. // // // Example sending a request using the AssumeRoleWithWebIdentityRequest method. // req, resp := client.AssumeRoleWithWebIdentityRequest(params) @@ -392,7 +485,7 @@ const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) { op := &request.Operation{ Name: opAssumeRoleWithWebIdentity, @@ -406,64 +499,114 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI output = &AssumeRoleWithWebIdentityOutput{} req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials return } // AssumeRoleWithWebIdentity API operation for AWS Security Token Service. // // Returns a set of temporary security credentials for users who have been authenticated -// in a mobile or web application with a web identity provider, such as Amazon -// Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible -// identity provider. +// in a mobile or web application with a web identity provider. Example providers +// include Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID +// Connect-compatible identity provider. // // For mobile applications, we recommend that you use Amazon Cognito. You can -// use Amazon Cognito with the AWS SDK for iOS (http://aws.amazon.com/sdkforios/) -// and the AWS SDK for Android (http://aws.amazon.com/sdkforandroid/) to uniquely -// identify a user and supply the user with a consistent identity throughout -// the lifetime of an application. -// -// To learn more about Amazon Cognito, see Amazon Cognito Overview (http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840) -// in the AWS SDK for Android Developer Guide guide and Amazon Cognito Overview -// (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664) +// use Amazon Cognito with the AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) +// and the AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/) +// to uniquely identify a user. You can also supply the user with a consistent +// identity throughout the lifetime of an application. +// +// To learn more about Amazon Cognito, see Amazon Cognito Overview (https://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840) +// in AWS SDK for Android Developer Guide and Amazon Cognito Overview (https://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664) // in the AWS SDK for iOS Developer Guide. // // Calling AssumeRoleWithWebIdentity does not require the use of AWS security // credentials. Therefore, you can distribute an application (for example, on // mobile devices) that requests temporary security credentials without including -// long-term AWS credentials in the application, and without deploying server-based -// proxy services that use long-term AWS credentials. Instead, the identity -// of the caller is validated by using a token from the web identity provider. -// For a comparison of AssumeRoleWithWebIdentity with the other APIs that produce -// temporary credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// long-term AWS credentials in the application. You also don't need to deploy +// server-based proxy services that use long-term AWS credentials. Instead, +// the identity of the caller is validated by using a token from the web identity +// provider. For a comparison of AssumeRoleWithWebIdentity with the other API +// operations that produce temporary credentials, see Requesting Temporary Security +// Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // // The temporary security credentials returned by this API consist of an access // key ID, a secret access key, and a security token. Applications can use these -// temporary security credentials to sign calls to AWS service APIs. +// temporary security credentials to sign calls to AWS service API operations. +// +// Session Duration +// +// By default, the temporary security credentials created by AssumeRoleWithWebIdentity +// last for one hour. However, you can use the optional DurationSeconds parameter +// to specify the duration of your session. You can provide a value from 900 +// seconds (15 minutes) up to the maximum session duration setting for the role. +// This setting can have a value from 1 hour to 12 hours. To learn how to view +// the maximum value for your role, see View the Maximum Session Duration Setting +// for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) +// in the IAM User Guide. The maximum session duration limit applies when you +// use the AssumeRole* API operations or the assume-role* CLI commands. However +// the limit does not apply when you use those operations to create a console +// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) +// in the IAM User Guide. // -// The credentials are valid for the duration that you specified when calling -// AssumeRoleWithWebIdentity, which can be from 900 seconds (15 minutes) to -// a maximum of 3600 seconds (1 hour). The default is 1 hour. +// Permissions // // The temporary security credentials created by AssumeRoleWithWebIdentity can // be used to make API calls to any AWS service with the following exception: -// you cannot call the STS service's GetFederationToken or GetSessionToken APIs. -// -// Optionally, you can pass an IAM access policy to this operation. If you choose -// not to pass a policy, the temporary security credentials that are returned -// by the operation have the permissions that are defined in the access policy -// of the role that is being assumed. If you pass a policy to this operation, -// the temporary security credentials that are returned by the operation have -// the permissions that are allowed by both the access policy of the role that -// is being assumed, and the policy that you pass. This gives you a way to further -// restrict the permissions for the resulting temporary security credentials. -// You cannot use the passed policy to grant permissions that are in excess -// of those allowed by the access policy of the role that is being assumed. -// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, -// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) +// you cannot call the STS GetFederationToken or GetSessionToken API operations. +// +// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policies to +// use as managed session policies. The plain text that you use for both inline +// and managed session policies can't exceed 2,048 characters. Passing policies +// to this operation returns new temporary credentials. The resulting session's +// permissions are the intersection of the role's identity-based policy and +// the session policies. You can use the role's temporary credentials in subsequent +// AWS API calls to access resources in the account that owns the role. You +// cannot use session policies to grant more permissions than those allowed +// by the identity-based policy of the role that is being assumed. For more +// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. +// +// Tags +// +// (Optional) You can configure your IdP to pass attributes into your web identity +// token as session tags. Each session tag consists of a key name and an associated +// value. For more information about session tags, see Passing Session Tags +// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You can pass up to 50 session tags. The plain text session tag keys can’t +// exceed 128 characters and the values can’t exceed 256 characters. For these +// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) // in the IAM User Guide. // +// An AWS conversion compresses the passed session policies and session tags +// into a packed binary format that has a separate limit. Your request can fail +// for this limit even if your plain text meets the other requirements. The +// PackedPolicySize response element indicates by percentage how close the policies +// and tags for your request are to the upper size limit. +// +// You can pass a session tag with the same key as a tag that is attached to +// the role. When you do, the session tag overrides the role tag with the same +// key. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// +// Identities +// // Before your application can call AssumeRoleWithWebIdentity, you must have // an identity token from a supported identity provider and create a role that // the application can assume. The role that your application assumes must trust @@ -480,23 +623,21 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // For more information about how to use web identity federation and the AssumeRoleWithWebIdentity // API, see the following resources: // -// * Using Web Identity Federation APIs for Mobile Apps (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html) -// and Federation Through a Web-based Identity Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). -// +// * Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html) +// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). // -// * Web Identity Federation Playground (https://web-identity-federation-playground.s3.amazonaws.com/index.html). -// This interactive website lets you walk through the process of authenticating -// via Login with Amazon, Facebook, or Google, getting temporary security -// credentials, and then using those credentials to make a request to AWS. +// * Web Identity Federation Playground (https://web-identity-federation-playground.s3.amazonaws.com/index.html). +// Walk through the process of authenticating through Login with Amazon, +// Facebook, or Google, getting temporary security credentials, and then +// using those credentials to make a request to AWS. // +// * AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) and +// AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/). +// These toolkits contain sample apps that show how to invoke the identity +// providers. The toolkits then show how to use the information from these +// providers to get and use temporary security credentials. // -// * AWS SDK for iOS (http://aws.amazon.com/sdkforios/) and AWS SDK for Android -// (http://aws.amazon.com/sdkforandroid/). These toolkits contain sample -// apps that show how to invoke the identity providers, and then how to use -// the information from these providers to get and use temporary security -// credentials. -// -// * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/4617974389850313). +// * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications). // This article discusses web identity federation and shows an example of // how to use web identity federation to get access to content in Amazon // S3. @@ -514,9 +655,18 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" // The identity provider (IdP) reported that authentication failed. This might @@ -526,11 +676,11 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // can also mean that the claim has expired or has been explicitly revoked. // // * ErrCodeIDPCommunicationErrorException "IDPCommunicationError" -// The request could not be fulfilled because the non-AWS identity provider -// (IDP) that was asked to verify the incoming identity token could not be reached. -// This is often a transient error caused by network conditions. Retry the request +// The request could not be fulfilled because the identity provider (IDP) that +// was asked to verify the incoming identity token could not be reached. This +// is often a transient error caused by network conditions. Retry the request // a limited number of times so that you don't exceed the request rate. If the -// error persists, the non-AWS identity provider might be down or not responding. +// error persists, the identity provider might be down or not responding. // // * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken" // The web identity token that was passed could not be validated by AWS. Get @@ -544,10 +694,10 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // STS is not activated in the requested region for the account that is being // asked to generate credentials. The account administrator must use the IAM // console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the IAM User Guide. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) { req, out := c.AssumeRoleWithWebIdentityRequest(input) return out, req.Send() @@ -573,19 +723,18 @@ const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" // DecodeAuthorizationMessageRequest generates a "aws/request.Request" representing the // client's request for the DecodeAuthorizationMessage operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. +// 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 DecodeAuthorizationMessage for usage and error information. +// See DecodeAuthorizationMessage for more information on using the DecodeAuthorizationMessage +// API call, and error handling. // -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the DecodeAuthorizationMessage method directly -// instead. +// 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. // -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. // // // Example sending a request using the DecodeAuthorizationMessageRequest method. // req, resp := client.DecodeAuthorizationMessageRequest(params) @@ -595,7 +744,7 @@ const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) { op := &request.Operation{ Name: opDecodeAuthorizationMessage, @@ -617,17 +766,17 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag // Decodes additional information about the authorization status of a request // from an encoded message returned in response to an AWS request. // -// For example, if a user is not authorized to perform an action that he or -// she has requested, the request returns a Client.UnauthorizedOperation response -// (an HTTP 403 response). Some AWS actions additionally return an encoded message -// that can provide details about this authorization failure. +// For example, if a user is not authorized to perform an operation that he +// or she has requested, the request returns a Client.UnauthorizedOperation +// response (an HTTP 403 response). Some AWS operations additionally return +// an encoded message that can provide details about this authorization failure. // -// Only certain AWS actions return an encoded authorization message. The documentation -// for an individual action indicates whether that action returns an encoded -// message in addition to returning an HTTP code. +// Only certain AWS operations return an encoded authorization message. The +// documentation for an individual operation indicates whether that operation +// returns an encoded message in addition to returning an HTTP code. // // The message is encoded because the details of the authorization status can -// constitute privileged information that the user who requested the action +// constitute privileged information that the user who requested the operation // should not see. To decode an authorization status message, a user must be // granted permissions via an IAM policy to request the DecodeAuthorizationMessage // (sts:DecodeAuthorizationMessage) action. @@ -636,7 +785,7 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag // // * Whether the request was denied due to an explicit deny or due to the // absence of an explicit allow. For more information, see Determining Whether -// a Request is Allowed or Denied (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) +// a Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow) // in the IAM User Guide. // // * The principal who made the request. @@ -660,7 +809,7 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag // invalid. This can happen if the token contains invalid characters, such as // linebreaks. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) { req, out := c.DecodeAuthorizationMessageRequest(input) return out, req.Send() @@ -682,23 +831,119 @@ func (c *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *Deco return out, req.Send() } +const opGetAccessKeyInfo = "GetAccessKeyInfo" + +// GetAccessKeyInfoRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessKeyInfo 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 GetAccessKeyInfo for more information on using the GetAccessKeyInfo +// 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 GetAccessKeyInfoRequest method. +// req, resp := client.GetAccessKeyInfoRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo +func (c *STS) GetAccessKeyInfoRequest(input *GetAccessKeyInfoInput) (req *request.Request, output *GetAccessKeyInfoOutput) { + op := &request.Operation{ + Name: opGetAccessKeyInfo, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAccessKeyInfoInput{} + } + + output = &GetAccessKeyInfoOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccessKeyInfo API operation for AWS Security Token Service. +// +// Returns the account identifier for the specified access key ID. +// +// Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) +// and a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). +// For more information about access keys, see Managing Access Keys for IAM +// Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) +// in the IAM User Guide. +// +// When you pass an access key ID to this operation, it returns the ID of the +// AWS account to which the keys belong. Access key IDs beginning with AKIA +// are long-term credentials for an IAM user or the AWS account root user. Access +// key IDs beginning with ASIA are temporary credentials that are created using +// STS operations. If the account in the response belongs to you, you can sign +// in as the root user and review your root user access keys. Then, you can +// pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) +// to learn which IAM user owns the keys. To learn who requested the temporary +// credentials for an ASIA access key, view the STS events in your CloudTrail +// logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) +// in the IAM User Guide. +// +// This operation does not indicate the state of the access key. The key might +// be active, inactive, or deleted. Active keys might not have permissions to +// perform an operation. Providing a deleted access key might return an error +// that the key doesn't exist. +// +// 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 AWS Security Token Service's +// API operation GetAccessKeyInfo for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo +func (c *STS) GetAccessKeyInfo(input *GetAccessKeyInfoInput) (*GetAccessKeyInfoOutput, error) { + req, out := c.GetAccessKeyInfoRequest(input) + return out, req.Send() +} + +// GetAccessKeyInfoWithContext is the same as GetAccessKeyInfo with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccessKeyInfo 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 *STS) GetAccessKeyInfoWithContext(ctx aws.Context, input *GetAccessKeyInfoInput, opts ...request.Option) (*GetAccessKeyInfoOutput, error) { + req, out := c.GetAccessKeyInfoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetCallerIdentity = "GetCallerIdentity" // GetCallerIdentityRequest generates a "aws/request.Request" representing the // client's request for the GetCallerIdentity operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. +// value will be populated with the request's response once the request completes +// successfully. // -// See GetCallerIdentity for usage and error information. +// 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. // -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetCallerIdentity method directly -// instead. +// See GetCallerIdentity for more information on using the GetCallerIdentity +// 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. // -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. // // // Example sending a request using the GetCallerIdentityRequest method. // req, resp := client.GetCallerIdentityRequest(params) @@ -708,7 +953,7 @@ const opGetCallerIdentity = "GetCallerIdentity" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) { op := &request.Operation{ Name: opGetCallerIdentity, @@ -727,8 +972,16 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ // GetCallerIdentity API operation for AWS Security Token Service. // -// Returns details about the IAM identity whose credentials are used to call -// the API. +// Returns details about the IAM user or role whose credentials are used to +// call the operation. +// +// No permissions are required to perform this operation. If an administrator +// adds a policy to your IAM user or role that explicitly denies access to the +// sts:GetCallerIdentity action, you can still perform this operation. Permissions +// are not required because the same information is returned when an IAM user +// or role is denied access. To view an example response, see I Am Not Authorized +// to Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa) +// in the IAM User Guide. // // 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 @@ -736,7 +989,7 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ // // See the AWS API reference guide for AWS Security Token Service's // API operation GetCallerIdentity for usage and error information. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) { req, out := c.GetCallerIdentityRequest(input) return out, req.Send() @@ -762,19 +1015,18 @@ const opGetFederationToken = "GetFederationToken" // GetFederationTokenRequest generates a "aws/request.Request" representing the // client's request for the GetFederationToken operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. +// value will be populated with the request's response once the request completes +// successfully. // -// See GetFederationToken for usage and error information. +// 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. // -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetFederationToken method directly -// instead. +// See GetFederationToken for more information on using the GetFederationToken +// 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. // -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. // // // Example sending a request using the GetFederationTokenRequest method. // req, resp := client.GetFederationTokenRequest(params) @@ -784,7 +1036,7 @@ const opGetFederationToken = "GetFederationToken" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) { op := &request.Operation{ Name: opGetFederationToken, @@ -806,81 +1058,92 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // Returns a set of temporary security credentials (consisting of an access // key ID, a secret access key, and a security token) for a federated user. // A typical use is in a proxy application that gets temporary security credentials -// on behalf of distributed applications inside a corporate network. Because -// you must call the GetFederationToken action using the long-term security -// credentials of an IAM user, this call is appropriate in contexts where those +// on behalf of distributed applications inside a corporate network. You must +// call the GetFederationToken operation using the long-term security credentials +// of an IAM user. As a result, this call is appropriate in contexts where those // credentials can be safely stored, usually in a server-based application. -// For a comparison of GetFederationToken with the other APIs that produce temporary -// credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// For a comparison of GetFederationToken with the other API operations that +// produce temporary credentials, see Requesting Temporary Security Credentials +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // -// If you are creating a mobile-based or browser-based app that can authenticate +// You can create a mobile-based or browser-based app that can authenticate // users using a web identity provider like Login with Amazon, Facebook, Google, -// or an OpenID Connect-compatible identity provider, we recommend that you -// use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. +// or an OpenID Connect-compatible identity provider. In this case, we recommend +// that you use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. // For more information, see Federation Through a Web-based Identity Provider -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). -// -// The GetFederationToken action must be called by using the long-term AWS security -// credentials of an IAM user. You can also call GetFederationToken using the -// security credentials of an AWS root account, but we do not recommended it. -// Instead, we recommend that you create an IAM user for the purpose of the -// proxy application and then attach a policy to the IAM user that limits federated -// users to only the actions and resources that they need access to. For more -// information, see IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) // in the IAM User Guide. // -// The temporary security credentials that are obtained by using the long-term -// credentials of an IAM user are valid for the specified duration, from 900 -// seconds (15 minutes) up to a maximium of 129600 seconds (36 hours). The default -// is 43200 seconds (12 hours). Temporary credentials that are obtained by using -// AWS root account credentials have a maximum duration of 3600 seconds (1 hour). -// -// The temporary security credentials created by GetFederationToken can be used -// to make API calls to any AWS service with the following exceptions: +// You can also call GetFederationToken using the security credentials of an +// AWS account root user, but we do not recommend it. Instead, we recommend +// that you create an IAM user for the purpose of the proxy application. Then +// attach a policy to the IAM user that limits federated users to only the actions +// and resources that they need to access. For more information, see IAM Best +// Practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) +// in the IAM User Guide. // -// * You cannot use these credentials to call any IAM APIs. +// Session duration // -// * You cannot call any STS APIs except GetCallerIdentity. +// The temporary credentials are valid for the specified duration, from 900 +// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default +// session duration is 43,200 seconds (12 hours). Temporary credentials that +// are obtained by using AWS account root user credentials have a maximum duration +// of 3,600 seconds (1 hour). // // Permissions // -// The permissions for the temporary security credentials returned by GetFederationToken -// are determined by a combination of the following: -// -// * The policy or policies that are attached to the IAM user whose credentials -// are used to call GetFederationToken. -// -// * The policy that is passed as a parameter in the call. -// -// The passed policy is attached to the temporary security credentials that -// result from the GetFederationToken API call--that is, to the federated user. -// When the federated user makes an AWS request, AWS evaluates the policy attached -// to the federated user in combination with the policy or policies attached -// to the IAM user whose credentials were used to call GetFederationToken. AWS -// allows the federated user's request only when both the federated user and -// the IAM user are explicitly allowed to perform the requested action. The -// passed policy cannot grant more permissions than those that are defined in -// the IAM user policy. -// -// A typical use case is that the permissions of the IAM user whose credentials -// are used to call GetFederationToken are designed to allow access to all the -// actions and resources that any federated user will need. Then, for individual -// users, you pass a policy to the operation that scopes down the permissions -// to a level that's appropriate to that individual user, using a policy that -// allows only a subset of permissions that are granted to the IAM user. -// -// If you do not pass a policy, the resulting temporary security credentials -// have no effective permissions. The only exception is when the temporary security -// credentials are used to access a resource that has a resource-based policy -// that specifically allows the federated user to access the resource. -// -// For more information about how permissions work, see Permissions for GetFederationToken -// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html). -// For information about using GetFederationToken to create temporary security -// credentials, see GetFederationToken—Federation Through a Custom Identity -// Broker (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). +// You can use the temporary credentials created by GetFederationToken in any +// AWS service except the following: +// +// * You cannot call any IAM operations using the AWS CLI or the AWS API. +// +// * You cannot call any STS operations except GetCallerIdentity. +// +// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// to this operation. You can pass a single JSON policy document to use as an +// inline session policy. You can also specify up to 10 managed policies to +// use as managed session policies. The plain text that you use for both inline +// and managed session policies can't exceed 2,048 characters. +// +// Though the session policy parameters are optional, if you do not pass a policy, +// then the resulting federated user session has no permissions. When you pass +// session policies, the session permissions are the intersection of the IAM +// user policies and the session policies that you pass. This gives you a way +// to further restrict the permissions for a federated user. You cannot use +// session policies to grant more permissions than those that are defined in +// the permissions policy of the IAM user. For more information, see Session +// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// in the IAM User Guide. For information about using GetFederationToken to +// create temporary security credentials, see GetFederationToken—Federation +// Through a Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). +// +// You can use the credentials to access a resource that has a resource-based +// policy. If that policy specifically references the federated user session +// in the Principal element of the policy, the session has the permissions allowed +// by the policy. These permissions are granted in addition to the permissions +// granted by the session policies. +// +// Tags +// +// (Optional) You can pass tag key-value pairs to your session. These are called +// session tags. For more information about session tags, see Passing Session +// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// Tag key–value pairs are not case sensitive, but case is preserved. This +// means that you cannot have separate Department and department tag keys. Assume +// that the user that you are federating has the Department=Marketing tag and +// you pass the department=engineering session tag. Department and department +// are not saved as separate tags, and the session tag passed in the request +// takes precedence over the user tag. // // 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 @@ -895,18 +1158,27 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeRegionDisabledException "RegionDisabledException" // STS is not activated in the requested region for the account that is being // asked to generate credentials. The account administrator must use the IAM // console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the IAM User Guide. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) { req, out := c.GetFederationTokenRequest(input) return out, req.Send() @@ -932,19 +1204,18 @@ const opGetSessionToken = "GetSessionToken" // GetSessionTokenRequest generates a "aws/request.Request" representing the // client's request for the GetSessionToken operation. The "output" return -// value can be used to capture response data after the request's "Send" method -// is called. +// 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 GetSessionToken for usage and error information. +// See GetSessionToken for more information on using the GetSessionToken +// API call, and error handling. // -// Creating a request object using this method should be used when you want to inject -// custom logic into the request's lifecycle using a custom handler, or if you want to -// access properties on the request object before or after sending the request. If -// you just want the service response, call the GetSessionToken method directly -// instead. +// 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. // -// Note: You must call the "Send" method on the returned request object in order -// to execute the request. // // // Example sending a request using the GetSessionTokenRequest method. // req, resp := client.GetSessionTokenRequest(params) @@ -954,7 +1225,7 @@ const opGetSessionToken = "GetSessionToken" // fmt.Println(resp) // } // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) { op := &request.Operation{ Name: opGetSessionToken, @@ -976,48 +1247,51 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // Returns a set of temporary credentials for an AWS account or IAM user. The // credentials consist of an access key ID, a secret access key, and a security // token. Typically, you use GetSessionToken if you want to use MFA to protect -// programmatic calls to specific AWS APIs like Amazon EC2 StopInstances. MFA-enabled -// IAM users would need to call GetSessionToken and submit an MFA code that -// is associated with their MFA device. Using the temporary security credentials -// that are returned from the call, IAM users can then make programmatic calls -// to APIs that require MFA authentication. If you do not supply a correct MFA -// code, then the API returns an access denied error. For a comparison of GetSessionToken -// with the other APIs that produce temporary credentials, see Requesting Temporary -// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) -// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) +// programmatic calls to specific AWS API operations like Amazon EC2 StopInstances. +// MFA-enabled IAM users would need to call GetSessionToken and submit an MFA +// code that is associated with their MFA device. Using the temporary security +// credentials that are returned from the call, IAM users can then make programmatic +// calls to API operations that require MFA authentication. If you do not supply +// a correct MFA code, then the API returns an access denied error. For a comparison +// of GetSessionToken with the other API operations that produce temporary credentials, +// see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html) +// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // -// The GetSessionToken action must be called by using the long-term AWS security -// credentials of the AWS account or an IAM user. Credentials that are created -// by IAM users are valid for the duration that you specify, from 900 seconds -// (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default -// of 43200 seconds (12 hours); credentials that are created by using account -// credentials can range from 900 seconds (15 minutes) up to a maximum of 3600 -// seconds (1 hour), with a default of 1 hour. +// Session Duration +// +// The GetSessionToken operation must be called by using the long-term AWS security +// credentials of the AWS account root user or an IAM user. Credentials that +// are created by IAM users are valid for the duration that you specify. This +// duration can range from 900 seconds (15 minutes) up to a maximum of 129,600 +// seconds (36 hours), with a default of 43,200 seconds (12 hours). Credentials +// based on account credentials can range from 900 seconds (15 minutes) up to +// 3,600 seconds (1 hour), with a default of 1 hour. +// +// Permissions // // The temporary security credentials created by GetSessionToken can be used // to make API calls to any AWS service with the following exceptions: // -// * You cannot call any IAM APIs unless MFA authentication information is -// included in the request. +// * You cannot call any IAM API operations unless MFA authentication information +// is included in the request. // -// * You cannot call any STS API exceptAssumeRole or GetCallerIdentity. +// * You cannot call any STS API except AssumeRole or GetCallerIdentity. // -// We recommend that you do not call GetSessionToken with root account credentials. -// Instead, follow our best practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) +// We recommend that you do not call GetSessionToken with AWS account root user +// credentials. Instead, follow our best practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users) // by creating one or more IAM users, giving them the necessary permissions, // and using IAM users for everyday interaction with AWS. // -// The permissions associated with the temporary security credentials returned -// by GetSessionToken are based on the permissions associated with account or -// IAM user whose credentials are used to call the action. If GetSessionToken -// is called using root account credentials, the temporary credentials have -// root account permissions. Similarly, if GetSessionToken is called using the -// credentials of an IAM user, the temporary credentials have the same permissions -// as the IAM user. +// The credentials that are returned by GetSessionToken are based on permissions +// associated with the user whose credentials were used to call the operation. +// If GetSessionToken is called using AWS account root user credentials, the +// temporary credentials have root user permissions. Similarly, if GetSessionToken +// is called using the credentials of an IAM user, the temporary credentials +// have the same permissions as the IAM user. // // For more information about using GetSessionToken to create temporary credentials, -// go to Temporary Credentials for Users in Untrusted Environments (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) +// go to Temporary Credentials for Users in Untrusted Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken) // in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1032,10 +1306,10 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // STS is not activated in the requested region for the account that is being // asked to generate credentials. The account administrator must use the IAM // console to activate STS in that region. For more information, see Activating -// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the IAM User Guide. // -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken +// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) { req, out := c.GetSessionTokenRequest(input) return out, req.Send() @@ -1057,64 +1331,97 @@ func (c *STS) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionToken return out, req.Send() } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest type AssumeRoleInput struct { _ struct{} `type:"structure"` // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set - // to 3600 seconds. - // - // This is separate from the duration of a console session that you might request - // using the returned credentials. The request to the federation endpoint for - // a console sign-in token takes a SessionDuration parameter that specifies - // the maximum length of the console session, separately from the DurationSeconds - // parameter on this API. For more information, see Creating a URL that Enables - // Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // seconds (15 minutes) up to the maximum session duration setting for the role. + // This setting can have a value from 1 hour to 12 hours. If you specify a value + // higher than this setting, the operation fails. For example, if you specify + // a session duration of 12 hours, but your administrator set the maximum session + // duration to 6 hours, your operation fails. To learn how to view the maximum + // value for your role, see View the Maximum Session Duration Setting for a + // Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // in the IAM User Guide. + // + // By default, the value is set to 3600 seconds. + // + // The DurationSeconds parameter is separate from the duration of a console + // session that you might request using the returned credentials. The request + // to the federation endpoint for a console sign-in token takes a SessionDuration + // parameter that specifies the maximum length of the console session. For more + // information, see Creating a URL that Enables Federated Users to Access the + // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) // in the IAM User Guide. DurationSeconds *int64 `min:"900" type:"integer"` - // A unique identifier that is used by third parties when assuming roles in - // their customers' accounts. For each role that the third party can assume, - // they should instruct their customers to ensure the role's trust policy checks - // for the external ID that the third party generated. Each time the third party - // assumes the role, they should pass the customer's external ID. The external - // ID is useful in order to help third parties bind a role to the customer who - // created it. For more information about the external ID, see How to Use an - // External ID When Granting Access to Your AWS Resources to a Third Party (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) + // A unique identifier that might be required when you assume a role in another + // account. If the administrator of the account to which the role belongs provided + // you with an external ID, then provide that value in the ExternalId parameter. + // This value can be any string, such as a passphrase or account number. A cross-account + // role is usually set up to trust everyone in an account. Therefore, the administrator + // of the trusting account might send an external ID to the administrator of + // the trusted account. That way, only someone with the ID can assume the role, + // rather than everyone in the account. For more information about the external + // ID, see How to Use an External ID When Granting Access to Your AWS Resources + // to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) // in the IAM User Guide. // - // The regex used to validated this parameter is a string of characters consisting + // The regex used to validate this parameter is a string of characters consisting // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@:\/- + // also include underscores or any of the following characters: =,.@:/- ExternalId *string `min:"2" type:"string"` - // An IAM policy in JSON format. - // - // This parameter is optional. If you pass a policy, the temporary security - // credentials that are returned by the operation have the permissions that - // are allowed by both (the intersection of) the access policy of the role that - // is being assumed, and the policy that you pass. This gives you a way to further - // restrict the permissions for the resulting temporary security credentials. - // You cannot use the passed policy to grant permissions that are in excess - // of those allowed by the access policy of the role that is being assumed. - // For more information, see Permissions for AssumeRole, AssumeRoleWithSAML, - // and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) + // An IAM policy in JSON format that you want to use as an inline session policy. + // + // This parameter is optional. Passing policies to this operation returns new + // temporary credentials. The resulting session's permissions are the intersection + // of the role's identity-based policy and the session policies. You can use + // the role's temporary credentials in subsequent AWS API calls to access resources + // in the account that owns the role. You cannot use session policies to grant + // more permissions than those allowed by the identity-based policy of the role + // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The format for this parameter, as described by its regex pattern, is a string - // of characters up to 2048 characters in length. The characters can be any - // ASCII character from the space character to the end of the valid character - // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // The plain text that you use for both inline and managed session policies + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII + // character from the space character to the end of the valid character list + // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The policy plain text must be 2048 bytes or shorter. However, an internal - // conversion compresses it into a packed binary format with a separate limit. - // The PackedPolicySize response element indicates by percentage how close to - // the upper size limit the policy is, with 100% equaling the maximum allowed - // size. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want + // to use as managed session policies. The policies must exist in the same account + // as the role. + // + // This parameter is optional. You can provide up to 10 managed policy ARNs. + // However, the plain text that you use for both inline and managed session + // policies can't exceed 2,048 characters. For more information about ARNs, + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // Passing policies to this operation returns new temporary credentials. The + // resulting session's permissions are the intersection of the role's identity-based + // policy and the session policies. You can use the role's temporary credentials + // in subsequent AWS API calls to access resources in the account that owns + // the role. You cannot use session policies to grant more permissions than + // those allowed by the identity-based policy of the role that is being assumed. + // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. + PolicyArns []*PolicyDescriptorType `type:"list"` + // The Amazon Resource Name (ARN) of the role to assume. // // RoleArn is a required field @@ -1127,8 +1434,8 @@ type AssumeRoleInput struct { // scenarios, the role session name is visible to, and can be logged by the // account that owns the role. The role session name is also used in the ARN // of the assumed role principal. This means that subsequent cross-account API - // requests using the temporary security credentials will expose the role session - // name to the external account in their CloudTrail logs. + // requests that use the temporary security credentials will expose the role + // session name to the external account in their AWS CloudTrail logs. // // The regex used to validate this parameter is a string of characters consisting // of upper- and lower-case alphanumeric characters with no spaces. You can @@ -1148,6 +1455,41 @@ type AssumeRoleInput struct { // also include underscores or any of the following characters: =,.@- SerialNumber *string `min:"9" type:"string"` + // A list of session tags that you want to pass. Each session tag consists of + // a key name and an associated value. For more information about session tags, + // see Tagging AWS STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plain + // text session tag keys can’t exceed 128 characters, and the values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the role. When you do, session tags override a role tag with the same + // key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This + // means that you cannot have separate Department and department tag keys. Assume + // that the role has the Department=Marketing tag and you pass the department=engineering + // session tag. Department and department are not saved as separate tags, and + // the session tag passed in the request takes precedence over the role tag. + // + // Additionally, if you used temporary credentials to perform this operation, + // the new session inherits any transitive session tags from the calling session. + // If you pass a session tag with the same key as an inherited tag, the operation + // fails. To view the inherited tags for a session, see the AWS CloudTrail logs. + // For more information, see Viewing Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs) + // in the IAM User Guide. + Tags []*Tag `type:"list"` + // The value provided by the MFA device, if the trust policy of the role being // assumed requires MFA (that is, if the policy includes a condition that tests // for MFA). If the role being assumed requires MFA and if the TokenCode value @@ -1156,6 +1498,19 @@ type AssumeRoleInput struct { // The format for this parameter, as described by its regex pattern, is a sequence // of six numeric digits. TokenCode *string `min:"6" type:"string"` + + // 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. For more information, see Chaining Roles with Session + // Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + // in the IAM User Guide. + // + // This parameter is optional. When you set session tags as transitive, the + // session policy and session tags packed binary limit is not affected. + // + // If you choose not to specify a transitive tag key, then no tags are passed + // from this session to any subsequent sessions. + TransitiveTagKeys []*string `type:"list"` } // String returns the string representation @@ -1198,6 +1553,26 @@ func (s *AssumeRoleInput) Validate() error { if s.TokenCode != nil && len(*s.TokenCode) < 6 { invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6)) } + if s.PolicyArns != nil { + for i, v := range s.PolicyArns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams)) + } + } + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1223,6 +1598,12 @@ func (s *AssumeRoleInput) SetPolicy(v string) *AssumeRoleInput { return s } +// SetPolicyArns sets the PolicyArns field's value. +func (s *AssumeRoleInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleInput { + s.PolicyArns = v + return s +} + // SetRoleArn sets the RoleArn field's value. func (s *AssumeRoleInput) SetRoleArn(v string) *AssumeRoleInput { s.RoleArn = &v @@ -1241,15 +1622,26 @@ func (s *AssumeRoleInput) SetSerialNumber(v string) *AssumeRoleInput { return s } +// SetTags sets the Tags field's value. +func (s *AssumeRoleInput) SetTags(v []*Tag) *AssumeRoleInput { + s.Tags = v + return s +} + // SetTokenCode sets the TokenCode field's value. func (s *AssumeRoleInput) SetTokenCode(v string) *AssumeRoleInput { s.TokenCode = &v return s } +// SetTransitiveTagKeys sets the TransitiveTagKeys field's value. +func (s *AssumeRoleInput) SetTransitiveTagKeys(v []*string) *AssumeRoleInput { + s.TransitiveTagKeys = v + return s +} + // Contains the response to a successful AssumeRole request, including temporary // AWS credentials that can be used to make AWS requests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleResponse type AssumeRoleOutput struct { _ struct{} `type:"structure"` @@ -1263,15 +1655,14 @@ type AssumeRoleOutput struct { // The temporary security credentials, which include an access key ID, a secret // access key, and a security (or session) token. // - // Note: The size of the security token that STS APIs return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. As - // of this writing, the typical size is less than 4096 bytes, but that can vary. - // Also, future updates to AWS might require larger sizes. + // The size of the security token that STS API operations return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` } @@ -1303,51 +1694,83 @@ func (s *AssumeRoleOutput) SetPackedPolicySize(v int64) *AssumeRoleOutput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLRequest type AssumeRoleWithSAMLInput struct { _ struct{} `type:"structure"` - // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set - // to 3600 seconds. An expiration can also be specified in the SAML authentication - // response's SessionNotOnOrAfter value. The actual expiration time is whichever - // value is shorter. - // - // This is separate from the duration of a console session that you might request - // using the returned credentials. The request to the federation endpoint for - // a console sign-in token takes a SessionDuration parameter that specifies - // the maximum length of the console session, separately from the DurationSeconds - // parameter on this API. For more information, see Enabling SAML 2.0 Federated - // Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html) + // The duration, in seconds, of the role session. Your role session lasts for + // the duration that you specify for the DurationSeconds parameter, or until + // the time specified in the SAML authentication response's SessionNotOnOrAfter + // value, whichever is shorter. You can provide a DurationSeconds value from + // 900 seconds (15 minutes) up to the maximum session duration setting for the + // role. This setting can have a value from 1 hour to 12 hours. If you specify + // a value higher than this setting, the operation fails. For example, if you + // specify a session duration of 12 hours, but your administrator set the maximum + // session duration to 6 hours, your operation fails. To learn how to view the + // maximum value for your role, see View the Maximum Session Duration Setting + // for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // in the IAM User Guide. + // + // By default, the value is set to 3600 seconds. + // + // The DurationSeconds parameter is separate from the duration of a console + // session that you might request using the returned credentials. The request + // to the federation endpoint for a console sign-in token takes a SessionDuration + // parameter that specifies the maximum length of the console session. For more + // information, see Creating a URL that Enables Federated Users to Access the + // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) // in the IAM User Guide. DurationSeconds *int64 `min:"900" type:"integer"` - // An IAM policy in JSON format. - // - // The policy parameter is optional. If you pass a policy, the temporary security - // credentials that are returned by the operation have the permissions that - // are allowed by both the access policy of the role that is being assumed, - // and the policy that you pass. This gives you a way to further restrict the - // permissions for the resulting temporary security credentials. You cannot - // use the passed policy to grant permissions that are in excess of those allowed - // by the access policy of the role that is being assumed. For more information, - // Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) + // An IAM policy in JSON format that you want to use as an inline session policy. + // + // This parameter is optional. Passing policies to this operation returns new + // temporary credentials. The resulting session's permissions are the intersection + // of the role's identity-based policy and the session policies. You can use + // the role's temporary credentials in subsequent AWS API calls to access resources + // in the account that owns the role. You cannot use session policies to grant + // more permissions than those allowed by the identity-based policy of the role + // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The format for this parameter, as described by its regex pattern, is a string - // of characters up to 2048 characters in length. The characters can be any - // ASCII character from the space character to the end of the valid character - // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // The plain text that you use for both inline and managed session policies + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII + // character from the space character to the end of the valid character list + // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The policy plain text must be 2048 bytes or shorter. However, an internal - // conversion compresses it into a packed binary format with a separate limit. - // The PackedPolicySize response element indicates by percentage how close to - // the upper size limit the policy is, with 100% equaling the maximum allowed - // size. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want + // to use as managed session policies. The policies must exist in the same account + // as the role. + // + // This parameter is optional. You can provide up to 10 managed policy ARNs. + // However, the plain text that you use for both inline and managed session + // policies can't exceed 2,048 characters. For more information about ARNs, + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // Passing policies to this operation returns new temporary credentials. The + // resulting session's permissions are the intersection of the role's identity-based + // policy and the session policies. You can use the role's temporary credentials + // in subsequent AWS API calls to access resources in the account that owns + // the role. You cannot use session policies to grant more permissions than + // those allowed by the identity-based policy of the role that is being assumed. + // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. + PolicyArns []*PolicyDescriptorType `type:"list"` + // The Amazon Resource Name (ARN) of the SAML provider in IAM that describes // the IdP. // @@ -1361,8 +1784,8 @@ type AssumeRoleWithSAMLInput struct { // The base-64 encoded SAML authentication response provided by the IdP. // - // For more information, see Configuring a Relying Party and Adding Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) - // in the Using IAM guide. + // For more information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) + // in the IAM User Guide. // // SAMLAssertion is a required field SAMLAssertion *string `min:"4" type:"string" required:"true"` @@ -1405,6 +1828,16 @@ func (s *AssumeRoleWithSAMLInput) Validate() error { if s.SAMLAssertion != nil && len(*s.SAMLAssertion) < 4 { invalidParams.Add(request.NewErrParamMinLen("SAMLAssertion", 4)) } + if s.PolicyArns != nil { + for i, v := range s.PolicyArns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1424,6 +1857,12 @@ func (s *AssumeRoleWithSAMLInput) SetPolicy(v string) *AssumeRoleWithSAMLInput { return s } +// SetPolicyArns sets the PolicyArns field's value. +func (s *AssumeRoleWithSAMLInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleWithSAMLInput { + s.PolicyArns = v + return s +} + // SetPrincipalArn sets the PrincipalArn field's value. func (s *AssumeRoleWithSAMLInput) SetPrincipalArn(v string) *AssumeRoleWithSAMLInput { s.PrincipalArn = &v @@ -1444,7 +1883,6 @@ func (s *AssumeRoleWithSAMLInput) SetSAMLAssertion(v string) *AssumeRoleWithSAML // Contains the response to a successful AssumeRoleWithSAML request, including // temporary AWS credentials that can be used to make AWS requests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLResponse type AssumeRoleWithSAMLOutput struct { _ struct{} `type:"structure"` @@ -1459,10 +1897,8 @@ type AssumeRoleWithSAMLOutput struct { // The temporary security credentials, which include an access key ID, a secret // access key, and a security (or session) token. // - // Note: The size of the security token that STS APIs return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. As - // of this writing, the typical size is less than 4096 bytes, but that can vary. - // Also, future updates to AWS might require larger sizes. + // The size of the security token that STS API operations return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` // The value of the Issuer element of the SAML assertion. @@ -1479,9 +1915,10 @@ type AssumeRoleWithSAMLOutput struct { // ) ) NameQualifier *string `type:"string"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` // The value of the NameID element in the Subject element of the SAML assertion. @@ -1556,48 +1993,80 @@ func (s *AssumeRoleWithSAMLOutput) SetSubjectType(v string) *AssumeRoleWithSAMLO return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityRequest type AssumeRoleWithWebIdentityInput struct { _ struct{} `type:"structure"` // The duration, in seconds, of the role session. The value can range from 900 - // seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set - // to 3600 seconds. - // - // This is separate from the duration of a console session that you might request - // using the returned credentials. The request to the federation endpoint for - // a console sign-in token takes a SessionDuration parameter that specifies - // the maximum length of the console session, separately from the DurationSeconds - // parameter on this API. For more information, see Creating a URL that Enables - // Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + // seconds (15 minutes) up to the maximum session duration setting for the role. + // This setting can have a value from 1 hour to 12 hours. If you specify a value + // higher than this setting, the operation fails. For example, if you specify + // a session duration of 12 hours, but your administrator set the maximum session + // duration to 6 hours, your operation fails. To learn how to view the maximum + // value for your role, see View the Maximum Session Duration Setting for a + // Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + // in the IAM User Guide. + // + // By default, the value is set to 3600 seconds. + // + // The DurationSeconds parameter is separate from the duration of a console + // session that you might request using the returned credentials. The request + // to the federation endpoint for a console sign-in token takes a SessionDuration + // parameter that specifies the maximum length of the console session. For more + // information, see Creating a URL that Enables Federated Users to Access the + // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) // in the IAM User Guide. DurationSeconds *int64 `min:"900" type:"integer"` - // An IAM policy in JSON format. + // An IAM policy in JSON format that you want to use as an inline session policy. // - // The policy parameter is optional. If you pass a policy, the temporary security - // credentials that are returned by the operation have the permissions that - // are allowed by both the access policy of the role that is being assumed, - // and the policy that you pass. This gives you a way to further restrict the - // permissions for the resulting temporary security credentials. You cannot - // use the passed policy to grant permissions that are in excess of those allowed - // by the access policy of the role that is being assumed. For more information, - // see Permissions for AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html) + // This parameter is optional. Passing policies to this operation returns new + // temporary credentials. The resulting session's permissions are the intersection + // of the role's identity-based policy and the session policies. You can use + // the role's temporary credentials in subsequent AWS API calls to access resources + // in the account that owns the role. You cannot use session policies to grant + // more permissions than those allowed by the identity-based policy of the role + // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The format for this parameter, as described by its regex pattern, is a string - // of characters up to 2048 characters in length. The characters can be any - // ASCII character from the space character to the end of the valid character - // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // The plain text that you use for both inline and managed session policies + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII + // character from the space character to the end of the valid character list + // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The policy plain text must be 2048 bytes or shorter. However, an internal - // conversion compresses it into a packed binary format with a separate limit. - // The PackedPolicySize response element indicates by percentage how close to - // the upper size limit the policy is, with 100% equaling the maximum allowed - // size. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want + // to use as managed session policies. The policies must exist in the same account + // as the role. + // + // This parameter is optional. You can provide up to 10 managed policy ARNs. + // However, the plain text that you use for both inline and managed session + // policies can't exceed 2,048 characters. For more information about ARNs, + // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // Passing policies to this operation returns new temporary credentials. The + // resulting session's permissions are the intersection of the role's identity-based + // policy and the session policies. You can use the role's temporary credentials + // in subsequent AWS API calls to access resources in the account that owns + // the role. You cannot use session policies to grant more permissions than + // those allowed by the identity-based policy of the role that is being assumed. + // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. + PolicyArns []*PolicyDescriptorType `type:"list"` + // The fully qualified host component of the domain name of the identity provider. // // Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com @@ -1674,6 +2143,16 @@ func (s *AssumeRoleWithWebIdentityInput) Validate() error { if s.WebIdentityToken != nil && len(*s.WebIdentityToken) < 4 { invalidParams.Add(request.NewErrParamMinLen("WebIdentityToken", 4)) } + if s.PolicyArns != nil { + for i, v := range s.PolicyArns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1693,6 +2172,12 @@ func (s *AssumeRoleWithWebIdentityInput) SetPolicy(v string) *AssumeRoleWithWebI return s } +// SetPolicyArns sets the PolicyArns field's value. +func (s *AssumeRoleWithWebIdentityInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleWithWebIdentityInput { + s.PolicyArns = v + return s +} + // SetProviderId sets the ProviderId field's value. func (s *AssumeRoleWithWebIdentityInput) SetProviderId(v string) *AssumeRoleWithWebIdentityInput { s.ProviderId = &v @@ -1719,7 +2204,6 @@ func (s *AssumeRoleWithWebIdentityInput) SetWebIdentityToken(v string) *AssumeRo // Contains the response to a successful AssumeRoleWithWebIdentity request, // including temporary AWS credentials that can be used to make AWS requests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityResponse type AssumeRoleWithWebIdentityOutput struct { _ struct{} `type:"structure"` @@ -1738,19 +2222,18 @@ type AssumeRoleWithWebIdentityOutput struct { // The temporary security credentials, which include an access key ID, a secret // access key, and a security token. // - // Note: The size of the security token that STS APIs return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. As - // of this writing, the typical size is less than 4096 bytes, but that can vary. - // Also, future updates to AWS might require larger sizes. + // The size of the security token that STS API operations return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` // The issuing authority of the web identity token presented. For OpenID Connect - // ID Tokens this contains the value of the iss field. For OAuth 2.0 access + // ID tokens, this contains the value of the iss field. For OAuth 2.0 access // tokens, this contains the value of the ProviderId parameter that was passed // in the AssumeRoleWithWebIdentity request. Provider *string `type:"string"` @@ -1812,14 +2295,13 @@ func (s *AssumeRoleWithWebIdentityOutput) SetSubjectFromWebIdentityToken(v strin // The identifiers for the temporary security credentials that the operation // returns. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumedRoleUser type AssumedRoleUser struct { _ struct{} `type:"structure"` // The ARN of the temporary security credentials that are returned from the // AssumeRole action. For more information about ARNs and how to use them in - // policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in Using IAM. + // policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -1855,7 +2337,6 @@ func (s *AssumedRoleUser) SetAssumedRoleId(v string) *AssumedRoleUser { } // AWS credentials for API authentication. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/Credentials type Credentials struct { _ struct{} `type:"structure"` @@ -1867,7 +2348,7 @@ type Credentials struct { // The date on which the current credentials expire. // // Expiration is a required field - Expiration *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + Expiration *time.Time `type:"timestamp" required:"true"` // The secret access key that can be used to sign requests. // @@ -1914,7 +2395,6 @@ func (s *Credentials) SetSessionToken(v string) *Credentials { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageRequest type DecodeAuthorizationMessageInput struct { _ struct{} `type:"structure"` @@ -1959,7 +2439,6 @@ func (s *DecodeAuthorizationMessageInput) SetEncodedMessage(v string) *DecodeAut // A document that contains additional information about the authorization status // of a request from an encoded message that is returned in response to an AWS // request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageResponse type DecodeAuthorizationMessageOutput struct { _ struct{} `type:"structure"` @@ -1984,14 +2463,13 @@ func (s *DecodeAuthorizationMessageOutput) SetDecodedMessage(v string) *DecodeAu } // Identifiers for the federated user that is associated with the credentials. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/FederatedUser type FederatedUser struct { _ struct{} `type:"structure"` // The ARN that specifies the federated user that is associated with the credentials. // For more information about ARNs and how to use them in policies, see IAM - // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in Using IAM. + // Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -2025,7 +2503,73 @@ func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityRequest +type GetAccessKeyInfoInput struct { + _ struct{} `type:"structure"` + + // The identifier of an access key. + // + // This parameter allows (through its regex pattern) a string of characters + // that can consist of any upper- or lowercase letter or digit. + // + // AccessKeyId is a required field + AccessKeyId *string `min:"16" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAccessKeyInfoInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyInfoInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccessKeyInfoInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessKeyInfoInput"} + if s.AccessKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("AccessKeyId")) + } + if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 { + invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *GetAccessKeyInfoInput) SetAccessKeyId(v string) *GetAccessKeyInfoInput { + s.AccessKeyId = &v + return s +} + +type GetAccessKeyInfoOutput struct { + _ struct{} `type:"structure"` + + // The number used to identify the AWS account. + Account *string `type:"string"` +} + +// String returns the string representation +func (s GetAccessKeyInfoOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessKeyInfoOutput) GoString() string { + return s.String() +} + +// SetAccount sets the Account field's value. +func (s *GetAccessKeyInfoOutput) SetAccount(v string) *GetAccessKeyInfoOutput { + s.Account = &v + return s +} + type GetCallerIdentityInput struct { _ struct{} `type:"structure"` } @@ -2042,7 +2586,6 @@ func (s GetCallerIdentityInput) GoString() string { // Contains the response to a successful GetCallerIdentity request, including // information about the entity making the request. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityResponse type GetCallerIdentityOutput struct { _ struct{} `type:"structure"` @@ -2054,8 +2597,8 @@ type GetCallerIdentityOutput struct { Arn *string `min:"20" type:"string"` // The unique identifier of the calling entity. The exact value depends on the - // type of entity making the call. The values returned are those listed in the - // aws:userid column in the Principal table (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) + // type of entity that is making the call. The values returned are those listed + // in the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) // found on the Policy Variables reference page in the IAM User Guide. UserId *string `type:"string"` } @@ -2088,17 +2631,15 @@ func (s *GetCallerIdentityOutput) SetUserId(v string) *GetCallerIdentityOutput { return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenRequest type GetFederationTokenInput struct { _ struct{} `type:"structure"` // The duration, in seconds, that the session should last. Acceptable durations - // for federation sessions range from 900 seconds (15 minutes) to 129600 seconds - // (36 hours), with 43200 seconds (12 hours) as the default. Sessions obtained - // using AWS account (root) credentials are restricted to a maximum of 3600 + // for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds + // (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained + // using AWS account root user credentials are restricted to a maximum of 3,600 // seconds (one hour). If the specified duration is longer than one hour, the - // session obtained by using AWS account (root) credentials defaults to one - // hour. + // session obtained by using root user credentials defaults to one hour. DurationSeconds *int64 `min:"900" type:"integer"` // The name of the federated user. The name is used as an identifier for the @@ -2113,36 +2654,107 @@ type GetFederationTokenInput struct { // Name is a required field Name *string `min:"2" type:"string" required:"true"` - // An IAM policy in JSON format that is passed with the GetFederationToken call - // and evaluated along with the policy or policies that are attached to the - // IAM user whose credentials are used to call GetFederationToken. The passed - // policy is used to scope down the permissions that are available to the IAM - // user, by allowing only a subset of the permissions that are granted to the - // IAM user. The passed policy cannot grant more permissions than those granted - // to the IAM user. The final permissions for the federated user are the most - // restrictive set based on the intersection of the passed policy and the IAM - // user policy. - // - // If you do not pass a policy, the resulting temporary security credentials - // have no effective permissions. The only exception is when the temporary security - // credentials are used to access a resource that has a resource-based policy - // that specifically allows the federated user to access the resource. - // - // The format for this parameter, as described by its regex pattern, is a string - // of characters up to 2048 characters in length. The characters can be any - // ASCII character from the space character to the end of the valid character - // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), - // and carriage return (\u000D) characters. + // An IAM policy in JSON format that you want to use as an inline session policy. + // + // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // to this operation. You can pass a single JSON policy document to use as an + // inline session policy. You can also specify up to 10 managed policies to + // use as managed session policies. // - // The policy plain text must be 2048 bytes or shorter. However, an internal - // conversion compresses it into a packed binary format with a separate limit. - // The PackedPolicySize response element indicates by percentage how close to - // the upper size limit the policy is, with 100% equaling the maximum allowed - // size. + // This parameter is optional. However, if you do not pass any session policies, + // then the resulting federated user session has no permissions. + // + // When you pass session policies, the session permissions are the intersection + // of the IAM user policies and the session policies that you pass. This gives + // you a way to further restrict the permissions for a federated user. You cannot + // use session policies to grant more permissions than those that are defined + // in the permissions policy of the IAM user. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. + // + // The resulting credentials can be used to access a resource that has a resource-based + // policy. If that policy specifically references the federated user session + // in the Principal element of the policy, the session has the permissions allowed + // by the policy. These permissions are granted in addition to the permissions + // that are granted by the session policies. + // + // The plain text that you use for both inline and managed session policies + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII + // character from the space character to the end of the valid character list + // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), + // and carriage return (\u000D) characters. // - // For more information about how permissions work, see Permissions for GetFederationToken - // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html). + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want + // to use as a managed session policy. The policies must exist in the same account + // as the IAM user that is requesting federated access. + // + // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // to this operation. You can pass a single JSON policy document to use as an + // inline session policy. You can also specify up to 10 managed policies to + // use as managed session policies. The plain text that you use for both inline + // and managed session policies can't exceed 2,048 characters. You can provide + // up to 10 managed policy ARNs. For more information about ARNs, see Amazon + // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + // + // This parameter is optional. However, if you do not pass any session policies, + // then the resulting federated user session has no permissions. + // + // When you pass session policies, the session permissions are the intersection + // of the IAM user policies and the session policies that you pass. This gives + // you a way to further restrict the permissions for a federated user. You cannot + // use session policies to grant more permissions than those that are defined + // in the permissions policy of the IAM user. For more information, see Session + // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + // in the IAM User Guide. + // + // The resulting credentials can be used to access a resource that has a resource-based + // policy. If that policy specifically references the federated user session + // in the Principal element of the policy, the session has the permissions allowed + // by the policy. These permissions are granted in addition to the permissions + // that are granted by the session policies. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + PolicyArns []*PolicyDescriptorType `type:"list"` + + // A list of session tags. Each session tag consists of a key name and an associated + // value. For more information about session tags, see Passing Session Tags + // in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plain + // text session tag keys can’t exceed 128 characters and the values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the user you are federating. When you do, session tags override a user + // tag with the same key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This + // means that you cannot have separate Department and department tag keys. Assume + // that the role has the Department=Marketing tag and you pass the department=engineering + // session tag. Department and department are not saved as separate tags, and + // the session tag passed in the request takes precedence over the role tag. + Tags []*Tag `type:"list"` } // String returns the string representation @@ -2170,6 +2782,26 @@ func (s *GetFederationTokenInput) Validate() error { if s.Policy != nil && len(*s.Policy) < 1 { invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) } + if s.PolicyArns != nil { + for i, v := range s.PolicyArns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams)) + } + } + } + if s.Tags != nil { + for i, v := range s.Tags { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -2195,19 +2827,28 @@ func (s *GetFederationTokenInput) SetPolicy(v string) *GetFederationTokenInput { return s } +// SetPolicyArns sets the PolicyArns field's value. +func (s *GetFederationTokenInput) SetPolicyArns(v []*PolicyDescriptorType) *GetFederationTokenInput { + s.PolicyArns = v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetFederationTokenInput) SetTags(v []*Tag) *GetFederationTokenInput { + s.Tags = v + return s +} + // Contains the response to a successful GetFederationToken request, including // temporary AWS credentials that can be used to make AWS requests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenResponse type GetFederationTokenOutput struct { _ struct{} `type:"structure"` // The temporary security credentials, which include an access key ID, a secret // access key, and a security (or session) token. // - // Note: The size of the security token that STS APIs return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. As - // of this writing, the typical size is less than 4096 bytes, but that can vary. - // Also, future updates to AWS might require larger sizes. + // The size of the security token that STS API operations return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` // Identifiers for the federated user associated with the credentials (such @@ -2216,9 +2857,10 @@ type GetFederationTokenOutput struct { // an Amazon S3 bucket policy. FederatedUser *FederatedUser `type:"structure"` - // A percentage value indicating the size of the policy in packed form. The - // service rejects policies for which the packed size is greater than 100 percent - // of the allowed value. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` } @@ -2250,16 +2892,15 @@ func (s *GetFederationTokenOutput) SetPackedPolicySize(v int64) *GetFederationTo return s } -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenRequest type GetSessionTokenInput struct { _ struct{} `type:"structure"` // The duration, in seconds, that the credentials should remain valid. Acceptable - // durations for IAM user sessions range from 900 seconds (15 minutes) to 129600 - // seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions - // for AWS account owners are restricted to a maximum of 3600 seconds (one hour). - // If the duration is longer than one hour, the session for AWS account owners - // defaults to one hour. + // durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600 + // seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions + // for AWS account owners are restricted to a maximum of 3,600 seconds (one + // hour). If the duration is longer than one hour, the session for AWS account + // owners defaults to one hour. DurationSeconds *int64 `min:"900" type:"integer"` // The identification number of the MFA device that is associated with the IAM @@ -2272,14 +2913,14 @@ type GetSessionTokenInput struct { // // The regex used to validate this parameter is a string of characters consisting // of upper- and lower-case alphanumeric characters with no spaces. You can - // also include underscores or any of the following characters: =,.@- + // also include underscores or any of the following characters: =,.@:/- SerialNumber *string `min:"9" type:"string"` // The value provided by the MFA device, if MFA is required. If any policy requires // the IAM user to submit an MFA code, specify this value. If MFA authentication - // is required, and the user does not provide a code when requesting a set of - // temporary security credentials, the user will receive an "access denied" - // response when requesting resources that require MFA authentication. + // is required, the user must provide a code when requesting a set of temporary + // security credentials. A user who fails to provide the code receives an "access + // denied" response when requesting resources that require MFA authentication. // // The format for this parameter, as described by its regex pattern, is a sequence // of six numeric digits. @@ -2335,17 +2976,14 @@ func (s *GetSessionTokenInput) SetTokenCode(v string) *GetSessionTokenInput { // Contains the response to a successful GetSessionToken request, including // temporary AWS credentials that can be used to make AWS requests. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenResponse type GetSessionTokenOutput struct { _ struct{} `type:"structure"` // The temporary security credentials, which include an access key ID, a secret // access key, and a security (or session) token. // - // Note: The size of the security token that STS APIs return is not fixed. We - // strongly recommend that you make no assumptions about the maximum size. As - // of this writing, the typical size is less than 4096 bytes, but that can vary. - // Also, future updates to AWS might require larger sizes. + // The size of the security token that STS API operations return is not fixed. + // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` } @@ -2364,3 +3002,114 @@ func (s *GetSessionTokenOutput) SetCredentials(v *Credentials) *GetSessionTokenO s.Credentials = v return s } + +// A reference to the IAM managed policy that is passed as a session policy +// for a role session or a federated user session. +type PolicyDescriptorType struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session + // policy for the role. For more information about ARNs, see Amazon Resource + // Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + Arn *string `locationName:"arn" min:"20" type:"string"` +} + +// String returns the string representation +func (s PolicyDescriptorType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyDescriptorType) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PolicyDescriptorType) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PolicyDescriptorType"} + if s.Arn != nil && len(*s.Arn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *PolicyDescriptorType) SetArn(v string) *PolicyDescriptorType { + s.Arn = &v + return s +} + +// You can pass custom key-value pair attributes when you assume a role or federate +// a user. These are called session tags. You can then use the session tags +// to control access to resources. For more information, see Tagging AWS STS +// Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +type Tag struct { + _ struct{} `type:"structure"` + + // The key for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag keys can’t + // exceed 128 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v + return s +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go index 4010cc7..d5307fc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go @@ -3,10 +3,9 @@ package sts import "github.com/aws/aws-sdk-go/aws/request" func init() { - initRequest = func(r *request.Request) { - switch r.Operation.Name { - case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: - r.Handlers.Sign.Clear() // these operations are unsigned - } - } + initRequest = customizeRequest +} + +func customizeRequest(r *request.Request) { + r.RetryErrorCodes = append(r.RetryErrorCodes, ErrCodeIDPCommunicationErrorException) } 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 6f870d3..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package sts_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/aws/aws-sdk-go/aws" - "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() - assert.NoError(t, err) - assert.Equal(t, "", req.HTTPRequest.Header.Get("Authorization")) -} - -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() - assert.NoError(t, err) - assert.Equal(t, "", req.HTTPRequest.Header.Get("Authorization")) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go new file mode 100644 index 0000000..fcb720d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go @@ -0,0 +1,108 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package sts provides the client and types for making API +// requests to AWS Security Token Service. +// +// The AWS Security Token Service (STS) is a web service that enables you to +// request temporary, limited-privilege credentials for AWS Identity and Access +// Management (IAM) users or for users that you authenticate (federated users). +// This guide provides descriptions of the STS API. For more detailed information +// about using this service, go to Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html). +// +// For information about setting up signatures and authorization through the +// API, go to Signing AWS API Requests (https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) +// in the AWS General Reference. For general information about the Query API, +// go to Making Query Requests (https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) +// in Using IAM. For information about using security tokens with other AWS +// products, go to AWS Services That Work with IAM (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) +// in the IAM User Guide. +// +// If you're new to AWS and need additional technical information about a specific +// AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/ +// (http://aws.amazon.com/documentation/). +// +// Endpoints +// +// By default, AWS Security Token Service (STS) is available as a global service, +// and all AWS STS requests go to a single endpoint at https://sts.amazonaws.com. +// Global requests map to the US East (N. Virginia) region. AWS recommends using +// Regional AWS STS endpoints instead of the global endpoint to reduce latency, +// build in redundancy, and increase session token validity. For more information, +// see Managing AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. +// +// Most AWS Regions are enabled for operations in all AWS services by default. +// Those Regions are automatically activated for use with AWS STS. Some Regions, +// such as Asia Pacific (Hong Kong), must be manually enabled. To learn more +// about enabling and disabling AWS Regions, see Managing AWS Regions (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) +// in the AWS General Reference. When you enable these AWS Regions, they are +// automatically activated for use with AWS STS. You cannot activate the STS +// endpoint for a Region that is disabled. Tokens that are valid in all AWS +// Regions are longer than tokens that are valid in Regions that are enabled +// by default. Changing this setting might affect existing systems where you +// temporarily store tokens. For more information, see Managing Global Endpoint +// Session Tokens (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-manage-tokens) +// in the IAM User Guide. +// +// After you activate a Region for use with AWS STS, you can direct AWS STS +// API calls to that Region. AWS STS recommends that you provide both the Region +// and endpoint when you make calls to a Regional endpoint. You can provide +// the Region alone for manually enabled Regions, such as Asia Pacific (Hong +// Kong). In this case, the calls are directed to the STS Regional endpoint. +// However, if you provide the Region alone for Regions enabled by default, +// the calls are directed to the global endpoint of https://sts.amazonaws.com. +// +// To view the list of AWS STS endpoints and whether they are active by default, +// see Writing Code to Use AWS STS Regions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#id_credentials_temp_enable-regions_writing_code) +// in the IAM User Guide. +// +// Recording API requests +// +// STS supports AWS CloudTrail, which is a service that records AWS calls for +// your AWS account and delivers log files to an Amazon S3 bucket. By using +// information collected by CloudTrail, you can determine what requests were +// successfully made to STS, who made the request, when it was made, and so +// on. +// +// If you activate AWS STS endpoints in Regions other than the default global +// endpoint, then you must also turn on CloudTrail logging in those Regions. +// This is necessary to record any AWS STS API calls that are made in those +// Regions. For more information, see Turning On CloudTrail in Additional Regions +// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/aggregating_logs_regions_turn_on_ct.html) +// in the AWS CloudTrail User Guide. +// +// AWS Security Token Service (STS) is a global service with a single endpoint +// at https://sts.amazonaws.com. Calls to this endpoint are logged as calls +// to a global service. However, because this endpoint is physically located +// in the US East (N. Virginia) Region, your logs list us-east-1 as the event +// Region. CloudTrail does not write these logs to the US East (Ohio) Region +// unless you choose to include global service logs in that Region. CloudTrail +// writes calls to all Regional endpoints to their respective Regions. For example, +// calls to sts.us-east-2.amazonaws.com are published to the US East (Ohio) +// Region and calls to sts.eu-central-1.amazonaws.com are published to the EU +// (Frankfurt) Region. +// +// To learn more about CloudTrail, including how to turn it on and find your +// log files, see the AWS CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). +// +// See https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15 for more information on this service. +// +// See sts package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sts/ +// +// Using the Client +// +// To contact AWS Security Token Service with the SDK use the New function to create +// a new service client. With that client you can make API requests to the service. +// These clients are safe to use concurrently. +// +// See the SDK's documentation for more information on how to use the SDK. +// https://docs.aws.amazon.com/sdk-for-go/api/ +// +// See aws.Config documentation for more information on configuring SDK clients. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +// +// See the AWS Security Token Service client STS for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/sts/#New +package sts diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go index e24884e..a233f54 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go @@ -14,11 +14,11 @@ const ( // ErrCodeIDPCommunicationErrorException for service response error code // "IDPCommunicationError". // - // The request could not be fulfilled because the non-AWS identity provider - // (IDP) that was asked to verify the incoming identity token could not be reached. - // This is often a transient error caused by network conditions. Retry the request + // The request could not be fulfilled because the identity provider (IDP) that + // was asked to verify the incoming identity token could not be reached. This + // is often a transient error caused by network conditions. Retry the request // a limited number of times so that you don't exceed the request rate. If the - // error persists, the non-AWS identity provider might be down or not responding. + // error persists, the identity provider might be down or not responding. ErrCodeIDPCommunicationErrorException = "IDPCommunicationError" // ErrCodeIDPRejectedClaimException for service response error code @@ -56,9 +56,18 @@ const ( // ErrCodePackedPolicyTooLargeException for service response error code // "PackedPolicyTooLarge". // - // The request was rejected because the policy document was too large. The error - // message describes how big the policy document is, in packed form, as a percentage - // of what the API allows. + // The request was rejected because the total packed size of the session policies + // and session tags combined was too large. An AWS conversion compresses the + // session policy document, session policy ARNs, and session tags into a packed + // binary format that has a separate limit. The error message indicates by percentage + // how close the policies and tags are to the upper size limit. For more information, + // see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // You could receive this error even though you meet other defined session policy + // and session tag limits. For more information, see IAM and STS Entity Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) + // in the IAM User Guide. ErrCodePackedPolicyTooLargeException = "PackedPolicyTooLarge" // ErrCodeRegionDisabledException for service response error code @@ -67,7 +76,7 @@ const ( // STS is not activated in the requested region for the account that is being // asked to generate credentials. The account administrator must use the IAM // console to activate STS in that region. For more information, see Activating - // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) + // and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the IAM User Guide. ErrCodeRegionDisabledException = "RegionDisabledException" ) 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 05df494..0000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/examples_test.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sts_test - -import ( - "bytes" - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/sts" -) - -var _ time.Duration -var _ bytes.Buffer - -func ExampleSTS_AssumeRole() { - sess := session.Must(session.NewSession()) - - svc := sts.New(sess) - - params := &sts.AssumeRoleInput{ - RoleArn: aws.String("arnType"), // Required - RoleSessionName: aws.String("roleSessionNameType"), // Required - DurationSeconds: aws.Int64(1), - ExternalId: aws.String("externalIdType"), - Policy: aws.String("sessionPolicyDocumentType"), - SerialNumber: aws.String("serialNumberType"), - TokenCode: aws.String("tokenCodeType"), - } - resp, err := svc.AssumeRole(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSTS_AssumeRoleWithSAML() { - sess := session.Must(session.NewSession()) - - svc := sts.New(sess) - - params := &sts.AssumeRoleWithSAMLInput{ - PrincipalArn: aws.String("arnType"), // Required - RoleArn: aws.String("arnType"), // Required - SAMLAssertion: aws.String("SAMLAssertionType"), // Required - DurationSeconds: aws.Int64(1), - Policy: aws.String("sessionPolicyDocumentType"), - } - resp, err := svc.AssumeRoleWithSAML(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSTS_AssumeRoleWithWebIdentity() { - sess := session.Must(session.NewSession()) - - svc := sts.New(sess) - - params := &sts.AssumeRoleWithWebIdentityInput{ - RoleArn: aws.String("arnType"), // Required - RoleSessionName: aws.String("roleSessionNameType"), // Required - WebIdentityToken: aws.String("clientTokenType"), // Required - DurationSeconds: aws.Int64(1), - Policy: aws.String("sessionPolicyDocumentType"), - ProviderId: aws.String("urlType"), - } - resp, err := svc.AssumeRoleWithWebIdentity(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSTS_DecodeAuthorizationMessage() { - sess := session.Must(session.NewSession()) - - svc := sts.New(sess) - - params := &sts.DecodeAuthorizationMessageInput{ - EncodedMessage: aws.String("encodedMessageType"), // Required - } - resp, err := svc.DecodeAuthorizationMessage(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSTS_GetCallerIdentity() { - sess := session.Must(session.NewSession()) - - svc := sts.New(sess) - - var params *sts.GetCallerIdentityInput - resp, err := svc.GetCallerIdentity(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSTS_GetFederationToken() { - sess := session.Must(session.NewSession()) - - svc := sts.New(sess) - - params := &sts.GetFederationTokenInput{ - Name: aws.String("userNameType"), // Required - DurationSeconds: aws.Int64(1), - Policy: aws.String("sessionPolicyDocumentType"), - } - resp, err := svc.GetFederationToken(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} - -func ExampleSTS_GetSessionToken() { - sess := session.Must(session.NewSession()) - - svc := sts.New(sess) - - params := &sts.GetSessionTokenInput{ - DurationSeconds: aws.Int64(1), - SerialNumber: aws.String("serialNumberType"), - TokenCode: aws.String("tokenCodeType"), - } - resp, err := svc.GetSessionToken(params) - - if err != nil { - // Print the error, cast err to awserr.Error to get the Code and - // Message from an error. - fmt.Println(err.Error()) - return - } - - // Pretty-print the response data. - fmt.Println(resp) -} 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 be21838..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 @@ -11,54 +11,12 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/query" ) -// The AWS Security Token Service (STS) is a web service that enables you to -// request temporary, limited-privilege credentials for AWS Identity and Access -// Management (IAM) users or for users that you authenticate (federated users). -// This guide provides descriptions of the STS API. For more detailed information -// about using this service, go to Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html). +// STS provides the API operation methods for making requests to +// AWS Security Token Service. See this package's package overview docs +// for details on the service. // -// As an alternative to using the API, you can use one of the AWS SDKs, which -// consist of libraries and sample code for various programming languages and -// platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient -// way to create programmatic access to STS. For example, the SDKs take care -// of cryptographically signing requests, managing errors, and retrying requests -// automatically. For information about the AWS SDKs, including how to download -// and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/). -// -// For information about setting up signatures and authorization through the -// API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html) -// in the AWS General Reference. For general information about the Query API, -// go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html) -// in Using IAM. For information about using security tokens with other AWS -// products, go to AWS Services That Work with IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) -// in the IAM User Guide. -// -// If you're new to AWS and need additional technical information about a specific -// AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/ -// (http://aws.amazon.com/documentation/). -// -// Endpoints -// -// The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com -// that maps to the US East (N. Virginia) region. Additional regions are available -// and are activated by default. For more information, see Activating and Deactivating -// AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) -// in the IAM User Guide. -// -// For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region) -// in the AWS General Reference. -// -// Recording API requests -// -// STS supports AWS CloudTrail, which is a service that records AWS calls for -// your AWS account and delivers log files to an Amazon S3 bucket. By using -// information collected by CloudTrail, you can determine what requests were -// successfully made to STS, who made the request, when it was made, and so -// on. To learn more about CloudTrail, including how to turn it on and find -// your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). -// The service client's operations are safe to be used concurrently. -// It is not safe to mutate any of the client's properties though. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15 +// STS methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. type STS struct { *client.Client } @@ -71,8 +29,9 @@ var initRequest func(*request.Request) // Service information constants const ( - ServiceName = "sts" // Service endpoint prefix API calls made to. - EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata. + ServiceName = "sts" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "STS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the STS client with a session. @@ -80,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a STS client from just a session. // svc := sts.New(mySession) // @@ -87,18 +48,20 @@ const ( // svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *STS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *STS { svc := &STS{ Client: client.New( cfg, metadata.ClientInfo{ ServiceName: ServiceName, + ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2011-06-15", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go new file mode 100644 index 0000000..e2e1d6e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go @@ -0,0 +1,96 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package stsiface provides an interface to enable mocking the AWS Security Token Service service client +// for testing your code. +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. +package stsiface + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/sts" +) + +// STSAPI provides an interface to enable mocking the +// sts.STS service client's API operation, +// paginators, and waiters. This make unit testing your code that calls out +// to the SDK's service client's calls easier. +// +// The best way to use this interface is so the SDK's service client's calls +// can be stubbed out for unit testing your code with the SDK without needing +// to inject custom request handlers into the SDK's request pipeline. +// +// // myFunc uses an SDK service client to make a request to +// // AWS Security Token Service. +// func myFunc(svc stsiface.STSAPI) bool { +// // Make svc.AssumeRole request +// } +// +// func main() { +// sess := session.New() +// svc := sts.New(sess) +// +// myFunc(svc) +// } +// +// In your _test.go file: +// +// // Define a mock struct to be used in your unit tests of myFunc. +// type mockSTSClient struct { +// stsiface.STSAPI +// } +// func (m *mockSTSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) { +// // mock response/functionality +// } +// +// func TestMyFunc(t *testing.T) { +// // Setup Test +// mockSvc := &mockSTSClient{} +// +// myfunc(mockSvc) +// +// // Verify myFunc's functionality +// } +// +// It is important to note that this interface will have breaking changes +// when the service model is updated and adds new API operations, paginators, +// and waiters. Its suggested to use the pattern above for testing, or using +// tooling to generate mocks to satisfy the interfaces. +type STSAPI interface { + AssumeRole(*sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) + AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error) + AssumeRoleRequest(*sts.AssumeRoleInput) (*request.Request, *sts.AssumeRoleOutput) + + AssumeRoleWithSAML(*sts.AssumeRoleWithSAMLInput) (*sts.AssumeRoleWithSAMLOutput, error) + AssumeRoleWithSAMLWithContext(aws.Context, *sts.AssumeRoleWithSAMLInput, ...request.Option) (*sts.AssumeRoleWithSAMLOutput, error) + AssumeRoleWithSAMLRequest(*sts.AssumeRoleWithSAMLInput) (*request.Request, *sts.AssumeRoleWithSAMLOutput) + + AssumeRoleWithWebIdentity(*sts.AssumeRoleWithWebIdentityInput) (*sts.AssumeRoleWithWebIdentityOutput, error) + AssumeRoleWithWebIdentityWithContext(aws.Context, *sts.AssumeRoleWithWebIdentityInput, ...request.Option) (*sts.AssumeRoleWithWebIdentityOutput, error) + AssumeRoleWithWebIdentityRequest(*sts.AssumeRoleWithWebIdentityInput) (*request.Request, *sts.AssumeRoleWithWebIdentityOutput) + + DecodeAuthorizationMessage(*sts.DecodeAuthorizationMessageInput) (*sts.DecodeAuthorizationMessageOutput, error) + DecodeAuthorizationMessageWithContext(aws.Context, *sts.DecodeAuthorizationMessageInput, ...request.Option) (*sts.DecodeAuthorizationMessageOutput, error) + DecodeAuthorizationMessageRequest(*sts.DecodeAuthorizationMessageInput) (*request.Request, *sts.DecodeAuthorizationMessageOutput) + + GetAccessKeyInfo(*sts.GetAccessKeyInfoInput) (*sts.GetAccessKeyInfoOutput, error) + GetAccessKeyInfoWithContext(aws.Context, *sts.GetAccessKeyInfoInput, ...request.Option) (*sts.GetAccessKeyInfoOutput, error) + GetAccessKeyInfoRequest(*sts.GetAccessKeyInfoInput) (*request.Request, *sts.GetAccessKeyInfoOutput) + + GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error) + GetCallerIdentityWithContext(aws.Context, *sts.GetCallerIdentityInput, ...request.Option) (*sts.GetCallerIdentityOutput, error) + GetCallerIdentityRequest(*sts.GetCallerIdentityInput) (*request.Request, *sts.GetCallerIdentityOutput) + + GetFederationToken(*sts.GetFederationTokenInput) (*sts.GetFederationTokenOutput, error) + GetFederationTokenWithContext(aws.Context, *sts.GetFederationTokenInput, ...request.Option) (*sts.GetFederationTokenOutput, error) + GetFederationTokenRequest(*sts.GetFederationTokenInput) (*request.Request, *sts.GetFederationTokenOutput) + + GetSessionToken(*sts.GetSessionTokenInput) (*sts.GetSessionTokenOutput, error) + GetSessionTokenWithContext(aws.Context, *sts.GetSessionTokenInput, ...request.Option) (*sts.GetSessionTokenOutput, error) + GetSessionTokenRequest(*sts.GetSessionTokenInput) (*request.Request, *sts.GetSessionTokenOutput) +} + +var _ STSAPI = (*sts.STS)(nil) diff --git a/vendor/github.com/davecgh/go-spew/LICENSE b/vendor/github.com/davecgh/go-spew/LICENSE deleted file mode 100644 index bb67332..0000000 --- a/vendor/github.com/davecgh/go-spew/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -ISC License - -Copyright (c) 2012-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. diff --git a/vendor/github.com/davecgh/go-spew/spew/bypass.go b/vendor/github.com/davecgh/go-spew/spew/bypass.go deleted file mode 100644 index d42a0bc..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/bypass.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2015 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 - -package spew - -import ( - "reflect" - "unsafe" -) - -const ( - // UnsafeDisabled is a build-time constant which specifies whether or - // not access to the unsafe package is available. - UnsafeDisabled = false - - // ptrSize is the size of a pointer on the current arch. - ptrSize = unsafe.Sizeof((*byte)(nil)) -) - -var ( - // offsetPtr, offsetScalar, and offsetFlag are the offsets for the - // internal reflect.Value fields. These values are valid before golang - // commit ecccf07e7f9d which changed the format. The are also valid - // after commit 82f48826c6c7 which changed the format again to mirror - // the original format. Code in the init function updates these offsets - // as necessary. - offsetPtr = uintptr(ptrSize) - offsetScalar = uintptr(0) - offsetFlag = uintptr(ptrSize * 2) - - // flagKindWidth and flagKindShift indicate various bits that the - // reflect package uses internally to track kind information. - // - // flagRO indicates whether or not the value field of a reflect.Value is - // read-only. - // - // flagIndir indicates whether the value field of a reflect.Value is - // the actual data or a pointer to the data. - // - // These values are valid before golang commit 90a7c3c86944 which - // changed their positions. Code in the init function updates these - // flags as necessary. - flagKindWidth = uintptr(5) - flagKindShift = uintptr(flagKindWidth - 1) - flagRO = uintptr(1 << 0) - flagIndir = uintptr(1 << 1) -) - -func init() { - // Older versions of reflect.Value stored small integers directly in the - // ptr field (which is named val in the older versions). Versions - // between commits ecccf07e7f9d and 82f48826c6c7 added a new field named - // scalar for this purpose which unfortunately came before the flag - // field, so the offset of the flag field is different for those - // versions. - // - // This code constructs a new reflect.Value from a known small integer - // and checks if the size of the reflect.Value struct indicates it has - // the scalar field. When it does, the offsets are updated accordingly. - vv := reflect.ValueOf(0xf00) - if unsafe.Sizeof(vv) == (ptrSize * 4) { - offsetScalar = ptrSize * 2 - offsetFlag = ptrSize * 3 - } - - // Commit 90a7c3c86944 changed the flag positions such that the low - // order bits are the kind. This code extracts the kind from the flags - // field and ensures it's the correct type. When it's not, the flag - // order has been changed to the newer format, so the flags are updated - // accordingly. - upf := unsafe.Pointer(uintptr(unsafe.Pointer(&vv)) + offsetFlag) - upfv := *(*uintptr)(upf) - flagKindMask := uintptr((1<>flagKindShift != uintptr(reflect.Int) { - flagKindShift = 0 - flagRO = 1 << 5 - flagIndir = 1 << 6 - - // Commit adf9b30e5594 modified the flags to separate the - // flagRO flag into two bits which specifies whether or not the - // field is embedded. This causes flagIndir to move over a bit - // and means that flagRO is the combination of either of the - // original flagRO bit and the new bit. - // - // This code detects the change by extracting what used to be - // the indirect bit to ensure it's set. When it's not, the flag - // order has been changed to the newer format, so the flags are - // updated accordingly. - if upfv&flagIndir == 0 { - flagRO = 3 << 5 - flagIndir = 1 << 7 - } - } -} - -// unsafeReflectValue converts the passed reflect.Value into a one that bypasses -// the typical safety restrictions preventing access to unaddressable and -// unexported data. It works by digging the raw pointer to the underlying -// value out of the protected value and generating a new unprotected (unsafe) -// reflect.Value to it. -// -// This allows us to check for implementations of the Stringer and error -// interfaces to be used for pretty printing ordinarily unaddressable and -// inaccessible values such as unexported struct fields. -func unsafeReflectValue(v reflect.Value) (rv reflect.Value) { - indirects := 1 - vt := v.Type() - upv := unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetPtr) - rvf := *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + offsetFlag)) - if rvf&flagIndir != 0 { - vt = reflect.PtrTo(v.Type()) - indirects++ - } else if offsetScalar != 0 { - // The value is in the scalar field when it's not one of the - // reference types. - switch vt.Kind() { - case reflect.Uintptr: - case reflect.Chan: - case reflect.Func: - case reflect.Map: - case reflect.Ptr: - case reflect.UnsafePointer: - default: - upv = unsafe.Pointer(uintptr(unsafe.Pointer(&v)) + - offsetScalar) - } - } - - pv := reflect.NewAt(vt, upv) - rv = pv - for i := 0; i < indirects; i++ { - rv = rv.Elem() - } - return rv -} diff --git a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go b/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go deleted file mode 100644 index e47a4e7..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/bypasssafe.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) 2015 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 running on Google App Engine, compiled by GopherJS, or -// "-tags safe" is added to the go build command line. The "disableunsafe" -// tag is deprecated and thus should not be used. -// +build js appengine safe disableunsafe - -package spew - -import "reflect" - -const ( - // UnsafeDisabled is a build-time constant which specifies whether or - // not access to the unsafe package is available. - UnsafeDisabled = true -) - -// unsafeReflectValue typically converts the passed reflect.Value into a one -// that bypasses the typical safety restrictions preventing access to -// unaddressable and unexported data. However, doing this relies on access to -// the unsafe package. This is a stub version which simply returns the passed -// reflect.Value when the unsafe package is not available. -func unsafeReflectValue(v reflect.Value) reflect.Value { - return v -} diff --git a/vendor/github.com/davecgh/go-spew/spew/common.go b/vendor/github.com/davecgh/go-spew/spew/common.go deleted file mode 100644 index 14f02dc..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/common.go +++ /dev/null @@ -1,341 +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. - */ - -package spew - -import ( - "bytes" - "fmt" - "io" - "reflect" - "sort" - "strconv" -) - -// Some constants in the form of bytes to avoid string overhead. This mirrors -// the technique used in the fmt package. -var ( - panicBytes = []byte("(PANIC=") - plusBytes = []byte("+") - iBytes = []byte("i") - trueBytes = []byte("true") - falseBytes = []byte("false") - interfaceBytes = []byte("(interface {})") - commaNewlineBytes = []byte(",\n") - newlineBytes = []byte("\n") - openBraceBytes = []byte("{") - openBraceNewlineBytes = []byte("{\n") - closeBraceBytes = []byte("}") - asteriskBytes = []byte("*") - colonBytes = []byte(":") - colonSpaceBytes = []byte(": ") - openParenBytes = []byte("(") - closeParenBytes = []byte(")") - spaceBytes = []byte(" ") - pointerChainBytes = []byte("->") - nilAngleBytes = []byte("") - maxNewlineBytes = []byte("\n") - maxShortBytes = []byte("") - circularBytes = []byte("") - circularShortBytes = []byte("") - invalidAngleBytes = []byte("") - openBracketBytes = []byte("[") - closeBracketBytes = []byte("]") - percentBytes = []byte("%") - precisionBytes = []byte(".") - openAngleBytes = []byte("<") - closeAngleBytes = []byte(">") - openMapBytes = []byte("map[") - closeMapBytes = []byte("]") - lenEqualsBytes = []byte("len=") - capEqualsBytes = []byte("cap=") -) - -// hexDigits is used to map a decimal value to a hex digit. -var hexDigits = "0123456789abcdef" - -// catchPanic handles any panics that might occur during the handleMethods -// calls. -func catchPanic(w io.Writer, v reflect.Value) { - if err := recover(); err != nil { - w.Write(panicBytes) - fmt.Fprintf(w, "%v", err) - w.Write(closeParenBytes) - } -} - -// handleMethods attempts to call the Error and String methods on the underlying -// type the passed reflect.Value represents and outputes the result to Writer w. -// -// It handles panics in any called methods by catching and displaying the error -// as the formatted value. -func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { - // We need an interface to check if the type implements the error or - // Stringer interface. However, the reflect package won't give us an - // interface on certain things like unexported struct fields in order - // to enforce visibility rules. We use unsafe, when it's available, - // to bypass these restrictions since this package does not mutate the - // values. - if !v.CanInterface() { - if UnsafeDisabled { - return false - } - - v = unsafeReflectValue(v) - } - - // Choose whether or not to do error and Stringer interface lookups against - // the base type or a pointer to the base type depending on settings. - // Technically calling one of these methods with a pointer receiver can - // mutate the value, however, types which choose to satisify an error or - // Stringer interface with a pointer receiver should not be mutating their - // state inside these interface methods. - if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { - v = unsafeReflectValue(v) - } - if v.CanAddr() { - v = v.Addr() - } - - // Is it an error or Stringer? - switch iface := v.Interface().(type) { - case error: - defer catchPanic(w, v) - if cs.ContinueOnMethod { - w.Write(openParenBytes) - w.Write([]byte(iface.Error())) - w.Write(closeParenBytes) - w.Write(spaceBytes) - return false - } - - w.Write([]byte(iface.Error())) - return true - - case fmt.Stringer: - defer catchPanic(w, v) - if cs.ContinueOnMethod { - w.Write(openParenBytes) - w.Write([]byte(iface.String())) - w.Write(closeParenBytes) - w.Write(spaceBytes) - return false - } - w.Write([]byte(iface.String())) - return true - } - return false -} - -// printBool outputs a boolean value as true or false to Writer w. -func printBool(w io.Writer, val bool) { - if val { - w.Write(trueBytes) - } else { - w.Write(falseBytes) - } -} - -// printInt outputs a signed integer value to Writer w. -func printInt(w io.Writer, val int64, base int) { - w.Write([]byte(strconv.FormatInt(val, base))) -} - -// printUint outputs an unsigned integer value to Writer w. -func printUint(w io.Writer, val uint64, base int) { - w.Write([]byte(strconv.FormatUint(val, base))) -} - -// printFloat outputs a floating point value using the specified precision, -// which is expected to be 32 or 64bit, to Writer w. -func printFloat(w io.Writer, val float64, precision int) { - w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) -} - -// printComplex outputs a complex value using the specified float precision -// for the real and imaginary parts to Writer w. -func printComplex(w io.Writer, c complex128, floatPrecision int) { - r := real(c) - w.Write(openParenBytes) - w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) - i := imag(c) - if i >= 0 { - w.Write(plusBytes) - } - w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) - w.Write(iBytes) - w.Write(closeParenBytes) -} - -// printHexPtr outputs a uintptr formatted as hexidecimal with a leading '0x' -// prefix to Writer w. -func printHexPtr(w io.Writer, p uintptr) { - // Null pointer. - num := uint64(p) - if num == 0 { - w.Write(nilAngleBytes) - return - } - - // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix - buf := make([]byte, 18) - - // It's simpler to construct the hex string right to left. - base := uint64(16) - i := len(buf) - 1 - for num >= base { - buf[i] = hexDigits[num%base] - num /= base - i-- - } - buf[i] = hexDigits[num] - - // Add '0x' prefix. - i-- - buf[i] = 'x' - i-- - buf[i] = '0' - - // Strip unused leading bytes. - buf = buf[i:] - w.Write(buf) -} - -// valuesSorter implements sort.Interface to allow a slice of reflect.Value -// elements to be sorted. -type valuesSorter struct { - values []reflect.Value - strings []string // either nil or same len and values - cs *ConfigState -} - -// newValuesSorter initializes a valuesSorter instance, which holds a set of -// surrogate keys on which the data should be sorted. It uses flags in -// ConfigState to decide if and how to populate those surrogate keys. -func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { - vs := &valuesSorter{values: values, cs: cs} - if canSortSimply(vs.values[0].Kind()) { - return vs - } - if !cs.DisableMethods { - vs.strings = make([]string, len(values)) - for i := range vs.values { - b := bytes.Buffer{} - if !handleMethods(cs, &b, vs.values[i]) { - vs.strings = nil - break - } - vs.strings[i] = b.String() - } - } - if vs.strings == nil && cs.SpewKeys { - vs.strings = make([]string, len(values)) - for i := range vs.values { - vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) - } - } - return vs -} - -// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted -// directly, or whether it should be considered for sorting by surrogate keys -// (if the ConfigState allows it). -func canSortSimply(kind reflect.Kind) bool { - // This switch parallels valueSortLess, except for the default case. - switch kind { - case reflect.Bool: - return true - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return true - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - return true - case reflect.Float32, reflect.Float64: - return true - case reflect.String: - return true - case reflect.Uintptr: - return true - case reflect.Array: - return true - } - return false -} - -// Len returns the number of values in the slice. It is part of the -// sort.Interface implementation. -func (s *valuesSorter) Len() int { - return len(s.values) -} - -// Swap swaps the values at the passed indices. It is part of the -// sort.Interface implementation. -func (s *valuesSorter) Swap(i, j int) { - s.values[i], s.values[j] = s.values[j], s.values[i] - if s.strings != nil { - s.strings[i], s.strings[j] = s.strings[j], s.strings[i] - } -} - -// valueSortLess returns whether the first value should sort before the second -// value. It is used by valueSorter.Less as part of the sort.Interface -// implementation. -func valueSortLess(a, b reflect.Value) bool { - switch a.Kind() { - case reflect.Bool: - return !a.Bool() && b.Bool() - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return a.Int() < b.Int() - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - return a.Uint() < b.Uint() - case reflect.Float32, reflect.Float64: - return a.Float() < b.Float() - case reflect.String: - return a.String() < b.String() - case reflect.Uintptr: - return a.Uint() < b.Uint() - case reflect.Array: - // Compare the contents of both arrays. - l := a.Len() - for i := 0; i < l; i++ { - av := a.Index(i) - bv := b.Index(i) - if av.Interface() == bv.Interface() { - continue - } - return valueSortLess(av, bv) - } - } - return a.String() < b.String() -} - -// Less returns whether the value at index i should sort before the -// value at index j. It is part of the sort.Interface implementation. -func (s *valuesSorter) Less(i, j int) bool { - if s.strings == nil { - return valueSortLess(s.values[i], s.values[j]) - } - return s.strings[i] < s.strings[j] -} - -// sortValues is a sort function that handles both native types and any type that -// can be converted to error or Stringer. Other inputs are sorted according to -// their Value.String() value to ensure display stability. -func sortValues(values []reflect.Value, cs *ConfigState) { - if len(values) == 0 { - return - } - sort.Sort(newValuesSorter(values, cs)) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/config.go b/vendor/github.com/davecgh/go-spew/spew/config.go deleted file mode 100644 index 9db83c6..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/config.go +++ /dev/null @@ -1,306 +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. - */ - -package spew - -import ( - "bytes" - "fmt" - "io" - "os" -) - -// ConfigState houses the configuration options used by spew to format and -// display values. There is a global instance, Config, that is used to control -// all top-level Formatter and Dump functionality. Each ConfigState instance -// provides methods equivalent to the top-level functions. -// -// The zero value for ConfigState provides no indentation. You would typically -// want to set it to a space or a tab. -// -// Alternatively, you can use NewDefaultConfig to get a ConfigState instance -// with default settings. See the documentation of NewDefaultConfig for default -// values. -type ConfigState struct { - // Indent specifies the string to use for each indentation level. The - // global config instance that all top-level functions use set this to a - // single space by default. If you would like more indentation, you might - // set this to a tab with "\t" or perhaps two spaces with " ". - Indent string - - // MaxDepth controls the maximum number of levels to descend into nested - // data structures. The default, 0, means there is no limit. - // - // NOTE: Circular data structures are properly detected, so it is not - // necessary to set this value unless you specifically want to limit deeply - // nested data structures. - MaxDepth int - - // DisableMethods specifies whether or not error and Stringer interfaces are - // invoked for types that implement them. - DisableMethods bool - - // DisablePointerMethods specifies whether or not to check for and invoke - // error and Stringer interfaces on types which only accept a pointer - // receiver when the current type is not a pointer. - // - // NOTE: This might be an unsafe action since calling one of these methods - // with a pointer receiver could technically mutate the value, however, - // in practice, types which choose to satisify an error or Stringer - // interface with a pointer receiver should not be mutating their state - // inside these interface methods. As a result, 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. - DisablePointerMethods bool - - // DisablePointerAddresses specifies whether to disable the printing of - // pointer addresses. This is useful when diffing data structures in tests. - DisablePointerAddresses bool - - // DisableCapacities specifies whether to disable the printing of capacities - // for arrays, slices, maps and channels. This is useful when diffing - // data structures in tests. - DisableCapacities bool - - // ContinueOnMethod specifies whether or not recursion should continue once - // a custom error or Stringer interface is invoked. The default, false, - // means it will print the results of invoking the custom error or Stringer - // interface and return immediately instead of continuing to recurse into - // the internals of the data type. - // - // NOTE: This flag does not have any effect if method invocation is disabled - // via the DisableMethods or DisablePointerMethods options. - ContinueOnMethod bool - - // 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 - // that support the error or Stringer interfaces (if methods are - // enabled) are supported, with other types sorted according to the - // reflect.Value.String() output which guarantees display stability. - SortKeys bool - - // 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. - SpewKeys bool -} - -// Config is the active configuration of the top-level functions. -// The configuration can be changed by modifying the contents of spew.Config. -var Config = ConfigState{Indent: " "} - -// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the formatted string as a value that satisfies error. See NewFormatter -// for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { - return fmt.Errorf(format, c.convertArgs(a)...) -} - -// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprint(w, c.convertArgs(a)...) -} - -// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - return fmt.Fprintf(w, format, c.convertArgs(a)...) -} - -// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it -// passed with a Formatter interface returned by c.NewFormatter. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprintln(w, c.convertArgs(a)...) -} - -// Print is a wrapper for fmt.Print that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Print(a ...interface{}) (n int, err error) { - return fmt.Print(c.convertArgs(a)...) -} - -// Printf is a wrapper for fmt.Printf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { - return fmt.Printf(format, c.convertArgs(a)...) -} - -// Println is a wrapper for fmt.Println that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Println(a ...interface{}) (n int, err error) { - return fmt.Println(c.convertArgs(a)...) -} - -// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprint(a ...interface{}) string { - return fmt.Sprint(c.convertArgs(a)...) -} - -// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were -// passed with a Formatter interface returned by c.NewFormatter. It returns -// the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprintf(format string, a ...interface{}) string { - return fmt.Sprintf(format, c.convertArgs(a)...) -} - -// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it -// were passed with a Formatter interface returned by c.NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) -func (c *ConfigState) Sprintln(a ...interface{}) string { - return fmt.Sprintln(c.convertArgs(a)...) -} - -/* -NewFormatter returns a custom formatter that satisfies the fmt.Formatter -interface. As a result, it integrates cleanly with standard fmt package -printing functions. The formatter is useful for inline printing of smaller data -types similar to the standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Typically this function shouldn't be called directly. It is much easier to make -use of the custom formatter by calling one of the convenience functions such as -c.Printf, c.Println, or c.Printf. -*/ -func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { - return newFormatter(c, v) -} - -// Fdump formats and displays the passed arguments to io.Writer w. It formats -// exactly the same as Dump. -func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { - fdump(c, w, a...) -} - -/* -Dump displays the passed parameters to standard out with newlines, customizable -indentation, and additional debug information such as complete types and all -pointer addresses used to indirect to the final value. It provides the -following features over the built-in printing facilities provided by the fmt -package: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output - -The configuration options are controlled by modifying the public members -of c. See ConfigState for options documentation. - -See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to -get the formatted result as a string. -*/ -func (c *ConfigState) Dump(a ...interface{}) { - fdump(c, os.Stdout, a...) -} - -// Sdump returns a string with the passed arguments formatted exactly the same -// as Dump. -func (c *ConfigState) Sdump(a ...interface{}) string { - var buf bytes.Buffer - fdump(c, &buf, a...) - return buf.String() -} - -// convertArgs accepts a slice of arguments and returns a slice of the same -// length with each argument converted to a spew Formatter interface using -// the ConfigState associated with s. -func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { - formatters = make([]interface{}, len(args)) - for index, arg := range args { - formatters[index] = newFormatter(c, arg) - } - return formatters -} - -// NewDefaultConfig returns a ConfigState with the following default settings. -// -// Indent: " " -// MaxDepth: 0 -// DisableMethods: false -// DisablePointerMethods: false -// ContinueOnMethod: false -// SortKeys: false -func NewDefaultConfig() *ConfigState { - return &ConfigState{Indent: " "} -} diff --git a/vendor/github.com/davecgh/go-spew/spew/doc.go b/vendor/github.com/davecgh/go-spew/spew/doc.go deleted file mode 100644 index 5be0c40..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/doc.go +++ /dev/null @@ -1,202 +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. - */ - -/* -Package spew implements a deep pretty printer for Go data structures to aid in -debugging. - -A quick overview of the additional features spew provides over the built-in -printing facilities for Go data types are as follows: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output (only when using - Dump style) - -There are two different approaches spew allows for dumping Go data structures: - - * Dump style which prints with newlines, customizable indentation, - and additional debug information such as types and all pointer addresses - used to indirect to the final value - * A custom Formatter interface that integrates cleanly with the standard fmt - package and replaces %v, %+v, %#v, and %#+v to provide inline printing - similar to the default %v while providing the additional functionality - outlined above and passing unsupported format verbs such as %x and %q - along to fmt - -Quick Start - -This section demonstrates how to quickly get started with spew. See the -sections below for further details on formatting and configuration options. - -To dump a variable with full newlines, indentation, type, and pointer -information use Dump, Fdump, or Sdump: - 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): - 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) - -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. - -The following configuration options are available: - * 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. - Pointer method invocation is enabled by default. - - * 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 - 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. - -Dump Usage - -Simply call spew.Dump with a list of variables you want to dump: - - spew.Dump(myVar1, myVar2, ...) - -You may also call spew.Fdump if you would prefer to output to an arbitrary -io.Writer. For example, to dump to standard error: - - spew.Fdump(os.Stderr, myVar1, myVar2, ...) - -A third option is to call spew.Sdump to get the formatted output as a string: - - str := spew.Sdump(myVar1, myVar2, ...) - -Sample Dump Output - -See the Dump example for details on the setup of the types and variables being -shown here. - - (main.Foo) { - unexportedField: (*main.Bar)(0xf84002e210)({ - flag: (main.Flag) flagTwo, - data: (uintptr) - }), - ExportedField: (map[interface {}]interface {}) (len=1) { - (string) (len=3) "one": (bool) true - } - } - -Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C -command as shown. - ([]uint8) (len=32 cap=32) { - 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| - } - -Custom Formatter - -Spew provides a custom formatter that implements the fmt.Formatter interface -so that it integrates cleanly with standard fmt package printing functions. The -formatter is useful for inline printing of smaller data types similar to the -standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Custom Formatter Usage - -The simplest way to make use of the spew custom formatter is to call one of the -convenience functions such as spew.Printf, spew.Println, or spew.Printf. The -functions have syntax you are most likely already familiar with: - - spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - spew.Println(myVar, myVar2) - spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) - spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) - -See the Index for the full list convenience functions. - -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)} - -See the Printf example for details on the setup of variables being shown -here. - -Errors - -Since it is possible for custom Stringer/error interfaces to panic, spew -detects them and handles them internally by printing the panic information -inline with the output. Since spew is intended to provide deep pretty printing -capabilities on structures, it intentionally does not return any errors. -*/ -package spew diff --git a/vendor/github.com/davecgh/go-spew/spew/dump.go b/vendor/github.com/davecgh/go-spew/spew/dump.go deleted file mode 100644 index 95f9dbf..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/dump.go +++ /dev/null @@ -1,509 +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. - */ - -package spew - -import ( - "bytes" - "encoding/hex" - "fmt" - "io" - "os" - "reflect" - "regexp" - "strconv" - "strings" -) - -var ( - // uint8Type is a reflect.Type representing a uint8. It is used to - // convert cgo types to uint8 slices for hexdumping. - uint8Type = reflect.TypeOf(uint8(0)) - - // cCharRE is a regular expression that matches a cgo char. - // It is used to detect character arrays to hexdump them. - cCharRE = regexp.MustCompile("^.*\\._Ctype_char$") - - // cUnsignedCharRE is a regular expression that matches a cgo unsigned - // char. It is used to detect unsigned character arrays to hexdump - // them. - cUnsignedCharRE = regexp.MustCompile("^.*\\._Ctype_unsignedchar$") - - // cUint8tCharRE is a regular expression that matches a cgo uint8_t. - // It is used to detect uint8_t arrays to hexdump them. - cUint8tCharRE = regexp.MustCompile("^.*\\._Ctype_uint8_t$") -) - -// dumpState contains information about the state of a dump operation. -type dumpState struct { - w io.Writer - depth int - pointers map[uintptr]int - ignoreNextType bool - ignoreNextIndent bool - cs *ConfigState -} - -// indent performs indentation according to the depth level and cs.Indent -// option. -func (d *dumpState) indent() { - if d.ignoreNextIndent { - d.ignoreNextIndent = false - return - } - d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) -} - -// unpackValue returns values inside of non-nil interfaces when possible. -// This is useful for data types like structs, arrays, slices, and maps which -// can contain varying types packed inside an interface. -func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Interface && !v.IsNil() { - v = v.Elem() - } - return v -} - -// dumpPtr handles formatting of pointers by indirecting them as necessary. -func (d *dumpState) dumpPtr(v reflect.Value) { - // Remove pointers at or below the current depth from map used to detect - // circular refs. - for k, depth := range d.pointers { - if depth >= d.depth { - delete(d.pointers, k) - } - } - - // Keep list of all dereferenced pointers to show later. - pointerChain := make([]uintptr, 0) - - // Figure out how many levels of indirection there are by dereferencing - // pointers and unpacking interfaces down the chain while detecting circular - // references. - nilFound := false - cycleFound := false - indirects := 0 - ve := v - for ve.Kind() == reflect.Ptr { - if ve.IsNil() { - nilFound = true - break - } - indirects++ - addr := ve.Pointer() - pointerChain = append(pointerChain, addr) - if pd, ok := d.pointers[addr]; ok && pd < d.depth { - cycleFound = true - indirects-- - break - } - d.pointers[addr] = d.depth - - ve = ve.Elem() - if ve.Kind() == reflect.Interface { - if ve.IsNil() { - nilFound = true - break - } - ve = ve.Elem() - } - } - - // Display type information. - d.w.Write(openParenBytes) - d.w.Write(bytes.Repeat(asteriskBytes, indirects)) - d.w.Write([]byte(ve.Type().String())) - d.w.Write(closeParenBytes) - - // Display pointer information. - if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { - d.w.Write(openParenBytes) - for i, addr := range pointerChain { - if i > 0 { - d.w.Write(pointerChainBytes) - } - printHexPtr(d.w, addr) - } - d.w.Write(closeParenBytes) - } - - // Display dereferenced value. - d.w.Write(openParenBytes) - switch { - case nilFound == true: - d.w.Write(nilAngleBytes) - - case cycleFound == true: - d.w.Write(circularBytes) - - default: - d.ignoreNextType = true - d.dump(ve) - } - d.w.Write(closeParenBytes) -} - -// dumpSlice handles formatting of arrays and slices. Byte (uint8 under -// reflection) arrays and slices are dumped in hexdump -C fashion. -func (d *dumpState) dumpSlice(v reflect.Value) { - // Determine whether this type should be hex dumped or not. Also, - // for types which should be hexdumped, try to use the underlying data - // first, then fall back to trying to convert them to a uint8 slice. - var buf []uint8 - doConvert := false - doHexDump := false - numEntries := v.Len() - if numEntries > 0 { - vt := v.Index(0).Type() - vts := vt.String() - switch { - // C types that need to be converted. - case cCharRE.MatchString(vts): - fallthrough - case cUnsignedCharRE.MatchString(vts): - fallthrough - case cUint8tCharRE.MatchString(vts): - doConvert = true - - // Try to use existing uint8 slices and fall back to converting - // and copying if that fails. - case vt.Kind() == reflect.Uint8: - // We need an addressable interface to convert the type - // to a byte slice. However, the reflect package won't - // give us an interface on certain things like - // unexported struct fields in order to enforce - // visibility rules. We use unsafe, when available, to - // bypass these restrictions since this package does not - // mutate the values. - vs := v - if !vs.CanInterface() || !vs.CanAddr() { - vs = unsafeReflectValue(vs) - } - if !UnsafeDisabled { - vs = vs.Slice(0, numEntries) - - // Use the existing uint8 slice if it can be - // type asserted. - iface := vs.Interface() - if slice, ok := iface.([]uint8); ok { - buf = slice - doHexDump = true - break - } - } - - // The underlying data needs to be converted if it can't - // be type asserted to a uint8 slice. - doConvert = true - } - - // Copy and convert the underlying type if needed. - if doConvert && vt.ConvertibleTo(uint8Type) { - // Convert and copy each element into a uint8 byte - // slice. - buf = make([]uint8, numEntries) - for i := 0; i < numEntries; i++ { - vv := v.Index(i) - buf[i] = uint8(vv.Convert(uint8Type).Uint()) - } - doHexDump = true - } - } - - // Hexdump the entire slice as needed. - if doHexDump { - indent := strings.Repeat(d.cs.Indent, d.depth) - str := indent + hex.Dump(buf) - str = strings.Replace(str, "\n", "\n"+indent, -1) - str = strings.TrimRight(str, d.cs.Indent) - d.w.Write([]byte(str)) - return - } - - // Recursively call dump for each item. - for i := 0; i < numEntries; i++ { - d.dump(d.unpackValue(v.Index(i))) - if i < (numEntries - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } -} - -// dump is the main workhorse for dumping a value. It uses the passed reflect -// value to figure out what kind of object we are dealing with and formats it -// appropriately. It is a recursive function, however circular data structures -// are detected and handled properly. -func (d *dumpState) dump(v reflect.Value) { - // Handle invalid reflect values immediately. - kind := v.Kind() - if kind == reflect.Invalid { - d.w.Write(invalidAngleBytes) - return - } - - // Handle pointers specially. - if kind == reflect.Ptr { - d.indent() - d.dumpPtr(v) - return - } - - // Print type information unless already handled elsewhere. - if !d.ignoreNextType { - d.indent() - d.w.Write(openParenBytes) - d.w.Write([]byte(v.Type().String())) - d.w.Write(closeParenBytes) - d.w.Write(spaceBytes) - } - d.ignoreNextType = false - - // Display length and capacity if the built-in len and cap functions - // work with the value's kind and the len/cap itself is non-zero. - valueLen, valueCap := 0, 0 - switch v.Kind() { - case reflect.Array, reflect.Slice, reflect.Chan: - valueLen, valueCap = v.Len(), v.Cap() - case reflect.Map, reflect.String: - valueLen = v.Len() - } - if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { - d.w.Write(openParenBytes) - if valueLen != 0 { - d.w.Write(lenEqualsBytes) - printInt(d.w, int64(valueLen), 10) - } - if !d.cs.DisableCapacities && valueCap != 0 { - if valueLen != 0 { - d.w.Write(spaceBytes) - } - d.w.Write(capEqualsBytes) - printInt(d.w, int64(valueCap), 10) - } - d.w.Write(closeParenBytes) - d.w.Write(spaceBytes) - } - - // Call Stringer/error interfaces if they exist and the handle methods flag - // is enabled - if !d.cs.DisableMethods { - if (kind != reflect.Invalid) && (kind != reflect.Interface) { - if handled := handleMethods(d.cs, d.w, v); handled { - return - } - } - } - - switch kind { - case reflect.Invalid: - // Do nothing. We should never get here since invalid has already - // been handled above. - - case reflect.Bool: - printBool(d.w, v.Bool()) - - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - printInt(d.w, v.Int(), 10) - - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - printUint(d.w, v.Uint(), 10) - - case reflect.Float32: - printFloat(d.w, v.Float(), 32) - - case reflect.Float64: - printFloat(d.w, v.Float(), 64) - - case reflect.Complex64: - printComplex(d.w, v.Complex(), 32) - - case reflect.Complex128: - printComplex(d.w, v.Complex(), 64) - - case reflect.Slice: - if v.IsNil() { - d.w.Write(nilAngleBytes) - break - } - fallthrough - - case reflect.Array: - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - d.dumpSlice(v) - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.String: - d.w.Write([]byte(strconv.Quote(v.String()))) - - case reflect.Interface: - // The only time we should get here is for nil interfaces due to - // unpackValue calls. - if v.IsNil() { - d.w.Write(nilAngleBytes) - } - - case reflect.Ptr: - // Do nothing. We should never get here since pointers have already - // been handled above. - - case reflect.Map: - // nil maps should be indicated as different than empty maps - if v.IsNil() { - d.w.Write(nilAngleBytes) - break - } - - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - numEntries := v.Len() - keys := v.MapKeys() - if d.cs.SortKeys { - sortValues(keys, d.cs) - } - for i, key := range keys { - d.dump(d.unpackValue(key)) - d.w.Write(colonSpaceBytes) - d.ignoreNextIndent = true - d.dump(d.unpackValue(v.MapIndex(key))) - if i < (numEntries - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.Struct: - d.w.Write(openBraceNewlineBytes) - d.depth++ - if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { - d.indent() - d.w.Write(maxNewlineBytes) - } else { - vt := v.Type() - numFields := v.NumField() - for i := 0; i < numFields; i++ { - d.indent() - vtf := vt.Field(i) - d.w.Write([]byte(vtf.Name)) - d.w.Write(colonSpaceBytes) - d.ignoreNextIndent = true - d.dump(d.unpackValue(v.Field(i))) - if i < (numFields - 1) { - d.w.Write(commaNewlineBytes) - } else { - d.w.Write(newlineBytes) - } - } - } - d.depth-- - d.indent() - d.w.Write(closeBraceBytes) - - case reflect.Uintptr: - printHexPtr(d.w, uintptr(v.Uint())) - - case reflect.UnsafePointer, reflect.Chan, reflect.Func: - printHexPtr(d.w, v.Pointer()) - - // There were not any other types at the time this code was written, but - // fall back to letting the default fmt package handle it in case any new - // types are added. - default: - if v.CanInterface() { - fmt.Fprintf(d.w, "%v", v.Interface()) - } else { - fmt.Fprintf(d.w, "%v", v.String()) - } - } -} - -// fdump is a helper function to consolidate the logic from the various public -// methods which take varying writers and config states. -func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { - for _, arg := range a { - if arg == nil { - w.Write(interfaceBytes) - w.Write(spaceBytes) - w.Write(nilAngleBytes) - w.Write(newlineBytes) - continue - } - - d := dumpState{w: w, cs: cs} - d.pointers = make(map[uintptr]int) - d.dump(reflect.ValueOf(arg)) - d.w.Write(newlineBytes) - } -} - -// Fdump formats and displays the passed arguments to io.Writer w. It formats -// exactly the same as Dump. -func Fdump(w io.Writer, a ...interface{}) { - fdump(&Config, w, a...) -} - -// Sdump returns a string with the passed arguments formatted exactly the same -// as Dump. -func Sdump(a ...interface{}) string { - var buf bytes.Buffer - fdump(&Config, &buf, a...) - return buf.String() -} - -/* -Dump displays the passed parameters to standard out with newlines, customizable -indentation, and additional debug information such as complete types and all -pointer addresses used to indirect to the final value. It provides the -following features over the built-in printing facilities provided by the fmt -package: - - * Pointers are dereferenced and followed - * Circular data structures are detected and handled properly - * Custom Stringer/error interfaces are optionally invoked, including - on unexported types - * Custom types which only implement the Stringer/error interfaces via - a pointer receiver are optionally invoked when passing non-pointer - variables - * Byte arrays and slices are dumped like the hexdump -C command which - includes offsets, byte values in hex, and ASCII output - -The configuration options are controlled by an exported package global, -spew.Config. See ConfigState for options documentation. - -See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to -get the formatted result as a string. -*/ -func Dump(a ...interface{}) { - fdump(&Config, os.Stdout, a...) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/format.go b/vendor/github.com/davecgh/go-spew/spew/format.go deleted file mode 100644 index ecf3b80..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/format.go +++ /dev/null @@ -1,419 +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. - */ - -package spew - -import ( - "bytes" - "fmt" - "reflect" - "strconv" - "strings" -) - -// supportedFlags is a list of all the character flags supported by fmt package. -const supportedFlags = "0-+# " - -// formatState implements the fmt.Formatter interface and contains information -// about the state of a formatting operation. The NewFormatter function can -// be used to get a new Formatter which can be used directly as arguments -// in standard fmt package printing calls. -type formatState struct { - value interface{} - fs fmt.State - depth int - pointers map[uintptr]int - ignoreNextType bool - cs *ConfigState -} - -// buildDefaultFormat recreates the original format string without precision -// and width information to pass in to fmt.Sprintf in the case of an -// unrecognized type. Unless new types are added to the language, this -// function won't ever be called. -func (f *formatState) buildDefaultFormat() (format string) { - buf := bytes.NewBuffer(percentBytes) - - for _, flag := range supportedFlags { - if f.fs.Flag(int(flag)) { - buf.WriteRune(flag) - } - } - - buf.WriteRune('v') - - format = buf.String() - return format -} - -// constructOrigFormat recreates the original format string including precision -// and width information to pass along to the standard fmt package. This allows -// automatic deferral of all format strings this package doesn't support. -func (f *formatState) constructOrigFormat(verb rune) (format string) { - buf := bytes.NewBuffer(percentBytes) - - for _, flag := range supportedFlags { - if f.fs.Flag(int(flag)) { - buf.WriteRune(flag) - } - } - - if width, ok := f.fs.Width(); ok { - buf.WriteString(strconv.Itoa(width)) - } - - if precision, ok := f.fs.Precision(); ok { - buf.Write(precisionBytes) - buf.WriteString(strconv.Itoa(precision)) - } - - buf.WriteRune(verb) - - format = buf.String() - return format -} - -// unpackValue returns values inside of non-nil interfaces when possible and -// ensures that types for values which have been unpacked from an interface -// are displayed when the show types flag is also set. -// This is useful for data types like structs, arrays, slices, and maps which -// can contain varying types packed inside an interface. -func (f *formatState) unpackValue(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Interface { - f.ignoreNextType = false - if !v.IsNil() { - v = v.Elem() - } - } - return v -} - -// formatPtr handles formatting of pointers by indirecting them as necessary. -func (f *formatState) formatPtr(v reflect.Value) { - // Display nil if top level pointer is nil. - showTypes := f.fs.Flag('#') - if v.IsNil() && (!showTypes || f.ignoreNextType) { - f.fs.Write(nilAngleBytes) - return - } - - // Remove pointers at or below the current depth from map used to detect - // circular refs. - for k, depth := range f.pointers { - if depth >= f.depth { - delete(f.pointers, k) - } - } - - // Keep list of all dereferenced pointers to possibly show later. - pointerChain := make([]uintptr, 0) - - // Figure out how many levels of indirection there are by derferencing - // pointers and unpacking interfaces down the chain while detecting circular - // references. - nilFound := false - cycleFound := false - indirects := 0 - ve := v - for ve.Kind() == reflect.Ptr { - if ve.IsNil() { - nilFound = true - break - } - indirects++ - addr := ve.Pointer() - pointerChain = append(pointerChain, addr) - if pd, ok := f.pointers[addr]; ok && pd < f.depth { - cycleFound = true - indirects-- - break - } - f.pointers[addr] = f.depth - - ve = ve.Elem() - if ve.Kind() == reflect.Interface { - if ve.IsNil() { - nilFound = true - break - } - ve = ve.Elem() - } - } - - // Display type or indirection level depending on flags. - if showTypes && !f.ignoreNextType { - f.fs.Write(openParenBytes) - f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) - f.fs.Write([]byte(ve.Type().String())) - f.fs.Write(closeParenBytes) - } else { - if nilFound || cycleFound { - indirects += strings.Count(ve.Type().String(), "*") - } - f.fs.Write(openAngleBytes) - f.fs.Write([]byte(strings.Repeat("*", indirects))) - f.fs.Write(closeAngleBytes) - } - - // Display pointer information depending on flags. - if f.fs.Flag('+') && (len(pointerChain) > 0) { - f.fs.Write(openParenBytes) - for i, addr := range pointerChain { - if i > 0 { - f.fs.Write(pointerChainBytes) - } - printHexPtr(f.fs, addr) - } - f.fs.Write(closeParenBytes) - } - - // Display dereferenced value. - switch { - case nilFound == true: - f.fs.Write(nilAngleBytes) - - case cycleFound == true: - f.fs.Write(circularShortBytes) - - default: - f.ignoreNextType = true - f.format(ve) - } -} - -// format is the main workhorse for providing the Formatter interface. It -// uses the passed reflect value to figure out what kind of object we are -// dealing with and formats it appropriately. It is a recursive function, -// however circular data structures are detected and handled properly. -func (f *formatState) format(v reflect.Value) { - // Handle invalid reflect values immediately. - kind := v.Kind() - if kind == reflect.Invalid { - f.fs.Write(invalidAngleBytes) - return - } - - // Handle pointers specially. - if kind == reflect.Ptr { - f.formatPtr(v) - return - } - - // Print type information unless already handled elsewhere. - if !f.ignoreNextType && f.fs.Flag('#') { - f.fs.Write(openParenBytes) - f.fs.Write([]byte(v.Type().String())) - f.fs.Write(closeParenBytes) - } - f.ignoreNextType = false - - // Call Stringer/error interfaces if they exist and the handle methods - // flag is enabled. - if !f.cs.DisableMethods { - if (kind != reflect.Invalid) && (kind != reflect.Interface) { - if handled := handleMethods(f.cs, f.fs, v); handled { - return - } - } - } - - switch kind { - case reflect.Invalid: - // Do nothing. We should never get here since invalid has already - // been handled above. - - case reflect.Bool: - printBool(f.fs, v.Bool()) - - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - printInt(f.fs, v.Int(), 10) - - case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: - printUint(f.fs, v.Uint(), 10) - - case reflect.Float32: - printFloat(f.fs, v.Float(), 32) - - case reflect.Float64: - printFloat(f.fs, v.Float(), 64) - - case reflect.Complex64: - printComplex(f.fs, v.Complex(), 32) - - case reflect.Complex128: - printComplex(f.fs, v.Complex(), 64) - - case reflect.Slice: - if v.IsNil() { - f.fs.Write(nilAngleBytes) - break - } - fallthrough - - case reflect.Array: - f.fs.Write(openBracketBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - numEntries := v.Len() - for i := 0; i < numEntries; i++ { - if i > 0 { - f.fs.Write(spaceBytes) - } - f.ignoreNextType = true - f.format(f.unpackValue(v.Index(i))) - } - } - f.depth-- - f.fs.Write(closeBracketBytes) - - case reflect.String: - f.fs.Write([]byte(v.String())) - - case reflect.Interface: - // The only time we should get here is for nil interfaces due to - // unpackValue calls. - if v.IsNil() { - f.fs.Write(nilAngleBytes) - } - - case reflect.Ptr: - // Do nothing. We should never get here since pointers have already - // been handled above. - - case reflect.Map: - // nil maps should be indicated as different than empty maps - if v.IsNil() { - f.fs.Write(nilAngleBytes) - break - } - - f.fs.Write(openMapBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - keys := v.MapKeys() - if f.cs.SortKeys { - sortValues(keys, f.cs) - } - for i, key := range keys { - if i > 0 { - f.fs.Write(spaceBytes) - } - f.ignoreNextType = true - f.format(f.unpackValue(key)) - f.fs.Write(colonBytes) - f.ignoreNextType = true - f.format(f.unpackValue(v.MapIndex(key))) - } - } - f.depth-- - f.fs.Write(closeMapBytes) - - case reflect.Struct: - numFields := v.NumField() - f.fs.Write(openBraceBytes) - f.depth++ - if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { - f.fs.Write(maxShortBytes) - } else { - vt := v.Type() - for i := 0; i < numFields; i++ { - if i > 0 { - f.fs.Write(spaceBytes) - } - vtf := vt.Field(i) - if f.fs.Flag('+') || f.fs.Flag('#') { - f.fs.Write([]byte(vtf.Name)) - f.fs.Write(colonBytes) - } - f.format(f.unpackValue(v.Field(i))) - } - } - f.depth-- - f.fs.Write(closeBraceBytes) - - case reflect.Uintptr: - printHexPtr(f.fs, uintptr(v.Uint())) - - case reflect.UnsafePointer, reflect.Chan, reflect.Func: - printHexPtr(f.fs, v.Pointer()) - - // There were not any other types at the time this code was written, but - // fall back to letting the default fmt package handle it if any get added. - default: - format := f.buildDefaultFormat() - if v.CanInterface() { - fmt.Fprintf(f.fs, format, v.Interface()) - } else { - fmt.Fprintf(f.fs, format, v.String()) - } - } -} - -// Format satisfies the fmt.Formatter interface. See NewFormatter for usage -// details. -func (f *formatState) Format(fs fmt.State, verb rune) { - f.fs = fs - - // Use standard formatting for verbs that are not v. - if verb != 'v' { - format := f.constructOrigFormat(verb) - fmt.Fprintf(fs, format, f.value) - return - } - - if f.value == nil { - if fs.Flag('#') { - fs.Write(interfaceBytes) - } - fs.Write(nilAngleBytes) - return - } - - f.format(reflect.ValueOf(f.value)) -} - -// newFormatter is a helper function to consolidate the logic from the various -// public methods which take varying config states. -func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { - fs := &formatState{value: v, cs: cs} - fs.pointers = make(map[uintptr]int) - return fs -} - -/* -NewFormatter returns a custom formatter that satisfies the fmt.Formatter -interface. As a result, it integrates cleanly with standard fmt package -printing functions. The formatter is useful for inline printing of smaller data -types similar to the standard %v format specifier. - -The custom formatter only responds to the %v (most compact), %+v (adds pointer -addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb -combinations. Any other verbs such as %x and %q will be sent to the the -standard fmt package for formatting. In addition, the custom formatter ignores -the width and precision arguments (however they will still work on the format -specifiers not handled by the custom formatter). - -Typically this function shouldn't be called directly. It is much easier to make -use of the custom formatter by calling one of the convenience functions such as -Printf, Println, or Fprintf. -*/ -func NewFormatter(v interface{}) fmt.Formatter { - return newFormatter(&Config, v) -} diff --git a/vendor/github.com/davecgh/go-spew/spew/spew.go b/vendor/github.com/davecgh/go-spew/spew/spew.go deleted file mode 100644 index d8233f5..0000000 --- a/vendor/github.com/davecgh/go-spew/spew/spew.go +++ /dev/null @@ -1,148 +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. - */ - -package spew - -import ( - "fmt" - "io" -) - -// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the formatted string as a value that satisfies error. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Errorf(format string, a ...interface{}) (err error) { - return fmt.Errorf(format, convertArgs(a)...) -} - -// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprint(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprint(w, convertArgs(a)...) -} - -// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - return fmt.Fprintf(w, format, convertArgs(a)...) -} - -// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it -// passed with a default Formatter interface returned by NewFormatter. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) -func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprintln(w, convertArgs(a)...) -} - -// Print is a wrapper for fmt.Print that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) -func Print(a ...interface{}) (n int, err error) { - return fmt.Print(convertArgs(a)...) -} - -// Printf is a wrapper for fmt.Printf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Printf(format string, a ...interface{}) (n int, err error) { - return fmt.Printf(format, convertArgs(a)...) -} - -// Println is a wrapper for fmt.Println that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the number of bytes written and any write error encountered. See -// NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) -func Println(a ...interface{}) (n int, err error) { - return fmt.Println(convertArgs(a)...) -} - -// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprint(a ...interface{}) string { - return fmt.Sprint(convertArgs(a)...) -} - -// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were -// passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprintf(format string, a ...interface{}) string { - return fmt.Sprintf(format, convertArgs(a)...) -} - -// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it -// were passed with a default Formatter interface returned by NewFormatter. It -// returns the resulting string. See NewFormatter for formatting details. -// -// This function is shorthand for the following syntax: -// -// fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) -func Sprintln(a ...interface{}) string { - return fmt.Sprintln(convertArgs(a)...) -} - -// convertArgs accepts a slice of arguments and returns a slice of the same -// length with each argument converted to a default spew Formatter interface. -func convertArgs(args []interface{}) (formatters []interface{}) { - formatters = make([]interface{}, len(args)) - for index, arg := range args { - formatters[index] = NewFormatter(arg) - } - return formatters -} diff --git a/vendor/github.com/go-ini/ini/LICENSE b/vendor/github.com/go-ini/ini/LICENSE deleted file mode 100644 index 37ec93a..0000000 --- a/vendor/github.com/go-ini/ini/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "[]" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same "printed page" as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-ini/ini/Makefile b/vendor/github.com/go-ini/ini/Makefile deleted file mode 100644 index ac034e5..0000000 --- a/vendor/github.com/go-ini/ini/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -.PHONY: build test bench vet - -build: vet bench - -test: - go test -v -cover -race - -bench: - go test -v -cover -race -test.bench=. -test.benchmem - -vet: - go vet diff --git a/vendor/github.com/go-ini/ini/README.md b/vendor/github.com/go-ini/ini/README.md deleted file mode 100644 index 8594742..0000000 --- a/vendor/github.com/go-ini/ini/README.md +++ /dev/null @@ -1,740 +0,0 @@ -INI [![Build Status](https://travis-ci.org/go-ini/ini.svg?branch=master)](https://travis-ci.org/go-ini/ini) [![Sourcegraph](https://sourcegraph.com/github.com/go-ini/ini/-/badge.svg)](https://sourcegraph.com/github.com/go-ini/ini?badge) -=== - -![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200) - -Package ini provides INI file read and write functionality in Go. - -[简体中文](README_ZH.md) - -## Feature - -- Load multiple data sources(`[]byte`, file and `io.ReadCloser`) with overwrites. -- Read with recursion values. -- Read with parent-child sections. -- Read with auto-increment key names. -- Read with multiple-line values. -- Read with tons of helper methods. -- Read and convert values to Go types. -- Read and **WRITE** comments of sections and keys. -- Manipulate sections, keys and comments with ease. -- Keep sections and keys in order as you parse and save. - -## Installation - -To use a tagged revision: - - go get gopkg.in/ini.v1 - -To use with latest changes: - - go get github.com/go-ini/ini - -Please add `-u` flag to update in the future. - -### Testing - -If you want to test on your machine, please apply `-t` flag: - - go get -t gopkg.in/ini.v1 - -Please add `-u` flag to update in the future. - -## Getting Started - -### Loading from data sources - -A **Data Source** is either raw data in type `[]byte`, a file name with type `string` or `io.ReadCloser`. You can load **as many data sources as you want**. Passing other types will simply return an error. - -```go -cfg, err := ini.Load([]byte("raw data"), "filename", ioutil.NopCloser(bytes.NewReader([]byte("some other data")))) -``` - -Or start with an empty object: - -```go -cfg := ini.Empty() -``` - -When you cannot decide how many data sources to load at the beginning, you will still be able to **Append()** them later. - -```go -err := cfg.Append("other file", []byte("other raw data")) -``` - -If you have a list of files with possibilities that some of them may not available at the time, and you don't know exactly which ones, you can use `LooseLoad` to ignore nonexistent files without returning error. - -```go -cfg, err := ini.LooseLoad("filename", "filename_404") -``` - -The cool thing is, whenever the file is available to load while you're calling `Reload` method, it will be counted as usual. - -#### Ignore cases of key name - -When you do not care about cases of section and key names, you can use `InsensitiveLoad` to force all names to be lowercased while parsing. - -```go -cfg, err := ini.InsensitiveLoad("filename") -//... - -// sec1 and sec2 are the exactly same section object -sec1, err := cfg.GetSection("Section") -sec2, err := cfg.GetSection("SecTIOn") - -// key1 and key2 are the exactly same key object -key1, err := cfg.GetKey("Key") -key2, err := cfg.GetKey("KeY") -``` - -#### MySQL-like boolean key - -MySQL's configuration allows a key without value as follows: - -```ini -[mysqld] -... -skip-host-cache -skip-name-resolve -``` - -By default, this is considered as missing value. But if you know you're going to deal with those cases, you can assign advanced load options: - -```go -cfg, err := LoadSources(LoadOptions{AllowBooleanKeys: true}, "my.cnf")) -``` - -The value of those keys are always `true`, and when you save to a file, it will keep in the same foramt as you read. - -To generate such keys in your program, you could use `NewBooleanKey`: - -```go -key, err := sec.NewBooleanKey("skip-host-cache") -``` - -#### Comment - -Take care that following format will be treated as comment: - -1. Line begins with `#` or `;` -2. Words after `#` or `;` -3. Words after section name (i.e words after `[some section name]`) - -If you want to save a value with `#` or `;`, please quote them with ``` ` ``` or ``` """ ```. - -### Working with sections - -To get a section, you would need to: - -```go -section, err := cfg.GetSection("section name") -``` - -For a shortcut for default section, just give an empty string as name: - -```go -section, err := cfg.GetSection("") -``` - -When you're pretty sure the section exists, following code could make your life easier: - -```go -section := cfg.Section("section name") -``` - -What happens when the section somehow does not exist? Don't panic, it automatically creates and returns a new section to you. - -To create a new section: - -```go -err := cfg.NewSection("new section") -``` - -To get a list of sections or section names: - -```go -sections := cfg.Sections() -names := cfg.SectionStrings() -``` - -### Working with keys - -To get a key under a section: - -```go -key, err := cfg.Section("").GetKey("key name") -``` - -Same rule applies to key operations: - -```go -key := cfg.Section("").Key("key name") -``` - -To check if a key exists: - -```go -yes := cfg.Section("").HasKey("key name") -``` - -To create a new key: - -```go -err := cfg.Section("").NewKey("name", "value") -``` - -To get a list of keys or key names: - -```go -keys := cfg.Section("").Keys() -names := cfg.Section("").KeyStrings() -``` - -To get a clone hash of keys and corresponding values: - -```go -hash := cfg.Section("").KeysHash() -``` - -### Working with values - -To get a string value: - -```go -val := cfg.Section("").Key("key name").String() -``` - -To validate key value on the fly: - -```go -val := cfg.Section("").Key("key name").Validate(func(in string) string { - if len(in) == 0 { - return "default" - } - return in -}) -``` - -If you do not want any auto-transformation (such as recursive read) for the values, you can get raw value directly (this way you get much better performance): - -```go -val := cfg.Section("").Key("key name").Value() -``` - -To check if raw value exists: - -```go -yes := cfg.Section("").HasValue("test value") -``` - -To get value with types: - -```go -// For boolean values: -// true when value is: 1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On -// false when value is: 0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off -v, err = cfg.Section("").Key("BOOL").Bool() -v, err = cfg.Section("").Key("FLOAT64").Float64() -v, err = cfg.Section("").Key("INT").Int() -v, err = cfg.Section("").Key("INT64").Int64() -v, err = cfg.Section("").Key("UINT").Uint() -v, err = cfg.Section("").Key("UINT64").Uint64() -v, err = cfg.Section("").Key("TIME").TimeFormat(time.RFC3339) -v, err = cfg.Section("").Key("TIME").Time() // RFC3339 - -v = cfg.Section("").Key("BOOL").MustBool() -v = cfg.Section("").Key("FLOAT64").MustFloat64() -v = cfg.Section("").Key("INT").MustInt() -v = cfg.Section("").Key("INT64").MustInt64() -v = cfg.Section("").Key("UINT").MustUint() -v = cfg.Section("").Key("UINT64").MustUint64() -v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339) -v = cfg.Section("").Key("TIME").MustTime() // RFC3339 - -// Methods start with Must also accept one argument for default value -// when key not found or fail to parse value to given type. -// Except method MustString, which you have to pass a default value. - -v = cfg.Section("").Key("String").MustString("default") -v = cfg.Section("").Key("BOOL").MustBool(true) -v = cfg.Section("").Key("FLOAT64").MustFloat64(1.25) -v = cfg.Section("").Key("INT").MustInt(10) -v = cfg.Section("").Key("INT64").MustInt64(99) -v = cfg.Section("").Key("UINT").MustUint(3) -v = cfg.Section("").Key("UINT64").MustUint64(6) -v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339, time.Now()) -v = cfg.Section("").Key("TIME").MustTime(time.Now()) // RFC3339 -``` - -What if my value is three-line long? - -```ini -[advance] -ADDRESS = """404 road, -NotFound, State, 5000 -Earth""" -``` - -Not a problem! - -```go -cfg.Section("advance").Key("ADDRESS").String() - -/* --- start --- -404 road, -NotFound, State, 5000 -Earth ------- end --- */ -``` - -That's cool, how about continuation lines? - -```ini -[advance] -two_lines = how about \ - continuation lines? -lots_of_lines = 1 \ - 2 \ - 3 \ - 4 -``` - -Piece of cake! - -```go -cfg.Section("advance").Key("two_lines").String() // how about continuation lines? -cfg.Section("advance").Key("lots_of_lines").String() // 1 2 3 4 -``` - -Well, I hate continuation lines, how do I disable that? - -```go -cfg, err := ini.LoadSources(ini.LoadOptions{ - IgnoreContinuation: true, -}, "filename") -``` - -Holy crap! - -Note that single quotes around values will be stripped: - -```ini -foo = "some value" // foo: some value -bar = 'some value' // bar: some value -``` - -That's all? Hmm, no. - -#### Helper methods of working with values - -To get value with given candidates: - -```go -v = cfg.Section("").Key("STRING").In("default", []string{"str", "arr", "types"}) -v = cfg.Section("").Key("FLOAT64").InFloat64(1.1, []float64{1.25, 2.5, 3.75}) -v = cfg.Section("").Key("INT").InInt(5, []int{10, 20, 30}) -v = cfg.Section("").Key("INT64").InInt64(10, []int64{10, 20, 30}) -v = cfg.Section("").Key("UINT").InUint(4, []int{3, 6, 9}) -v = cfg.Section("").Key("UINT64").InUint64(8, []int64{3, 6, 9}) -v = cfg.Section("").Key("TIME").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3}) -v = cfg.Section("").Key("TIME").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339 -``` - -Default value will be presented if value of key is not in candidates you given, and default value does not need be one of candidates. - -To validate value in a given range: - -```go -vals = cfg.Section("").Key("FLOAT64").RangeFloat64(0.0, 1.1, 2.2) -vals = cfg.Section("").Key("INT").RangeInt(0, 10, 20) -vals = cfg.Section("").Key("INT64").RangeInt64(0, 10, 20) -vals = cfg.Section("").Key("UINT").RangeUint(0, 3, 9) -vals = cfg.Section("").Key("UINT64").RangeUint64(0, 3, 9) -vals = cfg.Section("").Key("TIME").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime) -vals = cfg.Section("").Key("TIME").RangeTime(time.Now(), minTime, maxTime) // RFC3339 -``` - -##### Auto-split values into a slice - -To use zero value of type for invalid inputs: - -```go -// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4] -// Input: how, 2.2, are, you -> [0.0 2.2 0.0 0.0] -vals = cfg.Section("").Key("STRINGS").Strings(",") -vals = cfg.Section("").Key("FLOAT64S").Float64s(",") -vals = cfg.Section("").Key("INTS").Ints(",") -vals = cfg.Section("").Key("INT64S").Int64s(",") -vals = cfg.Section("").Key("UINTS").Uints(",") -vals = cfg.Section("").Key("UINT64S").Uint64s(",") -vals = cfg.Section("").Key("TIMES").Times(",") -``` - -To exclude invalid values out of result slice: - -```go -// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4] -// Input: how, 2.2, are, you -> [2.2] -vals = cfg.Section("").Key("FLOAT64S").ValidFloat64s(",") -vals = cfg.Section("").Key("INTS").ValidInts(",") -vals = cfg.Section("").Key("INT64S").ValidInt64s(",") -vals = cfg.Section("").Key("UINTS").ValidUints(",") -vals = cfg.Section("").Key("UINT64S").ValidUint64s(",") -vals = cfg.Section("").Key("TIMES").ValidTimes(",") -``` - -Or to return nothing but error when have invalid inputs: - -```go -// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4] -// Input: how, 2.2, are, you -> error -vals = cfg.Section("").Key("FLOAT64S").StrictFloat64s(",") -vals = cfg.Section("").Key("INTS").StrictInts(",") -vals = cfg.Section("").Key("INT64S").StrictInt64s(",") -vals = cfg.Section("").Key("UINTS").StrictUints(",") -vals = cfg.Section("").Key("UINT64S").StrictUint64s(",") -vals = cfg.Section("").Key("TIMES").StrictTimes(",") -``` - -### Save your configuration - -Finally, it's time to save your configuration to somewhere. - -A typical way to save configuration is writing it to a file: - -```go -// ... -err = cfg.SaveTo("my.ini") -err = cfg.SaveToIndent("my.ini", "\t") -``` - -Another way to save is writing to a `io.Writer` interface: - -```go -// ... -cfg.WriteTo(writer) -cfg.WriteToIndent(writer, "\t") -``` - -By default, spaces are used to align "=" sign between key and values, to disable that: - -```go -ini.PrettyFormat = false -``` - -## Advanced Usage - -### Recursive Values - -For all value of keys, there is a special syntax `%()s`, where `` is the key name in same section or default section, and `%()s` will be replaced by corresponding value(empty string if key not found). You can use this syntax at most 99 level of recursions. - -```ini -NAME = ini - -[author] -NAME = Unknwon -GITHUB = https://github.com/%(NAME)s - -[package] -FULL_NAME = github.com/go-ini/%(NAME)s -``` - -```go -cfg.Section("author").Key("GITHUB").String() // https://github.com/Unknwon -cfg.Section("package").Key("FULL_NAME").String() // github.com/go-ini/ini -``` - -### Parent-child Sections - -You can use `.` in section name to indicate parent-child relationship between two or more sections. If the key not found in the child section, library will try again on its parent section until there is no parent section. - -```ini -NAME = ini -VERSION = v1 -IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s - -[package] -CLONE_URL = https://%(IMPORT_PATH)s - -[package.sub] -``` - -```go -cfg.Section("package.sub").Key("CLONE_URL").String() // https://gopkg.in/ini.v1 -``` - -#### Retrieve parent keys available to a child section - -```go -cfg.Section("package.sub").ParentKeys() // ["CLONE_URL"] -``` - -### Unparseable Sections - -Sometimes, you have sections that do not contain key-value pairs but raw content, to handle such case, you can use `LoadOptions.UnparsableSections`: - -```go -cfg, err := LoadSources(LoadOptions{UnparseableSections: []string{"COMMENTS"}}, `[COMMENTS] -<1> This slide has the fuel listed in the wrong units `)) - -body := cfg.Section("COMMENTS").Body() - -/* --- start --- -<1> This slide has the fuel listed in the wrong units ------- end --- */ -``` - -### Auto-increment Key Names - -If key name is `-` in data source, then it would be seen as special syntax for auto-increment key name start from 1, and every section is independent on counter. - -```ini -[features] --: Support read/write comments of keys and sections --: Support auto-increment of key names --: Support load multiple files to overwrite key values -``` - -```go -cfg.Section("features").KeyStrings() // []{"#1", "#2", "#3"} -``` - -### Map To Struct - -Want more objective way to play with INI? Cool. - -```ini -Name = Unknwon -age = 21 -Male = true -Born = 1993-01-01T20:17:05Z - -[Note] -Content = Hi is a good man! -Cities = HangZhou, Boston -``` - -```go -type Note struct { - Content string - Cities []string -} - -type Person struct { - Name string - Age int `ini:"age"` - Male bool - Born time.Time - Note - Created time.Time `ini:"-"` -} - -func main() { - cfg, err := ini.Load("path/to/ini") - // ... - p := new(Person) - err = cfg.MapTo(p) - // ... - - // Things can be simpler. - err = ini.MapTo(p, "path/to/ini") - // ... - - // Just map a section? Fine. - n := new(Note) - err = cfg.Section("Note").MapTo(n) - // ... -} -``` - -Can I have default value for field? Absolutely. - -Assign it before you map to struct. It will keep the value as it is if the key is not presented or got wrong type. - -```go -// ... -p := &Person{ - Name: "Joe", -} -// ... -``` - -It's really cool, but what's the point if you can't give me my file back from struct? - -### Reflect From Struct - -Why not? - -```go -type Embeded struct { - Dates []time.Time `delim:"|"` - Places []string `ini:"places,omitempty"` - None []int `ini:",omitempty"` -} - -type Author struct { - Name string `ini:"NAME"` - Male bool - Age int - GPA float64 - NeverMind string `ini:"-"` - *Embeded -} - -func main() { - a := &Author{"Unknwon", true, 21, 2.8, "", - &Embeded{ - []time.Time{time.Now(), time.Now()}, - []string{"HangZhou", "Boston"}, - []int{}, - }} - cfg := ini.Empty() - err = ini.ReflectFrom(cfg, a) - // ... -} -``` - -So, what do I get? - -```ini -NAME = Unknwon -Male = true -Age = 21 -GPA = 2.8 - -[Embeded] -Dates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00 -places = HangZhou,Boston -``` - -#### Name Mapper - -To save your time and make your code cleaner, this library supports [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) between struct field and actual section and key name. - -There are 2 built-in name mappers: - -- `AllCapsUnderscore`: it converts to format `ALL_CAPS_UNDERSCORE` then match section or key. -- `TitleUnderscore`: it converts to format `title_underscore` then match section or key. - -To use them: - -```go -type Info struct { - PackageName string -} - -func main() { - err = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte("package_name=ini")) - // ... - - cfg, err := ini.Load([]byte("PACKAGE_NAME=ini")) - // ... - info := new(Info) - cfg.NameMapper = ini.AllCapsUnderscore - err = cfg.MapTo(info) - // ... -} -``` - -Same rules of name mapper apply to `ini.ReflectFromWithMapper` function. - -#### Value Mapper - -To expand values (e.g. from environment variables), you can use the `ValueMapper` to transform values: - -```go -type Env struct { - Foo string `ini:"foo"` -} - -func main() { - cfg, err := ini.Load([]byte("[env]\nfoo = ${MY_VAR}\n") - cfg.ValueMapper = os.ExpandEnv - // ... - env := &Env{} - err = cfg.Section("env").MapTo(env) -} -``` - -This would set the value of `env.Foo` to the value of the environment variable `MY_VAR`. - -#### Other Notes On Map/Reflect - -Any embedded struct is treated as a section by default, and there is no automatic parent-child relations in map/reflect feature: - -```go -type Child struct { - Age string -} - -type Parent struct { - Name string - Child -} - -type Config struct { - City string - Parent -} -``` - -Example configuration: - -```ini -City = Boston - -[Parent] -Name = Unknwon - -[Child] -Age = 21 -``` - -What if, yes, I'm paranoid, I want embedded struct to be in the same section. Well, all roads lead to Rome. - -```go -type Child struct { - Age string -} - -type Parent struct { - Name string - Child `ini:"Parent"` -} - -type Config struct { - City string - Parent -} -``` - -Example configuration: - -```ini -City = Boston - -[Parent] -Name = Unknwon -Age = 21 -``` - -## Getting Help - -- [API Documentation](https://gowalker.org/gopkg.in/ini.v1) -- [File An Issue](https://github.com/go-ini/ini/issues/new) - -## FAQs - -### What does `BlockMode` field do? - -By default, library lets you read and write values so we need a locker to make sure your data is safe. But in cases that you are very sure about only reading data through the library, you can set `cfg.BlockMode = false` to speed up read operations about **50-70%** faster. - -### Why another INI library? - -Many people are using my another INI library [goconfig](https://github.com/Unknwon/goconfig), so the reason for this one is I would like to make more Go style code. Also when you set `cfg.BlockMode = false`, this one is about **10-30%** faster. - -To make those changes I have to confirm API broken, so it's safer to keep it in another place and start using `gopkg.in` to version my package at this time.(PS: shorter import path) - -## License - -This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text. diff --git a/vendor/github.com/go-ini/ini/README_ZH.md b/vendor/github.com/go-ini/ini/README_ZH.md deleted file mode 100644 index 163432d..0000000 --- a/vendor/github.com/go-ini/ini/README_ZH.md +++ /dev/null @@ -1,727 +0,0 @@ -本包提供了 Go 语言中读写 INI 文件的功能。 - -## 功能特性 - -- 支持覆盖加载多个数据源(`[]byte`、文件和 `io.ReadCloser`) -- 支持递归读取键值 -- 支持读取父子分区 -- 支持读取自增键名 -- 支持读取多行的键值 -- 支持大量辅助方法 -- 支持在读取时直接转换为 Go 语言类型 -- 支持读取和 **写入** 分区和键的注释 -- 轻松操作分区、键值和注释 -- 在保存文件时分区和键值会保持原有的顺序 - -## 下载安装 - -使用一个特定版本: - - go get gopkg.in/ini.v1 - -使用最新版: - - go get github.com/go-ini/ini - -如需更新请添加 `-u` 选项。 - -### 测试安装 - -如果您想要在自己的机器上运行测试,请使用 `-t` 标记: - - go get -t gopkg.in/ini.v1 - -如需更新请添加 `-u` 选项。 - -## 开始使用 - -### 从数据源加载 - -一个 **数据源** 可以是 `[]byte` 类型的原始数据,`string` 类型的文件路径或 `io.ReadCloser`。您可以加载 **任意多个** 数据源。如果您传递其它类型的数据源,则会直接返回错误。 - -```go -cfg, err := ini.Load([]byte("raw data"), "filename", ioutil.NopCloser(bytes.NewReader([]byte("some other data")))) -``` - -或者从一个空白的文件开始: - -```go -cfg := ini.Empty() -``` - -当您在一开始无法决定需要加载哪些数据源时,仍可以使用 **Append()** 在需要的时候加载它们。 - -```go -err := cfg.Append("other file", []byte("other raw data")) -``` - -当您想要加载一系列文件,但是不能够确定其中哪些文件是不存在的,可以通过调用函数 `LooseLoad` 来忽略它们(`Load` 会因为文件不存在而返回错误): - -```go -cfg, err := ini.LooseLoad("filename", "filename_404") -``` - -更牛逼的是,当那些之前不存在的文件在重新调用 `Reload` 方法的时候突然出现了,那么它们会被正常加载。 - -#### 忽略键名的大小写 - -有时候分区和键的名称大小写混合非常烦人,这个时候就可以通过 `InsensitiveLoad` 将所有分区和键名在读取里强制转换为小写: - -```go -cfg, err := ini.InsensitiveLoad("filename") -//... - -// sec1 和 sec2 指向同一个分区对象 -sec1, err := cfg.GetSection("Section") -sec2, err := cfg.GetSection("SecTIOn") - -// key1 和 key2 指向同一个键对象 -key1, err := cfg.GetKey("Key") -key2, err := cfg.GetKey("KeY") -``` - -#### 类似 MySQL 配置中的布尔值键 - -MySQL 的配置文件中会出现没有具体值的布尔类型的键: - -```ini -[mysqld] -... -skip-host-cache -skip-name-resolve -``` - -默认情况下这被认为是缺失值而无法完成解析,但可以通过高级的加载选项对它们进行处理: - -```go -cfg, err := LoadSources(LoadOptions{AllowBooleanKeys: true}, "my.cnf")) -``` - -这些键的值永远为 `true`,且在保存到文件时也只会输出键名。 - -如果您想要通过程序来生成此类键,则可以使用 `NewBooleanKey`: - -```go -key, err := sec.NewBooleanKey("skip-host-cache") -``` - -#### 关于注释 - -下述几种情况的内容将被视为注释: - -1. 所有以 `#` 或 `;` 开头的行 -2. 所有在 `#` 或 `;` 之后的内容 -3. 分区标签后的文字 (即 `[分区名]` 之后的内容) - -如果你希望使用包含 `#` 或 `;` 的值,请使用 ``` ` ``` 或 ``` """ ``` 进行包覆。 - -### 操作分区(Section) - -获取指定分区: - -```go -section, err := cfg.GetSection("section name") -``` - -如果您想要获取默认分区,则可以用空字符串代替分区名: - -```go -section, err := cfg.GetSection("") -``` - -当您非常确定某个分区是存在的,可以使用以下简便方法: - -```go -section := cfg.Section("section name") -``` - -如果不小心判断错了,要获取的分区其实是不存在的,那会发生什么呢?没事的,它会自动创建并返回一个对应的分区对象给您。 - -创建一个分区: - -```go -err := cfg.NewSection("new section") -``` - -获取所有分区对象或名称: - -```go -sections := cfg.Sections() -names := cfg.SectionStrings() -``` - -### 操作键(Key) - -获取某个分区下的键: - -```go -key, err := cfg.Section("").GetKey("key name") -``` - -和分区一样,您也可以直接获取键而忽略错误处理: - -```go -key := cfg.Section("").Key("key name") -``` - -判断某个键是否存在: - -```go -yes := cfg.Section("").HasKey("key name") -``` - -创建一个新的键: - -```go -err := cfg.Section("").NewKey("name", "value") -``` - -获取分区下的所有键或键名: - -```go -keys := cfg.Section("").Keys() -names := cfg.Section("").KeyStrings() -``` - -获取分区下的所有键值对的克隆: - -```go -hash := cfg.Section("").KeysHash() -``` - -### 操作键值(Value) - -获取一个类型为字符串(string)的值: - -```go -val := cfg.Section("").Key("key name").String() -``` - -获取值的同时通过自定义函数进行处理验证: - -```go -val := cfg.Section("").Key("key name").Validate(func(in string) string { - if len(in) == 0 { - return "default" - } - return in -}) -``` - -如果您不需要任何对值的自动转变功能(例如递归读取),可以直接获取原值(这种方式性能最佳): - -```go -val := cfg.Section("").Key("key name").Value() -``` - -判断某个原值是否存在: - -```go -yes := cfg.Section("").HasValue("test value") -``` - -获取其它类型的值: - -```go -// 布尔值的规则: -// true 当值为:1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On -// false 当值为:0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off -v, err = cfg.Section("").Key("BOOL").Bool() -v, err = cfg.Section("").Key("FLOAT64").Float64() -v, err = cfg.Section("").Key("INT").Int() -v, err = cfg.Section("").Key("INT64").Int64() -v, err = cfg.Section("").Key("UINT").Uint() -v, err = cfg.Section("").Key("UINT64").Uint64() -v, err = cfg.Section("").Key("TIME").TimeFormat(time.RFC3339) -v, err = cfg.Section("").Key("TIME").Time() // RFC3339 - -v = cfg.Section("").Key("BOOL").MustBool() -v = cfg.Section("").Key("FLOAT64").MustFloat64() -v = cfg.Section("").Key("INT").MustInt() -v = cfg.Section("").Key("INT64").MustInt64() -v = cfg.Section("").Key("UINT").MustUint() -v = cfg.Section("").Key("UINT64").MustUint64() -v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339) -v = cfg.Section("").Key("TIME").MustTime() // RFC3339 - -// 由 Must 开头的方法名允许接收一个相同类型的参数来作为默认值, -// 当键不存在或者转换失败时,则会直接返回该默认值。 -// 但是,MustString 方法必须传递一个默认值。 - -v = cfg.Seciont("").Key("String").MustString("default") -v = cfg.Section("").Key("BOOL").MustBool(true) -v = cfg.Section("").Key("FLOAT64").MustFloat64(1.25) -v = cfg.Section("").Key("INT").MustInt(10) -v = cfg.Section("").Key("INT64").MustInt64(99) -v = cfg.Section("").Key("UINT").MustUint(3) -v = cfg.Section("").Key("UINT64").MustUint64(6) -v = cfg.Section("").Key("TIME").MustTimeFormat(time.RFC3339, time.Now()) -v = cfg.Section("").Key("TIME").MustTime(time.Now()) // RFC3339 -``` - -如果我的值有好多行怎么办? - -```ini -[advance] -ADDRESS = """404 road, -NotFound, State, 5000 -Earth""" -``` - -嗯哼?小 case! - -```go -cfg.Section("advance").Key("ADDRESS").String() - -/* --- start --- -404 road, -NotFound, State, 5000 -Earth ------- end --- */ -``` - -赞爆了!那要是我属于一行的内容写不下想要写到第二行怎么办? - -```ini -[advance] -two_lines = how about \ - continuation lines? -lots_of_lines = 1 \ - 2 \ - 3 \ - 4 -``` - -简直是小菜一碟! - -```go -cfg.Section("advance").Key("two_lines").String() // how about continuation lines? -cfg.Section("advance").Key("lots_of_lines").String() // 1 2 3 4 -``` - -可是我有时候觉得两行连在一起特别没劲,怎么才能不自动连接两行呢? - -```go -cfg, err := ini.LoadSources(ini.LoadOptions{ - IgnoreContinuation: true, -}, "filename") -``` - -哇靠给力啊! - -需要注意的是,值两侧的单引号会被自动剔除: - -```ini -foo = "some value" // foo: some value -bar = 'some value' // bar: some value -``` - -这就是全部了?哈哈,当然不是。 - -#### 操作键值的辅助方法 - -获取键值时设定候选值: - -```go -v = cfg.Section("").Key("STRING").In("default", []string{"str", "arr", "types"}) -v = cfg.Section("").Key("FLOAT64").InFloat64(1.1, []float64{1.25, 2.5, 3.75}) -v = cfg.Section("").Key("INT").InInt(5, []int{10, 20, 30}) -v = cfg.Section("").Key("INT64").InInt64(10, []int64{10, 20, 30}) -v = cfg.Section("").Key("UINT").InUint(4, []int{3, 6, 9}) -v = cfg.Section("").Key("UINT64").InUint64(8, []int64{3, 6, 9}) -v = cfg.Section("").Key("TIME").InTimeFormat(time.RFC3339, time.Now(), []time.Time{time1, time2, time3}) -v = cfg.Section("").Key("TIME").InTime(time.Now(), []time.Time{time1, time2, time3}) // RFC3339 -``` - -如果获取到的值不是候选值的任意一个,则会返回默认值,而默认值不需要是候选值中的一员。 - -验证获取的值是否在指定范围内: - -```go -vals = cfg.Section("").Key("FLOAT64").RangeFloat64(0.0, 1.1, 2.2) -vals = cfg.Section("").Key("INT").RangeInt(0, 10, 20) -vals = cfg.Section("").Key("INT64").RangeInt64(0, 10, 20) -vals = cfg.Section("").Key("UINT").RangeUint(0, 3, 9) -vals = cfg.Section("").Key("UINT64").RangeUint64(0, 3, 9) -vals = cfg.Section("").Key("TIME").RangeTimeFormat(time.RFC3339, time.Now(), minTime, maxTime) -vals = cfg.Section("").Key("TIME").RangeTime(time.Now(), minTime, maxTime) // RFC3339 -``` - -##### 自动分割键值到切片(slice) - -当存在无效输入时,使用零值代替: - -```go -// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4] -// Input: how, 2.2, are, you -> [0.0 2.2 0.0 0.0] -vals = cfg.Section("").Key("STRINGS").Strings(",") -vals = cfg.Section("").Key("FLOAT64S").Float64s(",") -vals = cfg.Section("").Key("INTS").Ints(",") -vals = cfg.Section("").Key("INT64S").Int64s(",") -vals = cfg.Section("").Key("UINTS").Uints(",") -vals = cfg.Section("").Key("UINT64S").Uint64s(",") -vals = cfg.Section("").Key("TIMES").Times(",") -``` - -从结果切片中剔除无效输入: - -```go -// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4] -// Input: how, 2.2, are, you -> [2.2] -vals = cfg.Section("").Key("FLOAT64S").ValidFloat64s(",") -vals = cfg.Section("").Key("INTS").ValidInts(",") -vals = cfg.Section("").Key("INT64S").ValidInt64s(",") -vals = cfg.Section("").Key("UINTS").ValidUints(",") -vals = cfg.Section("").Key("UINT64S").ValidUint64s(",") -vals = cfg.Section("").Key("TIMES").ValidTimes(",") -``` - -当存在无效输入时,直接返回错误: - -```go -// Input: 1.1, 2.2, 3.3, 4.4 -> [1.1 2.2 3.3 4.4] -// Input: how, 2.2, are, you -> error -vals = cfg.Section("").Key("FLOAT64S").StrictFloat64s(",") -vals = cfg.Section("").Key("INTS").StrictInts(",") -vals = cfg.Section("").Key("INT64S").StrictInt64s(",") -vals = cfg.Section("").Key("UINTS").StrictUints(",") -vals = cfg.Section("").Key("UINT64S").StrictUint64s(",") -vals = cfg.Section("").Key("TIMES").StrictTimes(",") -``` - -### 保存配置 - -终于到了这个时刻,是时候保存一下配置了。 - -比较原始的做法是输出配置到某个文件: - -```go -// ... -err = cfg.SaveTo("my.ini") -err = cfg.SaveToIndent("my.ini", "\t") -``` - -另一个比较高级的做法是写入到任何实现 `io.Writer` 接口的对象中: - -```go -// ... -cfg.WriteTo(writer) -cfg.WriteToIndent(writer, "\t") -``` - -默认情况下,空格将被用于对齐键值之间的等号以美化输出结果,以下代码可以禁用该功能: - -```go -ini.PrettyFormat = false -``` - -## 高级用法 - -### 递归读取键值 - -在获取所有键值的过程中,特殊语法 `%()s` 会被应用,其中 `` 可以是相同分区或者默认分区下的键名。字符串 `%()s` 会被相应的键值所替代,如果指定的键不存在,则会用空字符串替代。您可以最多使用 99 层的递归嵌套。 - -```ini -NAME = ini - -[author] -NAME = Unknwon -GITHUB = https://github.com/%(NAME)s - -[package] -FULL_NAME = github.com/go-ini/%(NAME)s -``` - -```go -cfg.Section("author").Key("GITHUB").String() // https://github.com/Unknwon -cfg.Section("package").Key("FULL_NAME").String() // github.com/go-ini/ini -``` - -### 读取父子分区 - -您可以在分区名称中使用 `.` 来表示两个或多个分区之间的父子关系。如果某个键在子分区中不存在,则会去它的父分区中再次寻找,直到没有父分区为止。 - -```ini -NAME = ini -VERSION = v1 -IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s - -[package] -CLONE_URL = https://%(IMPORT_PATH)s - -[package.sub] -``` - -```go -cfg.Section("package.sub").Key("CLONE_URL").String() // https://gopkg.in/ini.v1 -``` - -#### 获取上级父分区下的所有键名 - -```go -cfg.Section("package.sub").ParentKeys() // ["CLONE_URL"] -``` - -### 无法解析的分区 - -如果遇到一些比较特殊的分区,它们不包含常见的键值对,而是没有固定格式的纯文本,则可以使用 `LoadOptions.UnparsableSections` 进行处理: - -```go -cfg, err := LoadSources(LoadOptions{UnparseableSections: []string{"COMMENTS"}}, `[COMMENTS] -<1> This slide has the fuel listed in the wrong units `)) - -body := cfg.Section("COMMENTS").Body() - -/* --- start --- -<1> This slide has the fuel listed in the wrong units ------- end --- */ -``` - -### 读取自增键名 - -如果数据源中的键名为 `-`,则认为该键使用了自增键名的特殊语法。计数器从 1 开始,并且分区之间是相互独立的。 - -```ini -[features] --: Support read/write comments of keys and sections --: Support auto-increment of key names --: Support load multiple files to overwrite key values -``` - -```go -cfg.Section("features").KeyStrings() // []{"#1", "#2", "#3"} -``` - -### 映射到结构 - -想要使用更加面向对象的方式玩转 INI 吗?好主意。 - -```ini -Name = Unknwon -age = 21 -Male = true -Born = 1993-01-01T20:17:05Z - -[Note] -Content = Hi is a good man! -Cities = HangZhou, Boston -``` - -```go -type Note struct { - Content string - Cities []string -} - -type Person struct { - Name string - Age int `ini:"age"` - Male bool - Born time.Time - Note - Created time.Time `ini:"-"` -} - -func main() { - cfg, err := ini.Load("path/to/ini") - // ... - p := new(Person) - err = cfg.MapTo(p) - // ... - - // 一切竟可以如此的简单。 - err = ini.MapTo(p, "path/to/ini") - // ... - - // 嗯哼?只需要映射一个分区吗? - n := new(Note) - err = cfg.Section("Note").MapTo(n) - // ... -} -``` - -结构的字段怎么设置默认值呢?很简单,只要在映射之前对指定字段进行赋值就可以了。如果键未找到或者类型错误,该值不会发生改变。 - -```go -// ... -p := &Person{ - Name: "Joe", -} -// ... -``` - -这样玩 INI 真的好酷啊!然而,如果不能还给我原来的配置文件,有什么卵用? - -### 从结构反射 - -可是,我有说不能吗? - -```go -type Embeded struct { - Dates []time.Time `delim:"|"` - Places []string `ini:"places,omitempty"` - None []int `ini:",omitempty"` -} - -type Author struct { - Name string `ini:"NAME"` - Male bool - Age int - GPA float64 - NeverMind string `ini:"-"` - *Embeded -} - -func main() { - a := &Author{"Unknwon", true, 21, 2.8, "", - &Embeded{ - []time.Time{time.Now(), time.Now()}, - []string{"HangZhou", "Boston"}, - []int{}, - }} - cfg := ini.Empty() - err = ini.ReflectFrom(cfg, a) - // ... -} -``` - -瞧瞧,奇迹发生了。 - -```ini -NAME = Unknwon -Male = true -Age = 21 -GPA = 2.8 - -[Embeded] -Dates = 2015-08-07T22:14:22+08:00|2015-08-07T22:14:22+08:00 -places = HangZhou,Boston -``` - -#### 名称映射器(Name Mapper) - -为了节省您的时间并简化代码,本库支持类型为 [`NameMapper`](https://gowalker.org/gopkg.in/ini.v1#NameMapper) 的名称映射器,该映射器负责结构字段名与分区名和键名之间的映射。 - -目前有 2 款内置的映射器: - -- `AllCapsUnderscore`:该映射器将字段名转换至格式 `ALL_CAPS_UNDERSCORE` 后再去匹配分区名和键名。 -- `TitleUnderscore`:该映射器将字段名转换至格式 `title_underscore` 后再去匹配分区名和键名。 - -使用方法: - -```go -type Info struct{ - PackageName string -} - -func main() { - err = ini.MapToWithMapper(&Info{}, ini.TitleUnderscore, []byte("package_name=ini")) - // ... - - cfg, err := ini.Load([]byte("PACKAGE_NAME=ini")) - // ... - info := new(Info) - cfg.NameMapper = ini.AllCapsUnderscore - err = cfg.MapTo(info) - // ... -} -``` - -使用函数 `ini.ReflectFromWithMapper` 时也可应用相同的规则。 - -#### 值映射器(Value Mapper) - -值映射器允许使用一个自定义函数自动展开值的具体内容,例如:运行时获取环境变量: - -```go -type Env struct { - Foo string `ini:"foo"` -} - -func main() { - cfg, err := ini.Load([]byte("[env]\nfoo = ${MY_VAR}\n") - cfg.ValueMapper = os.ExpandEnv - // ... - env := &Env{} - err = cfg.Section("env").MapTo(env) -} -``` - -本例中,`env.Foo` 将会是运行时所获取到环境变量 `MY_VAR` 的值。 - -#### 映射/反射的其它说明 - -任何嵌入的结构都会被默认认作一个不同的分区,并且不会自动产生所谓的父子分区关联: - -```go -type Child struct { - Age string -} - -type Parent struct { - Name string - Child -} - -type Config struct { - City string - Parent -} -``` - -示例配置文件: - -```ini -City = Boston - -[Parent] -Name = Unknwon - -[Child] -Age = 21 -``` - -很好,但是,我就是要嵌入结构也在同一个分区。好吧,你爹是李刚! - -```go -type Child struct { - Age string -} - -type Parent struct { - Name string - Child `ini:"Parent"` -} - -type Config struct { - City string - Parent -} -``` - -示例配置文件: - -```ini -City = Boston - -[Parent] -Name = Unknwon -Age = 21 -``` - -## 获取帮助 - -- [API 文档](https://gowalker.org/gopkg.in/ini.v1) -- [创建工单](https://github.com/go-ini/ini/issues/new) - -## 常见问题 - -### 字段 `BlockMode` 是什么? - -默认情况下,本库会在您进行读写操作时采用锁机制来确保数据时间。但在某些情况下,您非常确定只进行读操作。此时,您可以通过设置 `cfg.BlockMode = false` 来将读操作提升大约 **50-70%** 的性能。 - -### 为什么要写另一个 INI 解析库? - -许多人都在使用我的 [goconfig](https://github.com/Unknwon/goconfig) 来完成对 INI 文件的操作,但我希望使用更加 Go 风格的代码。并且当您设置 `cfg.BlockMode = false` 时,会有大约 **10-30%** 的性能提升。 - -为了做出这些改变,我必须对 API 进行破坏,所以新开一个仓库是最安全的做法。除此之外,本库直接使用 `gopkg.in` 来进行版本化发布。(其实真相是导入路径更短了) diff --git a/vendor/github.com/go-ini/ini/error.go b/vendor/github.com/go-ini/ini/error.go deleted file mode 100644 index 80afe74..0000000 --- a/vendor/github.com/go-ini/ini/error.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "fmt" -) - -type ErrDelimiterNotFound struct { - Line string -} - -func IsErrDelimiterNotFound(err error) bool { - _, ok := err.(ErrDelimiterNotFound) - return ok -} - -func (err ErrDelimiterNotFound) Error() string { - return fmt.Sprintf("key-value delimiter not found: %s", err.Line) -} diff --git a/vendor/github.com/go-ini/ini/ini.go b/vendor/github.com/go-ini/ini/ini.go deleted file mode 100644 index 68d73aa..0000000 --- a/vendor/github.com/go-ini/ini/ini.go +++ /dev/null @@ -1,549 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -// Package ini provides INI file read and write functionality in Go. -package ini - -import ( - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "regexp" - "runtime" - "strconv" - "strings" - "sync" - "time" -) - -const ( - // Name for default section. You can use this constant or the string literal. - // In most of cases, an empty string is all you need to access the section. - DEFAULT_SECTION = "DEFAULT" - - // Maximum allowed depth when recursively substituing variable names. - _DEPTH_VALUES = 99 - _VERSION = "1.25.4" -) - -// Version returns current package version literal. -func Version() string { - return _VERSION -} - -var ( - // Delimiter to determine or compose a new line. - // This variable will be changed to "\r\n" automatically on Windows - // at package init time. - LineBreak = "\n" - - // Variable regexp pattern: %(variable)s - varPattern = regexp.MustCompile(`%\(([^\)]+)\)s`) - - // Indicate whether to align "=" sign with spaces to produce pretty output - // or reduce all possible spaces for compact format. - PrettyFormat = true - - // Explicitly write DEFAULT section header - DefaultHeader = false -) - -func init() { - if runtime.GOOS == "windows" { - LineBreak = "\r\n" - } -} - -func inSlice(str string, s []string) bool { - for _, v := range s { - if str == v { - return true - } - } - return false -} - -// dataSource is an interface that returns object which can be read and closed. -type dataSource interface { - ReadCloser() (io.ReadCloser, error) -} - -// sourceFile represents an object that contains content on the local file system. -type sourceFile struct { - name string -} - -func (s sourceFile) ReadCloser() (_ io.ReadCloser, err error) { - return os.Open(s.name) -} - -type bytesReadCloser struct { - reader io.Reader -} - -func (rc *bytesReadCloser) Read(p []byte) (n int, err error) { - return rc.reader.Read(p) -} - -func (rc *bytesReadCloser) Close() error { - return nil -} - -// sourceData represents an object that contains content in memory. -type sourceData struct { - data []byte -} - -func (s *sourceData) ReadCloser() (io.ReadCloser, error) { - return ioutil.NopCloser(bytes.NewReader(s.data)), nil -} - -// sourceReadCloser represents an input stream with Close method. -type sourceReadCloser struct { - reader io.ReadCloser -} - -func (s *sourceReadCloser) ReadCloser() (io.ReadCloser, error) { - return s.reader, nil -} - -// File represents a combination of a or more INI file(s) in memory. -type File struct { - // Should make things safe, but sometimes doesn't matter. - BlockMode bool - // Make sure data is safe in multiple goroutines. - lock sync.RWMutex - - // Allow combination of multiple data sources. - dataSources []dataSource - // Actual data is stored here. - sections map[string]*Section - - // To keep data in order. - sectionList []string - - options LoadOptions - - NameMapper - ValueMapper -} - -// newFile initializes File object with given data sources. -func newFile(dataSources []dataSource, opts LoadOptions) *File { - return &File{ - BlockMode: true, - dataSources: dataSources, - sections: make(map[string]*Section), - sectionList: make([]string, 0, 10), - options: opts, - } -} - -func parseDataSource(source interface{}) (dataSource, error) { - switch s := source.(type) { - case string: - return sourceFile{s}, nil - case []byte: - return &sourceData{s}, nil - case io.ReadCloser: - return &sourceReadCloser{s}, nil - default: - return nil, fmt.Errorf("error parsing data source: unknown type '%s'", s) - } -} - -type LoadOptions struct { - // Loose indicates whether the parser should ignore nonexistent files or return error. - Loose bool - // Insensitive indicates whether the parser forces all section and key names to lowercase. - Insensitive bool - // IgnoreContinuation indicates whether to ignore continuation lines while parsing. - IgnoreContinuation bool - // AllowBooleanKeys indicates whether to allow boolean type keys or treat as value is missing. - // This type of keys are mostly used in my.cnf. - AllowBooleanKeys bool - // AllowShadows indicates whether to keep track of keys with same name under same section. - AllowShadows bool - // Some INI formats allow group blocks that store a block of raw content that doesn't otherwise - // conform to key/value pairs. Specify the names of those blocks here. - UnparseableSections []string -} - -func LoadSources(opts LoadOptions, source interface{}, others ...interface{}) (_ *File, err error) { - sources := make([]dataSource, len(others)+1) - sources[0], err = parseDataSource(source) - if err != nil { - return nil, err - } - for i := range others { - sources[i+1], err = parseDataSource(others[i]) - if err != nil { - return nil, err - } - } - f := newFile(sources, opts) - if err = f.Reload(); err != nil { - return nil, err - } - return f, nil -} - -// Load loads and parses from INI data sources. -// Arguments can be mixed of file name with string type, or raw data in []byte. -// It will return error if list contains nonexistent files. -func Load(source interface{}, others ...interface{}) (*File, error) { - return LoadSources(LoadOptions{}, source, others...) -} - -// LooseLoad has exactly same functionality as Load function -// except it ignores nonexistent files instead of returning error. -func LooseLoad(source interface{}, others ...interface{}) (*File, error) { - return LoadSources(LoadOptions{Loose: true}, source, others...) -} - -// InsensitiveLoad has exactly same functionality as Load function -// except it forces all section and key names to be lowercased. -func InsensitiveLoad(source interface{}, others ...interface{}) (*File, error) { - return LoadSources(LoadOptions{Insensitive: true}, source, others...) -} - -// InsensitiveLoad has exactly same functionality as Load function -// except it allows have shadow keys. -func ShadowLoad(source interface{}, others ...interface{}) (*File, error) { - return LoadSources(LoadOptions{AllowShadows: true}, source, others...) -} - -// Empty returns an empty file object. -func Empty() *File { - // Ignore error here, we sure our data is good. - f, _ := Load([]byte("")) - return f -} - -// NewSection creates a new section. -func (f *File) NewSection(name string) (*Section, error) { - if len(name) == 0 { - return nil, errors.New("error creating new section: empty section name") - } else if f.options.Insensitive && name != DEFAULT_SECTION { - name = strings.ToLower(name) - } - - if f.BlockMode { - f.lock.Lock() - defer f.lock.Unlock() - } - - if inSlice(name, f.sectionList) { - return f.sections[name], nil - } - - f.sectionList = append(f.sectionList, name) - f.sections[name] = newSection(f, name) - return f.sections[name], nil -} - -// NewRawSection creates a new section with an unparseable body. -func (f *File) NewRawSection(name, body string) (*Section, error) { - section, err := f.NewSection(name) - if err != nil { - return nil, err - } - - section.isRawSection = true - section.rawBody = body - return section, nil -} - -// NewSections creates a list of sections. -func (f *File) NewSections(names ...string) (err error) { - for _, name := range names { - if _, err = f.NewSection(name); err != nil { - return err - } - } - return nil -} - -// GetSection returns section by given name. -func (f *File) GetSection(name string) (*Section, error) { - if len(name) == 0 { - name = DEFAULT_SECTION - } else if f.options.Insensitive { - name = strings.ToLower(name) - } - - if f.BlockMode { - f.lock.RLock() - defer f.lock.RUnlock() - } - - sec := f.sections[name] - if sec == nil { - return nil, fmt.Errorf("section '%s' does not exist", name) - } - return sec, nil -} - -// Section assumes named section exists and returns a zero-value when not. -func (f *File) Section(name string) *Section { - sec, err := f.GetSection(name) - if err != nil { - // Note: It's OK here because the only possible error is empty section name, - // but if it's empty, this piece of code won't be executed. - sec, _ = f.NewSection(name) - return sec - } - return sec -} - -// Section returns list of Section. -func (f *File) Sections() []*Section { - sections := make([]*Section, len(f.sectionList)) - for i := range f.sectionList { - sections[i] = f.Section(f.sectionList[i]) - } - return sections -} - -// SectionStrings returns list of section names. -func (f *File) SectionStrings() []string { - list := make([]string, len(f.sectionList)) - copy(list, f.sectionList) - return list -} - -// DeleteSection deletes a section. -func (f *File) DeleteSection(name string) { - if f.BlockMode { - f.lock.Lock() - defer f.lock.Unlock() - } - - if len(name) == 0 { - name = DEFAULT_SECTION - } - - for i, s := range f.sectionList { - if s == name { - f.sectionList = append(f.sectionList[:i], f.sectionList[i+1:]...) - delete(f.sections, name) - return - } - } -} - -func (f *File) reload(s dataSource) error { - r, err := s.ReadCloser() - if err != nil { - return err - } - defer r.Close() - - return f.parse(r) -} - -// Reload reloads and parses all data sources. -func (f *File) Reload() (err error) { - for _, s := range f.dataSources { - if err = f.reload(s); err != nil { - // In loose mode, we create an empty default section for nonexistent files. - if os.IsNotExist(err) && f.options.Loose { - f.parse(bytes.NewBuffer(nil)) - continue - } - return err - } - } - return nil -} - -// Append appends one or more data sources and reloads automatically. -func (f *File) Append(source interface{}, others ...interface{}) error { - ds, err := parseDataSource(source) - if err != nil { - return err - } - f.dataSources = append(f.dataSources, ds) - for _, s := range others { - ds, err = parseDataSource(s) - if err != nil { - return err - } - f.dataSources = append(f.dataSources, ds) - } - return f.Reload() -} - -// WriteToIndent writes content into io.Writer with given indention. -// If PrettyFormat has been set to be true, -// it will align "=" sign with spaces under each section. -func (f *File) WriteToIndent(w io.Writer, indent string) (n int64, err error) { - equalSign := "=" - if PrettyFormat { - equalSign = " = " - } - - // Use buffer to make sure target is safe until finish encoding. - buf := bytes.NewBuffer(nil) - for i, sname := range f.sectionList { - sec := f.Section(sname) - if len(sec.Comment) > 0 { - if sec.Comment[0] != '#' && sec.Comment[0] != ';' { - sec.Comment = "; " + sec.Comment - } - if _, err = buf.WriteString(sec.Comment + LineBreak); err != nil { - return 0, err - } - } - - if i > 0 || DefaultHeader { - if _, err = buf.WriteString("[" + sname + "]" + LineBreak); err != nil { - return 0, err - } - } else { - // Write nothing if default section is empty - if len(sec.keyList) == 0 { - continue - } - } - - if sec.isRawSection { - if _, err = buf.WriteString(sec.rawBody); err != nil { - return 0, err - } - continue - } - - // Count and generate alignment length and buffer spaces using the - // longest key. Keys may be modifed if they contain certain characters so - // we need to take that into account in our calculation. - alignLength := 0 - if PrettyFormat { - for _, kname := range sec.keyList { - keyLength := len(kname) - // First case will surround key by ` and second by """ - if strings.ContainsAny(kname, "\"=:") { - keyLength += 2 - } else if strings.Contains(kname, "`") { - keyLength += 6 - } - - if keyLength > alignLength { - alignLength = keyLength - } - } - } - alignSpaces := bytes.Repeat([]byte(" "), alignLength) - - KEY_LIST: - for _, kname := range sec.keyList { - key := sec.Key(kname) - if len(key.Comment) > 0 { - if len(indent) > 0 && sname != DEFAULT_SECTION { - buf.WriteString(indent) - } - if key.Comment[0] != '#' && key.Comment[0] != ';' { - key.Comment = "; " + key.Comment - } - if _, err = buf.WriteString(key.Comment + LineBreak); err != nil { - return 0, err - } - } - - if len(indent) > 0 && sname != DEFAULT_SECTION { - buf.WriteString(indent) - } - - switch { - case key.isAutoIncrement: - kname = "-" - case strings.ContainsAny(kname, "\"=:"): - kname = "`" + kname + "`" - case strings.Contains(kname, "`"): - kname = `"""` + kname + `"""` - } - - for _, val := range key.ValueWithShadows() { - if _, err = buf.WriteString(kname); err != nil { - return 0, err - } - - if key.isBooleanType { - if kname != sec.keyList[len(sec.keyList)-1] { - buf.WriteString(LineBreak) - } - continue KEY_LIST - } - - // Write out alignment spaces before "=" sign - if PrettyFormat { - buf.Write(alignSpaces[:alignLength-len(kname)]) - } - - // In case key value contains "\n", "`", "\"", "#" or ";" - if strings.ContainsAny(val, "\n`") { - val = `"""` + val + `"""` - } else if strings.ContainsAny(val, "#;") { - val = "`" + val + "`" - } - if _, err = buf.WriteString(equalSign + val + LineBreak); err != nil { - return 0, err - } - } - } - - // Put a line between sections - if _, err = buf.WriteString(LineBreak); err != nil { - return 0, err - } - } - - return buf.WriteTo(w) -} - -// WriteTo writes file content into io.Writer. -func (f *File) WriteTo(w io.Writer) (int64, error) { - return f.WriteToIndent(w, "") -} - -// SaveToIndent writes content to file system with given value indention. -func (f *File) SaveToIndent(filename, indent string) error { - // Note: Because we are truncating with os.Create, - // so it's safer to save to a temporary file location and rename afte done. - tmpPath := filename + "." + strconv.Itoa(time.Now().Nanosecond()) + ".tmp" - defer os.Remove(tmpPath) - - fw, err := os.Create(tmpPath) - if err != nil { - return err - } - - if _, err = f.WriteToIndent(fw, indent); err != nil { - fw.Close() - return err - } - fw.Close() - - // Remove old file and rename the new one. - os.Remove(filename) - return os.Rename(tmpPath, filename) -} - -// SaveTo writes content to file system. -func (f *File) SaveTo(filename string) error { - return f.SaveToIndent(filename, "") -} diff --git a/vendor/github.com/go-ini/ini/ini_test.go b/vendor/github.com/go-ini/ini/ini_test.go deleted file mode 100644 index 00b1baa..0000000 --- a/vendor/github.com/go-ini/ini/ini_test.go +++ /dev/null @@ -1,449 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "bytes" - "io/ioutil" - "strings" - "testing" - "time" - - . "github.com/smartystreets/goconvey/convey" -) - -func Test_Version(t *testing.T) { - Convey("Get version", t, func() { - So(Version(), ShouldEqual, _VERSION) - }) -} - -const _CONF_DATA = ` -; Package name -NAME = ini -; Package version -VERSION = v1 -; Package import path -IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s - -# Information about package author -# Bio can be written in multiple lines. -[author] -NAME = Unknwon ; Succeeding comment -E-MAIL = fake@localhost -GITHUB = https://github.com/%(NAME)s -BIO = """Gopher. -Coding addict. -Good man. -""" # Succeeding comment - -[package] -CLONE_URL = https://%(IMPORT_PATH)s - -[package.sub] -UNUSED_KEY = should be deleted - -[features] --: Support read/write comments of keys and sections --: Support auto-increment of key names --: Support load multiple files to overwrite key values - -[types] -STRING = str -BOOL = true -BOOL_FALSE = false -FLOAT64 = 1.25 -INT = 10 -TIME = 2015-01-01T20:17:05Z -DURATION = 2h45m -UINT = 3 - -[array] -STRINGS = en, zh, de -FLOAT64S = 1.1, 2.2, 3.3 -INTS = 1, 2, 3 -UINTS = 1, 2, 3 -TIMES = 2015-01-01T20:17:05Z,2015-01-01T20:17:05Z,2015-01-01T20:17:05Z - -[note] -empty_lines = next line is empty\ - -; Comment before the section -[comments] ; This is a comment for the section too -; Comment before key -key = "value" -key2 = "value2" ; This is a comment for key2 -key3 = "one", "two", "three" - -[advance] -value with quotes = "some value" -value quote2 again = 'some value' -includes comment sign = ` + "`" + "my#password" + "`" + ` -includes comment sign2 = ` + "`" + "my;password" + "`" + ` -true = 2+3=5 -"1+1=2" = true -"""6+1=7""" = true -"""` + "`" + `5+5` + "`" + `""" = 10 -` + "`" + `"6+6"` + "`" + ` = 12 -` + "`" + `7-2=4` + "`" + ` = false -ADDRESS = ` + "`" + `404 road, -NotFound, State, 50000` + "`" + ` - -two_lines = how about \ - continuation lines? -lots_of_lines = 1 \ - 2 \ - 3 \ - 4 \ -` - -func Test_Load(t *testing.T) { - Convey("Load from data sources", t, func() { - - Convey("Load with empty data", func() { - So(Empty(), ShouldNotBeNil) - }) - - Convey("Load with multiple data sources", func() { - cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini", ioutil.NopCloser(bytes.NewReader([]byte(_CONF_DATA)))) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - f, err := Load([]byte(_CONF_DATA), "testdata/404.ini") - So(err, ShouldNotBeNil) - So(f, ShouldBeNil) - }) - - Convey("Load with io.ReadCloser", func() { - cfg, err := Load(ioutil.NopCloser(bytes.NewReader([]byte(_CONF_DATA)))) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - So(cfg.Section("").Key("NAME").String(), ShouldEqual, "ini") - }) - }) - - Convey("Bad load process", t, func() { - - Convey("Load from invalid data sources", func() { - _, err := Load(_CONF_DATA) - So(err, ShouldNotBeNil) - - f, err := Load("testdata/404.ini") - So(err, ShouldNotBeNil) - So(f, ShouldBeNil) - - _, err = Load(1) - So(err, ShouldNotBeNil) - - _, err = Load([]byte(""), 1) - So(err, ShouldNotBeNil) - }) - - Convey("Load with bad section name", func() { - _, err := Load([]byte("[]")) - So(err, ShouldNotBeNil) - - _, err = Load([]byte("[")) - So(err, ShouldNotBeNil) - }) - - Convey("Load with bad keys", func() { - _, err := Load([]byte(`"""name`)) - So(err, ShouldNotBeNil) - - _, err = Load([]byte(`"""name"""`)) - So(err, ShouldNotBeNil) - - _, err = Load([]byte(`""=1`)) - So(err, ShouldNotBeNil) - - _, err = Load([]byte(`=`)) - So(err, ShouldNotBeNil) - - _, err = Load([]byte(`name`)) - So(err, ShouldNotBeNil) - }) - - Convey("Load with bad values", func() { - _, err := Load([]byte(`name="""Unknwon`)) - So(err, ShouldNotBeNil) - }) - }) - - Convey("Get section and key insensitively", t, func() { - cfg, err := InsensitiveLoad([]byte(_CONF_DATA), "testdata/conf.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - sec, err := cfg.GetSection("Author") - So(err, ShouldBeNil) - So(sec, ShouldNotBeNil) - - key, err := sec.GetKey("E-mail") - So(err, ShouldBeNil) - So(key, ShouldNotBeNil) - }) - - Convey("Load with ignoring continuation lines", t, func() { - cfg, err := LoadSources(LoadOptions{IgnoreContinuation: true}, []byte(`key1=a\b\ -key2=c\d\`)) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - So(cfg.Section("").Key("key1").String(), ShouldEqual, `a\b\`) - So(cfg.Section("").Key("key2").String(), ShouldEqual, `c\d\`) - }) - - Convey("Load with boolean type keys", t, func() { - cfg, err := LoadSources(LoadOptions{AllowBooleanKeys: true}, []byte(`key1=hello -key2 -#key3 -key4 -key5`)) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - So(strings.Join(cfg.Section("").KeyStrings(), ","), ShouldEqual, "key1,key2,key4,key5") - So(cfg.Section("").Key("key2").MustBool(false), ShouldBeTrue) - - var buf bytes.Buffer - cfg.WriteTo(&buf) - // there is always a trailing \n at the end of the section - So(buf.String(), ShouldEqual, `key1 = hello -key2 -#key3 -key4 -key5 -`) - }) -} - -func Test_LooseLoad(t *testing.T) { - Convey("Loose load from data sources", t, func() { - Convey("Loose load mixed with nonexistent file", func() { - cfg, err := LooseLoad("testdata/404.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - var fake struct { - Name string `ini:"name"` - } - So(cfg.MapTo(&fake), ShouldBeNil) - - cfg, err = LooseLoad([]byte("name=Unknwon"), "testdata/404.ini") - So(err, ShouldBeNil) - So(cfg.Section("").Key("name").String(), ShouldEqual, "Unknwon") - So(cfg.MapTo(&fake), ShouldBeNil) - So(fake.Name, ShouldEqual, "Unknwon") - }) - }) - -} - -func Test_File_Append(t *testing.T) { - Convey("Append data sources", t, func() { - cfg, err := Load([]byte("")) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - So(cfg.Append([]byte(""), []byte("")), ShouldBeNil) - - Convey("Append bad data sources", func() { - So(cfg.Append(1), ShouldNotBeNil) - So(cfg.Append([]byte(""), 1), ShouldNotBeNil) - }) - }) -} - -func Test_File_WriteTo(t *testing.T) { - Convey("Write to somewhere", t, func() { - var buf bytes.Buffer - cfg := Empty() - cfg.WriteTo(&buf) - }) -} - -func Test_File_SaveTo_WriteTo(t *testing.T) { - Convey("Save file", t, func() { - cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - cfg.Section("").Key("NAME").Comment = "Package name" - cfg.Section("author").Comment = `Information about package author -# Bio can be written in multiple lines.` - cfg.Section("advanced").Key("val w/ pound").SetValue("my#password") - cfg.Section("advanced").Key("longest key has a colon : yes/no").SetValue("yes") - So(cfg.SaveTo("testdata/conf_out.ini"), ShouldBeNil) - - cfg.Section("author").Key("NAME").Comment = "This is author name" - - So(cfg.SaveToIndent("testdata/conf_out.ini", "\t"), ShouldBeNil) - - var buf bytes.Buffer - _, err = cfg.WriteToIndent(&buf, "\t") - So(err, ShouldBeNil) - So(buf.String(), ShouldEqual, `; Package name -NAME = ini -; Package version -VERSION = v1 -; Package import path -IMPORT_PATH = gopkg.in/%(NAME)s.%(VERSION)s - -; Information about package author -# Bio can be written in multiple lines. -[author] - ; This is author name - NAME = Unknwon - E-MAIL = u@gogs.io - GITHUB = https://github.com/%(NAME)s - # Succeeding comment - BIO = """Gopher. -Coding addict. -Good man. -""" - -[package] - CLONE_URL = https://%(IMPORT_PATH)s - -[package.sub] - UNUSED_KEY = should be deleted - -[features] - - = Support read/write comments of keys and sections - - = Support auto-increment of key names - - = Support load multiple files to overwrite key values - -[types] - STRING = str - BOOL = true - BOOL_FALSE = false - FLOAT64 = 1.25 - INT = 10 - TIME = 2015-01-01T20:17:05Z - DURATION = 2h45m - UINT = 3 - -[array] - STRINGS = en, zh, de - FLOAT64S = 1.1, 2.2, 3.3 - INTS = 1, 2, 3 - UINTS = 1, 2, 3 - TIMES = 2015-01-01T20:17:05Z,2015-01-01T20:17:05Z,2015-01-01T20:17:05Z - -[note] - empty_lines = next line is empty - -; Comment before the section -; This is a comment for the section too -[comments] - ; Comment before key - key = value - ; This is a comment for key2 - key2 = value2 - key3 = "one", "two", "three" - -[advance] - value with quotes = some value - value quote2 again = some value - includes comment sign = `+"`"+"my#password"+"`"+` - includes comment sign2 = `+"`"+"my;password"+"`"+` - true = 2+3=5 - `+"`"+`1+1=2`+"`"+` = true - `+"`"+`6+1=7`+"`"+` = true - """`+"`"+`5+5`+"`"+`""" = 10 - `+"`"+`"6+6"`+"`"+` = 12 - `+"`"+`7-2=4`+"`"+` = false - ADDRESS = """404 road, -NotFound, State, 50000""" - two_lines = how about continuation lines? - lots_of_lines = 1 2 3 4 - -[advanced] - val w/ pound = `+"`"+`my#password`+"`"+` - `+"`"+`longest key has a colon : yes/no`+"`"+` = yes - -`) - }) -} - -func Test_File_WriteTo_SectionRaw(t *testing.T) { - Convey("Write a INI with a raw section", t, func() { - var buf bytes.Buffer - cfg, err := LoadSources( - LoadOptions{ - UnparseableSections: []string{"CORE_LESSON", "COMMENTS"}, - }, - "testdata/aicc.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - cfg.WriteToIndent(&buf, "\t") - So(buf.String(), ShouldEqual, `[Core] - Lesson_Location = 87 - Lesson_Status = C - Score = 3 - Time = 00:02:30 - -[CORE_LESSON] -my lesson state data – 1111111111111111111000000000000000001110000 -111111111111111111100000000000111000000000 – end my lesson state data -[COMMENTS] -<1> This slide has the fuel listed in the wrong units -`) - }) -} - -// Helpers for slice tests. -func float64sEqual(values []float64, expected ...float64) { - So(values, ShouldHaveLength, len(expected)) - for i, v := range expected { - So(values[i], ShouldEqual, v) - } -} - -func intsEqual(values []int, expected ...int) { - So(values, ShouldHaveLength, len(expected)) - for i, v := range expected { - So(values[i], ShouldEqual, v) - } -} - -func int64sEqual(values []int64, expected ...int64) { - So(values, ShouldHaveLength, len(expected)) - for i, v := range expected { - So(values[i], ShouldEqual, v) - } -} - -func uintsEqual(values []uint, expected ...uint) { - So(values, ShouldHaveLength, len(expected)) - for i, v := range expected { - So(values[i], ShouldEqual, v) - } -} - -func uint64sEqual(values []uint64, expected ...uint64) { - So(values, ShouldHaveLength, len(expected)) - for i, v := range expected { - So(values[i], ShouldEqual, v) - } -} - -func timesEqual(values []time.Time, expected ...time.Time) { - So(values, ShouldHaveLength, len(expected)) - for i, v := range expected { - So(values[i].String(), ShouldEqual, v.String()) - } -} diff --git a/vendor/github.com/go-ini/ini/key.go b/vendor/github.com/go-ini/ini/key.go deleted file mode 100644 index 852696f..0000000 --- a/vendor/github.com/go-ini/ini/key.go +++ /dev/null @@ -1,703 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "errors" - "fmt" - "strconv" - "strings" - "time" -) - -// Key represents a key under a section. -type Key struct { - s *Section - name string - value string - isAutoIncrement bool - isBooleanType bool - - isShadow bool - shadows []*Key - - Comment string -} - -// newKey simply return a key object with given values. -func newKey(s *Section, name, val string) *Key { - return &Key{ - s: s, - name: name, - value: val, - } -} - -func (k *Key) addShadow(val string) error { - if k.isShadow { - return errors.New("cannot add shadow to another shadow key") - } else if k.isAutoIncrement || k.isBooleanType { - return errors.New("cannot add shadow to auto-increment or boolean key") - } - - shadow := newKey(k.s, k.name, val) - shadow.isShadow = true - k.shadows = append(k.shadows, shadow) - return nil -} - -// AddShadow adds a new shadow key to itself. -func (k *Key) AddShadow(val string) error { - if !k.s.f.options.AllowShadows { - return errors.New("shadow key is not allowed") - } - return k.addShadow(val) -} - -// ValueMapper represents a mapping function for values, e.g. os.ExpandEnv -type ValueMapper func(string) string - -// Name returns name of key. -func (k *Key) Name() string { - return k.name -} - -// Value returns raw value of key for performance purpose. -func (k *Key) Value() string { - return k.value -} - -// ValueWithShadows returns raw values of key and its shadows if any. -func (k *Key) ValueWithShadows() []string { - if len(k.shadows) == 0 { - return []string{k.value} - } - vals := make([]string, len(k.shadows)+1) - vals[0] = k.value - for i := range k.shadows { - vals[i+1] = k.shadows[i].value - } - return vals -} - -// transformValue takes a raw value and transforms to its final string. -func (k *Key) transformValue(val string) string { - if k.s.f.ValueMapper != nil { - val = k.s.f.ValueMapper(val) - } - - // Fail-fast if no indicate char found for recursive value - if !strings.Contains(val, "%") { - return val - } - for i := 0; i < _DEPTH_VALUES; i++ { - vr := varPattern.FindString(val) - if len(vr) == 0 { - break - } - - // Take off leading '%(' and trailing ')s'. - noption := strings.TrimLeft(vr, "%(") - noption = strings.TrimRight(noption, ")s") - - // Search in the same section. - nk, err := k.s.GetKey(noption) - if err != nil { - // Search again in default section. - nk, _ = k.s.f.Section("").GetKey(noption) - } - - // Substitute by new value and take off leading '%(' and trailing ')s'. - val = strings.Replace(val, vr, nk.value, -1) - } - return val -} - -// String returns string representation of value. -func (k *Key) String() string { - return k.transformValue(k.value) -} - -// Validate accepts a validate function which can -// return modifed result as key value. -func (k *Key) Validate(fn func(string) string) string { - return fn(k.String()) -} - -// parseBool returns the boolean value represented by the string. -// -// It accepts 1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On, -// 0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off. -// Any other value returns an error. -func parseBool(str string) (value bool, err error) { - switch str { - case "1", "t", "T", "true", "TRUE", "True", "YES", "yes", "Yes", "y", "ON", "on", "On": - return true, nil - case "0", "f", "F", "false", "FALSE", "False", "NO", "no", "No", "n", "OFF", "off", "Off": - return false, nil - } - return false, fmt.Errorf("parsing \"%s\": invalid syntax", str) -} - -// Bool returns bool type value. -func (k *Key) Bool() (bool, error) { - return parseBool(k.String()) -} - -// Float64 returns float64 type value. -func (k *Key) Float64() (float64, error) { - return strconv.ParseFloat(k.String(), 64) -} - -// Int returns int type value. -func (k *Key) Int() (int, error) { - return strconv.Atoi(k.String()) -} - -// Int64 returns int64 type value. -func (k *Key) Int64() (int64, error) { - return strconv.ParseInt(k.String(), 10, 64) -} - -// Uint returns uint type valued. -func (k *Key) Uint() (uint, error) { - u, e := strconv.ParseUint(k.String(), 10, 64) - return uint(u), e -} - -// Uint64 returns uint64 type value. -func (k *Key) Uint64() (uint64, error) { - return strconv.ParseUint(k.String(), 10, 64) -} - -// Duration returns time.Duration type value. -func (k *Key) Duration() (time.Duration, error) { - return time.ParseDuration(k.String()) -} - -// TimeFormat parses with given format and returns time.Time type value. -func (k *Key) TimeFormat(format string) (time.Time, error) { - return time.Parse(format, k.String()) -} - -// Time parses with RFC3339 format and returns time.Time type value. -func (k *Key) Time() (time.Time, error) { - return k.TimeFormat(time.RFC3339) -} - -// MustString returns default value if key value is empty. -func (k *Key) MustString(defaultVal string) string { - val := k.String() - if len(val) == 0 { - k.value = defaultVal - return defaultVal - } - return val -} - -// MustBool always returns value without error, -// it returns false if error occurs. -func (k *Key) MustBool(defaultVal ...bool) bool { - val, err := k.Bool() - if len(defaultVal) > 0 && err != nil { - k.value = strconv.FormatBool(defaultVal[0]) - return defaultVal[0] - } - return val -} - -// MustFloat64 always returns value without error, -// it returns 0.0 if error occurs. -func (k *Key) MustFloat64(defaultVal ...float64) float64 { - val, err := k.Float64() - if len(defaultVal) > 0 && err != nil { - k.value = strconv.FormatFloat(defaultVal[0], 'f', -1, 64) - return defaultVal[0] - } - return val -} - -// MustInt always returns value without error, -// it returns 0 if error occurs. -func (k *Key) MustInt(defaultVal ...int) int { - val, err := k.Int() - if len(defaultVal) > 0 && err != nil { - k.value = strconv.FormatInt(int64(defaultVal[0]), 10) - return defaultVal[0] - } - return val -} - -// MustInt64 always returns value without error, -// it returns 0 if error occurs. -func (k *Key) MustInt64(defaultVal ...int64) int64 { - val, err := k.Int64() - if len(defaultVal) > 0 && err != nil { - k.value = strconv.FormatInt(defaultVal[0], 10) - return defaultVal[0] - } - return val -} - -// MustUint always returns value without error, -// it returns 0 if error occurs. -func (k *Key) MustUint(defaultVal ...uint) uint { - val, err := k.Uint() - if len(defaultVal) > 0 && err != nil { - k.value = strconv.FormatUint(uint64(defaultVal[0]), 10) - return defaultVal[0] - } - return val -} - -// MustUint64 always returns value without error, -// it returns 0 if error occurs. -func (k *Key) MustUint64(defaultVal ...uint64) uint64 { - val, err := k.Uint64() - if len(defaultVal) > 0 && err != nil { - k.value = strconv.FormatUint(defaultVal[0], 10) - return defaultVal[0] - } - return val -} - -// MustDuration always returns value without error, -// it returns zero value if error occurs. -func (k *Key) MustDuration(defaultVal ...time.Duration) time.Duration { - val, err := k.Duration() - if len(defaultVal) > 0 && err != nil { - k.value = defaultVal[0].String() - return defaultVal[0] - } - return val -} - -// MustTimeFormat always parses with given format and returns value without error, -// it returns zero value if error occurs. -func (k *Key) MustTimeFormat(format string, defaultVal ...time.Time) time.Time { - val, err := k.TimeFormat(format) - if len(defaultVal) > 0 && err != nil { - k.value = defaultVal[0].Format(format) - return defaultVal[0] - } - return val -} - -// MustTime always parses with RFC3339 format and returns value without error, -// it returns zero value if error occurs. -func (k *Key) MustTime(defaultVal ...time.Time) time.Time { - return k.MustTimeFormat(time.RFC3339, defaultVal...) -} - -// In always returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) In(defaultVal string, candidates []string) string { - val := k.String() - for _, cand := range candidates { - if val == cand { - return val - } - } - return defaultVal -} - -// InFloat64 always returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) InFloat64(defaultVal float64, candidates []float64) float64 { - val := k.MustFloat64() - for _, cand := range candidates { - if val == cand { - return val - } - } - return defaultVal -} - -// InInt always returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) InInt(defaultVal int, candidates []int) int { - val := k.MustInt() - for _, cand := range candidates { - if val == cand { - return val - } - } - return defaultVal -} - -// InInt64 always returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) InInt64(defaultVal int64, candidates []int64) int64 { - val := k.MustInt64() - for _, cand := range candidates { - if val == cand { - return val - } - } - return defaultVal -} - -// InUint always returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) InUint(defaultVal uint, candidates []uint) uint { - val := k.MustUint() - for _, cand := range candidates { - if val == cand { - return val - } - } - return defaultVal -} - -// InUint64 always returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) InUint64(defaultVal uint64, candidates []uint64) uint64 { - val := k.MustUint64() - for _, cand := range candidates { - if val == cand { - return val - } - } - return defaultVal -} - -// InTimeFormat always parses with given format and returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) InTimeFormat(format string, defaultVal time.Time, candidates []time.Time) time.Time { - val := k.MustTimeFormat(format) - for _, cand := range candidates { - if val == cand { - return val - } - } - return defaultVal -} - -// InTime always parses with RFC3339 format and returns value without error, -// it returns default value if error occurs or doesn't fit into candidates. -func (k *Key) InTime(defaultVal time.Time, candidates []time.Time) time.Time { - return k.InTimeFormat(time.RFC3339, defaultVal, candidates) -} - -// RangeFloat64 checks if value is in given range inclusively, -// and returns default value if it's not. -func (k *Key) RangeFloat64(defaultVal, min, max float64) float64 { - val := k.MustFloat64() - if val < min || val > max { - return defaultVal - } - return val -} - -// RangeInt checks if value is in given range inclusively, -// and returns default value if it's not. -func (k *Key) RangeInt(defaultVal, min, max int) int { - val := k.MustInt() - if val < min || val > max { - return defaultVal - } - return val -} - -// RangeInt64 checks if value is in given range inclusively, -// and returns default value if it's not. -func (k *Key) RangeInt64(defaultVal, min, max int64) int64 { - val := k.MustInt64() - if val < min || val > max { - return defaultVal - } - return val -} - -// RangeTimeFormat checks if value with given format is in given range inclusively, -// and returns default value if it's not. -func (k *Key) RangeTimeFormat(format string, defaultVal, min, max time.Time) time.Time { - val := k.MustTimeFormat(format) - if val.Unix() < min.Unix() || val.Unix() > max.Unix() { - return defaultVal - } - return val -} - -// RangeTime checks if value with RFC3339 format is in given range inclusively, -// and returns default value if it's not. -func (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time { - return k.RangeTimeFormat(time.RFC3339, defaultVal, min, max) -} - -// Strings returns list of string divided by given delimiter. -func (k *Key) Strings(delim string) []string { - str := k.String() - if len(str) == 0 { - return []string{} - } - - vals := strings.Split(str, delim) - for i := range vals { - // vals[i] = k.transformValue(strings.TrimSpace(vals[i])) - vals[i] = strings.TrimSpace(vals[i]) - } - return vals -} - -// StringsWithShadows returns list of string divided by given delimiter. -// Shadows will also be appended if any. -func (k *Key) StringsWithShadows(delim string) []string { - vals := k.ValueWithShadows() - results := make([]string, 0, len(vals)*2) - for i := range vals { - if len(vals) == 0 { - continue - } - - results = append(results, strings.Split(vals[i], delim)...) - } - - for i := range results { - results[i] = k.transformValue(strings.TrimSpace(results[i])) - } - return results -} - -// Float64s returns list of float64 divided by given delimiter. Any invalid input will be treated as zero value. -func (k *Key) Float64s(delim string) []float64 { - vals, _ := k.getFloat64s(delim, true, false) - return vals -} - -// Ints returns list of int divided by given delimiter. Any invalid input will be treated as zero value. -func (k *Key) Ints(delim string) []int { - vals, _ := k.parseInts(k.Strings(delim), true, false) - return vals -} - -// Int64s returns list of int64 divided by given delimiter. Any invalid input will be treated as zero value. -func (k *Key) Int64s(delim string) []int64 { - vals, _ := k.parseInt64s(k.Strings(delim), true, false) - return vals -} - -// Uints returns list of uint divided by given delimiter. Any invalid input will be treated as zero value. -func (k *Key) Uints(delim string) []uint { - vals, _ := k.getUints(delim, true, false) - return vals -} - -// Uint64s returns list of uint64 divided by given delimiter. Any invalid input will be treated as zero value. -func (k *Key) Uint64s(delim string) []uint64 { - vals, _ := k.getUint64s(delim, true, false) - return vals -} - -// TimesFormat parses with given format and returns list of time.Time divided by given delimiter. -// Any invalid input will be treated as zero value (0001-01-01 00:00:00 +0000 UTC). -func (k *Key) TimesFormat(format, delim string) []time.Time { - vals, _ := k.getTimesFormat(format, delim, true, false) - return vals -} - -// Times parses with RFC3339 format and returns list of time.Time divided by given delimiter. -// Any invalid input will be treated as zero value (0001-01-01 00:00:00 +0000 UTC). -func (k *Key) Times(delim string) []time.Time { - return k.TimesFormat(time.RFC3339, delim) -} - -// ValidFloat64s returns list of float64 divided by given delimiter. If some value is not float, then -// it will not be included to result list. -func (k *Key) ValidFloat64s(delim string) []float64 { - vals, _ := k.getFloat64s(delim, false, false) - return vals -} - -// ValidInts returns list of int divided by given delimiter. If some value is not integer, then it will -// not be included to result list. -func (k *Key) ValidInts(delim string) []int { - vals, _ := k.parseInts(k.Strings(delim), false, false) - return vals -} - -// ValidInt64s returns list of int64 divided by given delimiter. If some value is not 64-bit integer, -// then it will not be included to result list. -func (k *Key) ValidInt64s(delim string) []int64 { - vals, _ := k.parseInt64s(k.Strings(delim), false, false) - return vals -} - -// ValidUints returns list of uint divided by given delimiter. If some value is not unsigned integer, -// then it will not be included to result list. -func (k *Key) ValidUints(delim string) []uint { - vals, _ := k.getUints(delim, false, false) - return vals -} - -// ValidUint64s returns list of uint64 divided by given delimiter. If some value is not 64-bit unsigned -// integer, then it will not be included to result list. -func (k *Key) ValidUint64s(delim string) []uint64 { - vals, _ := k.getUint64s(delim, false, false) - return vals -} - -// ValidTimesFormat parses with given format and returns list of time.Time divided by given delimiter. -func (k *Key) ValidTimesFormat(format, delim string) []time.Time { - vals, _ := k.getTimesFormat(format, delim, false, false) - return vals -} - -// ValidTimes parses with RFC3339 format and returns list of time.Time divided by given delimiter. -func (k *Key) ValidTimes(delim string) []time.Time { - return k.ValidTimesFormat(time.RFC3339, delim) -} - -// StrictFloat64s returns list of float64 divided by given delimiter or error on first invalid input. -func (k *Key) StrictFloat64s(delim string) ([]float64, error) { - return k.getFloat64s(delim, false, true) -} - -// StrictInts returns list of int divided by given delimiter or error on first invalid input. -func (k *Key) StrictInts(delim string) ([]int, error) { - return k.parseInts(k.Strings(delim), false, true) -} - -// StrictInt64s returns list of int64 divided by given delimiter or error on first invalid input. -func (k *Key) StrictInt64s(delim string) ([]int64, error) { - return k.parseInt64s(k.Strings(delim), false, true) -} - -// StrictUints returns list of uint divided by given delimiter or error on first invalid input. -func (k *Key) StrictUints(delim string) ([]uint, error) { - return k.getUints(delim, false, true) -} - -// StrictUint64s returns list of uint64 divided by given delimiter or error on first invalid input. -func (k *Key) StrictUint64s(delim string) ([]uint64, error) { - return k.getUint64s(delim, false, true) -} - -// StrictTimesFormat parses with given format and returns list of time.Time divided by given delimiter -// or error on first invalid input. -func (k *Key) StrictTimesFormat(format, delim string) ([]time.Time, error) { - return k.getTimesFormat(format, delim, false, true) -} - -// StrictTimes parses with RFC3339 format and returns list of time.Time divided by given delimiter -// or error on first invalid input. -func (k *Key) StrictTimes(delim string) ([]time.Time, error) { - return k.StrictTimesFormat(time.RFC3339, delim) -} - -// getFloat64s returns list of float64 divided by given delimiter. -func (k *Key) getFloat64s(delim string, addInvalid, returnOnInvalid bool) ([]float64, error) { - strs := k.Strings(delim) - vals := make([]float64, 0, len(strs)) - for _, str := range strs { - val, err := strconv.ParseFloat(str, 64) - if err != nil && returnOnInvalid { - return nil, err - } - if err == nil || addInvalid { - vals = append(vals, val) - } - } - return vals, nil -} - -// parseInts transforms strings to ints. -func (k *Key) parseInts(strs []string, addInvalid, returnOnInvalid bool) ([]int, error) { - vals := make([]int, 0, len(strs)) - for _, str := range strs { - val, err := strconv.Atoi(str) - if err != nil && returnOnInvalid { - return nil, err - } - if err == nil || addInvalid { - vals = append(vals, val) - } - } - return vals, nil -} - -// parseInt64s transforms strings to int64s. -func (k *Key) parseInt64s(strs []string, addInvalid, returnOnInvalid bool) ([]int64, error) { - vals := make([]int64, 0, len(strs)) - for _, str := range strs { - val, err := strconv.ParseInt(str, 10, 64) - if err != nil && returnOnInvalid { - return nil, err - } - if err == nil || addInvalid { - vals = append(vals, val) - } - } - return vals, nil -} - -// getUints returns list of uint divided by given delimiter. -func (k *Key) getUints(delim string, addInvalid, returnOnInvalid bool) ([]uint, error) { - strs := k.Strings(delim) - vals := make([]uint, 0, len(strs)) - for _, str := range strs { - val, err := strconv.ParseUint(str, 10, 0) - if err != nil && returnOnInvalid { - return nil, err - } - if err == nil || addInvalid { - vals = append(vals, uint(val)) - } - } - return vals, nil -} - -// getUint64s returns list of uint64 divided by given delimiter. -func (k *Key) getUint64s(delim string, addInvalid, returnOnInvalid bool) ([]uint64, error) { - strs := k.Strings(delim) - vals := make([]uint64, 0, len(strs)) - for _, str := range strs { - val, err := strconv.ParseUint(str, 10, 64) - if err != nil && returnOnInvalid { - return nil, err - } - if err == nil || addInvalid { - vals = append(vals, val) - } - } - return vals, nil -} - -// getTimesFormat parses with given format and returns list of time.Time divided by given delimiter. -func (k *Key) getTimesFormat(format, delim string, addInvalid, returnOnInvalid bool) ([]time.Time, error) { - strs := k.Strings(delim) - vals := make([]time.Time, 0, len(strs)) - for _, str := range strs { - val, err := time.Parse(format, str) - if err != nil && returnOnInvalid { - return nil, err - } - if err == nil || addInvalid { - vals = append(vals, val) - } - } - return vals, nil -} - -// SetValue changes key value. -func (k *Key) SetValue(v string) { - if k.s.f.BlockMode { - k.s.f.lock.Lock() - defer k.s.f.lock.Unlock() - } - - k.value = v - k.s.keysHash[k.name] = v -} diff --git a/vendor/github.com/go-ini/ini/key_test.go b/vendor/github.com/go-ini/ini/key_test.go deleted file mode 100644 index 1281d5b..0000000 --- a/vendor/github.com/go-ini/ini/key_test.go +++ /dev/null @@ -1,573 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "bytes" - "fmt" - "strings" - "testing" - "time" - - . "github.com/smartystreets/goconvey/convey" -) - -func Test_Key(t *testing.T) { - Convey("Test getting and setting values", t, func() { - cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - Convey("Get values in default section", func() { - sec := cfg.Section("") - So(sec, ShouldNotBeNil) - So(sec.Key("NAME").Value(), ShouldEqual, "ini") - So(sec.Key("NAME").String(), ShouldEqual, "ini") - So(sec.Key("NAME").Validate(func(in string) string { - return in - }), ShouldEqual, "ini") - So(sec.Key("NAME").Comment, ShouldEqual, "; Package name") - So(sec.Key("IMPORT_PATH").String(), ShouldEqual, "gopkg.in/ini.v1") - }) - - Convey("Get values in non-default section", func() { - sec := cfg.Section("author") - So(sec, ShouldNotBeNil) - So(sec.Key("NAME").String(), ShouldEqual, "Unknwon") - So(sec.Key("GITHUB").String(), ShouldEqual, "https://github.com/Unknwon") - - sec = cfg.Section("package") - So(sec, ShouldNotBeNil) - So(sec.Key("CLONE_URL").String(), ShouldEqual, "https://gopkg.in/ini.v1") - }) - - Convey("Get auto-increment key names", func() { - keys := cfg.Section("features").Keys() - for i, k := range keys { - So(k.Name(), ShouldEqual, fmt.Sprintf("#%d", i+1)) - } - }) - - Convey("Get parent-keys that are available to the child section", func() { - parentKeys := cfg.Section("package.sub").ParentKeys() - for _, k := range parentKeys { - So(k.Name(), ShouldEqual, "CLONE_URL") - } - }) - - Convey("Get overwrite value", func() { - So(cfg.Section("author").Key("E-MAIL").String(), ShouldEqual, "u@gogs.io") - }) - - Convey("Get sections", func() { - sections := cfg.Sections() - for i, name := range []string{DEFAULT_SECTION, "author", "package", "package.sub", "features", "types", "array", "note", "comments", "advance"} { - So(sections[i].Name(), ShouldEqual, name) - } - }) - - Convey("Get parent section value", func() { - So(cfg.Section("package.sub").Key("CLONE_URL").String(), ShouldEqual, "https://gopkg.in/ini.v1") - So(cfg.Section("package.fake.sub").Key("CLONE_URL").String(), ShouldEqual, "https://gopkg.in/ini.v1") - }) - - Convey("Get multiple line value", func() { - So(cfg.Section("author").Key("BIO").String(), ShouldEqual, "Gopher.\nCoding addict.\nGood man.\n") - }) - - Convey("Get values with type", func() { - sec := cfg.Section("types") - v1, err := sec.Key("BOOL").Bool() - So(err, ShouldBeNil) - So(v1, ShouldBeTrue) - - v1, err = sec.Key("BOOL_FALSE").Bool() - So(err, ShouldBeNil) - So(v1, ShouldBeFalse) - - v2, err := sec.Key("FLOAT64").Float64() - So(err, ShouldBeNil) - So(v2, ShouldEqual, 1.25) - - v3, err := sec.Key("INT").Int() - So(err, ShouldBeNil) - So(v3, ShouldEqual, 10) - - v4, err := sec.Key("INT").Int64() - So(err, ShouldBeNil) - So(v4, ShouldEqual, 10) - - v5, err := sec.Key("UINT").Uint() - So(err, ShouldBeNil) - So(v5, ShouldEqual, 3) - - v6, err := sec.Key("UINT").Uint64() - So(err, ShouldBeNil) - So(v6, ShouldEqual, 3) - - t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") - So(err, ShouldBeNil) - v7, err := sec.Key("TIME").Time() - So(err, ShouldBeNil) - So(v7.String(), ShouldEqual, t.String()) - - Convey("Must get values with type", func() { - So(sec.Key("STRING").MustString("404"), ShouldEqual, "str") - So(sec.Key("BOOL").MustBool(), ShouldBeTrue) - So(sec.Key("FLOAT64").MustFloat64(), ShouldEqual, 1.25) - So(sec.Key("INT").MustInt(), ShouldEqual, 10) - So(sec.Key("INT").MustInt64(), ShouldEqual, 10) - So(sec.Key("UINT").MustUint(), ShouldEqual, 3) - So(sec.Key("UINT").MustUint64(), ShouldEqual, 3) - So(sec.Key("TIME").MustTime().String(), ShouldEqual, t.String()) - - dur, err := time.ParseDuration("2h45m") - So(err, ShouldBeNil) - So(sec.Key("DURATION").MustDuration().Seconds(), ShouldEqual, dur.Seconds()) - - Convey("Must get values with default value", func() { - So(sec.Key("STRING_404").MustString("404"), ShouldEqual, "404") - So(sec.Key("BOOL_404").MustBool(true), ShouldBeTrue) - So(sec.Key("FLOAT64_404").MustFloat64(2.5), ShouldEqual, 2.5) - So(sec.Key("INT_404").MustInt(15), ShouldEqual, 15) - So(sec.Key("INT64_404").MustInt64(15), ShouldEqual, 15) - So(sec.Key("UINT_404").MustUint(6), ShouldEqual, 6) - So(sec.Key("UINT64_404").MustUint64(6), ShouldEqual, 6) - - t, err := time.Parse(time.RFC3339, "2014-01-01T20:17:05Z") - So(err, ShouldBeNil) - So(sec.Key("TIME_404").MustTime(t).String(), ShouldEqual, t.String()) - - So(sec.Key("DURATION_404").MustDuration(dur).Seconds(), ShouldEqual, dur.Seconds()) - - Convey("Must should set default as key value", func() { - So(sec.Key("STRING_404").String(), ShouldEqual, "404") - So(sec.Key("BOOL_404").String(), ShouldEqual, "true") - So(sec.Key("FLOAT64_404").String(), ShouldEqual, "2.5") - So(sec.Key("INT_404").String(), ShouldEqual, "15") - So(sec.Key("INT64_404").String(), ShouldEqual, "15") - So(sec.Key("UINT_404").String(), ShouldEqual, "6") - So(sec.Key("UINT64_404").String(), ShouldEqual, "6") - So(sec.Key("TIME_404").String(), ShouldEqual, "2014-01-01T20:17:05Z") - So(sec.Key("DURATION_404").String(), ShouldEqual, "2h45m0s") - }) - }) - }) - }) - - Convey("Get value with candidates", func() { - sec := cfg.Section("types") - So(sec.Key("STRING").In("", []string{"str", "arr", "types"}), ShouldEqual, "str") - So(sec.Key("FLOAT64").InFloat64(0, []float64{1.25, 2.5, 3.75}), ShouldEqual, 1.25) - So(sec.Key("INT").InInt(0, []int{10, 20, 30}), ShouldEqual, 10) - So(sec.Key("INT").InInt64(0, []int64{10, 20, 30}), ShouldEqual, 10) - So(sec.Key("UINT").InUint(0, []uint{3, 6, 9}), ShouldEqual, 3) - So(sec.Key("UINT").InUint64(0, []uint64{3, 6, 9}), ShouldEqual, 3) - - zt, err := time.Parse(time.RFC3339, "0001-01-01T01:00:00Z") - So(err, ShouldBeNil) - t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") - So(err, ShouldBeNil) - So(sec.Key("TIME").InTime(zt, []time.Time{t, time.Now(), time.Now().Add(1 * time.Second)}).String(), ShouldEqual, t.String()) - - Convey("Get value with candidates and default value", func() { - So(sec.Key("STRING_404").In("str", []string{"str", "arr", "types"}), ShouldEqual, "str") - So(sec.Key("FLOAT64_404").InFloat64(1.25, []float64{1.25, 2.5, 3.75}), ShouldEqual, 1.25) - So(sec.Key("INT_404").InInt(10, []int{10, 20, 30}), ShouldEqual, 10) - So(sec.Key("INT64_404").InInt64(10, []int64{10, 20, 30}), ShouldEqual, 10) - So(sec.Key("UINT_404").InUint(3, []uint{3, 6, 9}), ShouldEqual, 3) - So(sec.Key("UINT_404").InUint64(3, []uint64{3, 6, 9}), ShouldEqual, 3) - So(sec.Key("TIME_404").InTime(t, []time.Time{time.Now(), time.Now(), time.Now().Add(1 * time.Second)}).String(), ShouldEqual, t.String()) - }) - }) - - Convey("Get values in range", func() { - sec := cfg.Section("types") - So(sec.Key("FLOAT64").RangeFloat64(0, 1, 2), ShouldEqual, 1.25) - So(sec.Key("INT").RangeInt(0, 10, 20), ShouldEqual, 10) - So(sec.Key("INT").RangeInt64(0, 10, 20), ShouldEqual, 10) - - minT, err := time.Parse(time.RFC3339, "0001-01-01T01:00:00Z") - So(err, ShouldBeNil) - midT, err := time.Parse(time.RFC3339, "2013-01-01T01:00:00Z") - So(err, ShouldBeNil) - maxT, err := time.Parse(time.RFC3339, "9999-01-01T01:00:00Z") - So(err, ShouldBeNil) - t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") - So(err, ShouldBeNil) - So(sec.Key("TIME").RangeTime(t, minT, maxT).String(), ShouldEqual, t.String()) - - Convey("Get value in range with default value", func() { - So(sec.Key("FLOAT64").RangeFloat64(5, 0, 1), ShouldEqual, 5) - So(sec.Key("INT").RangeInt(7, 0, 5), ShouldEqual, 7) - So(sec.Key("INT").RangeInt64(7, 0, 5), ShouldEqual, 7) - So(sec.Key("TIME").RangeTime(t, minT, midT).String(), ShouldEqual, t.String()) - }) - }) - - Convey("Get values into slice", func() { - sec := cfg.Section("array") - So(strings.Join(sec.Key("STRINGS").Strings(","), ","), ShouldEqual, "en,zh,de") - So(len(sec.Key("STRINGS_404").Strings(",")), ShouldEqual, 0) - - vals1 := sec.Key("FLOAT64S").Float64s(",") - float64sEqual(vals1, 1.1, 2.2, 3.3) - - vals2 := sec.Key("INTS").Ints(",") - intsEqual(vals2, 1, 2, 3) - - vals3 := sec.Key("INTS").Int64s(",") - int64sEqual(vals3, 1, 2, 3) - - vals4 := sec.Key("UINTS").Uints(",") - uintsEqual(vals4, 1, 2, 3) - - vals5 := sec.Key("UINTS").Uint64s(",") - uint64sEqual(vals5, 1, 2, 3) - - t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") - So(err, ShouldBeNil) - vals6 := sec.Key("TIMES").Times(",") - timesEqual(vals6, t, t, t) - }) - - Convey("Get valid values into slice", func() { - sec := cfg.Section("array") - vals1 := sec.Key("FLOAT64S").ValidFloat64s(",") - float64sEqual(vals1, 1.1, 2.2, 3.3) - - vals2 := sec.Key("INTS").ValidInts(",") - intsEqual(vals2, 1, 2, 3) - - vals3 := sec.Key("INTS").ValidInt64s(",") - int64sEqual(vals3, 1, 2, 3) - - vals4 := sec.Key("UINTS").ValidUints(",") - uintsEqual(vals4, 1, 2, 3) - - vals5 := sec.Key("UINTS").ValidUint64s(",") - uint64sEqual(vals5, 1, 2, 3) - - t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") - So(err, ShouldBeNil) - vals6 := sec.Key("TIMES").ValidTimes(",") - timesEqual(vals6, t, t, t) - }) - - Convey("Get values one type into slice of another type", func() { - sec := cfg.Section("array") - vals1 := sec.Key("STRINGS").ValidFloat64s(",") - So(vals1, ShouldBeEmpty) - - vals2 := sec.Key("STRINGS").ValidInts(",") - So(vals2, ShouldBeEmpty) - - vals3 := sec.Key("STRINGS").ValidInt64s(",") - So(vals3, ShouldBeEmpty) - - vals4 := sec.Key("STRINGS").ValidUints(",") - So(vals4, ShouldBeEmpty) - - vals5 := sec.Key("STRINGS").ValidUint64s(",") - So(vals5, ShouldBeEmpty) - - vals6 := sec.Key("STRINGS").ValidTimes(",") - So(vals6, ShouldBeEmpty) - }) - - Convey("Get valid values into slice without errors", func() { - sec := cfg.Section("array") - vals1, err := sec.Key("FLOAT64S").StrictFloat64s(",") - So(err, ShouldBeNil) - float64sEqual(vals1, 1.1, 2.2, 3.3) - - vals2, err := sec.Key("INTS").StrictInts(",") - So(err, ShouldBeNil) - intsEqual(vals2, 1, 2, 3) - - vals3, err := sec.Key("INTS").StrictInt64s(",") - So(err, ShouldBeNil) - int64sEqual(vals3, 1, 2, 3) - - vals4, err := sec.Key("UINTS").StrictUints(",") - So(err, ShouldBeNil) - uintsEqual(vals4, 1, 2, 3) - - vals5, err := sec.Key("UINTS").StrictUint64s(",") - So(err, ShouldBeNil) - uint64sEqual(vals5, 1, 2, 3) - - t, err := time.Parse(time.RFC3339, "2015-01-01T20:17:05Z") - So(err, ShouldBeNil) - vals6, err := sec.Key("TIMES").StrictTimes(",") - So(err, ShouldBeNil) - timesEqual(vals6, t, t, t) - }) - - Convey("Get invalid values into slice", func() { - sec := cfg.Section("array") - vals1, err := sec.Key("STRINGS").StrictFloat64s(",") - So(vals1, ShouldBeEmpty) - So(err, ShouldNotBeNil) - - vals2, err := sec.Key("STRINGS").StrictInts(",") - So(vals2, ShouldBeEmpty) - So(err, ShouldNotBeNil) - - vals3, err := sec.Key("STRINGS").StrictInt64s(",") - So(vals3, ShouldBeEmpty) - So(err, ShouldNotBeNil) - - vals4, err := sec.Key("STRINGS").StrictUints(",") - So(vals4, ShouldBeEmpty) - So(err, ShouldNotBeNil) - - vals5, err := sec.Key("STRINGS").StrictUint64s(",") - So(vals5, ShouldBeEmpty) - So(err, ShouldNotBeNil) - - vals6, err := sec.Key("STRINGS").StrictTimes(",") - So(vals6, ShouldBeEmpty) - So(err, ShouldNotBeNil) - }) - - Convey("Get key hash", func() { - cfg.Section("").KeysHash() - }) - - Convey("Set key value", func() { - k := cfg.Section("author").Key("NAME") - k.SetValue("无闻") - So(k.String(), ShouldEqual, "无闻") - }) - - Convey("Get key strings", func() { - So(strings.Join(cfg.Section("types").KeyStrings(), ","), ShouldEqual, "STRING,BOOL,BOOL_FALSE,FLOAT64,INT,TIME,DURATION,UINT") - }) - - Convey("Delete a key", func() { - cfg.Section("package.sub").DeleteKey("UNUSED_KEY") - _, err := cfg.Section("package.sub").GetKey("UNUSED_KEY") - So(err, ShouldNotBeNil) - }) - - Convey("Has Key (backwards compatible)", func() { - sec := cfg.Section("package.sub") - haskey1 := sec.Haskey("UNUSED_KEY") - haskey2 := sec.Haskey("CLONE_URL") - haskey3 := sec.Haskey("CLONE_URL_NO") - So(haskey1, ShouldBeTrue) - So(haskey2, ShouldBeTrue) - So(haskey3, ShouldBeFalse) - }) - - Convey("Has Key", func() { - sec := cfg.Section("package.sub") - haskey1 := sec.HasKey("UNUSED_KEY") - haskey2 := sec.HasKey("CLONE_URL") - haskey3 := sec.HasKey("CLONE_URL_NO") - So(haskey1, ShouldBeTrue) - So(haskey2, ShouldBeTrue) - So(haskey3, ShouldBeFalse) - }) - - Convey("Has Value", func() { - sec := cfg.Section("author") - hasvalue1 := sec.HasValue("Unknwon") - hasvalue2 := sec.HasValue("doc") - So(hasvalue1, ShouldBeTrue) - So(hasvalue2, ShouldBeFalse) - }) - }) - - Convey("Test getting and setting bad values", t, func() { - cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - Convey("Create new key with empty name", func() { - k, err := cfg.Section("").NewKey("", "") - So(err, ShouldNotBeNil) - So(k, ShouldBeNil) - }) - - Convey("Create new section with empty name", func() { - s, err := cfg.NewSection("") - So(err, ShouldNotBeNil) - So(s, ShouldBeNil) - }) - - Convey("Create new sections with empty name", func() { - So(cfg.NewSections(""), ShouldNotBeNil) - }) - - Convey("Get section that not exists", func() { - s, err := cfg.GetSection("404") - So(err, ShouldNotBeNil) - So(s, ShouldBeNil) - - s = cfg.Section("404") - So(s, ShouldNotBeNil) - }) - }) - - Convey("Test key hash clone", t, func() { - cfg, err := Load([]byte(strings.Replace("network=tcp,addr=127.0.0.1:6379,db=4,pool_size=100,idle_timeout=180", ",", "\n", -1))) - So(err, ShouldBeNil) - for _, v := range cfg.Section("").KeysHash() { - So(len(v), ShouldBeGreaterThan, 0) - } - }) - - Convey("Key has empty value", t, func() { - _conf := `key1= -key2= ; comment` - cfg, err := Load([]byte(_conf)) - So(err, ShouldBeNil) - So(cfg.Section("").Key("key1").Value(), ShouldBeEmpty) - }) -} - -const _CONF_GIT_CONFIG = ` -[remote "origin"] - url = https://github.com/Antergone/test1.git - url = https://github.com/Antergone/test2.git -` - -func Test_Key_Shadows(t *testing.T) { - Convey("Shadows keys", t, func() { - Convey("Disable shadows", func() { - cfg, err := Load([]byte(_CONF_GIT_CONFIG)) - So(err, ShouldBeNil) - So(cfg.Section(`remote "origin"`).Key("url").String(), ShouldEqual, "https://github.com/Antergone/test2.git") - }) - - Convey("Enable shadows", func() { - cfg, err := ShadowLoad([]byte(_CONF_GIT_CONFIG)) - So(err, ShouldBeNil) - So(cfg.Section(`remote "origin"`).Key("url").String(), ShouldEqual, "https://github.com/Antergone/test1.git") - So(strings.Join(cfg.Section(`remote "origin"`).Key("url").ValueWithShadows(), " "), ShouldEqual, - "https://github.com/Antergone/test1.git https://github.com/Antergone/test2.git") - - Convey("Save with shadows", func() { - var buf bytes.Buffer - _, err := cfg.WriteTo(&buf) - So(err, ShouldBeNil) - So(buf.String(), ShouldEqual, `[remote "origin"] -url = https://github.com/Antergone/test1.git -url = https://github.com/Antergone/test2.git - -`) - }) - }) - }) -} - -func newTestFile(block bool) *File { - c, _ := Load([]byte(_CONF_DATA)) - c.BlockMode = block - return c -} - -func Benchmark_Key_Value(b *testing.B) { - c := newTestFile(true) - for i := 0; i < b.N; i++ { - c.Section("").Key("NAME").Value() - } -} - -func Benchmark_Key_Value_NonBlock(b *testing.B) { - c := newTestFile(false) - for i := 0; i < b.N; i++ { - c.Section("").Key("NAME").Value() - } -} - -func Benchmark_Key_Value_ViaSection(b *testing.B) { - c := newTestFile(true) - sec := c.Section("") - for i := 0; i < b.N; i++ { - sec.Key("NAME").Value() - } -} - -func Benchmark_Key_Value_ViaSection_NonBlock(b *testing.B) { - c := newTestFile(false) - sec := c.Section("") - for i := 0; i < b.N; i++ { - sec.Key("NAME").Value() - } -} - -func Benchmark_Key_Value_Direct(b *testing.B) { - c := newTestFile(true) - key := c.Section("").Key("NAME") - for i := 0; i < b.N; i++ { - key.Value() - } -} - -func Benchmark_Key_Value_Direct_NonBlock(b *testing.B) { - c := newTestFile(false) - key := c.Section("").Key("NAME") - for i := 0; i < b.N; i++ { - key.Value() - } -} - -func Benchmark_Key_String(b *testing.B) { - c := newTestFile(true) - for i := 0; i < b.N; i++ { - _ = c.Section("").Key("NAME").String() - } -} - -func Benchmark_Key_String_NonBlock(b *testing.B) { - c := newTestFile(false) - for i := 0; i < b.N; i++ { - _ = c.Section("").Key("NAME").String() - } -} - -func Benchmark_Key_String_ViaSection(b *testing.B) { - c := newTestFile(true) - sec := c.Section("") - for i := 0; i < b.N; i++ { - _ = sec.Key("NAME").String() - } -} - -func Benchmark_Key_String_ViaSection_NonBlock(b *testing.B) { - c := newTestFile(false) - sec := c.Section("") - for i := 0; i < b.N; i++ { - _ = sec.Key("NAME").String() - } -} - -func Benchmark_Key_SetValue(b *testing.B) { - c := newTestFile(true) - for i := 0; i < b.N; i++ { - c.Section("").Key("NAME").SetValue("10") - } -} - -func Benchmark_Key_SetValue_VisSection(b *testing.B) { - c := newTestFile(true) - sec := c.Section("") - for i := 0; i < b.N; i++ { - sec.Key("NAME").SetValue("10") - } -} diff --git a/vendor/github.com/go-ini/ini/parser.go b/vendor/github.com/go-ini/ini/parser.go deleted file mode 100644 index 673ef80..0000000 --- a/vendor/github.com/go-ini/ini/parser.go +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright 2015 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "bufio" - "bytes" - "fmt" - "io" - "strconv" - "strings" - "unicode" -) - -type tokenType int - -const ( - _TOKEN_INVALID tokenType = iota - _TOKEN_COMMENT - _TOKEN_SECTION - _TOKEN_KEY -) - -type parser struct { - buf *bufio.Reader - isEOF bool - count int - comment *bytes.Buffer -} - -func newParser(r io.Reader) *parser { - return &parser{ - buf: bufio.NewReader(r), - count: 1, - comment: &bytes.Buffer{}, - } -} - -// BOM handles header of UTF-8, UTF-16 LE and UTF-16 BE's BOM format. -// http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding -func (p *parser) BOM() error { - mask, err := p.buf.Peek(2) - if err != nil && err != io.EOF { - return err - } else if len(mask) < 2 { - return nil - } - - switch { - case mask[0] == 254 && mask[1] == 255: - fallthrough - case mask[0] == 255 && mask[1] == 254: - p.buf.Read(mask) - case mask[0] == 239 && mask[1] == 187: - mask, err := p.buf.Peek(3) - if err != nil && err != io.EOF { - return err - } else if len(mask) < 3 { - return nil - } - if mask[2] == 191 { - p.buf.Read(mask) - } - } - return nil -} - -func (p *parser) readUntil(delim byte) ([]byte, error) { - data, err := p.buf.ReadBytes(delim) - if err != nil { - if err == io.EOF { - p.isEOF = true - } else { - return nil, err - } - } - return data, nil -} - -func cleanComment(in []byte) ([]byte, bool) { - i := bytes.IndexAny(in, "#;") - if i == -1 { - return nil, false - } - return in[i:], true -} - -func readKeyName(in []byte) (string, int, error) { - line := string(in) - - // Check if key name surrounded by quotes. - var keyQuote string - if line[0] == '"' { - if len(line) > 6 && string(line[0:3]) == `"""` { - keyQuote = `"""` - } else { - keyQuote = `"` - } - } else if line[0] == '`' { - keyQuote = "`" - } - - // Get out key name - endIdx := -1 - if len(keyQuote) > 0 { - startIdx := len(keyQuote) - // FIXME: fail case -> """"""name"""=value - pos := strings.Index(line[startIdx:], keyQuote) - if pos == -1 { - return "", -1, fmt.Errorf("missing closing key quote: %s", line) - } - pos += startIdx - - // Find key-value delimiter - i := strings.IndexAny(line[pos+startIdx:], "=:") - if i < 0 { - return "", -1, ErrDelimiterNotFound{line} - } - endIdx = pos + i - return strings.TrimSpace(line[startIdx:pos]), endIdx + startIdx + 1, nil - } - - endIdx = strings.IndexAny(line, "=:") - if endIdx < 0 { - return "", -1, ErrDelimiterNotFound{line} - } - return strings.TrimSpace(line[0:endIdx]), endIdx + 1, nil -} - -func (p *parser) readMultilines(line, val, valQuote string) (string, error) { - for { - data, err := p.readUntil('\n') - if err != nil { - return "", err - } - next := string(data) - - pos := strings.LastIndex(next, valQuote) - if pos > -1 { - val += next[:pos] - - comment, has := cleanComment([]byte(next[pos:])) - if has { - p.comment.Write(bytes.TrimSpace(comment)) - } - break - } - val += next - if p.isEOF { - return "", fmt.Errorf("missing closing key quote from '%s' to '%s'", line, next) - } - } - return val, nil -} - -func (p *parser) readContinuationLines(val string) (string, error) { - for { - data, err := p.readUntil('\n') - if err != nil { - return "", err - } - next := strings.TrimSpace(string(data)) - - if len(next) == 0 { - break - } - val += next - if val[len(val)-1] != '\\' { - break - } - val = val[:len(val)-1] - } - return val, nil -} - -// hasSurroundedQuote check if and only if the first and last characters -// are quotes \" or \'. -// It returns false if any other parts also contain same kind of quotes. -func hasSurroundedQuote(in string, quote byte) bool { - return len(in) > 2 && in[0] == quote && in[len(in)-1] == quote && - strings.IndexByte(in[1:], quote) == len(in)-2 -} - -func (p *parser) readValue(in []byte, ignoreContinuation bool) (string, error) { - line := strings.TrimLeftFunc(string(in), unicode.IsSpace) - if len(line) == 0 { - return "", nil - } - - var valQuote string - if len(line) > 3 && string(line[0:3]) == `"""` { - valQuote = `"""` - } else if line[0] == '`' { - valQuote = "`" - } - - if len(valQuote) > 0 { - startIdx := len(valQuote) - pos := strings.LastIndex(line[startIdx:], valQuote) - // Check for multi-line value - if pos == -1 { - return p.readMultilines(line, line[startIdx:], valQuote) - } - - return line[startIdx : pos+startIdx], nil - } - - // Won't be able to reach here if value only contains whitespace. - line = strings.TrimSpace(line) - - // Check continuation lines when desired. - if !ignoreContinuation && line[len(line)-1] == '\\' { - return p.readContinuationLines(line[:len(line)-1]) - } - - i := strings.IndexAny(line, "#;") - if i > -1 { - p.comment.WriteString(line[i:]) - line = strings.TrimSpace(line[:i]) - } - - // Trim single quotes - if hasSurroundedQuote(line, '\'') || - hasSurroundedQuote(line, '"') { - line = line[1 : len(line)-1] - } - return line, nil -} - -// parse parses data through an io.Reader. -func (f *File) parse(reader io.Reader) (err error) { - p := newParser(reader) - if err = p.BOM(); err != nil { - return fmt.Errorf("BOM: %v", err) - } - - // Ignore error because default section name is never empty string. - section, _ := f.NewSection(DEFAULT_SECTION) - - var line []byte - var inUnparseableSection bool - for !p.isEOF { - line, err = p.readUntil('\n') - if err != nil { - return err - } - - line = bytes.TrimLeftFunc(line, unicode.IsSpace) - if len(line) == 0 { - continue - } - - // Comments - if line[0] == '#' || line[0] == ';' { - // Note: we do not care ending line break, - // it is needed for adding second line, - // so just clean it once at the end when set to value. - p.comment.Write(line) - continue - } - - // Section - if line[0] == '[' { - // Read to the next ']' (TODO: support quoted strings) - // TODO(unknwon): use LastIndexByte when stop supporting Go1.4 - closeIdx := bytes.LastIndex(line, []byte("]")) - if closeIdx == -1 { - return fmt.Errorf("unclosed section: %s", line) - } - - name := string(line[1:closeIdx]) - section, err = f.NewSection(name) - if err != nil { - return err - } - - comment, has := cleanComment(line[closeIdx+1:]) - if has { - p.comment.Write(comment) - } - - section.Comment = strings.TrimSpace(p.comment.String()) - - // Reset aotu-counter and comments - p.comment.Reset() - p.count = 1 - - inUnparseableSection = false - for i := range f.options.UnparseableSections { - if f.options.UnparseableSections[i] == name || - (f.options.Insensitive && strings.ToLower(f.options.UnparseableSections[i]) == strings.ToLower(name)) { - inUnparseableSection = true - continue - } - } - continue - } - - if inUnparseableSection { - section.isRawSection = true - section.rawBody += string(line) - continue - } - - kname, offset, err := readKeyName(line) - if err != nil { - // Treat as boolean key when desired, and whole line is key name. - if IsErrDelimiterNotFound(err) && f.options.AllowBooleanKeys { - kname, err := p.readValue(line, f.options.IgnoreContinuation) - if err != nil { - return err - } - key, err := section.NewBooleanKey(kname) - if err != nil { - return err - } - key.Comment = strings.TrimSpace(p.comment.String()) - p.comment.Reset() - continue - } - return err - } - - // Auto increment. - isAutoIncr := false - if kname == "-" { - isAutoIncr = true - kname = "#" + strconv.Itoa(p.count) - p.count++ - } - - value, err := p.readValue(line[offset:], f.options.IgnoreContinuation) - if err != nil { - return err - } - - key, err := section.NewKey(kname, value) - if err != nil { - return err - } - key.isAutoIncrement = isAutoIncr - key.Comment = strings.TrimSpace(p.comment.String()) - p.comment.Reset() - } - return nil -} diff --git a/vendor/github.com/go-ini/ini/parser_test.go b/vendor/github.com/go-ini/ini/parser_test.go deleted file mode 100644 index 0525819..0000000 --- a/vendor/github.com/go-ini/ini/parser_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2016 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "testing" - - . "github.com/smartystreets/goconvey/convey" -) - -func Test_BOM(t *testing.T) { - Convey("Test handling BOM", t, func() { - Convey("UTF-8-BOM", func() { - cfg, err := Load("testdata/UTF-8-BOM.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - So(cfg.Section("author").Key("E-MAIL").String(), ShouldEqual, "u@gogs.io") - }) - - Convey("UTF-16-LE-BOM", func() { - cfg, err := Load("testdata/UTF-16-LE-BOM.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - }) - - Convey("UTF-16-BE-BOM", func() { - }) - }) -} diff --git a/vendor/github.com/go-ini/ini/section.go b/vendor/github.com/go-ini/ini/section.go deleted file mode 100644 index c9fa27e..0000000 --- a/vendor/github.com/go-ini/ini/section.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "errors" - "fmt" - "strings" -) - -// Section represents a config section. -type Section struct { - f *File - Comment string - name string - keys map[string]*Key - keyList []string - keysHash map[string]string - - isRawSection bool - rawBody string -} - -func newSection(f *File, name string) *Section { - return &Section{ - f: f, - name: name, - keys: make(map[string]*Key), - keyList: make([]string, 0, 10), - keysHash: make(map[string]string), - } -} - -// Name returns name of Section. -func (s *Section) Name() string { - return s.name -} - -// Body returns rawBody of Section if the section was marked as unparseable. -// It still follows the other rules of the INI format surrounding leading/trailing whitespace. -func (s *Section) Body() string { - return strings.TrimSpace(s.rawBody) -} - -// NewKey creates a new key to given section. -func (s *Section) NewKey(name, val string) (*Key, error) { - if len(name) == 0 { - return nil, errors.New("error creating new key: empty key name") - } else if s.f.options.Insensitive { - name = strings.ToLower(name) - } - - if s.f.BlockMode { - s.f.lock.Lock() - defer s.f.lock.Unlock() - } - - if inSlice(name, s.keyList) { - if s.f.options.AllowShadows { - if err := s.keys[name].addShadow(val); err != nil { - return nil, err - } - } else { - s.keys[name].value = val - } - return s.keys[name], nil - } - - s.keyList = append(s.keyList, name) - s.keys[name] = newKey(s, name, val) - s.keysHash[name] = val - return s.keys[name], nil -} - -// NewBooleanKey creates a new boolean type key to given section. -func (s *Section) NewBooleanKey(name string) (*Key, error) { - key, err := s.NewKey(name, "true") - if err != nil { - return nil, err - } - - key.isBooleanType = true - return key, nil -} - -// GetKey returns key in section by given name. -func (s *Section) GetKey(name string) (*Key, error) { - // FIXME: change to section level lock? - if s.f.BlockMode { - s.f.lock.RLock() - } - if s.f.options.Insensitive { - name = strings.ToLower(name) - } - key := s.keys[name] - if s.f.BlockMode { - s.f.lock.RUnlock() - } - - if key == nil { - // Check if it is a child-section. - sname := s.name - for { - if i := strings.LastIndex(sname, "."); i > -1 { - sname = sname[:i] - sec, err := s.f.GetSection(sname) - if err != nil { - continue - } - return sec.GetKey(name) - } else { - break - } - } - return nil, fmt.Errorf("error when getting key of section '%s': key '%s' not exists", s.name, name) - } - return key, nil -} - -// HasKey returns true if section contains a key with given name. -func (s *Section) HasKey(name string) bool { - key, _ := s.GetKey(name) - return key != nil -} - -// Haskey is a backwards-compatible name for HasKey. -func (s *Section) Haskey(name string) bool { - return s.HasKey(name) -} - -// HasValue returns true if section contains given raw value. -func (s *Section) HasValue(value string) bool { - if s.f.BlockMode { - s.f.lock.RLock() - defer s.f.lock.RUnlock() - } - - for _, k := range s.keys { - if value == k.value { - return true - } - } - return false -} - -// Key assumes named Key exists in section and returns a zero-value when not. -func (s *Section) Key(name string) *Key { - key, err := s.GetKey(name) - if err != nil { - // It's OK here because the only possible error is empty key name, - // but if it's empty, this piece of code won't be executed. - key, _ = s.NewKey(name, "") - return key - } - return key -} - -// Keys returns list of keys of section. -func (s *Section) Keys() []*Key { - keys := make([]*Key, len(s.keyList)) - for i := range s.keyList { - keys[i] = s.Key(s.keyList[i]) - } - return keys -} - -// ParentKeys returns list of keys of parent section. -func (s *Section) ParentKeys() []*Key { - var parentKeys []*Key - sname := s.name - for { - if i := strings.LastIndex(sname, "."); i > -1 { - sname = sname[:i] - sec, err := s.f.GetSection(sname) - if err != nil { - continue - } - parentKeys = append(parentKeys, sec.Keys()...) - } else { - break - } - - } - return parentKeys -} - -// KeyStrings returns list of key names of section. -func (s *Section) KeyStrings() []string { - list := make([]string, len(s.keyList)) - copy(list, s.keyList) - return list -} - -// KeysHash returns keys hash consisting of names and values. -func (s *Section) KeysHash() map[string]string { - if s.f.BlockMode { - s.f.lock.RLock() - defer s.f.lock.RUnlock() - } - - hash := map[string]string{} - for key, value := range s.keysHash { - hash[key] = value - } - return hash -} - -// DeleteKey deletes a key from section. -func (s *Section) DeleteKey(name string) { - if s.f.BlockMode { - s.f.lock.Lock() - defer s.f.lock.Unlock() - } - - for i, k := range s.keyList { - if k == name { - s.keyList = append(s.keyList[:i], s.keyList[i+1:]...) - delete(s.keys, name) - return - } - } -} diff --git a/vendor/github.com/go-ini/ini/section_test.go b/vendor/github.com/go-ini/ini/section_test.go deleted file mode 100644 index 80282c1..0000000 --- a/vendor/github.com/go-ini/ini/section_test.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "strings" - "testing" - - . "github.com/smartystreets/goconvey/convey" -) - -func Test_Section(t *testing.T) { - Convey("Test CRD sections", t, func() { - cfg, err := Load([]byte(_CONF_DATA), "testdata/conf.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - Convey("Get section strings", func() { - So(strings.Join(cfg.SectionStrings(), ","), ShouldEqual, "DEFAULT,author,package,package.sub,features,types,array,note,comments,advance") - }) - - Convey("Delete a section", func() { - cfg.DeleteSection("") - So(cfg.SectionStrings()[0], ShouldNotEqual, DEFAULT_SECTION) - }) - - Convey("Create new sections", func() { - cfg.NewSections("test", "test2") - _, err := cfg.GetSection("test") - So(err, ShouldBeNil) - _, err = cfg.GetSection("test2") - So(err, ShouldBeNil) - }) - }) -} - -func Test_SectionRaw(t *testing.T) { - Convey("Test section raw string", t, func() { - cfg, err := LoadSources( - LoadOptions{ - Insensitive: true, - UnparseableSections: []string{"core_lesson", "comments"}, - }, - "testdata/aicc.ini") - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - Convey("Get section strings", func() { - So(strings.Join(cfg.SectionStrings(), ","), ShouldEqual, "DEFAULT,core,core_lesson,comments") - }) - - Convey("Validate non-raw section", func() { - val, err := cfg.Section("core").GetKey("lesson_status") - So(err, ShouldBeNil) - So(val.String(), ShouldEqual, "C") - }) - - Convey("Validate raw section", func() { - So(cfg.Section("core_lesson").Body(), ShouldEqual, `my lesson state data – 1111111111111111111000000000000000001110000 -111111111111111111100000000000111000000000 – end my lesson state data`) - }) - }) -} \ No newline at end of file diff --git a/vendor/github.com/go-ini/ini/struct.go b/vendor/github.com/go-ini/ini/struct.go deleted file mode 100644 index 509c682..0000000 --- a/vendor/github.com/go-ini/ini/struct.go +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "bytes" - "errors" - "fmt" - "reflect" - "strings" - "time" - "unicode" -) - -// NameMapper represents a ini tag name mapper. -type NameMapper func(string) string - -// Built-in name getters. -var ( - // AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE. - AllCapsUnderscore NameMapper = func(raw string) string { - newstr := make([]rune, 0, len(raw)) - for i, chr := range raw { - if isUpper := 'A' <= chr && chr <= 'Z'; isUpper { - if i > 0 { - newstr = append(newstr, '_') - } - } - newstr = append(newstr, unicode.ToUpper(chr)) - } - return string(newstr) - } - // TitleUnderscore converts to format title_underscore. - TitleUnderscore NameMapper = func(raw string) string { - newstr := make([]rune, 0, len(raw)) - for i, chr := range raw { - if isUpper := 'A' <= chr && chr <= 'Z'; isUpper { - if i > 0 { - newstr = append(newstr, '_') - } - chr -= ('A' - 'a') - } - newstr = append(newstr, chr) - } - return string(newstr) - } -) - -func (s *Section) parseFieldName(raw, actual string) string { - if len(actual) > 0 { - return actual - } - if s.f.NameMapper != nil { - return s.f.NameMapper(raw) - } - return raw -} - -func parseDelim(actual string) string { - if len(actual) > 0 { - return actual - } - return "," -} - -var reflectTime = reflect.TypeOf(time.Now()).Kind() - -// setSliceWithProperType sets proper values to slice based on its type. -func setSliceWithProperType(key *Key, field reflect.Value, delim string, allowShadow bool) error { - var strs []string - if allowShadow { - strs = key.StringsWithShadows(delim) - } else { - strs = key.Strings(delim) - } - - numVals := len(strs) - if numVals == 0 { - return nil - } - - var vals interface{} - - sliceOf := field.Type().Elem().Kind() - switch sliceOf { - case reflect.String: - vals = strs - case reflect.Int: - vals, _ = key.parseInts(strs, true, false) - case reflect.Int64: - vals, _ = key.parseInt64s(strs, true, false) - case reflect.Uint: - vals = key.Uints(delim) - case reflect.Uint64: - vals = key.Uint64s(delim) - case reflect.Float64: - vals = key.Float64s(delim) - case reflectTime: - vals = key.Times(delim) - default: - return fmt.Errorf("unsupported type '[]%s'", sliceOf) - } - - slice := reflect.MakeSlice(field.Type(), numVals, numVals) - for i := 0; i < numVals; i++ { - switch sliceOf { - case reflect.String: - slice.Index(i).Set(reflect.ValueOf(vals.([]string)[i])) - case reflect.Int: - slice.Index(i).Set(reflect.ValueOf(vals.([]int)[i])) - case reflect.Int64: - slice.Index(i).Set(reflect.ValueOf(vals.([]int64)[i])) - case reflect.Uint: - slice.Index(i).Set(reflect.ValueOf(vals.([]uint)[i])) - case reflect.Uint64: - slice.Index(i).Set(reflect.ValueOf(vals.([]uint64)[i])) - case reflect.Float64: - slice.Index(i).Set(reflect.ValueOf(vals.([]float64)[i])) - case reflectTime: - slice.Index(i).Set(reflect.ValueOf(vals.([]time.Time)[i])) - } - } - field.Set(slice) - return nil -} - -// setWithProperType sets proper value to field based on its type, -// but it does not return error for failing parsing, -// because we want to use default value that is already assigned to strcut. -func setWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string, allowShadow bool) error { - switch t.Kind() { - case reflect.String: - if len(key.String()) == 0 { - return nil - } - field.SetString(key.String()) - case reflect.Bool: - boolVal, err := key.Bool() - if err != nil { - return nil - } - field.SetBool(boolVal) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - durationVal, err := key.Duration() - // Skip zero value - if err == nil && int(durationVal) > 0 { - field.Set(reflect.ValueOf(durationVal)) - return nil - } - - intVal, err := key.Int64() - if err != nil || intVal == 0 { - return nil - } - field.SetInt(intVal) - // byte is an alias for uint8, so supporting uint8 breaks support for byte - case reflect.Uint, reflect.Uint16, reflect.Uint32, reflect.Uint64: - durationVal, err := key.Duration() - // Skip zero value - if err == nil && int(durationVal) > 0 { - field.Set(reflect.ValueOf(durationVal)) - return nil - } - - uintVal, err := key.Uint64() - if err != nil { - return nil - } - field.SetUint(uintVal) - - case reflect.Float32, reflect.Float64: - floatVal, err := key.Float64() - if err != nil { - return nil - } - field.SetFloat(floatVal) - case reflectTime: - timeVal, err := key.Time() - if err != nil { - return nil - } - field.Set(reflect.ValueOf(timeVal)) - case reflect.Slice: - return setSliceWithProperType(key, field, delim, allowShadow) - default: - return fmt.Errorf("unsupported type '%s'", t) - } - return nil -} - -func parseTagOptions(tag string) (rawName string, omitEmpty bool, allowShadow bool) { - opts := strings.SplitN(tag, ",", 3) - rawName = opts[0] - if len(opts) > 1 { - omitEmpty = opts[1] == "omitempty" - } - if len(opts) > 2 { - allowShadow = opts[2] == "allowshadow" - } - return rawName, omitEmpty, allowShadow -} - -func (s *Section) mapTo(val reflect.Value) error { - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - typ := val.Type() - - for i := 0; i < typ.NumField(); i++ { - field := val.Field(i) - tpField := typ.Field(i) - - tag := tpField.Tag.Get("ini") - if tag == "-" { - continue - } - - rawName, _, allowShadow := parseTagOptions(tag) - fieldName := s.parseFieldName(tpField.Name, rawName) - if len(fieldName) == 0 || !field.CanSet() { - continue - } - - isAnonymous := tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous - isStruct := tpField.Type.Kind() == reflect.Struct - if isAnonymous { - field.Set(reflect.New(tpField.Type.Elem())) - } - - if isAnonymous || isStruct { - if sec, err := s.f.GetSection(fieldName); err == nil { - if err = sec.mapTo(field); err != nil { - return fmt.Errorf("error mapping field(%s): %v", fieldName, err) - } - continue - } - } - - if key, err := s.GetKey(fieldName); err == nil { - delim := parseDelim(tpField.Tag.Get("delim")) - if err = setWithProperType(tpField.Type, key, field, delim, allowShadow); err != nil { - return fmt.Errorf("error mapping field(%s): %v", fieldName, err) - } - } - } - return nil -} - -// MapTo maps section to given struct. -func (s *Section) MapTo(v interface{}) error { - typ := reflect.TypeOf(v) - val := reflect.ValueOf(v) - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - val = val.Elem() - } else { - return errors.New("cannot map to non-pointer struct") - } - - return s.mapTo(val) -} - -// MapTo maps file to given struct. -func (f *File) MapTo(v interface{}) error { - return f.Section("").MapTo(v) -} - -// MapTo maps data sources to given struct with name mapper. -func MapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error { - cfg, err := Load(source, others...) - if err != nil { - return err - } - cfg.NameMapper = mapper - return cfg.MapTo(v) -} - -// MapTo maps data sources to given struct. -func MapTo(v, source interface{}, others ...interface{}) error { - return MapToWithMapper(v, nil, source, others...) -} - -// reflectSliceWithProperType does the opposite thing as setSliceWithProperType. -func reflectSliceWithProperType(key *Key, field reflect.Value, delim string) error { - slice := field.Slice(0, field.Len()) - if field.Len() == 0 { - return nil - } - - var buf bytes.Buffer - sliceOf := field.Type().Elem().Kind() - for i := 0; i < field.Len(); i++ { - switch sliceOf { - case reflect.String: - buf.WriteString(slice.Index(i).String()) - case reflect.Int, reflect.Int64: - buf.WriteString(fmt.Sprint(slice.Index(i).Int())) - case reflect.Uint, reflect.Uint64: - buf.WriteString(fmt.Sprint(slice.Index(i).Uint())) - case reflect.Float64: - buf.WriteString(fmt.Sprint(slice.Index(i).Float())) - case reflectTime: - buf.WriteString(slice.Index(i).Interface().(time.Time).Format(time.RFC3339)) - default: - return fmt.Errorf("unsupported type '[]%s'", sliceOf) - } - buf.WriteString(delim) - } - key.SetValue(buf.String()[:buf.Len()-1]) - return nil -} - -// reflectWithProperType does the opposite thing as setWithProperType. -func reflectWithProperType(t reflect.Type, key *Key, field reflect.Value, delim string) error { - switch t.Kind() { - case reflect.String: - key.SetValue(field.String()) - case reflect.Bool: - key.SetValue(fmt.Sprint(field.Bool())) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - key.SetValue(fmt.Sprint(field.Int())) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - key.SetValue(fmt.Sprint(field.Uint())) - case reflect.Float32, reflect.Float64: - key.SetValue(fmt.Sprint(field.Float())) - case reflectTime: - key.SetValue(fmt.Sprint(field.Interface().(time.Time).Format(time.RFC3339))) - case reflect.Slice: - return reflectSliceWithProperType(key, field, delim) - default: - return fmt.Errorf("unsupported type '%s'", t) - } - return nil -} - -// CR: copied from encoding/json/encode.go with modifications of time.Time support. -// TODO: add more test coverage. -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflectTime: - return v.Interface().(time.Time).IsZero() - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} - -func (s *Section) reflectFrom(val reflect.Value) error { - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - typ := val.Type() - - for i := 0; i < typ.NumField(); i++ { - field := val.Field(i) - tpField := typ.Field(i) - - tag := tpField.Tag.Get("ini") - if tag == "-" { - continue - } - - opts := strings.SplitN(tag, ",", 2) - if len(opts) == 2 && opts[1] == "omitempty" && isEmptyValue(field) { - continue - } - - fieldName := s.parseFieldName(tpField.Name, opts[0]) - if len(fieldName) == 0 || !field.CanSet() { - continue - } - - if (tpField.Type.Kind() == reflect.Ptr && tpField.Anonymous) || - (tpField.Type.Kind() == reflect.Struct && tpField.Type.Name() != "Time") { - // Note: The only error here is section doesn't exist. - sec, err := s.f.GetSection(fieldName) - if err != nil { - // Note: fieldName can never be empty here, ignore error. - sec, _ = s.f.NewSection(fieldName) - } - if err = sec.reflectFrom(field); err != nil { - return fmt.Errorf("error reflecting field (%s): %v", fieldName, err) - } - continue - } - - // Note: Same reason as secion. - key, err := s.GetKey(fieldName) - if err != nil { - key, _ = s.NewKey(fieldName, "") - } - if err = reflectWithProperType(tpField.Type, key, field, parseDelim(tpField.Tag.Get("delim"))); err != nil { - return fmt.Errorf("error reflecting field (%s): %v", fieldName, err) - } - - } - return nil -} - -// ReflectFrom reflects secion from given struct. -func (s *Section) ReflectFrom(v interface{}) error { - typ := reflect.TypeOf(v) - val := reflect.ValueOf(v) - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - val = val.Elem() - } else { - return errors.New("cannot reflect from non-pointer struct") - } - - return s.reflectFrom(val) -} - -// ReflectFrom reflects file from given struct. -func (f *File) ReflectFrom(v interface{}) error { - return f.Section("").ReflectFrom(v) -} - -// ReflectFrom reflects data sources from given struct with name mapper. -func ReflectFromWithMapper(cfg *File, v interface{}, mapper NameMapper) error { - cfg.NameMapper = mapper - return cfg.ReflectFrom(v) -} - -// ReflectFrom reflects data sources from given struct. -func ReflectFrom(cfg *File, v interface{}) error { - return ReflectFromWithMapper(cfg, v, nil) -} diff --git a/vendor/github.com/go-ini/ini/struct_test.go b/vendor/github.com/go-ini/ini/struct_test.go deleted file mode 100644 index 7237715..0000000 --- a/vendor/github.com/go-ini/ini/struct_test.go +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright 2014 Unknwon -// -// Licensed under the Apache License, Version 2.0 (the "License"): you may -// not use this file except in compliance with the License. You may obtain -// a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations -// under the License. - -package ini - -import ( - "bytes" - "fmt" - "strings" - "testing" - "time" - - . "github.com/smartystreets/goconvey/convey" -) - -type testNested struct { - Cities []string `delim:"|"` - Visits []time.Time - Years []int - Numbers []int64 - Ages []uint - Populations []uint64 - Coordinates []float64 - Note string - Unused int `ini:"-"` -} - -type testEmbeded struct { - GPA float64 -} - -type testStruct struct { - Name string `ini:"NAME"` - Age int - Male bool - Money float64 - Born time.Time - Time time.Duration `ini:"Duration"` - Others testNested - *testEmbeded `ini:"grade"` - Unused int `ini:"-"` - Unsigned uint - Omitted bool `ini:"omitthis,omitempty"` - Shadows []string `ini:",,allowshadow"` - ShadowInts []int `ini:"Shadows,,allowshadow"` -} - -const _CONF_DATA_STRUCT = ` -NAME = Unknwon -Age = 21 -Male = true -Money = 1.25 -Born = 1993-10-07T20:17:05Z -Duration = 2h45m -Unsigned = 3 -omitthis = true -Shadows = 1, 2 -Shadows = 3, 4 - -[Others] -Cities = HangZhou|Boston -Visits = 1993-10-07T20:17:05Z, 1993-10-07T20:17:05Z -Years = 1993,1994 -Numbers = 10010,10086 -Ages = 18,19 -Populations = 12345678,98765432 -Coordinates = 192.168,10.11 -Note = Hello world! - -[grade] -GPA = 2.8 - -[foo.bar] -Here = there -When = then -` - -type unsupport struct { - Byte byte -} - -type unsupport2 struct { - Others struct { - Cities byte - } -} - -type unsupport3 struct { - Cities byte -} - -type unsupport4 struct { - *unsupport3 `ini:"Others"` -} - -type defaultValue struct { - Name string - Age int - Male bool - Money float64 - Born time.Time - Cities []string -} - -type fooBar struct { - Here, When string -} - -const _INVALID_DATA_CONF_STRUCT = ` -Name = -Age = age -Male = 123 -Money = money -Born = nil -Cities = -` - -func Test_Struct(t *testing.T) { - Convey("Map to struct", t, func() { - Convey("Map file to struct", func() { - ts := new(testStruct) - So(MapTo(ts, []byte(_CONF_DATA_STRUCT)), ShouldBeNil) - - So(ts.Name, ShouldEqual, "Unknwon") - So(ts.Age, ShouldEqual, 21) - So(ts.Male, ShouldBeTrue) - So(ts.Money, ShouldEqual, 1.25) - So(ts.Unsigned, ShouldEqual, 3) - - t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z") - So(err, ShouldBeNil) - So(ts.Born.String(), ShouldEqual, t.String()) - - dur, err := time.ParseDuration("2h45m") - So(err, ShouldBeNil) - So(ts.Time.Seconds(), ShouldEqual, dur.Seconds()) - - So(strings.Join(ts.Others.Cities, ","), ShouldEqual, "HangZhou,Boston") - So(ts.Others.Visits[0].String(), ShouldEqual, t.String()) - So(fmt.Sprint(ts.Others.Years), ShouldEqual, "[1993 1994]") - So(fmt.Sprint(ts.Others.Numbers), ShouldEqual, "[10010 10086]") - So(fmt.Sprint(ts.Others.Ages), ShouldEqual, "[18 19]") - So(fmt.Sprint(ts.Others.Populations), ShouldEqual, "[12345678 98765432]") - So(fmt.Sprint(ts.Others.Coordinates), ShouldEqual, "[192.168 10.11]") - So(ts.Others.Note, ShouldEqual, "Hello world!") - So(ts.testEmbeded.GPA, ShouldEqual, 2.8) - }) - - Convey("Map section to struct", func() { - foobar := new(fooBar) - f, err := Load([]byte(_CONF_DATA_STRUCT)) - So(err, ShouldBeNil) - - So(f.Section("foo.bar").MapTo(foobar), ShouldBeNil) - So(foobar.Here, ShouldEqual, "there") - So(foobar.When, ShouldEqual, "then") - }) - - Convey("Map to non-pointer struct", func() { - cfg, err := Load([]byte(_CONF_DATA_STRUCT)) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - So(cfg.MapTo(testStruct{}), ShouldNotBeNil) - }) - - Convey("Map to unsupported type", func() { - cfg, err := Load([]byte(_CONF_DATA_STRUCT)) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - cfg.NameMapper = func(raw string) string { - if raw == "Byte" { - return "NAME" - } - return raw - } - So(cfg.MapTo(&unsupport{}), ShouldNotBeNil) - So(cfg.MapTo(&unsupport2{}), ShouldNotBeNil) - So(cfg.MapTo(&unsupport4{}), ShouldNotBeNil) - }) - - Convey("Map to omitempty field", func() { - ts := new(testStruct) - So(MapTo(ts, []byte(_CONF_DATA_STRUCT)), ShouldBeNil) - - So(ts.Omitted, ShouldEqual, true) - }) - - Convey("Map with shadows", func() { - cfg, err := LoadSources(LoadOptions{AllowShadows: true}, []byte(_CONF_DATA_STRUCT)) - So(err, ShouldBeNil) - ts := new(testStruct) - So(cfg.MapTo(ts), ShouldBeNil) - - So(strings.Join(ts.Shadows, " "), ShouldEqual, "1 2 3 4") - So(fmt.Sprintf("%v", ts.ShadowInts), ShouldEqual, "[1 2 3 4]") - }) - - Convey("Map from invalid data source", func() { - So(MapTo(&testStruct{}, "hi"), ShouldNotBeNil) - }) - - Convey("Map to wrong types and gain default values", func() { - cfg, err := Load([]byte(_INVALID_DATA_CONF_STRUCT)) - So(err, ShouldBeNil) - - t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z") - So(err, ShouldBeNil) - dv := &defaultValue{"Joe", 10, true, 1.25, t, []string{"HangZhou", "Boston"}} - So(cfg.MapTo(dv), ShouldBeNil) - So(dv.Name, ShouldEqual, "Joe") - So(dv.Age, ShouldEqual, 10) - So(dv.Male, ShouldBeTrue) - So(dv.Money, ShouldEqual, 1.25) - So(dv.Born.String(), ShouldEqual, t.String()) - So(strings.Join(dv.Cities, ","), ShouldEqual, "HangZhou,Boston") - }) - }) - - Convey("Reflect from struct", t, func() { - type Embeded struct { - Dates []time.Time `delim:"|"` - Places []string - Years []int - Numbers []int64 - Ages []uint - Populations []uint64 - Coordinates []float64 - None []int - } - type Author struct { - Name string `ini:"NAME"` - Male bool - Age int - Height uint - GPA float64 - Date time.Time - NeverMind string `ini:"-"` - *Embeded `ini:"infos"` - } - - t, err := time.Parse(time.RFC3339, "1993-10-07T20:17:05Z") - So(err, ShouldBeNil) - a := &Author{"Unknwon", true, 21, 100, 2.8, t, "", - &Embeded{ - []time.Time{t, t}, - []string{"HangZhou", "Boston"}, - []int{1993, 1994}, - []int64{10010, 10086}, - []uint{18, 19}, - []uint64{12345678, 98765432}, - []float64{192.168, 10.11}, - []int{}, - }} - cfg := Empty() - So(ReflectFrom(cfg, a), ShouldBeNil) - - var buf bytes.Buffer - _, err = cfg.WriteTo(&buf) - So(err, ShouldBeNil) - So(buf.String(), ShouldEqual, `NAME = Unknwon -Male = true -Age = 21 -Height = 100 -GPA = 2.8 -Date = 1993-10-07T20:17:05Z - -[infos] -Dates = 1993-10-07T20:17:05Z|1993-10-07T20:17:05Z -Places = HangZhou,Boston -Years = 1993,1994 -Numbers = 10010,10086 -Ages = 18,19 -Populations = 12345678,98765432 -Coordinates = 192.168,10.11 -None = - -`) - - Convey("Reflect from non-point struct", func() { - So(ReflectFrom(cfg, Author{}), ShouldNotBeNil) - }) - - Convey("Reflect from struct with omitempty", func() { - cfg := Empty() - type SpecialStruct struct { - FirstName string `ini:"first_name"` - LastName string `ini:"last_name"` - JustOmitMe string `ini:"omitempty"` - LastLogin time.Time `ini:"last_login,omitempty"` - LastLogin2 time.Time `ini:",omitempty"` - NotEmpty int `ini:"omitempty"` - } - - So(ReflectFrom(cfg, &SpecialStruct{FirstName: "John", LastName: "Doe", NotEmpty: 9}), ShouldBeNil) - - var buf bytes.Buffer - _, err = cfg.WriteTo(&buf) - So(buf.String(), ShouldEqual, `first_name = John -last_name = Doe -omitempty = 9 - -`) - }) - }) -} - -type testMapper struct { - PackageName string -} - -func Test_NameGetter(t *testing.T) { - Convey("Test name mappers", t, func() { - So(MapToWithMapper(&testMapper{}, TitleUnderscore, []byte("packag_name=ini")), ShouldBeNil) - - cfg, err := Load([]byte("PACKAGE_NAME=ini")) - So(err, ShouldBeNil) - So(cfg, ShouldNotBeNil) - - cfg.NameMapper = AllCapsUnderscore - tg := new(testMapper) - So(cfg.MapTo(tg), ShouldBeNil) - So(tg.PackageName, ShouldEqual, "ini") - }) -} diff --git a/vendor/github.com/go-ini/ini/testdata/UTF-16-BE-BOM.ini b/vendor/github.com/go-ini/ini/testdata/UTF-16-BE-BOM.ini deleted file mode 100644 index c8bf82c..0000000 Binary files a/vendor/github.com/go-ini/ini/testdata/UTF-16-BE-BOM.ini and /dev/null differ diff --git a/vendor/github.com/go-ini/ini/testdata/UTF-16-LE-BOM.ini b/vendor/github.com/go-ini/ini/testdata/UTF-16-LE-BOM.ini deleted file mode 100644 index 27f6218..0000000 Binary files a/vendor/github.com/go-ini/ini/testdata/UTF-16-LE-BOM.ini and /dev/null differ diff --git a/vendor/github.com/go-ini/ini/testdata/UTF-8-BOM.ini b/vendor/github.com/go-ini/ini/testdata/UTF-8-BOM.ini deleted file mode 100644 index 2ed0ac1..0000000 --- a/vendor/github.com/go-ini/ini/testdata/UTF-8-BOM.ini +++ /dev/null @@ -1,2 +0,0 @@ -[author] -E-MAIL = u@gogs.io \ No newline at end of file diff --git a/vendor/github.com/go-ini/ini/testdata/aicc.ini b/vendor/github.com/go-ini/ini/testdata/aicc.ini deleted file mode 100644 index 59a6197..0000000 --- a/vendor/github.com/go-ini/ini/testdata/aicc.ini +++ /dev/null @@ -1,11 +0,0 @@ -[Core] - Lesson_Location = 87 -Lesson_Status = C - Score = 3 -Time = 00:02:30 - -[CORE_LESSON] -my lesson state data – 1111111111111111111000000000000000001110000 -111111111111111111100000000000111000000000 – end my lesson state data -[COMMENTS] -<1> This slide has the fuel listed in the wrong units diff --git a/vendor/github.com/go-ini/ini/testdata/conf.ini b/vendor/github.com/go-ini/ini/testdata/conf.ini deleted file mode 100644 index f8e7ec8..0000000 --- a/vendor/github.com/go-ini/ini/testdata/conf.ini +++ /dev/null @@ -1,2 +0,0 @@ -[author] -E-MAIL = u@gogs.io \ No newline at end of file diff --git a/vendor/github.com/jmespath/go-jmespath/.gitignore b/vendor/github.com/jmespath/go-jmespath/.gitignore new file mode 100644 index 0000000..5091fb0 --- /dev/null +++ b/vendor/github.com/jmespath/go-jmespath/.gitignore @@ -0,0 +1,4 @@ +/jpgo +jmespath-fuzz.zip +cpu.out +go-jmespath.test diff --git a/vendor/github.com/jmespath/go-jmespath/.travis.yml b/vendor/github.com/jmespath/go-jmespath/.travis.yml new file mode 100644 index 0000000..1f98077 --- /dev/null +++ b/vendor/github.com/jmespath/go-jmespath/.travis.yml @@ -0,0 +1,9 @@ +language: go + +sudo: false + +go: + - 1.4 + +install: go get -v -t ./... +script: make test diff --git a/vendor/github.com/jmespath/go-jmespath/api.go b/vendor/github.com/jmespath/go-jmespath/api.go index 9cfa988..8e26ffe 100644 --- a/vendor/github.com/jmespath/go-jmespath/api.go +++ b/vendor/github.com/jmespath/go-jmespath/api.go @@ -2,7 +2,7 @@ package jmespath import "strconv" -// JmesPath is the epresentation of a compiled JMES path query. A JmesPath is +// JMESPath is the epresentation of a compiled JMES path query. A JMESPath is // safe for concurrent use by multiple goroutines. type JMESPath struct { ast ASTNode diff --git a/vendor/github.com/jmespath/go-jmespath/api_test.go b/vendor/github.com/jmespath/go-jmespath/api_test.go deleted file mode 100644 index b0b106d..0000000 --- a/vendor/github.com/jmespath/go-jmespath/api_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package jmespath - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestValidPrecompiledExpressionSearches(t *testing.T) { - assert := assert.New(t) - data := make(map[string]interface{}) - data["foo"] = "bar" - precompiled, err := Compile("foo") - assert.Nil(err) - result, err := precompiled.Search(data) - assert.Nil(err) - assert.Equal("bar", result) -} - -func TestInvalidPrecompileErrors(t *testing.T) { - assert := assert.New(t) - _, err := Compile("not a valid expression") - assert.NotNil(err) -} - -func TestInvalidMustCompilePanics(t *testing.T) { - defer func() { - r := recover() - assert.NotNil(t, r) - }() - MustCompile("not a valid expression") -} diff --git a/vendor/github.com/jmespath/go-jmespath/compliance_test.go b/vendor/github.com/jmespath/go-jmespath/compliance_test.go deleted file mode 100644 index 4ee9c95..0000000 --- a/vendor/github.com/jmespath/go-jmespath/compliance_test.go +++ /dev/null @@ -1,123 +0,0 @@ -package jmespath - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "testing" - - "github.com/stretchr/testify/assert" -) - -type TestSuite struct { - Given interface{} - TestCases []TestCase `json:"cases"` - Comment string -} -type TestCase struct { - Comment string - Expression string - Result interface{} - Error string -} - -var whiteListed = []string{ - "compliance/basic.json", - "compliance/current.json", - "compliance/escape.json", - "compliance/filters.json", - "compliance/functions.json", - "compliance/identifiers.json", - "compliance/indices.json", - "compliance/literal.json", - "compliance/multiselect.json", - "compliance/ormatch.json", - "compliance/pipe.json", - "compliance/slice.json", - "compliance/syntax.json", - "compliance/unicode.json", - "compliance/wildcard.json", - "compliance/boolean.json", -} - -func allowed(path string) bool { - for _, el := range whiteListed { - if el == path { - return true - } - } - return false -} - -func TestCompliance(t *testing.T) { - assert := assert.New(t) - - var complianceFiles []string - err := filepath.Walk("compliance", func(path string, _ os.FileInfo, _ error) error { - //if strings.HasSuffix(path, ".json") { - if allowed(path) { - complianceFiles = append(complianceFiles, path) - } - return nil - }) - if assert.Nil(err) { - for _, filename := range complianceFiles { - runComplianceTest(assert, filename) - } - } -} - -func runComplianceTest(assert *assert.Assertions, filename string) { - var testSuites []TestSuite - data, err := ioutil.ReadFile(filename) - if assert.Nil(err) { - err := json.Unmarshal(data, &testSuites) - if assert.Nil(err) { - for _, testsuite := range testSuites { - runTestSuite(assert, testsuite, filename) - } - } - } -} - -func runTestSuite(assert *assert.Assertions, testsuite TestSuite, filename string) { - for _, testcase := range testsuite.TestCases { - if testcase.Error != "" { - // This is a test case that verifies we error out properly. - runSyntaxTestCase(assert, testsuite.Given, testcase, filename) - } else { - runTestCase(assert, testsuite.Given, testcase, filename) - } - } -} - -func runSyntaxTestCase(assert *assert.Assertions, given interface{}, testcase TestCase, filename string) { - // Anything with an .Error means that we expect that JMESPath should return - // an error when we try to evaluate the expression. - _, err := Search(testcase.Expression, given) - assert.NotNil(err, fmt.Sprintf("Expression: %s", testcase.Expression)) -} - -func runTestCase(assert *assert.Assertions, given interface{}, testcase TestCase, filename string) { - lexer := NewLexer() - var err error - _, err = lexer.tokenize(testcase.Expression) - if err != nil { - errMsg := fmt.Sprintf("(%s) Could not lex expression: %s -- %s", filename, testcase.Expression, err.Error()) - assert.Fail(errMsg) - return - } - parser := NewParser() - _, err = parser.Parse(testcase.Expression) - if err != nil { - errMsg := fmt.Sprintf("(%s) Could not parse expression: %s -- %s", filename, testcase.Expression, err.Error()) - assert.Fail(errMsg) - return - } - actual, err := Search(testcase.Expression, given) - if assert.Nil(err, fmt.Sprintf("Expression: %s", testcase.Expression)) { - assert.Equal(testcase.Result, actual, fmt.Sprintf("Expression: %s", testcase.Expression)) - } -} diff --git a/vendor/github.com/jmespath/go-jmespath/interpreter_test.go b/vendor/github.com/jmespath/go-jmespath/interpreter_test.go deleted file mode 100644 index 11c6d0a..0000000 --- a/vendor/github.com/jmespath/go-jmespath/interpreter_test.go +++ /dev/null @@ -1,221 +0,0 @@ -package jmespath - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/assert" -) - -type scalars struct { - Foo string - Bar string -} - -type sliceType struct { - A string - B []scalars - C []*scalars -} - -type benchmarkStruct struct { - Fooasdfasdfasdfasdf string -} - -type benchmarkNested struct { - Fooasdfasdfasdfasdf nestedA -} - -type nestedA struct { - Fooasdfasdfasdfasdf nestedB -} - -type nestedB struct { - Fooasdfasdfasdfasdf nestedC -} - -type nestedC struct { - Fooasdfasdfasdfasdf string -} - -type nestedSlice struct { - A []sliceType -} - -func TestCanSupportEmptyInterface(t *testing.T) { - assert := assert.New(t) - data := make(map[string]interface{}) - data["foo"] = "bar" - result, err := Search("foo", data) - assert.Nil(err) - assert.Equal("bar", result) -} - -func TestCanSupportUserDefinedStructsValue(t *testing.T) { - assert := assert.New(t) - s := scalars{Foo: "one", Bar: "bar"} - result, err := Search("Foo", s) - assert.Nil(err) - assert.Equal("one", result) -} - -func TestCanSupportUserDefinedStructsRef(t *testing.T) { - assert := assert.New(t) - s := scalars{Foo: "one", Bar: "bar"} - result, err := Search("Foo", &s) - assert.Nil(err) - assert.Equal("one", result) -} - -func TestCanSupportStructWithSliceAll(t *testing.T) { - assert := assert.New(t) - data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}} - result, err := Search("B[].Foo", data) - assert.Nil(err) - assert.Equal([]interface{}{"f1", "correct"}, result) -} - -func TestCanSupportStructWithSlicingExpression(t *testing.T) { - assert := assert.New(t) - data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}} - result, err := Search("B[:].Foo", data) - assert.Nil(err) - assert.Equal([]interface{}{"f1", "correct"}, result) -} - -func TestCanSupportStructWithFilterProjection(t *testing.T) { - assert := assert.New(t) - data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}} - result, err := Search("B[? `true` ].Foo", data) - assert.Nil(err) - assert.Equal([]interface{}{"f1", "correct"}, result) -} - -func TestCanSupportStructWithSlice(t *testing.T) { - assert := assert.New(t) - data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}} - result, err := Search("B[-1].Foo", data) - assert.Nil(err) - assert.Equal("correct", result) -} - -func TestCanSupportStructWithOrExpressions(t *testing.T) { - assert := assert.New(t) - data := sliceType{A: "foo", C: nil} - result, err := Search("C || A", data) - assert.Nil(err) - assert.Equal("foo", result) -} - -func TestCanSupportStructWithSlicePointer(t *testing.T) { - assert := assert.New(t) - data := sliceType{A: "foo", C: []*scalars{{"f1", "b1"}, {"correct", "b2"}}} - result, err := Search("C[-1].Foo", data) - assert.Nil(err) - assert.Equal("correct", result) -} - -func TestWillAutomaticallyCapitalizeFieldNames(t *testing.T) { - assert := assert.New(t) - s := scalars{Foo: "one", Bar: "bar"} - // Note that there's a lower cased "foo" instead of "Foo", - // but it should still correspond to the Foo field in the - // scalars struct - result, err := Search("foo", &s) - assert.Nil(err) - assert.Equal("one", result) -} - -func TestCanSupportStructWithSliceLowerCased(t *testing.T) { - assert := assert.New(t) - data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}} - result, err := Search("b[-1].foo", data) - assert.Nil(err) - assert.Equal("correct", result) -} - -func TestCanSupportStructWithNestedPointers(t *testing.T) { - assert := assert.New(t) - data := struct{ A *struct{ B int } }{} - result, err := Search("A.B", data) - assert.Nil(err) - assert.Nil(result) -} - -func TestCanSupportFlattenNestedSlice(t *testing.T) { - assert := assert.New(t) - data := nestedSlice{A: []sliceType{ - {B: []scalars{{Foo: "f1a"}, {Foo: "f1b"}}}, - {B: []scalars{{Foo: "f2a"}, {Foo: "f2b"}}}, - }} - result, err := Search("A[].B[].Foo", data) - assert.Nil(err) - assert.Equal([]interface{}{"f1a", "f1b", "f2a", "f2b"}, result) -} - -func TestCanSupportFlattenNestedEmptySlice(t *testing.T) { - assert := assert.New(t) - data := nestedSlice{A: []sliceType{ - {}, {B: []scalars{{Foo: "a"}}}, - }} - result, err := Search("A[].B[].Foo", data) - assert.Nil(err) - assert.Equal([]interface{}{"a"}, result) -} - -func TestCanSupportProjectionsWithStructs(t *testing.T) { - assert := assert.New(t) - data := nestedSlice{A: []sliceType{ - {A: "first"}, {A: "second"}, {A: "third"}, - }} - result, err := Search("A[*].A", data) - assert.Nil(err) - assert.Equal([]interface{}{"first", "second", "third"}, result) -} - -func TestCanSupportSliceOfStructsWithFunctions(t *testing.T) { - assert := assert.New(t) - data := []scalars{scalars{"a1", "b1"}, scalars{"a2", "b2"}} - result, err := Search("length(@)", data) - assert.Nil(err) - assert.Equal(result.(float64), 2.0) -} - -func BenchmarkInterpretSingleFieldStruct(b *testing.B) { - intr := newInterpreter() - parser := NewParser() - ast, _ := parser.Parse("fooasdfasdfasdfasdf") - data := benchmarkStruct{"foobarbazqux"} - for i := 0; i < b.N; i++ { - intr.Execute(ast, &data) - } -} - -func BenchmarkInterpretNestedStruct(b *testing.B) { - intr := newInterpreter() - parser := NewParser() - ast, _ := parser.Parse("fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf") - data := benchmarkNested{ - nestedA{ - nestedB{ - nestedC{"foobarbazqux"}, - }, - }, - } - for i := 0; i < b.N; i++ { - intr.Execute(ast, &data) - } -} - -func BenchmarkInterpretNestedMaps(b *testing.B) { - jsonData := []byte(`{"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": {"fooasdfasdfasdfasdf": "foobarbazqux"}}}}`) - var data interface{} - json.Unmarshal(jsonData, &data) - - intr := newInterpreter() - parser := NewParser() - ast, _ := parser.Parse("fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf.fooasdfasdfasdfasdf") - for i := 0; i < b.N; i++ { - intr.Execute(ast, data) - } -} diff --git a/vendor/github.com/jmespath/go-jmespath/lexer_test.go b/vendor/github.com/jmespath/go-jmespath/lexer_test.go deleted file mode 100644 index d13a042..0000000 --- a/vendor/github.com/jmespath/go-jmespath/lexer_test.go +++ /dev/null @@ -1,161 +0,0 @@ -package jmespath - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" -) - -var lexingTests = []struct { - expression string - expected []token -}{ - {"*", []token{{tStar, "*", 0, 1}}}, - {".", []token{{tDot, ".", 0, 1}}}, - {"[?", []token{{tFilter, "[?", 0, 2}}}, - {"[]", []token{{tFlatten, "[]", 0, 2}}}, - {"(", []token{{tLparen, "(", 0, 1}}}, - {")", []token{{tRparen, ")", 0, 1}}}, - {"[", []token{{tLbracket, "[", 0, 1}}}, - {"]", []token{{tRbracket, "]", 0, 1}}}, - {"{", []token{{tLbrace, "{", 0, 1}}}, - {"}", []token{{tRbrace, "}", 0, 1}}}, - {"||", []token{{tOr, "||", 0, 2}}}, - {"|", []token{{tPipe, "|", 0, 1}}}, - {"29", []token{{tNumber, "29", 0, 2}}}, - {"2", []token{{tNumber, "2", 0, 1}}}, - {"0", []token{{tNumber, "0", 0, 1}}}, - {"-20", []token{{tNumber, "-20", 0, 3}}}, - {"foo", []token{{tUnquotedIdentifier, "foo", 0, 3}}}, - {`"bar"`, []token{{tQuotedIdentifier, "bar", 0, 3}}}, - // Escaping the delimiter - {`"bar\"baz"`, []token{{tQuotedIdentifier, `bar"baz`, 0, 7}}}, - {",", []token{{tComma, ",", 0, 1}}}, - {":", []token{{tColon, ":", 0, 1}}}, - {"<", []token{{tLT, "<", 0, 1}}}, - {"<=", []token{{tLTE, "<=", 0, 2}}}, - {">", []token{{tGT, ">", 0, 1}}}, - {">=", []token{{tGTE, ">=", 0, 2}}}, - {"==", []token{{tEQ, "==", 0, 2}}}, - {"!=", []token{{tNE, "!=", 0, 2}}}, - {"`[0, 1, 2]`", []token{{tJSONLiteral, "[0, 1, 2]", 1, 9}}}, - {"'foo'", []token{{tStringLiteral, "foo", 1, 3}}}, - {"'a'", []token{{tStringLiteral, "a", 1, 1}}}, - {`'foo\'bar'`, []token{{tStringLiteral, "foo'bar", 1, 7}}}, - {"@", []token{{tCurrent, "@", 0, 1}}}, - {"&", []token{{tExpref, "&", 0, 1}}}, - // Quoted identifier unicode escape sequences - {`"\u2713"`, []token{{tQuotedIdentifier, "✓", 0, 3}}}, - {`"\\"`, []token{{tQuotedIdentifier, `\`, 0, 1}}}, - {"`\"foo\"`", []token{{tJSONLiteral, "\"foo\"", 1, 5}}}, - // Combinations of tokens. - {"foo.bar", []token{ - {tUnquotedIdentifier, "foo", 0, 3}, - {tDot, ".", 3, 1}, - {tUnquotedIdentifier, "bar", 4, 3}, - }}, - {"foo[0]", []token{ - {tUnquotedIdentifier, "foo", 0, 3}, - {tLbracket, "[", 3, 1}, - {tNumber, "0", 4, 1}, - {tRbracket, "]", 5, 1}, - }}, - {"foo[?a b { - return a - } - return b -} - -func calculateRatio(matches, length int) float64 { - if length > 0 { - return 2.0 * float64(matches) / float64(length) - } - return 1.0 -} - -type Match struct { - A int - B int - Size int -} - -type OpCode struct { - Tag byte - I1 int - I2 int - J1 int - J2 int -} - -// SequenceMatcher compares sequence of strings. The basic -// algorithm predates, and is a little fancier than, an algorithm -// published in the late 1980's by Ratcliff and Obershelp under the -// hyperbolic name "gestalt pattern matching". The basic idea is to find -// the longest contiguous matching subsequence that contains no "junk" -// elements (R-O doesn't address junk). The same idea is then applied -// recursively to the pieces of the sequences to the left and to the right -// of the matching subsequence. This does not yield minimal edit -// sequences, but does tend to yield matches that "look right" to people. -// -// SequenceMatcher tries to compute a "human-friendly diff" between two -// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the -// longest *contiguous* & junk-free matching subsequence. That's what -// catches peoples' eyes. The Windows(tm) windiff has another interesting -// notion, pairing up elements that appear uniquely in each sequence. -// That, and the method here, appear to yield more intuitive difference -// reports than does diff. This method appears to be the least vulnerable -// to synching up on blocks of "junk lines", though (like blank lines in -// ordinary text files, or maybe "

" lines in HTML files). That may be -// because this is the only method of the 3 that has a *concept* of -// "junk" . -// -// Timing: Basic R-O is cubic time worst case and quadratic time expected -// case. SequenceMatcher is quadratic time for the worst case and has -// expected-case behavior dependent in a complicated way on how many -// elements the sequences have in common; best case time is linear. -type SequenceMatcher struct { - a []string - b []string - b2j map[string][]int - IsJunk func(string) bool - autoJunk bool - bJunk map[string]struct{} - matchingBlocks []Match - fullBCount map[string]int - bPopular map[string]struct{} - opCodes []OpCode -} - -func NewMatcher(a, b []string) *SequenceMatcher { - m := SequenceMatcher{autoJunk: true} - m.SetSeqs(a, b) - return &m -} - -func NewMatcherWithJunk(a, b []string, autoJunk bool, - isJunk func(string) bool) *SequenceMatcher { - - m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} - m.SetSeqs(a, b) - return &m -} - -// Set two sequences to be compared. -func (m *SequenceMatcher) SetSeqs(a, b []string) { - m.SetSeq1(a) - m.SetSeq2(b) -} - -// Set the first sequence to be compared. The second sequence to be compared is -// not changed. -// -// SequenceMatcher computes and caches detailed information about the second -// sequence, so if you want to compare one sequence S against many sequences, -// use .SetSeq2(s) once and call .SetSeq1(x) repeatedly for each of the other -// sequences. -// -// See also SetSeqs() and SetSeq2(). -func (m *SequenceMatcher) SetSeq1(a []string) { - if &a == &m.a { - return - } - m.a = a - m.matchingBlocks = nil - m.opCodes = nil -} - -// Set the second sequence to be compared. The first sequence to be compared is -// not changed. -func (m *SequenceMatcher) SetSeq2(b []string) { - if &b == &m.b { - return - } - m.b = b - m.matchingBlocks = nil - m.opCodes = nil - m.fullBCount = nil - m.chainB() -} - -func (m *SequenceMatcher) chainB() { - // Populate line -> index mapping - b2j := map[string][]int{} - for i, s := range m.b { - indices := b2j[s] - indices = append(indices, i) - b2j[s] = indices - } - - // Purge junk elements - m.bJunk = map[string]struct{}{} - if m.IsJunk != nil { - junk := m.bJunk - for s, _ := range b2j { - if m.IsJunk(s) { - junk[s] = struct{}{} - } - } - for s, _ := range junk { - delete(b2j, s) - } - } - - // Purge remaining popular elements - popular := map[string]struct{}{} - n := len(m.b) - if m.autoJunk && n >= 200 { - ntest := n/100 + 1 - for s, indices := range b2j { - if len(indices) > ntest { - popular[s] = struct{}{} - } - } - for s, _ := range popular { - delete(b2j, s) - } - } - m.bPopular = popular - m.b2j = b2j -} - -func (m *SequenceMatcher) isBJunk(s string) bool { - _, ok := m.bJunk[s] - return ok -} - -// Find longest matching block in a[alo:ahi] and b[blo:bhi]. -// -// If IsJunk is not defined: -// -// Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where -// alo <= i <= i+k <= ahi -// blo <= j <= j+k <= bhi -// and for all (i',j',k') meeting those conditions, -// k >= k' -// i <= i' -// and if i == i', j <= j' -// -// In other words, of all maximal matching blocks, return one that -// starts earliest in a, and of all those maximal matching blocks that -// start earliest in a, return the one that starts earliest in b. -// -// If IsJunk is defined, first the longest matching block is -// determined as above, but with the additional restriction that no -// junk element appears in the block. Then that block is extended as -// far as possible by matching (only) junk elements on both sides. So -// the resulting block never matches on junk except as identical junk -// happens to be adjacent to an "interesting" match. -// -// If no blocks match, return (alo, blo, 0). -func (m *SequenceMatcher) findLongestMatch(alo, ahi, blo, bhi int) Match { - // CAUTION: stripping common prefix or suffix would be incorrect. - // E.g., - // ab - // acab - // Longest matching block is "ab", but if common prefix is - // stripped, it's "a" (tied with "b"). UNIX(tm) diff does so - // strip, so ends up claiming that ab is changed to acab by - // inserting "ca" in the middle. That's minimal but unintuitive: - // "it's obvious" that someone inserted "ac" at the front. - // Windiff ends up at the same place as diff, but by pairing up - // the unique 'b's and then matching the first two 'a's. - besti, bestj, bestsize := alo, blo, 0 - - // find longest junk-free match - // during an iteration of the loop, j2len[j] = length of longest - // junk-free match ending with a[i-1] and b[j] - j2len := map[int]int{} - for i := alo; i != ahi; i++ { - // look at all instances of a[i] in b; note that because - // b2j has no junk keys, the loop is skipped if a[i] is junk - newj2len := map[int]int{} - for _, j := range m.b2j[m.a[i]] { - // a[i] matches b[j] - if j < blo { - continue - } - if j >= bhi { - break - } - k := j2len[j-1] + 1 - newj2len[j] = k - if k > bestsize { - besti, bestj, bestsize = i-k+1, j-k+1, k - } - } - j2len = newj2len - } - - // Extend the best by non-junk elements on each end. In particular, - // "popular" non-junk elements aren't in b2j, which greatly speeds - // the inner loop above, but also means "the best" match so far - // doesn't contain any junk *or* popular non-junk elements. - for besti > alo && bestj > blo && !m.isBJunk(m.b[bestj-1]) && - m.a[besti-1] == m.b[bestj-1] { - besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 - } - for besti+bestsize < ahi && bestj+bestsize < bhi && - !m.isBJunk(m.b[bestj+bestsize]) && - m.a[besti+bestsize] == m.b[bestj+bestsize] { - bestsize += 1 - } - - // Now that we have a wholly interesting match (albeit possibly - // empty!), we may as well suck up the matching junk on each - // side of it too. Can't think of a good reason not to, and it - // saves post-processing the (possibly considerable) expense of - // figuring out what to do with it. In the case of an empty - // interesting match, this is clearly the right thing to do, - // because no other kind of match is possible in the regions. - for besti > alo && bestj > blo && m.isBJunk(m.b[bestj-1]) && - m.a[besti-1] == m.b[bestj-1] { - besti, bestj, bestsize = besti-1, bestj-1, bestsize+1 - } - for besti+bestsize < ahi && bestj+bestsize < bhi && - m.isBJunk(m.b[bestj+bestsize]) && - m.a[besti+bestsize] == m.b[bestj+bestsize] { - bestsize += 1 - } - - return Match{A: besti, B: bestj, Size: bestsize} -} - -// Return list of triples describing matching subsequences. -// -// Each triple is of the form (i, j, n), and means that -// a[i:i+n] == b[j:j+n]. The triples are monotonically increasing in -// i and in j. It's also guaranteed that if (i, j, n) and (i', j', n') are -// adjacent triples in the list, and the second is not the last triple in the -// list, then i+n != i' or j+n != j'. IOW, adjacent triples never describe -// adjacent equal blocks. -// -// The last triple is a dummy, (len(a), len(b), 0), and is the only -// triple with n==0. -func (m *SequenceMatcher) GetMatchingBlocks() []Match { - if m.matchingBlocks != nil { - return m.matchingBlocks - } - - var matchBlocks func(alo, ahi, blo, bhi int, matched []Match) []Match - matchBlocks = func(alo, ahi, blo, bhi int, matched []Match) []Match { - match := m.findLongestMatch(alo, ahi, blo, bhi) - i, j, k := match.A, match.B, match.Size - if match.Size > 0 { - if alo < i && blo < j { - matched = matchBlocks(alo, i, blo, j, matched) - } - matched = append(matched, match) - if i+k < ahi && j+k < bhi { - matched = matchBlocks(i+k, ahi, j+k, bhi, matched) - } - } - return matched - } - matched := matchBlocks(0, len(m.a), 0, len(m.b), nil) - - // It's possible that we have adjacent equal blocks in the - // matching_blocks list now. - nonAdjacent := []Match{} - i1, j1, k1 := 0, 0, 0 - for _, b := range matched { - // Is this block adjacent to i1, j1, k1? - i2, j2, k2 := b.A, b.B, b.Size - if i1+k1 == i2 && j1+k1 == j2 { - // Yes, so collapse them -- this just increases the length of - // the first block by the length of the second, and the first - // block so lengthened remains the block to compare against. - k1 += k2 - } else { - // Not adjacent. Remember the first block (k1==0 means it's - // the dummy we started with), and make the second block the - // new block to compare against. - if k1 > 0 { - nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) - } - i1, j1, k1 = i2, j2, k2 - } - } - if k1 > 0 { - nonAdjacent = append(nonAdjacent, Match{i1, j1, k1}) - } - - nonAdjacent = append(nonAdjacent, Match{len(m.a), len(m.b), 0}) - m.matchingBlocks = nonAdjacent - return m.matchingBlocks -} - -// Return list of 5-tuples describing how to turn a into b. -// -// Each tuple is of the form (tag, i1, i2, j1, j2). The first tuple -// has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the -// tuple preceding it, and likewise for j1 == the previous j2. -// -// The tags are characters, with these meanings: -// -// 'r' (replace): a[i1:i2] should be replaced by b[j1:j2] -// -// 'd' (delete): a[i1:i2] should be deleted, j1==j2 in this case. -// -// 'i' (insert): b[j1:j2] should be inserted at a[i1:i1], i1==i2 in this case. -// -// 'e' (equal): a[i1:i2] == b[j1:j2] -func (m *SequenceMatcher) GetOpCodes() []OpCode { - if m.opCodes != nil { - return m.opCodes - } - i, j := 0, 0 - matching := m.GetMatchingBlocks() - opCodes := make([]OpCode, 0, len(matching)) - for _, m := range matching { - // invariant: we've pumped out correct diffs to change - // a[:i] into b[:j], and the next matching block is - // a[ai:ai+size] == b[bj:bj+size]. So we need to pump - // out a diff to change a[i:ai] into b[j:bj], pump out - // the matching block, and move (i,j) beyond the match - ai, bj, size := m.A, m.B, m.Size - tag := byte(0) - if i < ai && j < bj { - tag = 'r' - } else if i < ai { - tag = 'd' - } else if j < bj { - tag = 'i' - } - if tag > 0 { - opCodes = append(opCodes, OpCode{tag, i, ai, j, bj}) - } - i, j = ai+size, bj+size - // the list of matching blocks is terminated by a - // sentinel with size 0 - if size > 0 { - opCodes = append(opCodes, OpCode{'e', ai, i, bj, j}) - } - } - m.opCodes = opCodes - return m.opCodes -} - -// Isolate change clusters by eliminating ranges with no changes. -// -// Return a generator of groups with up to n lines of context. -// Each group is in the same format as returned by GetOpCodes(). -func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { - if n < 0 { - n = 3 - } - codes := m.GetOpCodes() - if len(codes) == 0 { - codes = []OpCode{OpCode{'e', 0, 1, 0, 1}} - } - // Fixup leading and trailing groups if they show no changes. - if codes[0].Tag == 'e' { - c := codes[0] - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - codes[0] = OpCode{c.Tag, max(i1, i2-n), i2, max(j1, j2-n), j2} - } - if codes[len(codes)-1].Tag == 'e' { - c := codes[len(codes)-1] - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - codes[len(codes)-1] = OpCode{c.Tag, i1, min(i2, i1+n), j1, min(j2, j1+n)} - } - nn := n + n - groups := [][]OpCode{} - group := []OpCode{} - for _, c := range codes { - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - // End the current group and start a new one whenever - // there is a large range with no changes. - if c.Tag == 'e' && i2-i1 > nn { - group = append(group, OpCode{c.Tag, i1, min(i2, i1+n), - j1, min(j2, j1+n)}) - groups = append(groups, group) - group = []OpCode{} - i1, j1 = max(i1, i2-n), max(j1, j2-n) - } - group = append(group, OpCode{c.Tag, i1, i2, j1, j2}) - } - if len(group) > 0 && !(len(group) == 1 && group[0].Tag == 'e') { - groups = append(groups, group) - } - return groups -} - -// Return a measure of the sequences' similarity (float in [0,1]). -// -// Where T is the total number of elements in both sequences, and -// M is the number of matches, this is 2.0*M / T. -// Note that this is 1 if the sequences are identical, and 0 if -// they have nothing in common. -// -// .Ratio() is expensive to compute if you haven't already computed -// .GetMatchingBlocks() or .GetOpCodes(), in which case you may -// want to try .QuickRatio() or .RealQuickRation() first to get an -// upper bound. -func (m *SequenceMatcher) Ratio() float64 { - matches := 0 - for _, m := range m.GetMatchingBlocks() { - matches += m.Size - } - return calculateRatio(matches, len(m.a)+len(m.b)) -} - -// Return an upper bound on ratio() relatively quickly. -// -// This isn't defined beyond that it is an upper bound on .Ratio(), and -// is faster to compute. -func (m *SequenceMatcher) QuickRatio() float64 { - // viewing a and b as multisets, set matches to the cardinality - // of their intersection; this counts the number of matches - // without regard to order, so is clearly an upper bound - if m.fullBCount == nil { - m.fullBCount = map[string]int{} - for _, s := range m.b { - m.fullBCount[s] = m.fullBCount[s] + 1 - } - } - - // avail[x] is the number of times x appears in 'b' less the - // number of times we've seen it in 'a' so far ... kinda - avail := map[string]int{} - matches := 0 - for _, s := range m.a { - n, ok := avail[s] - if !ok { - n = m.fullBCount[s] - } - avail[s] = n - 1 - if n > 0 { - matches += 1 - } - } - return calculateRatio(matches, len(m.a)+len(m.b)) -} - -// Return an upper bound on ratio() very quickly. -// -// This isn't defined beyond that it is an upper bound on .Ratio(), and -// is faster to compute than either .Ratio() or .QuickRatio(). -func (m *SequenceMatcher) RealQuickRatio() float64 { - la, lb := len(m.a), len(m.b) - return calculateRatio(min(la, lb), la+lb) -} - -// Convert range to the "ed" format -func formatRangeUnified(start, stop int) string { - // Per the diff spec at http://www.unix.org/single_unix_specification/ - beginning := start + 1 // lines start numbering with one - length := stop - start - if length == 1 { - return fmt.Sprintf("%d", beginning) - } - if length == 0 { - beginning -= 1 // empty ranges begin at line just before the range - } - return fmt.Sprintf("%d,%d", beginning, length) -} - -// Unified diff parameters -type UnifiedDiff struct { - A []string // First sequence lines - FromFile string // First file name - FromDate string // First file time - B []string // Second sequence lines - ToFile string // Second file name - ToDate string // Second file time - Eol string // Headers end of line, defaults to LF - Context int // Number of context lines -} - -// Compare two sequences of lines; generate the delta as a unified diff. -// -// Unified diffs are a compact way of showing line changes and a few -// lines of context. The number of context lines is set by 'n' which -// defaults to three. -// -// By default, the diff control lines (those with ---, +++, or @@) are -// created with a trailing newline. This is helpful so that inputs -// created from file.readlines() result in diffs that are suitable for -// file.writelines() since both the inputs and outputs have trailing -// newlines. -// -// For inputs that do not have trailing newlines, set the lineterm -// argument to "" so that the output will be uniformly newline free. -// -// The unidiff format normally has a header for filenames and modification -// times. Any or all of these may be specified using strings for -// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. -// The modification times are normally expressed in the ISO 8601 format. -func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { - buf := bufio.NewWriter(writer) - defer buf.Flush() - w := func(format string, args ...interface{}) error { - _, err := buf.WriteString(fmt.Sprintf(format, args...)) - return err - } - - if len(diff.Eol) == 0 { - diff.Eol = "\n" - } - - started := false - m := NewMatcher(diff.A, diff.B) - for _, g := range m.GetGroupedOpCodes(diff.Context) { - if !started { - started = true - fromDate := "" - if len(diff.FromDate) > 0 { - fromDate = "\t" + diff.FromDate - } - toDate := "" - if len(diff.ToDate) > 0 { - toDate = "\t" + diff.ToDate - } - err := w("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) - if err != nil { - return err - } - err = w("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) - if err != nil { - return err - } - } - first, last := g[0], g[len(g)-1] - range1 := formatRangeUnified(first.I1, last.I2) - range2 := formatRangeUnified(first.J1, last.J2) - if err := w("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { - return err - } - for _, c := range g { - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - if c.Tag == 'e' { - for _, line := range diff.A[i1:i2] { - if err := w(" " + line); err != nil { - return err - } - } - continue - } - if c.Tag == 'r' || c.Tag == 'd' { - for _, line := range diff.A[i1:i2] { - if err := w("-" + line); err != nil { - return err - } - } - } - if c.Tag == 'r' || c.Tag == 'i' { - for _, line := range diff.B[j1:j2] { - if err := w("+" + line); err != nil { - return err - } - } - } - } - } - return nil -} - -// Like WriteUnifiedDiff but returns the diff a string. -func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { - w := &bytes.Buffer{} - err := WriteUnifiedDiff(w, diff) - return string(w.Bytes()), err -} - -// Convert range to the "ed" format. -func formatRangeContext(start, stop int) string { - // Per the diff spec at http://www.unix.org/single_unix_specification/ - beginning := start + 1 // lines start numbering with one - length := stop - start - if length == 0 { - beginning -= 1 // empty ranges begin at line just before the range - } - if length <= 1 { - return fmt.Sprintf("%d", beginning) - } - return fmt.Sprintf("%d,%d", beginning, beginning+length-1) -} - -type ContextDiff UnifiedDiff - -// Compare two sequences of lines; generate the delta as a context diff. -// -// Context diffs are a compact way of showing line changes and a few -// lines of context. The number of context lines is set by diff.Context -// which defaults to three. -// -// By default, the diff control lines (those with *** or ---) are -// created with a trailing newline. -// -// For inputs that do not have trailing newlines, set the diff.Eol -// argument to "" so that the output will be uniformly newline free. -// -// The context diff format normally has a header for filenames and -// modification times. Any or all of these may be specified using -// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate. -// The modification times are normally expressed in the ISO 8601 format. -// If not specified, the strings default to blanks. -func WriteContextDiff(writer io.Writer, diff ContextDiff) error { - buf := bufio.NewWriter(writer) - defer buf.Flush() - var diffErr error - w := func(format string, args ...interface{}) { - _, err := buf.WriteString(fmt.Sprintf(format, args...)) - if diffErr == nil && err != nil { - diffErr = err - } - } - - if len(diff.Eol) == 0 { - diff.Eol = "\n" - } - - prefix := map[byte]string{ - 'i': "+ ", - 'd': "- ", - 'r': "! ", - 'e': " ", - } - - started := false - m := NewMatcher(diff.A, diff.B) - for _, g := range m.GetGroupedOpCodes(diff.Context) { - if !started { - started = true - fromDate := "" - if len(diff.FromDate) > 0 { - fromDate = "\t" + diff.FromDate - } - toDate := "" - if len(diff.ToDate) > 0 { - toDate = "\t" + diff.ToDate - } - w("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) - w("--- %s%s%s", diff.ToFile, toDate, diff.Eol) - } - - first, last := g[0], g[len(g)-1] - w("***************" + diff.Eol) - - range1 := formatRangeContext(first.I1, last.I2) - w("*** %s ****%s", range1, diff.Eol) - for _, c := range g { - if c.Tag == 'r' || c.Tag == 'd' { - for _, cc := range g { - if cc.Tag == 'i' { - continue - } - for _, line := range diff.A[cc.I1:cc.I2] { - w(prefix[cc.Tag] + line) - } - } - break - } - } - - range2 := formatRangeContext(first.J1, last.J2) - w("--- %s ----%s", range2, diff.Eol) - for _, c := range g { - if c.Tag == 'r' || c.Tag == 'i' { - for _, cc := range g { - if cc.Tag == 'd' { - continue - } - for _, line := range diff.B[cc.J1:cc.J2] { - w(prefix[cc.Tag] + line) - } - } - break - } - } - } - return diffErr -} - -// Like WriteContextDiff but returns the diff a string. -func GetContextDiffString(diff ContextDiff) (string, error) { - w := &bytes.Buffer{} - err := WriteContextDiff(w, diff) - return string(w.Bytes()), err -} - -// Split a string on "\n" while preserving them. The output can be used -// as input for UnifiedDiff and ContextDiff structures. -func SplitLines(s string) []string { - lines := strings.SplitAfter(s, "\n") - lines[len(lines)-1] += "\n" - return lines -} diff --git a/vendor/github.com/stretchr/testify/LICENSE b/vendor/github.com/stretchr/testify/LICENSE deleted file mode 100644 index 473b670..0000000 --- a/vendor/github.com/stretchr/testify/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell - -Please consider promoting this project if you find it useful. - -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/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go deleted file mode 100644 index 29b71d1..0000000 --- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ /dev/null @@ -1,346 +0,0 @@ -/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND - */ - -package assert - -import ( - http "net/http" - url "net/url" - time "time" -) - -// Condition uses a Comparison to assert a complex condition. -func (a *Assertions) Condition(comp Comparison, msgAndArgs ...interface{}) bool { - return Condition(a.t, comp, msgAndArgs...) -} - -// Contains asserts that the specified string, list(array, slice...) or map contains the -// specified substring or element. -// -// a.Contains("Hello World", "World", "But 'Hello World' does contain 'World'") -// a.Contains(["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") -// a.Contains({"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { - return Contains(a.t, s, contains, msgAndArgs...) -} - -// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// a.Empty(obj) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool { - return Empty(a.t, object, msgAndArgs...) -} - -// Equal asserts that two objects are equal. -// -// a.Equal(123, 123, "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { - return Equal(a.t, expected, actual, msgAndArgs...) -} - -// EqualError asserts that a function returned an error (i.e. not `nil`) -// and that it is equal to the provided error. -// -// actualObj, err := SomeFunction() -// a.EqualError(err, expectedErrorString, "An error was expected") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool { - return EqualError(a.t, theError, errString, msgAndArgs...) -} - -// EqualValues asserts that two objects are equal or convertable to the same types -// and equal. -// -// a.EqualValues(uint32(123), int32(123), "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { - return EqualValues(a.t, expected, actual, msgAndArgs...) -} - -// Error asserts that a function returned an error (i.e. not `nil`). -// -// actualObj, err := SomeFunction() -// if a.Error(err, "An error was expected") { -// assert.Equal(t, err, expectedError) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { - return Error(a.t, err, msgAndArgs...) -} - -// Exactly asserts that two objects are equal is value and type. -// -// a.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { - return Exactly(a.t, expected, actual, msgAndArgs...) -} - -// Fail reports a failure through -func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) bool { - return Fail(a.t, failureMessage, msgAndArgs...) -} - -// FailNow fails test -func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) bool { - return FailNow(a.t, failureMessage, msgAndArgs...) -} - -// False asserts that the specified value is false. -// -// a.False(myBool, "myBool should be false") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool { - return False(a.t, value, msgAndArgs...) -} - -// HTTPBodyContains asserts that a specified handler returns a -// body that contains a string. -// -// a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool { - return HTTPBodyContains(a.t, handler, method, url, values, str) -} - -// HTTPBodyNotContains asserts that a specified handler returns a -// body that does not contain a string. -// -// a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) bool { - return HTTPBodyNotContains(a.t, handler, method, url, values, str) -} - -// HTTPError asserts that a specified handler returns an error status code. -// -// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values) bool { - return HTTPError(a.t, handler, method, url, values) -} - -// HTTPRedirect asserts that a specified handler returns a redirect status code. -// -// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values) bool { - return HTTPRedirect(a.t, handler, method, url, values) -} - -// HTTPSuccess asserts that a specified handler returns a success status code. -// -// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values) bool { - return HTTPSuccess(a.t, handler, method, url, values) -} - -// Implements asserts that an object is implemented by the specified interface. -// -// a.Implements((*MyInterface)(nil), new(MyObject), "MyObject") -func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { - return Implements(a.t, interfaceObject, object, msgAndArgs...) -} - -// InDelta asserts that the two numerals are within delta of each other. -// -// a.InDelta(math.Pi, (22 / 7.0), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { - return InDelta(a.t, expected, actual, delta, msgAndArgs...) -} - -// InDeltaSlice is the same as InDelta, except it compares two slices. -func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { - return InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...) -} - -// InEpsilon asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { - return InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) -} - -// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. -func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { - return InEpsilonSlice(a.t, expected, actual, epsilon, msgAndArgs...) -} - -// IsType asserts that the specified objects are of the same type. -func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { - return IsType(a.t, expectedType, object, msgAndArgs...) -} - -// JSONEq asserts that two JSON strings are equivalent. -// -// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool { - return JSONEq(a.t, expected, actual, msgAndArgs...) -} - -// Len asserts that the specified object has specific length. -// Len also fails if the object has a type that len() not accept. -// -// a.Len(mySlice, 3, "The size of slice is not 3") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool { - return Len(a.t, object, length, msgAndArgs...) -} - -// Nil asserts that the specified object is nil. -// -// a.Nil(err, "err should be nothing") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool { - return Nil(a.t, object, msgAndArgs...) -} - -// NoError asserts that a function returned no error (i.e. `nil`). -// -// actualObj, err := SomeFunction() -// if a.NoError(err) { -// assert.Equal(t, actualObj, expectedObj) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool { - return NoError(a.t, err, msgAndArgs...) -} - -// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the -// specified substring or element. -// -// a.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") -// a.NotContains(["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") -// a.NotContains({"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { - return NotContains(a.t, s, contains, msgAndArgs...) -} - -// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// if a.NotEmpty(obj) { -// assert.Equal(t, "two", obj[1]) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool { - return NotEmpty(a.t, object, msgAndArgs...) -} - -// NotEqual asserts that the specified values are NOT equal. -// -// a.NotEqual(obj1, obj2, "two objects shouldn't be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { - return NotEqual(a.t, expected, actual, msgAndArgs...) -} - -// NotNil asserts that the specified object is not nil. -// -// a.NotNil(err, "err should be something") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool { - return NotNil(a.t, object, msgAndArgs...) -} - -// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. -// -// a.NotPanics(func(){ -// RemainCalm() -// }, "Calling RemainCalm() should NOT panic") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool { - return NotPanics(a.t, f, msgAndArgs...) -} - -// NotRegexp asserts that a specified regexp does not match a string. -// -// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") -// a.NotRegexp("^start", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { - return NotRegexp(a.t, rx, str, msgAndArgs...) -} - -// NotZero asserts that i is not the zero value for its type and returns the truth. -func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) bool { - return NotZero(a.t, i, msgAndArgs...) -} - -// Panics asserts that the code inside the specified PanicTestFunc panics. -// -// a.Panics(func(){ -// GoCrazy() -// }, "Calling GoCrazy() should panic") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool { - return Panics(a.t, f, msgAndArgs...) -} - -// Regexp asserts that a specified regexp matches a string. -// -// a.Regexp(regexp.MustCompile("start"), "it's starting") -// a.Regexp("start...$", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { - return Regexp(a.t, rx, str, msgAndArgs...) -} - -// True asserts that the specified value is true. -// -// a.True(myBool, "myBool should be true") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool { - return True(a.t, value, msgAndArgs...) -} - -// WithinDuration asserts that the two times are within duration delta of each other. -// -// a.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { - return WithinDuration(a.t, expected, actual, delta, msgAndArgs...) -} - -// Zero asserts that i is the zero value for its type and returns the truth. -func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) bool { - return Zero(a.t, i, msgAndArgs...) -} diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl b/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl deleted file mode 100644 index 99f9acf..0000000 --- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl +++ /dev/null @@ -1,4 +0,0 @@ -{{.CommentWithoutT "a"}} -func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { - return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) -} diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go deleted file mode 100644 index 2feb419..0000000 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ /dev/null @@ -1,1063 +0,0 @@ -package assert - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - "math" - "reflect" - "regexp" - "runtime" - "strings" - "time" - "unicode" - "unicode/utf8" - - "github.com/davecgh/go-spew/spew" - "github.com/pmezard/go-difflib/difflib" -) - -// TestingT is an interface wrapper around *testing.T -type TestingT interface { - Errorf(format string, args ...interface{}) -} - -// Comparison a custom function that returns true on success and false on failure -type Comparison func() (success bool) - -/* - Helper functions -*/ - -// ObjectsAreEqual determines if two objects are considered equal. -// -// This function does no assertion of any kind. -func ObjectsAreEqual(expected, actual interface{}) bool { - - if expected == nil || actual == nil { - return expected == actual - } - - return reflect.DeepEqual(expected, actual) - -} - -// ObjectsAreEqualValues gets whether two objects are equal, or if their -// values are equal. -func ObjectsAreEqualValues(expected, actual interface{}) bool { - if ObjectsAreEqual(expected, actual) { - return true - } - - actualType := reflect.TypeOf(actual) - if actualType == nil { - return false - } - expectedValue := reflect.ValueOf(expected) - if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) { - // Attempt comparison after type conversion - return reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual) - } - - return false -} - -/* CallerInfo is necessary because the assert functions use the testing object -internally, causing it to print the file:line of the assert method, rather than where -the problem actually occurred in calling code.*/ - -// CallerInfo returns an array of strings containing the file and line number -// of each stack frame leading from the current test to the assert call that -// failed. -func CallerInfo() []string { - - pc := uintptr(0) - file := "" - line := 0 - ok := false - name := "" - - callers := []string{} - for i := 0; ; i++ { - pc, file, line, ok = runtime.Caller(i) - if !ok { - // The breaks below failed to terminate the loop, and we ran off the - // end of the call stack. - break - } - - // This is a huge edge case, but it will panic if this is the case, see #180 - if file == "" { - break - } - - f := runtime.FuncForPC(pc) - if f == nil { - break - } - name = f.Name() - - // testing.tRunner is the standard library function that calls - // tests. Subtests are called directly by tRunner, without going through - // the Test/Benchmark/Example function that contains the t.Run calls, so - // with subtests we should break when we hit tRunner, without adding it - // to the list of callers. - if name == "testing.tRunner" { - break - } - - parts := strings.Split(file, "/") - dir := parts[len(parts)-2] - file = parts[len(parts)-1] - if (dir != "assert" && dir != "mock" && dir != "require") || file == "mock_test.go" { - callers = append(callers, fmt.Sprintf("%s:%d", file, line)) - } - - // Drop the package - segments := strings.Split(name, ".") - name = segments[len(segments)-1] - if isTest(name, "Test") || - isTest(name, "Benchmark") || - isTest(name, "Example") { - break - } - } - - return callers -} - -// Stolen from the `go test` tool. -// isTest tells whether name looks like a test (or benchmark, according to prefix). -// It is a Test (say) if there is a character after Test that is not a lower-case letter. -// We don't want TesticularCancer. -func isTest(name, prefix string) bool { - if !strings.HasPrefix(name, prefix) { - return false - } - if len(name) == len(prefix) { // "Test" is ok - return true - } - rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) - return !unicode.IsLower(rune) -} - -// getWhitespaceString returns a string that is long enough to overwrite the default -// output from the go testing framework. -func getWhitespaceString() string { - - _, file, line, ok := runtime.Caller(1) - if !ok { - return "" - } - parts := strings.Split(file, "/") - file = parts[len(parts)-1] - - return strings.Repeat(" ", len(fmt.Sprintf("%s:%d: ", file, line))) - -} - -func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { - if len(msgAndArgs) == 0 || msgAndArgs == nil { - return "" - } - if len(msgAndArgs) == 1 { - return msgAndArgs[0].(string) - } - if len(msgAndArgs) > 1 { - return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) - } - return "" -} - -// Indents all lines of the message by appending a number of tabs to each line, in an output format compatible with Go's -// test printing (see inner comment for specifics) -func indentMessageLines(message string, tabs int) string { - outBuf := new(bytes.Buffer) - - for i, scanner := 0, bufio.NewScanner(strings.NewReader(message)); scanner.Scan(); i++ { - if i != 0 { - outBuf.WriteRune('\n') - } - for ii := 0; ii < tabs; ii++ { - outBuf.WriteRune('\t') - // Bizarrely, all lines except the first need one fewer tabs prepended, so deliberately advance the counter - // by 1 prematurely. - if ii == 0 && i > 0 { - ii++ - } - } - outBuf.WriteString(scanner.Text()) - } - - return outBuf.String() -} - -type failNower interface { - FailNow() -} - -// FailNow fails test -func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { - Fail(t, failureMessage, msgAndArgs...) - - // We cannot extend TestingT with FailNow() and - // maintain backwards compatibility, so we fallback - // to panicking when FailNow is not available in - // TestingT. - // See issue #263 - - if t, ok := t.(failNower); ok { - t.FailNow() - } else { - panic("test failed and t is missing `FailNow()`") - } - return false -} - -// Fail reports a failure through -func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) bool { - - message := messageFromMsgAndArgs(msgAndArgs...) - - errorTrace := strings.Join(CallerInfo(), "\n\r\t\t\t") - if len(message) > 0 { - t.Errorf("\r%s\r\tError Trace:\t%s\n"+ - "\r\tError:%s\n"+ - "\r\tMessages:\t%s\n\r", - getWhitespaceString(), - errorTrace, - indentMessageLines(failureMessage, 2), - message) - } else { - t.Errorf("\r%s\r\tError Trace:\t%s\n"+ - "\r\tError:%s\n\r", - getWhitespaceString(), - errorTrace, - indentMessageLines(failureMessage, 2)) - } - - return false -} - -// Implements asserts that an object is implemented by the specified interface. -// -// assert.Implements(t, (*MyInterface)(nil), new(MyObject), "MyObject") -func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { - - interfaceType := reflect.TypeOf(interfaceObject).Elem() - - if !reflect.TypeOf(object).Implements(interfaceType) { - return Fail(t, fmt.Sprintf("%T must implement %v", object, interfaceType), msgAndArgs...) - } - - return true - -} - -// IsType asserts that the specified objects are of the same type. -func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { - - if !ObjectsAreEqual(reflect.TypeOf(object), reflect.TypeOf(expectedType)) { - return Fail(t, fmt.Sprintf("Object expected to be of type %v, but was %v", reflect.TypeOf(expectedType), reflect.TypeOf(object)), msgAndArgs...) - } - - return true -} - -// Equal asserts that two objects are equal. -// -// assert.Equal(t, 123, 123, "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func Equal(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { - - if !ObjectsAreEqual(expected, actual) { - diff := diff(expected, actual) - expected, actual = formatUnequalValues(expected, actual) - return Fail(t, fmt.Sprintf("Not equal: \n"+ - "expected: %s\n"+ - "received: %s%s", expected, actual, diff), msgAndArgs...) - } - - return true - -} - -// formatUnequalValues takes two values of arbitrary types and returns string -// representations appropriate to be presented to the user. -// -// If the values are not of like type, the returned strings will be prefixed -// with the type name, and the value will be enclosed in parenthesis similar -// to a type conversion in the Go grammar. -func formatUnequalValues(expected, actual interface{}) (e string, a string) { - aType := reflect.TypeOf(expected) - bType := reflect.TypeOf(actual) - - if aType != bType && isNumericType(aType) && isNumericType(bType) { - return fmt.Sprintf("%v(%#v)", aType, expected), - fmt.Sprintf("%v(%#v)", bType, actual) - } - - return fmt.Sprintf("%#v", expected), - fmt.Sprintf("%#v", actual) -} - -func isNumericType(t reflect.Type) bool { - switch t.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return true - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return true - case reflect.Float32, reflect.Float64: - return true - } - - return false -} - -// EqualValues asserts that two objects are equal or convertable to the same types -// and equal. -// -// assert.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { - - if !ObjectsAreEqualValues(expected, actual) { - diff := diff(expected, actual) - expected, actual = formatUnequalValues(expected, actual) - return Fail(t, fmt.Sprintf("Not equal: \n"+ - "expected: %s\n"+ - "received: %s%s", expected, actual, diff), msgAndArgs...) - } - - return true - -} - -// Exactly asserts that two objects are equal is value and type. -// -// assert.Exactly(t, int32(123), int64(123), "123 and 123 should NOT be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { - - aType := reflect.TypeOf(expected) - bType := reflect.TypeOf(actual) - - if aType != bType { - return Fail(t, fmt.Sprintf("Types expected to match exactly\n\r\t%v != %v", aType, bType), msgAndArgs...) - } - - return Equal(t, expected, actual, msgAndArgs...) - -} - -// NotNil asserts that the specified object is not nil. -// -// assert.NotNil(t, err, "err should be something") -// -// Returns whether the assertion was successful (true) or not (false). -func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - if !isNil(object) { - return true - } - return Fail(t, "Expected value not to be nil.", msgAndArgs...) -} - -// isNil checks if a specified object is nil or not, without Failing. -func isNil(object interface{}) bool { - if object == nil { - return true - } - - value := reflect.ValueOf(object) - kind := value.Kind() - if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() { - return true - } - - return false -} - -// Nil asserts that the specified object is nil. -// -// assert.Nil(t, err, "err should be nothing") -// -// Returns whether the assertion was successful (true) or not (false). -func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - if isNil(object) { - return true - } - return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...) -} - -var numericZeros = []interface{}{ - int(0), - int8(0), - int16(0), - int32(0), - int64(0), - uint(0), - uint8(0), - uint16(0), - uint32(0), - uint64(0), - float32(0), - float64(0), -} - -// isEmpty gets whether the specified object is considered empty or not. -func isEmpty(object interface{}) bool { - - if object == nil { - return true - } else if object == "" { - return true - } else if object == false { - return true - } - - for _, v := range numericZeros { - if object == v { - return true - } - } - - objValue := reflect.ValueOf(object) - - switch objValue.Kind() { - case reflect.Map: - fallthrough - case reflect.Slice, reflect.Chan: - { - return (objValue.Len() == 0) - } - case reflect.Struct: - switch object.(type) { - case time.Time: - return object.(time.Time).IsZero() - } - case reflect.Ptr: - { - if objValue.IsNil() { - return true - } - switch object.(type) { - case *time.Time: - return object.(*time.Time).IsZero() - default: - return false - } - } - } - return false -} - -// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// assert.Empty(t, obj) -// -// Returns whether the assertion was successful (true) or not (false). -func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - - pass := isEmpty(object) - if !pass { - Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...) - } - - return pass - -} - -// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// if assert.NotEmpty(t, obj) { -// assert.Equal(t, "two", obj[1]) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { - - pass := !isEmpty(object) - if !pass { - Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...) - } - - return pass - -} - -// getLen try to get length of object. -// return (false, 0) if impossible. -func getLen(x interface{}) (ok bool, length int) { - v := reflect.ValueOf(x) - defer func() { - if e := recover(); e != nil { - ok = false - } - }() - return true, v.Len() -} - -// Len asserts that the specified object has specific length. -// Len also fails if the object has a type that len() not accept. -// -// assert.Len(t, mySlice, 3, "The size of slice is not 3") -// -// Returns whether the assertion was successful (true) or not (false). -func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool { - ok, l := getLen(object) - if !ok { - return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", object), msgAndArgs...) - } - - if l != length { - return Fail(t, fmt.Sprintf("\"%s\" should have %d item(s), but has %d", object, length, l), msgAndArgs...) - } - return true -} - -// True asserts that the specified value is true. -// -// assert.True(t, myBool, "myBool should be true") -// -// Returns whether the assertion was successful (true) or not (false). -func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { - - if value != true { - return Fail(t, "Should be true", msgAndArgs...) - } - - return true - -} - -// False asserts that the specified value is false. -// -// assert.False(t, myBool, "myBool should be false") -// -// Returns whether the assertion was successful (true) or not (false). -func False(t TestingT, value bool, msgAndArgs ...interface{}) bool { - - if value != false { - return Fail(t, "Should be false", msgAndArgs...) - } - - return true - -} - -// NotEqual asserts that the specified values are NOT equal. -// -// assert.NotEqual(t, obj1, obj2, "two objects shouldn't be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { - - if ObjectsAreEqual(expected, actual) { - return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) - } - - return true - -} - -// containsElement try loop over the list check if the list includes the element. -// return (false, false) if impossible. -// return (true, false) if element was not found. -// return (true, true) if element was found. -func includeElement(list interface{}, element interface{}) (ok, found bool) { - - listValue := reflect.ValueOf(list) - elementValue := reflect.ValueOf(element) - defer func() { - if e := recover(); e != nil { - ok = false - found = false - } - }() - - if reflect.TypeOf(list).Kind() == reflect.String { - return true, strings.Contains(listValue.String(), elementValue.String()) - } - - if reflect.TypeOf(list).Kind() == reflect.Map { - mapKeys := listValue.MapKeys() - for i := 0; i < len(mapKeys); i++ { - if ObjectsAreEqual(mapKeys[i].Interface(), element) { - return true, true - } - } - return true, false - } - - for i := 0; i < listValue.Len(); i++ { - if ObjectsAreEqual(listValue.Index(i).Interface(), element) { - return true, true - } - } - return true, false - -} - -// Contains asserts that the specified string, list(array, slice...) or map contains the -// specified substring or element. -// -// assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'") -// assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") -// assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") -// -// Returns whether the assertion was successful (true) or not (false). -func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { - - ok, found := includeElement(s, contains) - if !ok { - return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) - } - if !found { - return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", s, contains), msgAndArgs...) - } - - return true - -} - -// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the -// specified substring or element. -// -// assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") -// assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") -// assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") -// -// Returns whether the assertion was successful (true) or not (false). -func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { - - ok, found := includeElement(s, contains) - if !ok { - return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) - } - if found { - return Fail(t, fmt.Sprintf("\"%s\" should not contain \"%s\"", s, contains), msgAndArgs...) - } - - return true - -} - -// Condition uses a Comparison to assert a complex condition. -func Condition(t TestingT, comp Comparison, msgAndArgs ...interface{}) bool { - result := comp() - if !result { - Fail(t, "Condition failed!", msgAndArgs...) - } - return result -} - -// PanicTestFunc defines a func that should be passed to the assert.Panics and assert.NotPanics -// methods, and represents a simple func that takes no arguments, and returns nothing. -type PanicTestFunc func() - -// didPanic returns true if the function passed to it panics. Otherwise, it returns false. -func didPanic(f PanicTestFunc) (bool, interface{}) { - - didPanic := false - var message interface{} - func() { - - defer func() { - if message = recover(); message != nil { - didPanic = true - } - }() - - // call the target function - f() - - }() - - return didPanic, message - -} - -// Panics asserts that the code inside the specified PanicTestFunc panics. -// -// assert.Panics(t, func(){ -// GoCrazy() -// }, "Calling GoCrazy() should panic") -// -// Returns whether the assertion was successful (true) or not (false). -func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { - - if funcDidPanic, panicValue := didPanic(f); !funcDidPanic { - return Fail(t, fmt.Sprintf("func %#v should panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...) - } - - return true -} - -// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. -// -// assert.NotPanics(t, func(){ -// RemainCalm() -// }, "Calling RemainCalm() should NOT panic") -// -// Returns whether the assertion was successful (true) or not (false). -func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { - - if funcDidPanic, panicValue := didPanic(f); funcDidPanic { - return Fail(t, fmt.Sprintf("func %#v should not panic\n\r\tPanic value:\t%v", f, panicValue), msgAndArgs...) - } - - return true -} - -// WithinDuration asserts that the two times are within duration delta of each other. -// -// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") -// -// Returns whether the assertion was successful (true) or not (false). -func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { - - dt := expected.Sub(actual) - if dt < -delta || dt > delta { - return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) - } - - return true -} - -func toFloat(x interface{}) (float64, bool) { - var xf float64 - xok := true - - switch xn := x.(type) { - case uint8: - xf = float64(xn) - case uint16: - xf = float64(xn) - case uint32: - xf = float64(xn) - case uint64: - xf = float64(xn) - case int: - xf = float64(xn) - case int8: - xf = float64(xn) - case int16: - xf = float64(xn) - case int32: - xf = float64(xn) - case int64: - xf = float64(xn) - case float32: - xf = float64(xn) - case float64: - xf = float64(xn) - default: - xok = false - } - - return xf, xok -} - -// InDelta asserts that the two numerals are within delta of each other. -// -// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). -func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { - - af, aok := toFloat(expected) - bf, bok := toFloat(actual) - - if !aok || !bok { - return Fail(t, fmt.Sprintf("Parameters must be numerical"), msgAndArgs...) - } - - if math.IsNaN(af) { - return Fail(t, fmt.Sprintf("Actual must not be NaN"), msgAndArgs...) - } - - if math.IsNaN(bf) { - return Fail(t, fmt.Sprintf("Expected %v with delta %v, but was NaN", expected, delta), msgAndArgs...) - } - - dt := af - bf - if dt < -delta || dt > delta { - return Fail(t, fmt.Sprintf("Max difference between %v and %v allowed is %v, but difference was %v", expected, actual, delta, dt), msgAndArgs...) - } - - return true -} - -// InDeltaSlice is the same as InDelta, except it compares two slices. -func InDeltaSlice(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { - if expected == nil || actual == nil || - reflect.TypeOf(actual).Kind() != reflect.Slice || - reflect.TypeOf(expected).Kind() != reflect.Slice { - return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...) - } - - actualSlice := reflect.ValueOf(actual) - expectedSlice := reflect.ValueOf(expected) - - for i := 0; i < actualSlice.Len(); i++ { - result := InDelta(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), delta) - if !result { - return result - } - } - - return true -} - -func calcRelativeError(expected, actual interface{}) (float64, error) { - af, aok := toFloat(expected) - if !aok { - return 0, fmt.Errorf("expected value %q cannot be converted to float", expected) - } - if af == 0 { - return 0, fmt.Errorf("expected value must have a value other than zero to calculate the relative error") - } - bf, bok := toFloat(actual) - if !bok { - return 0, fmt.Errorf("expected value %q cannot be converted to float", actual) - } - - return math.Abs(af-bf) / math.Abs(af), nil -} - -// InEpsilon asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). -func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { - actualEpsilon, err := calcRelativeError(expected, actual) - if err != nil { - return Fail(t, err.Error(), msgAndArgs...) - } - if actualEpsilon > epsilon { - return Fail(t, fmt.Sprintf("Relative error is too high: %#v (expected)\n"+ - " < %#v (actual)", actualEpsilon, epsilon), msgAndArgs...) - } - - return true -} - -// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. -func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, msgAndArgs ...interface{}) bool { - if expected == nil || actual == nil || - reflect.TypeOf(actual).Kind() != reflect.Slice || - reflect.TypeOf(expected).Kind() != reflect.Slice { - return Fail(t, fmt.Sprintf("Parameters must be slice"), msgAndArgs...) - } - - actualSlice := reflect.ValueOf(actual) - expectedSlice := reflect.ValueOf(expected) - - for i := 0; i < actualSlice.Len(); i++ { - result := InEpsilon(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), epsilon) - if !result { - return result - } - } - - return true -} - -/* - Errors -*/ - -// NoError asserts that a function returned no error (i.e. `nil`). -// -// actualObj, err := SomeFunction() -// if assert.NoError(t, err) { -// assert.Equal(t, actualObj, expectedObj) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { - if err != nil { - return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...) - } - - return true -} - -// Error asserts that a function returned an error (i.e. not `nil`). -// -// actualObj, err := SomeFunction() -// if assert.Error(t, err, "An error was expected") { -// assert.Equal(t, err, expectedError) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { - - if err == nil { - return Fail(t, "An error is expected but got nil.", msgAndArgs...) - } - - return true -} - -// EqualError asserts that a function returned an error (i.e. not `nil`) -// and that it is equal to the provided error. -// -// actualObj, err := SomeFunction() -// assert.EqualError(t, err, expectedErrorString, "An error was expected") -// -// Returns whether the assertion was successful (true) or not (false). -func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool { - if !Error(t, theError, msgAndArgs...) { - return false - } - expected := errString - actual := theError.Error() - // don't need to use deep equals here, we know they are both strings - if expected != actual { - return Fail(t, fmt.Sprintf("Error message not equal:\n"+ - "expected: %q\n"+ - "received: %q", expected, actual), msgAndArgs...) - } - return true -} - -// matchRegexp return true if a specified regexp matches a string. -func matchRegexp(rx interface{}, str interface{}) bool { - - var r *regexp.Regexp - if rr, ok := rx.(*regexp.Regexp); ok { - r = rr - } else { - r = regexp.MustCompile(fmt.Sprint(rx)) - } - - return (r.FindStringIndex(fmt.Sprint(str)) != nil) - -} - -// Regexp asserts that a specified regexp matches a string. -// -// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") -// assert.Regexp(t, "start...$", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { - - match := matchRegexp(rx, str) - - if !match { - Fail(t, fmt.Sprintf("Expect \"%v\" to match \"%v\"", str, rx), msgAndArgs...) - } - - return match -} - -// NotRegexp asserts that a specified regexp does not match a string. -// -// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") -// assert.NotRegexp(t, "^start", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { - match := matchRegexp(rx, str) - - if match { - Fail(t, fmt.Sprintf("Expect \"%v\" to NOT match \"%v\"", str, rx), msgAndArgs...) - } - - return !match - -} - -// Zero asserts that i is the zero value for its type and returns the truth. -func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { - if i != nil && !reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { - return Fail(t, fmt.Sprintf("Should be zero, but was %v", i), msgAndArgs...) - } - return true -} - -// NotZero asserts that i is not the zero value for its type and returns the truth. -func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) bool { - if i == nil || reflect.DeepEqual(i, reflect.Zero(reflect.TypeOf(i)).Interface()) { - return Fail(t, fmt.Sprintf("Should not be zero, but was %v", i), msgAndArgs...) - } - return true -} - -// JSONEq asserts that two JSON strings are equivalent. -// -// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) -// -// Returns whether the assertion was successful (true) or not (false). -func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { - var expectedJSONAsInterface, actualJSONAsInterface interface{} - - if err := json.Unmarshal([]byte(expected), &expectedJSONAsInterface); err != nil { - return Fail(t, fmt.Sprintf("Expected value ('%s') is not valid json.\nJSON parsing error: '%s'", expected, err.Error()), msgAndArgs...) - } - - if err := json.Unmarshal([]byte(actual), &actualJSONAsInterface); err != nil { - return Fail(t, fmt.Sprintf("Input ('%s') needs to be valid json.\nJSON parsing error: '%s'", actual, err.Error()), msgAndArgs...) - } - - return Equal(t, expectedJSONAsInterface, actualJSONAsInterface, msgAndArgs...) -} - -func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { - t := reflect.TypeOf(v) - k := t.Kind() - - if k == reflect.Ptr { - t = t.Elem() - k = t.Kind() - } - return t, k -} - -// diff returns a diff of both values as long as both are of the same type and -// are a struct, map, slice or array. Otherwise it returns an empty string. -func diff(expected interface{}, actual interface{}) string { - if expected == nil || actual == nil { - return "" - } - - et, ek := typeAndKind(expected) - at, _ := typeAndKind(actual) - - if et != at { - return "" - } - - if ek != reflect.Struct && ek != reflect.Map && ek != reflect.Slice && ek != reflect.Array { - return "" - } - - e := spewConfig.Sdump(expected) - a := spewConfig.Sdump(actual) - - diff, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ - A: difflib.SplitLines(e), - B: difflib.SplitLines(a), - FromFile: "Expected", - FromDate: "", - ToFile: "Actual", - ToDate: "", - Context: 1, - }) - - return "\n\nDiff:\n" + diff -} - -var spewConfig = spew.ConfigState{ - Indent: " ", - DisablePointerAddresses: true, - DisableCapacities: true, - SortKeys: true, -} diff --git a/vendor/github.com/stretchr/testify/assert/assertions_test.go b/vendor/github.com/stretchr/testify/assert/assertions_test.go deleted file mode 100644 index ac9b701..0000000 --- a/vendor/github.com/stretchr/testify/assert/assertions_test.go +++ /dev/null @@ -1,1210 +0,0 @@ -package assert - -import ( - "errors" - "io" - "math" - "os" - "reflect" - "regexp" - "testing" - "time" -) - -var ( - i interface{} - zeros = []interface{}{ - false, - byte(0), - complex64(0), - complex128(0), - float32(0), - float64(0), - int(0), - int8(0), - int16(0), - int32(0), - int64(0), - rune(0), - uint(0), - uint8(0), - uint16(0), - uint32(0), - uint64(0), - uintptr(0), - "", - [0]interface{}{}, - []interface{}(nil), - struct{ x int }{}, - (*interface{})(nil), - (func())(nil), - nil, - interface{}(nil), - map[interface{}]interface{}(nil), - (chan interface{})(nil), - (<-chan interface{})(nil), - (chan<- interface{})(nil), - } - nonZeros = []interface{}{ - true, - byte(1), - complex64(1), - complex128(1), - float32(1), - float64(1), - int(1), - int8(1), - int16(1), - int32(1), - int64(1), - rune(1), - uint(1), - uint8(1), - uint16(1), - uint32(1), - uint64(1), - uintptr(1), - "s", - [1]interface{}{1}, - []interface{}{}, - struct{ x int }{1}, - (*interface{})(&i), - (func())(func() {}), - interface{}(1), - map[interface{}]interface{}{}, - (chan interface{})(make(chan interface{})), - (<-chan interface{})(make(chan interface{})), - (chan<- interface{})(make(chan interface{})), - } -) - -// AssertionTesterInterface defines an interface to be used for testing assertion methods -type AssertionTesterInterface interface { - TestMethod() -} - -// AssertionTesterConformingObject is an object that conforms to the AssertionTesterInterface interface -type AssertionTesterConformingObject struct { -} - -func (a *AssertionTesterConformingObject) TestMethod() { -} - -// AssertionTesterNonConformingObject is an object that does not conform to the AssertionTesterInterface interface -type AssertionTesterNonConformingObject struct { -} - -func TestObjectsAreEqual(t *testing.T) { - - if !ObjectsAreEqual("Hello World", "Hello World") { - t.Error("objectsAreEqual should return true") - } - if !ObjectsAreEqual(123, 123) { - t.Error("objectsAreEqual should return true") - } - if !ObjectsAreEqual(123.5, 123.5) { - t.Error("objectsAreEqual should return true") - } - if !ObjectsAreEqual([]byte("Hello World"), []byte("Hello World")) { - t.Error("objectsAreEqual should return true") - } - if !ObjectsAreEqual(nil, nil) { - t.Error("objectsAreEqual should return true") - } - if ObjectsAreEqual(map[int]int{5: 10}, map[int]int{10: 20}) { - t.Error("objectsAreEqual should return false") - } - if ObjectsAreEqual('x', "x") { - t.Error("objectsAreEqual should return false") - } - if ObjectsAreEqual("x", 'x') { - t.Error("objectsAreEqual should return false") - } - if ObjectsAreEqual(0, 0.1) { - t.Error("objectsAreEqual should return false") - } - if ObjectsAreEqual(0.1, 0) { - t.Error("objectsAreEqual should return false") - } - if ObjectsAreEqual(uint32(10), int32(10)) { - t.Error("objectsAreEqual should return false") - } - if !ObjectsAreEqualValues(uint32(10), int32(10)) { - t.Error("ObjectsAreEqualValues should return true") - } - if ObjectsAreEqualValues(0, nil) { - t.Fail() - } - if ObjectsAreEqualValues(nil, 0) { - t.Fail() - } - -} - -func TestImplements(t *testing.T) { - - mockT := new(testing.T) - - if !Implements(mockT, (*AssertionTesterInterface)(nil), new(AssertionTesterConformingObject)) { - t.Error("Implements method should return true: AssertionTesterConformingObject implements AssertionTesterInterface") - } - if Implements(mockT, (*AssertionTesterInterface)(nil), new(AssertionTesterNonConformingObject)) { - t.Error("Implements method should return false: AssertionTesterNonConformingObject does not implements AssertionTesterInterface") - } - -} - -func TestIsType(t *testing.T) { - - mockT := new(testing.T) - - if !IsType(mockT, new(AssertionTesterConformingObject), new(AssertionTesterConformingObject)) { - t.Error("IsType should return true: AssertionTesterConformingObject is the same type as AssertionTesterConformingObject") - } - if IsType(mockT, new(AssertionTesterConformingObject), new(AssertionTesterNonConformingObject)) { - t.Error("IsType should return false: AssertionTesterConformingObject is not the same type as AssertionTesterNonConformingObject") - } - -} - -func TestEqual(t *testing.T) { - - mockT := new(testing.T) - - if !Equal(mockT, "Hello World", "Hello World") { - t.Error("Equal should return true") - } - if !Equal(mockT, 123, 123) { - t.Error("Equal should return true") - } - if !Equal(mockT, 123.5, 123.5) { - t.Error("Equal should return true") - } - if !Equal(mockT, []byte("Hello World"), []byte("Hello World")) { - t.Error("Equal should return true") - } - if !Equal(mockT, nil, nil) { - t.Error("Equal should return true") - } - if !Equal(mockT, int32(123), int32(123)) { - t.Error("Equal should return true") - } - if !Equal(mockT, uint64(123), uint64(123)) { - t.Error("Equal should return true") - } - -} - -func TestFormatUnequalValues(t *testing.T) { - expected, actual := formatUnequalValues("foo", "bar") - Equal(t, `"foo"`, expected, "value should not include type") - Equal(t, `"bar"`, actual, "value should not include type") - - expected, actual = formatUnequalValues(123, 123) - Equal(t, `123`, expected, "value should not include type") - Equal(t, `123`, actual, "value should not include type") - - expected, actual = formatUnequalValues(int64(123), int32(123)) - Equal(t, `int64(123)`, expected, "value should include type") - Equal(t, `int32(123)`, actual, "value should include type") - - type testStructType struct { - Val string - } - - expected, actual = formatUnequalValues(&testStructType{Val: "test"}, &testStructType{Val: "test"}) - Equal(t, `&assert.testStructType{Val:"test"}`, expected, "value should not include type annotation") - Equal(t, `&assert.testStructType{Val:"test"}`, actual, "value should not include type annotation") -} - -func TestNotNil(t *testing.T) { - - mockT := new(testing.T) - - if !NotNil(mockT, new(AssertionTesterConformingObject)) { - t.Error("NotNil should return true: object is not nil") - } - if NotNil(mockT, nil) { - t.Error("NotNil should return false: object is nil") - } - if NotNil(mockT, (*struct{})(nil)) { - t.Error("NotNil should return false: object is (*struct{})(nil)") - } - -} - -func TestNil(t *testing.T) { - - mockT := new(testing.T) - - if !Nil(mockT, nil) { - t.Error("Nil should return true: object is nil") - } - if !Nil(mockT, (*struct{})(nil)) { - t.Error("Nil should return true: object is (*struct{})(nil)") - } - if Nil(mockT, new(AssertionTesterConformingObject)) { - t.Error("Nil should return false: object is not nil") - } - -} - -func TestTrue(t *testing.T) { - - mockT := new(testing.T) - - if !True(mockT, true) { - t.Error("True should return true") - } - if True(mockT, false) { - t.Error("True should return false") - } - -} - -func TestFalse(t *testing.T) { - - mockT := new(testing.T) - - if !False(mockT, false) { - t.Error("False should return true") - } - if False(mockT, true) { - t.Error("False should return false") - } - -} - -func TestExactly(t *testing.T) { - - mockT := new(testing.T) - - a := float32(1) - b := float64(1) - c := float32(1) - d := float32(2) - - if Exactly(mockT, a, b) { - t.Error("Exactly should return false") - } - if Exactly(mockT, a, d) { - t.Error("Exactly should return false") - } - if !Exactly(mockT, a, c) { - t.Error("Exactly should return true") - } - - if Exactly(mockT, nil, a) { - t.Error("Exactly should return false") - } - if Exactly(mockT, a, nil) { - t.Error("Exactly should return false") - } - -} - -func TestNotEqual(t *testing.T) { - - mockT := new(testing.T) - - if !NotEqual(mockT, "Hello World", "Hello World!") { - t.Error("NotEqual should return true") - } - if !NotEqual(mockT, 123, 1234) { - t.Error("NotEqual should return true") - } - if !NotEqual(mockT, 123.5, 123.55) { - t.Error("NotEqual should return true") - } - if !NotEqual(mockT, []byte("Hello World"), []byte("Hello World!")) { - t.Error("NotEqual should return true") - } - if !NotEqual(mockT, nil, new(AssertionTesterConformingObject)) { - t.Error("NotEqual should return true") - } - funcA := func() int { return 23 } - funcB := func() int { return 42 } - if !NotEqual(mockT, funcA, funcB) { - t.Error("NotEqual should return true") - } - - if NotEqual(mockT, "Hello World", "Hello World") { - t.Error("NotEqual should return false") - } - if NotEqual(mockT, 123, 123) { - t.Error("NotEqual should return false") - } - if NotEqual(mockT, 123.5, 123.5) { - t.Error("NotEqual should return false") - } - if NotEqual(mockT, []byte("Hello World"), []byte("Hello World")) { - t.Error("NotEqual should return false") - } - if NotEqual(mockT, new(AssertionTesterConformingObject), new(AssertionTesterConformingObject)) { - t.Error("NotEqual should return false") - } -} - -type A struct { - Name, Value string -} - -func TestContains(t *testing.T) { - - mockT := new(testing.T) - list := []string{"Foo", "Bar"} - complexList := []*A{ - {"b", "c"}, - {"d", "e"}, - {"g", "h"}, - {"j", "k"}, - } - simpleMap := map[interface{}]interface{}{"Foo": "Bar"} - - if !Contains(mockT, "Hello World", "Hello") { - t.Error("Contains should return true: \"Hello World\" contains \"Hello\"") - } - if Contains(mockT, "Hello World", "Salut") { - t.Error("Contains should return false: \"Hello World\" does not contain \"Salut\"") - } - - if !Contains(mockT, list, "Bar") { - t.Error("Contains should return true: \"[\"Foo\", \"Bar\"]\" contains \"Bar\"") - } - if Contains(mockT, list, "Salut") { - t.Error("Contains should return false: \"[\"Foo\", \"Bar\"]\" does not contain \"Salut\"") - } - if !Contains(mockT, complexList, &A{"g", "h"}) { - t.Error("Contains should return true: complexList contains {\"g\", \"h\"}") - } - if Contains(mockT, complexList, &A{"g", "e"}) { - t.Error("Contains should return false: complexList contains {\"g\", \"e\"}") - } - if Contains(mockT, complexList, &A{"g", "e"}) { - t.Error("Contains should return false: complexList contains {\"g\", \"e\"}") - } - if !Contains(mockT, simpleMap, "Foo") { - t.Error("Contains should return true: \"{\"Foo\": \"Bar\"}\" contains \"Foo\"") - } - if Contains(mockT, simpleMap, "Bar") { - t.Error("Contains should return false: \"{\"Foo\": \"Bar\"}\" does not contains \"Bar\"") - } -} - -func TestNotContains(t *testing.T) { - - mockT := new(testing.T) - list := []string{"Foo", "Bar"} - simpleMap := map[interface{}]interface{}{"Foo": "Bar"} - - if !NotContains(mockT, "Hello World", "Hello!") { - t.Error("NotContains should return true: \"Hello World\" does not contain \"Hello!\"") - } - if NotContains(mockT, "Hello World", "Hello") { - t.Error("NotContains should return false: \"Hello World\" contains \"Hello\"") - } - - if !NotContains(mockT, list, "Foo!") { - t.Error("NotContains should return true: \"[\"Foo\", \"Bar\"]\" does not contain \"Foo!\"") - } - if NotContains(mockT, list, "Foo") { - t.Error("NotContains should return false: \"[\"Foo\", \"Bar\"]\" contains \"Foo\"") - } - if NotContains(mockT, simpleMap, "Foo") { - t.Error("Contains should return true: \"{\"Foo\": \"Bar\"}\" contains \"Foo\"") - } - if !NotContains(mockT, simpleMap, "Bar") { - t.Error("Contains should return false: \"{\"Foo\": \"Bar\"}\" does not contains \"Bar\"") - } -} - -func Test_includeElement(t *testing.T) { - - list1 := []string{"Foo", "Bar"} - list2 := []int{1, 2} - simpleMap := map[interface{}]interface{}{"Foo": "Bar"} - - ok, found := includeElement("Hello World", "World") - True(t, ok) - True(t, found) - - ok, found = includeElement(list1, "Foo") - True(t, ok) - True(t, found) - - ok, found = includeElement(list1, "Bar") - True(t, ok) - True(t, found) - - ok, found = includeElement(list2, 1) - True(t, ok) - True(t, found) - - ok, found = includeElement(list2, 2) - True(t, ok) - True(t, found) - - ok, found = includeElement(list1, "Foo!") - True(t, ok) - False(t, found) - - ok, found = includeElement(list2, 3) - True(t, ok) - False(t, found) - - ok, found = includeElement(list2, "1") - True(t, ok) - False(t, found) - - ok, found = includeElement(simpleMap, "Foo") - True(t, ok) - True(t, found) - - ok, found = includeElement(simpleMap, "Bar") - True(t, ok) - False(t, found) - - ok, found = includeElement(1433, "1") - False(t, ok) - False(t, found) -} - -func TestCondition(t *testing.T) { - mockT := new(testing.T) - - if !Condition(mockT, func() bool { return true }, "Truth") { - t.Error("Condition should return true") - } - - if Condition(mockT, func() bool { return false }, "Lie") { - t.Error("Condition should return false") - } - -} - -func TestDidPanic(t *testing.T) { - - if funcDidPanic, _ := didPanic(func() { - panic("Panic!") - }); !funcDidPanic { - t.Error("didPanic should return true") - } - - if funcDidPanic, _ := didPanic(func() { - }); funcDidPanic { - t.Error("didPanic should return false") - } - -} - -func TestPanics(t *testing.T) { - - mockT := new(testing.T) - - if !Panics(mockT, func() { - panic("Panic!") - }) { - t.Error("Panics should return true") - } - - if Panics(mockT, func() { - }) { - t.Error("Panics should return false") - } - -} - -func TestNotPanics(t *testing.T) { - - mockT := new(testing.T) - - if !NotPanics(mockT, func() { - }) { - t.Error("NotPanics should return true") - } - - if NotPanics(mockT, func() { - panic("Panic!") - }) { - t.Error("NotPanics should return false") - } - -} - -func TestNoError(t *testing.T) { - - mockT := new(testing.T) - - // start with a nil error - var err error - - True(t, NoError(mockT, err), "NoError should return True for nil arg") - - // now set an error - err = errors.New("some error") - - False(t, NoError(mockT, err), "NoError with error should return False") - - // returning an empty error interface - err = func() error { - var err *customError - if err != nil { - t.Fatal("err should be nil here") - } - return err - }() - - if err == nil { // err is not nil here! - t.Errorf("Error should be nil due to empty interface", err) - } - - False(t, NoError(mockT, err), "NoError should fail with empty error interface") -} - -type customError struct{} - -func (*customError) Error() string { return "fail" } - -func TestError(t *testing.T) { - - mockT := new(testing.T) - - // start with a nil error - var err error - - False(t, Error(mockT, err), "Error should return False for nil arg") - - // now set an error - err = errors.New("some error") - - True(t, Error(mockT, err), "Error with error should return True") - - // returning an empty error interface - err = func() error { - var err *customError - if err != nil { - t.Fatal("err should be nil here") - } - return err - }() - - if err == nil { // err is not nil here! - t.Errorf("Error should be nil due to empty interface", err) - } - - True(t, Error(mockT, err), "Error should pass with empty error interface") -} - -func TestEqualError(t *testing.T) { - mockT := new(testing.T) - - // start with a nil error - var err error - False(t, EqualError(mockT, err, ""), - "EqualError should return false for nil arg") - - // now set an error - err = errors.New("some error") - False(t, EqualError(mockT, err, "Not some error"), - "EqualError should return false for different error string") - True(t, EqualError(mockT, err, "some error"), - "EqualError should return true") -} - -func Test_isEmpty(t *testing.T) { - - chWithValue := make(chan struct{}, 1) - chWithValue <- struct{}{} - - True(t, isEmpty("")) - True(t, isEmpty(nil)) - True(t, isEmpty([]string{})) - True(t, isEmpty(0)) - True(t, isEmpty(int32(0))) - True(t, isEmpty(int64(0))) - True(t, isEmpty(false)) - True(t, isEmpty(map[string]string{})) - True(t, isEmpty(new(time.Time))) - True(t, isEmpty(time.Time{})) - True(t, isEmpty(make(chan struct{}))) - False(t, isEmpty("something")) - False(t, isEmpty(errors.New("something"))) - False(t, isEmpty([]string{"something"})) - False(t, isEmpty(1)) - False(t, isEmpty(true)) - False(t, isEmpty(map[string]string{"Hello": "World"})) - False(t, isEmpty(chWithValue)) - -} - -func TestEmpty(t *testing.T) { - - mockT := new(testing.T) - chWithValue := make(chan struct{}, 1) - chWithValue <- struct{}{} - var tiP *time.Time - var tiNP time.Time - var s *string - var f *os.File - - True(t, Empty(mockT, ""), "Empty string is empty") - True(t, Empty(mockT, nil), "Nil is empty") - True(t, Empty(mockT, []string{}), "Empty string array is empty") - True(t, Empty(mockT, 0), "Zero int value is empty") - True(t, Empty(mockT, false), "False value is empty") - True(t, Empty(mockT, make(chan struct{})), "Channel without values is empty") - True(t, Empty(mockT, s), "Nil string pointer is empty") - True(t, Empty(mockT, f), "Nil os.File pointer is empty") - True(t, Empty(mockT, tiP), "Nil time.Time pointer is empty") - True(t, Empty(mockT, tiNP), "time.Time is empty") - - False(t, Empty(mockT, "something"), "Non Empty string is not empty") - False(t, Empty(mockT, errors.New("something")), "Non nil object is not empty") - False(t, Empty(mockT, []string{"something"}), "Non empty string array is not empty") - False(t, Empty(mockT, 1), "Non-zero int value is not empty") - False(t, Empty(mockT, true), "True value is not empty") - False(t, Empty(mockT, chWithValue), "Channel with values is not empty") -} - -func TestNotEmpty(t *testing.T) { - - mockT := new(testing.T) - chWithValue := make(chan struct{}, 1) - chWithValue <- struct{}{} - - False(t, NotEmpty(mockT, ""), "Empty string is empty") - False(t, NotEmpty(mockT, nil), "Nil is empty") - False(t, NotEmpty(mockT, []string{}), "Empty string array is empty") - False(t, NotEmpty(mockT, 0), "Zero int value is empty") - False(t, NotEmpty(mockT, false), "False value is empty") - False(t, NotEmpty(mockT, make(chan struct{})), "Channel without values is empty") - - True(t, NotEmpty(mockT, "something"), "Non Empty string is not empty") - True(t, NotEmpty(mockT, errors.New("something")), "Non nil object is not empty") - True(t, NotEmpty(mockT, []string{"something"}), "Non empty string array is not empty") - True(t, NotEmpty(mockT, 1), "Non-zero int value is not empty") - True(t, NotEmpty(mockT, true), "True value is not empty") - True(t, NotEmpty(mockT, chWithValue), "Channel with values is not empty") -} - -func Test_getLen(t *testing.T) { - falseCases := []interface{}{ - nil, - 0, - true, - false, - 'A', - struct{}{}, - } - for _, v := range falseCases { - ok, l := getLen(v) - False(t, ok, "Expected getLen fail to get length of %#v", v) - Equal(t, 0, l, "getLen should return 0 for %#v", v) - } - - ch := make(chan int, 5) - ch <- 1 - ch <- 2 - ch <- 3 - trueCases := []struct { - v interface{} - l int - }{ - {[]int{1, 2, 3}, 3}, - {[...]int{1, 2, 3}, 3}, - {"ABC", 3}, - {map[int]int{1: 2, 2: 4, 3: 6}, 3}, - {ch, 3}, - - {[]int{}, 0}, - {map[int]int{}, 0}, - {make(chan int), 0}, - - {[]int(nil), 0}, - {map[int]int(nil), 0}, - {(chan int)(nil), 0}, - } - - for _, c := range trueCases { - ok, l := getLen(c.v) - True(t, ok, "Expected getLen success to get length of %#v", c.v) - Equal(t, c.l, l) - } -} - -func TestLen(t *testing.T) { - mockT := new(testing.T) - - False(t, Len(mockT, nil, 0), "nil does not have length") - False(t, Len(mockT, 0, 0), "int does not have length") - False(t, Len(mockT, true, 0), "true does not have length") - False(t, Len(mockT, false, 0), "false does not have length") - False(t, Len(mockT, 'A', 0), "Rune does not have length") - False(t, Len(mockT, struct{}{}, 0), "Struct does not have length") - - ch := make(chan int, 5) - ch <- 1 - ch <- 2 - ch <- 3 - - cases := []struct { - v interface{} - l int - }{ - {[]int{1, 2, 3}, 3}, - {[...]int{1, 2, 3}, 3}, - {"ABC", 3}, - {map[int]int{1: 2, 2: 4, 3: 6}, 3}, - {ch, 3}, - - {[]int{}, 0}, - {map[int]int{}, 0}, - {make(chan int), 0}, - - {[]int(nil), 0}, - {map[int]int(nil), 0}, - {(chan int)(nil), 0}, - } - - for _, c := range cases { - True(t, Len(mockT, c.v, c.l), "%#v have %d items", c.v, c.l) - } - - cases = []struct { - v interface{} - l int - }{ - {[]int{1, 2, 3}, 4}, - {[...]int{1, 2, 3}, 2}, - {"ABC", 2}, - {map[int]int{1: 2, 2: 4, 3: 6}, 4}, - {ch, 2}, - - {[]int{}, 1}, - {map[int]int{}, 1}, - {make(chan int), 1}, - - {[]int(nil), 1}, - {map[int]int(nil), 1}, - {(chan int)(nil), 1}, - } - - for _, c := range cases { - False(t, Len(mockT, c.v, c.l), "%#v have %d items", c.v, c.l) - } -} - -func TestWithinDuration(t *testing.T) { - - mockT := new(testing.T) - a := time.Now() - b := a.Add(10 * time.Second) - - True(t, WithinDuration(mockT, a, b, 10*time.Second), "A 10s difference is within a 10s time difference") - True(t, WithinDuration(mockT, b, a, 10*time.Second), "A 10s difference is within a 10s time difference") - - False(t, WithinDuration(mockT, a, b, 9*time.Second), "A 10s difference is not within a 9s time difference") - False(t, WithinDuration(mockT, b, a, 9*time.Second), "A 10s difference is not within a 9s time difference") - - False(t, WithinDuration(mockT, a, b, -9*time.Second), "A 10s difference is not within a 9s time difference") - False(t, WithinDuration(mockT, b, a, -9*time.Second), "A 10s difference is not within a 9s time difference") - - False(t, WithinDuration(mockT, a, b, -11*time.Second), "A 10s difference is not within a 9s time difference") - False(t, WithinDuration(mockT, b, a, -11*time.Second), "A 10s difference is not within a 9s time difference") -} - -func TestInDelta(t *testing.T) { - mockT := new(testing.T) - - True(t, InDelta(mockT, 1.001, 1, 0.01), "|1.001 - 1| <= 0.01") - True(t, InDelta(mockT, 1, 1.001, 0.01), "|1 - 1.001| <= 0.01") - True(t, InDelta(mockT, 1, 2, 1), "|1 - 2| <= 1") - False(t, InDelta(mockT, 1, 2, 0.5), "Expected |1 - 2| <= 0.5 to fail") - False(t, InDelta(mockT, 2, 1, 0.5), "Expected |2 - 1| <= 0.5 to fail") - False(t, InDelta(mockT, "", nil, 1), "Expected non numerals to fail") - False(t, InDelta(mockT, 42, math.NaN(), 0.01), "Expected NaN for actual to fail") - False(t, InDelta(mockT, math.NaN(), 42, 0.01), "Expected NaN for expected to fail") - - cases := []struct { - a, b interface{} - delta float64 - }{ - {uint8(2), uint8(1), 1}, - {uint16(2), uint16(1), 1}, - {uint32(2), uint32(1), 1}, - {uint64(2), uint64(1), 1}, - - {int(2), int(1), 1}, - {int8(2), int8(1), 1}, - {int16(2), int16(1), 1}, - {int32(2), int32(1), 1}, - {int64(2), int64(1), 1}, - - {float32(2), float32(1), 1}, - {float64(2), float64(1), 1}, - } - - for _, tc := range cases { - True(t, InDelta(mockT, tc.a, tc.b, tc.delta), "Expected |%V - %V| <= %v", tc.a, tc.b, tc.delta) - } -} - -func TestInDeltaSlice(t *testing.T) { - mockT := new(testing.T) - - True(t, InDeltaSlice(mockT, - []float64{1.001, 0.999}, - []float64{1, 1}, - 0.1), "{1.001, 0.009} is element-wise close to {1, 1} in delta=0.1") - - True(t, InDeltaSlice(mockT, - []float64{1, 2}, - []float64{0, 3}, - 1), "{1, 2} is element-wise close to {0, 3} in delta=1") - - False(t, InDeltaSlice(mockT, - []float64{1, 2}, - []float64{0, 3}, - 0.1), "{1, 2} is not element-wise close to {0, 3} in delta=0.1") - - False(t, InDeltaSlice(mockT, "", nil, 1), "Expected non numeral slices to fail") -} - -func TestInEpsilon(t *testing.T) { - mockT := new(testing.T) - - cases := []struct { - a, b interface{} - epsilon float64 - }{ - {uint8(2), uint16(2), .001}, - {2.1, 2.2, 0.1}, - {2.2, 2.1, 0.1}, - {-2.1, -2.2, 0.1}, - {-2.2, -2.1, 0.1}, - {uint64(100), uint8(101), 0.01}, - {0.1, -0.1, 2}, - {0.1, 0, 2}, - } - - for _, tc := range cases { - True(t, InEpsilon(t, tc.a, tc.b, tc.epsilon, "Expected %V and %V to have a relative difference of %v", tc.a, tc.b, tc.epsilon), "test: %q", tc) - } - - cases = []struct { - a, b interface{} - epsilon float64 - }{ - {uint8(2), int16(-2), .001}, - {uint64(100), uint8(102), 0.01}, - {2.1, 2.2, 0.001}, - {2.2, 2.1, 0.001}, - {2.1, -2.2, 1}, - {2.1, "bla-bla", 0}, - {0.1, -0.1, 1.99}, - {0, 0.1, 2}, // expected must be different to zero - } - - for _, tc := range cases { - False(t, InEpsilon(mockT, tc.a, tc.b, tc.epsilon, "Expected %V and %V to have a relative difference of %v", tc.a, tc.b, tc.epsilon)) - } - -} - -func TestInEpsilonSlice(t *testing.T) { - mockT := new(testing.T) - - True(t, InEpsilonSlice(mockT, - []float64{2.2, 2.0}, - []float64{2.1, 2.1}, - 0.06), "{2.2, 2.0} is element-wise close to {2.1, 2.1} in espilon=0.06") - - False(t, InEpsilonSlice(mockT, - []float64{2.2, 2.0}, - []float64{2.1, 2.1}, - 0.04), "{2.2, 2.0} is not element-wise close to {2.1, 2.1} in espilon=0.04") - - False(t, InEpsilonSlice(mockT, "", nil, 1), "Expected non numeral slices to fail") -} - -func TestRegexp(t *testing.T) { - mockT := new(testing.T) - - cases := []struct { - rx, str string - }{ - {"^start", "start of the line"}, - {"end$", "in the end"}, - {"[0-9]{3}[.-]?[0-9]{2}[.-]?[0-9]{2}", "My phone number is 650.12.34"}, - } - - for _, tc := range cases { - True(t, Regexp(mockT, tc.rx, tc.str)) - True(t, Regexp(mockT, regexp.MustCompile(tc.rx), tc.str)) - False(t, NotRegexp(mockT, tc.rx, tc.str)) - False(t, NotRegexp(mockT, regexp.MustCompile(tc.rx), tc.str)) - } - - cases = []struct { - rx, str string - }{ - {"^asdfastart", "Not the start of the line"}, - {"end$", "in the end."}, - {"[0-9]{3}[.-]?[0-9]{2}[.-]?[0-9]{2}", "My phone number is 650.12a.34"}, - } - - for _, tc := range cases { - False(t, Regexp(mockT, tc.rx, tc.str), "Expected \"%s\" to not match \"%s\"", tc.rx, tc.str) - False(t, Regexp(mockT, regexp.MustCompile(tc.rx), tc.str)) - True(t, NotRegexp(mockT, tc.rx, tc.str)) - True(t, NotRegexp(mockT, regexp.MustCompile(tc.rx), tc.str)) - } -} - -func testAutogeneratedFunction() { - defer func() { - if err := recover(); err == nil { - panic("did not panic") - } - CallerInfo() - }() - t := struct { - io.Closer - }{} - var c io.Closer - c = t - c.Close() -} - -func TestCallerInfoWithAutogeneratedFunctions(t *testing.T) { - NotPanics(t, func() { - testAutogeneratedFunction() - }) -} - -func TestZero(t *testing.T) { - mockT := new(testing.T) - - for _, test := range zeros { - True(t, Zero(mockT, test, "%#v is not the %v zero value", test, reflect.TypeOf(test))) - } - - for _, test := range nonZeros { - False(t, Zero(mockT, test, "%#v is not the %v zero value", test, reflect.TypeOf(test))) - } -} - -func TestNotZero(t *testing.T) { - mockT := new(testing.T) - - for _, test := range zeros { - False(t, NotZero(mockT, test, "%#v is not the %v zero value", test, reflect.TypeOf(test))) - } - - for _, test := range nonZeros { - True(t, NotZero(mockT, test, "%#v is not the %v zero value", test, reflect.TypeOf(test))) - } -} - -func TestJSONEq_EqualSONString(t *testing.T) { - mockT := new(testing.T) - True(t, JSONEq(mockT, `{"hello": "world", "foo": "bar"}`, `{"hello": "world", "foo": "bar"}`)) -} - -func TestJSONEq_EquivalentButNotEqual(t *testing.T) { - mockT := new(testing.T) - True(t, JSONEq(mockT, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)) -} - -func TestJSONEq_HashOfArraysAndHashes(t *testing.T) { - mockT := new(testing.T) - True(t, JSONEq(mockT, "{\r\n\t\"numeric\": 1.5,\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]],\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\"\r\n}", - "{\r\n\t\"numeric\": 1.5,\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\",\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]]\r\n}")) -} - -func TestJSONEq_Array(t *testing.T) { - mockT := new(testing.T) - True(t, JSONEq(mockT, `["foo", {"hello": "world", "nested": "hash"}]`, `["foo", {"nested": "hash", "hello": "world"}]`)) -} - -func TestJSONEq_HashAndArrayNotEquivalent(t *testing.T) { - mockT := new(testing.T) - False(t, JSONEq(mockT, `["foo", {"hello": "world", "nested": "hash"}]`, `{"foo": "bar", {"nested": "hash", "hello": "world"}}`)) -} - -func TestJSONEq_HashesNotEquivalent(t *testing.T) { - mockT := new(testing.T) - False(t, JSONEq(mockT, `{"foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)) -} - -func TestJSONEq_ActualIsNotJSON(t *testing.T) { - mockT := new(testing.T) - False(t, JSONEq(mockT, `{"foo": "bar"}`, "Not JSON")) -} - -func TestJSONEq_ExpectedIsNotJSON(t *testing.T) { - mockT := new(testing.T) - False(t, JSONEq(mockT, "Not JSON", `{"foo": "bar", "hello": "world"}`)) -} - -func TestJSONEq_ExpectedAndActualNotJSON(t *testing.T) { - mockT := new(testing.T) - False(t, JSONEq(mockT, "Not JSON", "Not JSON")) -} - -func TestJSONEq_ArraysOfDifferentOrder(t *testing.T) { - mockT := new(testing.T) - False(t, JSONEq(mockT, `["foo", {"hello": "world", "nested": "hash"}]`, `[{ "hello": "world", "nested": "hash"}, "foo"]`)) -} - -func TestDiff(t *testing.T) { - expected := ` - -Diff: ---- Expected -+++ Actual -@@ -1,3 +1,3 @@ - (struct { foo string }) { -- foo: (string) (len=5) "hello" -+ foo: (string) (len=3) "bar" - } -` - actual := diff( - struct{ foo string }{"hello"}, - struct{ foo string }{"bar"}, - ) - Equal(t, expected, actual) - - expected = ` - -Diff: ---- Expected -+++ Actual -@@ -2,5 +2,5 @@ - (int) 1, -- (int) 2, - (int) 3, -- (int) 4 -+ (int) 5, -+ (int) 7 - } -` - actual = diff( - []int{1, 2, 3, 4}, - []int{1, 3, 5, 7}, - ) - Equal(t, expected, actual) - - expected = ` - -Diff: ---- Expected -+++ Actual -@@ -2,4 +2,4 @@ - (int) 1, -- (int) 2, -- (int) 3 -+ (int) 3, -+ (int) 5 - } -` - actual = diff( - []int{1, 2, 3, 4}[0:3], - []int{1, 3, 5, 7}[0:3], - ) - Equal(t, expected, actual) - - expected = ` - -Diff: ---- Expected -+++ Actual -@@ -1,6 +1,6 @@ - (map[string]int) (len=4) { -- (string) (len=4) "four": (int) 4, -+ (string) (len=4) "five": (int) 5, - (string) (len=3) "one": (int) 1, -- (string) (len=5) "three": (int) 3, -- (string) (len=3) "two": (int) 2 -+ (string) (len=5) "seven": (int) 7, -+ (string) (len=5) "three": (int) 3 - } -` - - actual = diff( - map[string]int{"one": 1, "two": 2, "three": 3, "four": 4}, - map[string]int{"one": 1, "three": 3, "five": 5, "seven": 7}, - ) - Equal(t, expected, actual) -} - -func TestDiffEmptyCases(t *testing.T) { - Equal(t, "", diff(nil, nil)) - Equal(t, "", diff(struct{ foo string }{}, nil)) - Equal(t, "", diff(nil, struct{ foo string }{})) - Equal(t, "", diff(1, 2)) - Equal(t, "", diff(1, 2)) - Equal(t, "", diff([]int{1}, []bool{true})) -} - -// Ensure there are no data races -func TestDiffRace(t *testing.T) { - t.Parallel() - - expected := map[string]string{ - "a": "A", - "b": "B", - "c": "C", - } - - actual := map[string]string{ - "d": "D", - "e": "E", - "f": "F", - } - - // run diffs in parallel simulating tests with t.Parallel() - numRoutines := 10 - rChans := make([]chan string, numRoutines) - for idx := range rChans { - rChans[idx] = make(chan string) - go func(ch chan string) { - defer close(ch) - ch <- diff(expected, actual) - }(rChans[idx]) - } - - for _, ch := range rChans { - for msg := range ch { - NotZero(t, msg) // dummy assert - } - } -} - -type mockTestingT struct { -} - -func (m *mockTestingT) Errorf(format string, args ...interface{}) {} - -func TestFailNowWithPlainTestingT(t *testing.T) { - mockT := &mockTestingT{} - - Panics(t, func() { - FailNow(mockT, "failed") - }, "should panic since mockT is missing FailNow()") -} - -type mockFailNowTestingT struct { -} - -func (m *mockFailNowTestingT) Errorf(format string, args ...interface{}) {} - -func (m *mockFailNowTestingT) FailNow() {} - -func TestFailNowWithFullTestingT(t *testing.T) { - mockT := &mockFailNowTestingT{} - - NotPanics(t, func() { - FailNow(mockT, "failed") - }, "should call mockT.FailNow() rather than panicking") -} diff --git a/vendor/github.com/stretchr/testify/assert/doc.go b/vendor/github.com/stretchr/testify/assert/doc.go deleted file mode 100644 index c9dccc4..0000000 --- a/vendor/github.com/stretchr/testify/assert/doc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. -// -// Example Usage -// -// The following is a complete example using assert in a standard test function: -// import ( -// "testing" -// "github.com/stretchr/testify/assert" -// ) -// -// func TestSomething(t *testing.T) { -// -// var a string = "Hello" -// var b string = "Hello" -// -// assert.Equal(t, a, b, "The two words should be the same.") -// -// } -// -// if you assert many times, use the format below: -// -// import ( -// "testing" -// "github.com/stretchr/testify/assert" -// ) -// -// func TestSomething(t *testing.T) { -// assert := assert.New(t) -// -// var a string = "Hello" -// var b string = "Hello" -// -// assert.Equal(a, b, "The two words should be the same.") -// } -// -// Assertions -// -// Assertions allow you to easily write test code, and are global funcs in the `assert` package. -// All assertion functions take, as the first argument, the `*testing.T` object provided by the -// testing framework. This allows the assertion funcs to write the failings and other details to -// the correct place. -// -// Every assertion function also takes an optional string message as the final argument, -// allowing custom error messages to be appended to the message the assertion method outputs. -package assert diff --git a/vendor/github.com/stretchr/testify/assert/errors.go b/vendor/github.com/stretchr/testify/assert/errors.go deleted file mode 100644 index ac9dc9d..0000000 --- a/vendor/github.com/stretchr/testify/assert/errors.go +++ /dev/null @@ -1,10 +0,0 @@ -package assert - -import ( - "errors" -) - -// AnError is an error instance useful for testing. If the code does not care -// about error specifics, and only needs to return the error for example, this -// error should be used to make the test code more readable. -var AnError = errors.New("assert.AnError general error for testing") diff --git a/vendor/github.com/stretchr/testify/assert/forward_assertions.go b/vendor/github.com/stretchr/testify/assert/forward_assertions.go deleted file mode 100644 index b867e95..0000000 --- a/vendor/github.com/stretchr/testify/assert/forward_assertions.go +++ /dev/null @@ -1,16 +0,0 @@ -package assert - -// Assertions provides assertion methods around the -// TestingT interface. -type Assertions struct { - t TestingT -} - -// New makes a new Assertions object for the specified TestingT. -func New(t TestingT) *Assertions { - return &Assertions{ - t: t, - } -} - -//go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl diff --git a/vendor/github.com/stretchr/testify/assert/forward_assertions_test.go b/vendor/github.com/stretchr/testify/assert/forward_assertions_test.go deleted file mode 100644 index 22e1df1..0000000 --- a/vendor/github.com/stretchr/testify/assert/forward_assertions_test.go +++ /dev/null @@ -1,611 +0,0 @@ -package assert - -import ( - "errors" - "regexp" - "testing" - "time" -) - -func TestImplementsWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.Implements((*AssertionTesterInterface)(nil), new(AssertionTesterConformingObject)) { - t.Error("Implements method should return true: AssertionTesterConformingObject implements AssertionTesterInterface") - } - if assert.Implements((*AssertionTesterInterface)(nil), new(AssertionTesterNonConformingObject)) { - t.Error("Implements method should return false: AssertionTesterNonConformingObject does not implements AssertionTesterInterface") - } -} - -func TestIsTypeWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.IsType(new(AssertionTesterConformingObject), new(AssertionTesterConformingObject)) { - t.Error("IsType should return true: AssertionTesterConformingObject is the same type as AssertionTesterConformingObject") - } - if assert.IsType(new(AssertionTesterConformingObject), new(AssertionTesterNonConformingObject)) { - t.Error("IsType should return false: AssertionTesterConformingObject is not the same type as AssertionTesterNonConformingObject") - } - -} - -func TestEqualWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.Equal("Hello World", "Hello World") { - t.Error("Equal should return true") - } - if !assert.Equal(123, 123) { - t.Error("Equal should return true") - } - if !assert.Equal(123.5, 123.5) { - t.Error("Equal should return true") - } - if !assert.Equal([]byte("Hello World"), []byte("Hello World")) { - t.Error("Equal should return true") - } - if !assert.Equal(nil, nil) { - t.Error("Equal should return true") - } -} - -func TestEqualValuesWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.EqualValues(uint32(10), int32(10)) { - t.Error("EqualValues should return true") - } -} - -func TestNotNilWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.NotNil(new(AssertionTesterConformingObject)) { - t.Error("NotNil should return true: object is not nil") - } - if assert.NotNil(nil) { - t.Error("NotNil should return false: object is nil") - } - -} - -func TestNilWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.Nil(nil) { - t.Error("Nil should return true: object is nil") - } - if assert.Nil(new(AssertionTesterConformingObject)) { - t.Error("Nil should return false: object is not nil") - } - -} - -func TestTrueWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.True(true) { - t.Error("True should return true") - } - if assert.True(false) { - t.Error("True should return false") - } - -} - -func TestFalseWrapper(t *testing.T) { - assert := New(new(testing.T)) - - if !assert.False(false) { - t.Error("False should return true") - } - if assert.False(true) { - t.Error("False should return false") - } - -} - -func TestExactlyWrapper(t *testing.T) { - assert := New(new(testing.T)) - - a := float32(1) - b := float64(1) - c := float32(1) - d := float32(2) - - if assert.Exactly(a, b) { - t.Error("Exactly should return false") - } - if assert.Exactly(a, d) { - t.Error("Exactly should return false") - } - if !assert.Exactly(a, c) { - t.Error("Exactly should return true") - } - - if assert.Exactly(nil, a) { - t.Error("Exactly should return false") - } - if assert.Exactly(a, nil) { - t.Error("Exactly should return false") - } - -} - -func TestNotEqualWrapper(t *testing.T) { - - assert := New(new(testing.T)) - - if !assert.NotEqual("Hello World", "Hello World!") { - t.Error("NotEqual should return true") - } - if !assert.NotEqual(123, 1234) { - t.Error("NotEqual should return true") - } - if !assert.NotEqual(123.5, 123.55) { - t.Error("NotEqual should return true") - } - if !assert.NotEqual([]byte("Hello World"), []byte("Hello World!")) { - t.Error("NotEqual should return true") - } - if !assert.NotEqual(nil, new(AssertionTesterConformingObject)) { - t.Error("NotEqual should return true") - } -} - -func TestContainsWrapper(t *testing.T) { - - assert := New(new(testing.T)) - list := []string{"Foo", "Bar"} - - if !assert.Contains("Hello World", "Hello") { - t.Error("Contains should return true: \"Hello World\" contains \"Hello\"") - } - if assert.Contains("Hello World", "Salut") { - t.Error("Contains should return false: \"Hello World\" does not contain \"Salut\"") - } - - if !assert.Contains(list, "Foo") { - t.Error("Contains should return true: \"[\"Foo\", \"Bar\"]\" contains \"Foo\"") - } - if assert.Contains(list, "Salut") { - t.Error("Contains should return false: \"[\"Foo\", \"Bar\"]\" does not contain \"Salut\"") - } - -} - -func TestNotContainsWrapper(t *testing.T) { - - assert := New(new(testing.T)) - list := []string{"Foo", "Bar"} - - if !assert.NotContains("Hello World", "Hello!") { - t.Error("NotContains should return true: \"Hello World\" does not contain \"Hello!\"") - } - if assert.NotContains("Hello World", "Hello") { - t.Error("NotContains should return false: \"Hello World\" contains \"Hello\"") - } - - if !assert.NotContains(list, "Foo!") { - t.Error("NotContains should return true: \"[\"Foo\", \"Bar\"]\" does not contain \"Foo!\"") - } - if assert.NotContains(list, "Foo") { - t.Error("NotContains should return false: \"[\"Foo\", \"Bar\"]\" contains \"Foo\"") - } - -} - -func TestConditionWrapper(t *testing.T) { - - assert := New(new(testing.T)) - - if !assert.Condition(func() bool { return true }, "Truth") { - t.Error("Condition should return true") - } - - if assert.Condition(func() bool { return false }, "Lie") { - t.Error("Condition should return false") - } - -} - -func TestDidPanicWrapper(t *testing.T) { - - if funcDidPanic, _ := didPanic(func() { - panic("Panic!") - }); !funcDidPanic { - t.Error("didPanic should return true") - } - - if funcDidPanic, _ := didPanic(func() { - }); funcDidPanic { - t.Error("didPanic should return false") - } - -} - -func TestPanicsWrapper(t *testing.T) { - - assert := New(new(testing.T)) - - if !assert.Panics(func() { - panic("Panic!") - }) { - t.Error("Panics should return true") - } - - if assert.Panics(func() { - }) { - t.Error("Panics should return false") - } - -} - -func TestNotPanicsWrapper(t *testing.T) { - - assert := New(new(testing.T)) - - if !assert.NotPanics(func() { - }) { - t.Error("NotPanics should return true") - } - - if assert.NotPanics(func() { - panic("Panic!") - }) { - t.Error("NotPanics should return false") - } - -} - -func TestNoErrorWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - // start with a nil error - var err error - - assert.True(mockAssert.NoError(err), "NoError should return True for nil arg") - - // now set an error - err = errors.New("Some error") - - assert.False(mockAssert.NoError(err), "NoError with error should return False") - -} - -func TestErrorWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - // start with a nil error - var err error - - assert.False(mockAssert.Error(err), "Error should return False for nil arg") - - // now set an error - err = errors.New("Some error") - - assert.True(mockAssert.Error(err), "Error with error should return True") - -} - -func TestEqualErrorWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - // start with a nil error - var err error - assert.False(mockAssert.EqualError(err, ""), - "EqualError should return false for nil arg") - - // now set an error - err = errors.New("some error") - assert.False(mockAssert.EqualError(err, "Not some error"), - "EqualError should return false for different error string") - assert.True(mockAssert.EqualError(err, "some error"), - "EqualError should return true") -} - -func TestEmptyWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - assert.True(mockAssert.Empty(""), "Empty string is empty") - assert.True(mockAssert.Empty(nil), "Nil is empty") - assert.True(mockAssert.Empty([]string{}), "Empty string array is empty") - assert.True(mockAssert.Empty(0), "Zero int value is empty") - assert.True(mockAssert.Empty(false), "False value is empty") - - assert.False(mockAssert.Empty("something"), "Non Empty string is not empty") - assert.False(mockAssert.Empty(errors.New("something")), "Non nil object is not empty") - assert.False(mockAssert.Empty([]string{"something"}), "Non empty string array is not empty") - assert.False(mockAssert.Empty(1), "Non-zero int value is not empty") - assert.False(mockAssert.Empty(true), "True value is not empty") - -} - -func TestNotEmptyWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - assert.False(mockAssert.NotEmpty(""), "Empty string is empty") - assert.False(mockAssert.NotEmpty(nil), "Nil is empty") - assert.False(mockAssert.NotEmpty([]string{}), "Empty string array is empty") - assert.False(mockAssert.NotEmpty(0), "Zero int value is empty") - assert.False(mockAssert.NotEmpty(false), "False value is empty") - - assert.True(mockAssert.NotEmpty("something"), "Non Empty string is not empty") - assert.True(mockAssert.NotEmpty(errors.New("something")), "Non nil object is not empty") - assert.True(mockAssert.NotEmpty([]string{"something"}), "Non empty string array is not empty") - assert.True(mockAssert.NotEmpty(1), "Non-zero int value is not empty") - assert.True(mockAssert.NotEmpty(true), "True value is not empty") - -} - -func TestLenWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - assert.False(mockAssert.Len(nil, 0), "nil does not have length") - assert.False(mockAssert.Len(0, 0), "int does not have length") - assert.False(mockAssert.Len(true, 0), "true does not have length") - assert.False(mockAssert.Len(false, 0), "false does not have length") - assert.False(mockAssert.Len('A', 0), "Rune does not have length") - assert.False(mockAssert.Len(struct{}{}, 0), "Struct does not have length") - - ch := make(chan int, 5) - ch <- 1 - ch <- 2 - ch <- 3 - - cases := []struct { - v interface{} - l int - }{ - {[]int{1, 2, 3}, 3}, - {[...]int{1, 2, 3}, 3}, - {"ABC", 3}, - {map[int]int{1: 2, 2: 4, 3: 6}, 3}, - {ch, 3}, - - {[]int{}, 0}, - {map[int]int{}, 0}, - {make(chan int), 0}, - - {[]int(nil), 0}, - {map[int]int(nil), 0}, - {(chan int)(nil), 0}, - } - - for _, c := range cases { - assert.True(mockAssert.Len(c.v, c.l), "%#v have %d items", c.v, c.l) - } -} - -func TestWithinDurationWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - a := time.Now() - b := a.Add(10 * time.Second) - - assert.True(mockAssert.WithinDuration(a, b, 10*time.Second), "A 10s difference is within a 10s time difference") - assert.True(mockAssert.WithinDuration(b, a, 10*time.Second), "A 10s difference is within a 10s time difference") - - assert.False(mockAssert.WithinDuration(a, b, 9*time.Second), "A 10s difference is not within a 9s time difference") - assert.False(mockAssert.WithinDuration(b, a, 9*time.Second), "A 10s difference is not within a 9s time difference") - - assert.False(mockAssert.WithinDuration(a, b, -9*time.Second), "A 10s difference is not within a 9s time difference") - assert.False(mockAssert.WithinDuration(b, a, -9*time.Second), "A 10s difference is not within a 9s time difference") - - assert.False(mockAssert.WithinDuration(a, b, -11*time.Second), "A 10s difference is not within a 9s time difference") - assert.False(mockAssert.WithinDuration(b, a, -11*time.Second), "A 10s difference is not within a 9s time difference") -} - -func TestInDeltaWrapper(t *testing.T) { - assert := New(new(testing.T)) - - True(t, assert.InDelta(1.001, 1, 0.01), "|1.001 - 1| <= 0.01") - True(t, assert.InDelta(1, 1.001, 0.01), "|1 - 1.001| <= 0.01") - True(t, assert.InDelta(1, 2, 1), "|1 - 2| <= 1") - False(t, assert.InDelta(1, 2, 0.5), "Expected |1 - 2| <= 0.5 to fail") - False(t, assert.InDelta(2, 1, 0.5), "Expected |2 - 1| <= 0.5 to fail") - False(t, assert.InDelta("", nil, 1), "Expected non numerals to fail") - - cases := []struct { - a, b interface{} - delta float64 - }{ - {uint8(2), uint8(1), 1}, - {uint16(2), uint16(1), 1}, - {uint32(2), uint32(1), 1}, - {uint64(2), uint64(1), 1}, - - {int(2), int(1), 1}, - {int8(2), int8(1), 1}, - {int16(2), int16(1), 1}, - {int32(2), int32(1), 1}, - {int64(2), int64(1), 1}, - - {float32(2), float32(1), 1}, - {float64(2), float64(1), 1}, - } - - for _, tc := range cases { - True(t, assert.InDelta(tc.a, tc.b, tc.delta), "Expected |%V - %V| <= %v", tc.a, tc.b, tc.delta) - } -} - -func TestInEpsilonWrapper(t *testing.T) { - assert := New(new(testing.T)) - - cases := []struct { - a, b interface{} - epsilon float64 - }{ - {uint8(2), uint16(2), .001}, - {2.1, 2.2, 0.1}, - {2.2, 2.1, 0.1}, - {-2.1, -2.2, 0.1}, - {-2.2, -2.1, 0.1}, - {uint64(100), uint8(101), 0.01}, - {0.1, -0.1, 2}, - } - - for _, tc := range cases { - True(t, assert.InEpsilon(tc.a, tc.b, tc.epsilon, "Expected %V and %V to have a relative difference of %v", tc.a, tc.b, tc.epsilon)) - } - - cases = []struct { - a, b interface{} - epsilon float64 - }{ - {uint8(2), int16(-2), .001}, - {uint64(100), uint8(102), 0.01}, - {2.1, 2.2, 0.001}, - {2.2, 2.1, 0.001}, - {2.1, -2.2, 1}, - {2.1, "bla-bla", 0}, - {0.1, -0.1, 1.99}, - } - - for _, tc := range cases { - False(t, assert.InEpsilon(tc.a, tc.b, tc.epsilon, "Expected %V and %V to have a relative difference of %v", tc.a, tc.b, tc.epsilon)) - } -} - -func TestRegexpWrapper(t *testing.T) { - - assert := New(new(testing.T)) - - cases := []struct { - rx, str string - }{ - {"^start", "start of the line"}, - {"end$", "in the end"}, - {"[0-9]{3}[.-]?[0-9]{2}[.-]?[0-9]{2}", "My phone number is 650.12.34"}, - } - - for _, tc := range cases { - True(t, assert.Regexp(tc.rx, tc.str)) - True(t, assert.Regexp(regexp.MustCompile(tc.rx), tc.str)) - False(t, assert.NotRegexp(tc.rx, tc.str)) - False(t, assert.NotRegexp(regexp.MustCompile(tc.rx), tc.str)) - } - - cases = []struct { - rx, str string - }{ - {"^asdfastart", "Not the start of the line"}, - {"end$", "in the end."}, - {"[0-9]{3}[.-]?[0-9]{2}[.-]?[0-9]{2}", "My phone number is 650.12a.34"}, - } - - for _, tc := range cases { - False(t, assert.Regexp(tc.rx, tc.str), "Expected \"%s\" to not match \"%s\"", tc.rx, tc.str) - False(t, assert.Regexp(regexp.MustCompile(tc.rx), tc.str)) - True(t, assert.NotRegexp(tc.rx, tc.str)) - True(t, assert.NotRegexp(regexp.MustCompile(tc.rx), tc.str)) - } -} - -func TestZeroWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - for _, test := range zeros { - assert.True(mockAssert.Zero(test), "Zero should return true for %v", test) - } - - for _, test := range nonZeros { - assert.False(mockAssert.Zero(test), "Zero should return false for %v", test) - } -} - -func TestNotZeroWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - for _, test := range zeros { - assert.False(mockAssert.NotZero(test), "Zero should return true for %v", test) - } - - for _, test := range nonZeros { - assert.True(mockAssert.NotZero(test), "Zero should return false for %v", test) - } -} - -func TestJSONEqWrapper_EqualSONString(t *testing.T) { - assert := New(new(testing.T)) - if !assert.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"hello": "world", "foo": "bar"}`) { - t.Error("JSONEq should return true") - } - -} - -func TestJSONEqWrapper_EquivalentButNotEqual(t *testing.T) { - assert := New(new(testing.T)) - if !assert.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) { - t.Error("JSONEq should return true") - } - -} - -func TestJSONEqWrapper_HashOfArraysAndHashes(t *testing.T) { - assert := New(new(testing.T)) - if !assert.JSONEq("{\r\n\t\"numeric\": 1.5,\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]],\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\"\r\n}", - "{\r\n\t\"numeric\": 1.5,\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\",\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]]\r\n}") { - t.Error("JSONEq should return true") - } -} - -func TestJSONEqWrapper_Array(t *testing.T) { - assert := New(new(testing.T)) - if !assert.JSONEq(`["foo", {"hello": "world", "nested": "hash"}]`, `["foo", {"nested": "hash", "hello": "world"}]`) { - t.Error("JSONEq should return true") - } - -} - -func TestJSONEqWrapper_HashAndArrayNotEquivalent(t *testing.T) { - assert := New(new(testing.T)) - if assert.JSONEq(`["foo", {"hello": "world", "nested": "hash"}]`, `{"foo": "bar", {"nested": "hash", "hello": "world"}}`) { - t.Error("JSONEq should return false") - } -} - -func TestJSONEqWrapper_HashesNotEquivalent(t *testing.T) { - assert := New(new(testing.T)) - if assert.JSONEq(`{"foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) { - t.Error("JSONEq should return false") - } -} - -func TestJSONEqWrapper_ActualIsNotJSON(t *testing.T) { - assert := New(new(testing.T)) - if assert.JSONEq(`{"foo": "bar"}`, "Not JSON") { - t.Error("JSONEq should return false") - } -} - -func TestJSONEqWrapper_ExpectedIsNotJSON(t *testing.T) { - assert := New(new(testing.T)) - if assert.JSONEq("Not JSON", `{"foo": "bar", "hello": "world"}`) { - t.Error("JSONEq should return false") - } -} - -func TestJSONEqWrapper_ExpectedAndActualNotJSON(t *testing.T) { - assert := New(new(testing.T)) - if assert.JSONEq("Not JSON", "Not JSON") { - t.Error("JSONEq should return false") - } -} - -func TestJSONEqWrapper_ArraysOfDifferentOrder(t *testing.T) { - assert := New(new(testing.T)) - if assert.JSONEq(`["foo", {"hello": "world", "nested": "hash"}]`, `[{ "hello": "world", "nested": "hash"}, "foo"]`) { - t.Error("JSONEq should return false") - } -} diff --git a/vendor/github.com/stretchr/testify/assert/http_assertions.go b/vendor/github.com/stretchr/testify/assert/http_assertions.go deleted file mode 100644 index fa7ab89..0000000 --- a/vendor/github.com/stretchr/testify/assert/http_assertions.go +++ /dev/null @@ -1,106 +0,0 @@ -package assert - -import ( - "fmt" - "net/http" - "net/http/httptest" - "net/url" - "strings" -) - -// httpCode is a helper that returns HTTP code of the response. It returns -1 -// if building a new request fails. -func httpCode(handler http.HandlerFunc, method, url string, values url.Values) int { - w := httptest.NewRecorder() - req, err := http.NewRequest(method, url+"?"+values.Encode(), nil) - if err != nil { - return -1 - } - handler(w, req) - return w.Code -} - -// HTTPSuccess asserts that a specified handler returns a success status code. -// -// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { - code := httpCode(handler, method, url, values) - if code == -1 { - return false - } - return code >= http.StatusOK && code <= http.StatusPartialContent -} - -// HTTPRedirect asserts that a specified handler returns a redirect status code. -// -// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { - code := httpCode(handler, method, url, values) - if code == -1 { - return false - } - return code >= http.StatusMultipleChoices && code <= http.StatusTemporaryRedirect -} - -// HTTPError asserts that a specified handler returns an error status code. -// -// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values) bool { - code := httpCode(handler, method, url, values) - if code == -1 { - return false - } - return code >= http.StatusBadRequest -} - -// HTTPBody is a helper that returns HTTP body of the response. It returns -// empty string if building a new request fails. -func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string { - w := httptest.NewRecorder() - req, err := http.NewRequest(method, url+"?"+values.Encode(), nil) - if err != nil { - return "" - } - handler(w, req) - return w.Body.String() -} - -// HTTPBodyContains asserts that a specified handler returns a -// body that contains a string. -// -// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { - body := HTTPBody(handler, method, url, values) - - contains := strings.Contains(body, fmt.Sprint(str)) - if !contains { - Fail(t, fmt.Sprintf("Expected response body for \"%s\" to contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body)) - } - - return contains -} - -// HTTPBodyNotContains asserts that a specified handler returns a -// body that does not contain a string. -// -// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}) bool { - body := HTTPBody(handler, method, url, values) - - contains := strings.Contains(body, fmt.Sprint(str)) - if contains { - Fail(t, fmt.Sprintf("Expected response body for \"%s\" to NOT contain \"%s\" but found \"%s\"", url+"?"+values.Encode(), str, body)) - } - - return !contains -} diff --git a/vendor/github.com/stretchr/testify/assert/http_assertions_test.go b/vendor/github.com/stretchr/testify/assert/http_assertions_test.go deleted file mode 100644 index 684c2d5..0000000 --- a/vendor/github.com/stretchr/testify/assert/http_assertions_test.go +++ /dev/null @@ -1,86 +0,0 @@ -package assert - -import ( - "fmt" - "net/http" - "net/url" - "testing" -) - -func httpOK(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) -} - -func httpRedirect(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusTemporaryRedirect) -} - -func httpError(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusInternalServerError) -} - -func TestHTTPStatuses(t *testing.T) { - assert := New(t) - mockT := new(testing.T) - - assert.Equal(HTTPSuccess(mockT, httpOK, "GET", "/", nil), true) - assert.Equal(HTTPSuccess(mockT, httpRedirect, "GET", "/", nil), false) - assert.Equal(HTTPSuccess(mockT, httpError, "GET", "/", nil), false) - - assert.Equal(HTTPRedirect(mockT, httpOK, "GET", "/", nil), false) - assert.Equal(HTTPRedirect(mockT, httpRedirect, "GET", "/", nil), true) - assert.Equal(HTTPRedirect(mockT, httpError, "GET", "/", nil), false) - - assert.Equal(HTTPError(mockT, httpOK, "GET", "/", nil), false) - assert.Equal(HTTPError(mockT, httpRedirect, "GET", "/", nil), false) - assert.Equal(HTTPError(mockT, httpError, "GET", "/", nil), true) -} - -func TestHTTPStatusesWrapper(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - assert.Equal(mockAssert.HTTPSuccess(httpOK, "GET", "/", nil), true) - assert.Equal(mockAssert.HTTPSuccess(httpRedirect, "GET", "/", nil), false) - assert.Equal(mockAssert.HTTPSuccess(httpError, "GET", "/", nil), false) - - assert.Equal(mockAssert.HTTPRedirect(httpOK, "GET", "/", nil), false) - assert.Equal(mockAssert.HTTPRedirect(httpRedirect, "GET", "/", nil), true) - assert.Equal(mockAssert.HTTPRedirect(httpError, "GET", "/", nil), false) - - assert.Equal(mockAssert.HTTPError(httpOK, "GET", "/", nil), false) - assert.Equal(mockAssert.HTTPError(httpRedirect, "GET", "/", nil), false) - assert.Equal(mockAssert.HTTPError(httpError, "GET", "/", nil), true) -} - -func httpHelloName(w http.ResponseWriter, r *http.Request) { - name := r.FormValue("name") - w.Write([]byte(fmt.Sprintf("Hello, %s!", name))) -} - -func TestHttpBody(t *testing.T) { - assert := New(t) - mockT := new(testing.T) - - assert.True(HTTPBodyContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!")) - assert.True(HTTPBodyContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World")) - assert.False(HTTPBodyContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world")) - - assert.False(HTTPBodyNotContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!")) - assert.False(HTTPBodyNotContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World")) - assert.True(HTTPBodyNotContains(mockT, httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world")) -} - -func TestHttpBodyWrappers(t *testing.T) { - assert := New(t) - mockAssert := New(new(testing.T)) - - assert.True(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!")) - assert.True(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World")) - assert.False(mockAssert.HTTPBodyContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world")) - - assert.False(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "Hello, World!")) - assert.False(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "World")) - assert.True(mockAssert.HTTPBodyNotContains(httpHelloName, "GET", "/", url.Values{"name": []string{"World"}}, "world")) - -} diff --git a/vendor/github.com/stretchr/testify/require/doc.go b/vendor/github.com/stretchr/testify/require/doc.go deleted file mode 100644 index 169de39..0000000 --- a/vendor/github.com/stretchr/testify/require/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Package require implements the same assertions as the `assert` package but -// stops test execution when a test fails. -// -// Example Usage -// -// The following is a complete example using require in a standard test function: -// import ( -// "testing" -// "github.com/stretchr/testify/require" -// ) -// -// func TestSomething(t *testing.T) { -// -// var a string = "Hello" -// var b string = "Hello" -// -// require.Equal(t, a, b, "The two words should be the same.") -// -// } -// -// Assertions -// -// The `require` package have same global functions as in the `assert` package, -// but instead of returning a boolean result they call `t.FailNow()`. -// -// Every assertion function also takes an optional string message as the final argument, -// allowing custom error messages to be appended to the message the assertion method outputs. -package require diff --git a/vendor/github.com/stretchr/testify/require/forward_requirements.go b/vendor/github.com/stretchr/testify/require/forward_requirements.go deleted file mode 100644 index d3c2ab9..0000000 --- a/vendor/github.com/stretchr/testify/require/forward_requirements.go +++ /dev/null @@ -1,16 +0,0 @@ -package require - -// Assertions provides assertion methods around the -// TestingT interface. -type Assertions struct { - t TestingT -} - -// New makes a new Assertions object for the specified TestingT. -func New(t TestingT) *Assertions { - return &Assertions{ - t: t, - } -} - -//go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl diff --git a/vendor/github.com/stretchr/testify/require/forward_requirements_test.go b/vendor/github.com/stretchr/testify/require/forward_requirements_test.go deleted file mode 100644 index b120ae3..0000000 --- a/vendor/github.com/stretchr/testify/require/forward_requirements_test.go +++ /dev/null @@ -1,385 +0,0 @@ -package require - -import ( - "errors" - "testing" - "time" -) - -func TestImplementsWrapper(t *testing.T) { - require := New(t) - - require.Implements((*AssertionTesterInterface)(nil), new(AssertionTesterConformingObject)) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Implements((*AssertionTesterInterface)(nil), new(AssertionTesterNonConformingObject)) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestIsTypeWrapper(t *testing.T) { - require := New(t) - require.IsType(new(AssertionTesterConformingObject), new(AssertionTesterConformingObject)) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.IsType(new(AssertionTesterConformingObject), new(AssertionTesterNonConformingObject)) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestEqualWrapper(t *testing.T) { - require := New(t) - require.Equal(1, 1) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Equal(1, 2) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotEqualWrapper(t *testing.T) { - require := New(t) - require.NotEqual(1, 2) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.NotEqual(2, 2) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestExactlyWrapper(t *testing.T) { - require := New(t) - - a := float32(1) - b := float32(1) - c := float64(1) - - require.Exactly(a, b) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Exactly(a, c) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotNilWrapper(t *testing.T) { - require := New(t) - require.NotNil(t, new(AssertionTesterConformingObject)) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.NotNil(nil) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNilWrapper(t *testing.T) { - require := New(t) - require.Nil(nil) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Nil(new(AssertionTesterConformingObject)) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestTrueWrapper(t *testing.T) { - require := New(t) - require.True(true) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.True(false) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestFalseWrapper(t *testing.T) { - require := New(t) - require.False(false) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.False(true) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestContainsWrapper(t *testing.T) { - require := New(t) - require.Contains("Hello World", "Hello") - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Contains("Hello World", "Salut") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotContainsWrapper(t *testing.T) { - require := New(t) - require.NotContains("Hello World", "Hello!") - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.NotContains("Hello World", "Hello") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestPanicsWrapper(t *testing.T) { - require := New(t) - require.Panics(func() { - panic("Panic!") - }) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Panics(func() {}) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotPanicsWrapper(t *testing.T) { - require := New(t) - require.NotPanics(func() {}) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.NotPanics(func() { - panic("Panic!") - }) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNoErrorWrapper(t *testing.T) { - require := New(t) - require.NoError(nil) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.NoError(errors.New("some error")) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestErrorWrapper(t *testing.T) { - require := New(t) - require.Error(errors.New("some error")) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Error(nil) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestEqualErrorWrapper(t *testing.T) { - require := New(t) - require.EqualError(errors.New("some error"), "some error") - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.EqualError(errors.New("some error"), "Not some error") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestEmptyWrapper(t *testing.T) { - require := New(t) - require.Empty("") - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Empty("x") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotEmptyWrapper(t *testing.T) { - require := New(t) - require.NotEmpty("x") - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.NotEmpty("") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestWithinDurationWrapper(t *testing.T) { - require := New(t) - a := time.Now() - b := a.Add(10 * time.Second) - - require.WithinDuration(a, b, 15*time.Second) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.WithinDuration(a, b, 5*time.Second) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestInDeltaWrapper(t *testing.T) { - require := New(t) - require.InDelta(1.001, 1, 0.01) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.InDelta(1, 2, 0.5) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestZeroWrapper(t *testing.T) { - require := New(t) - require.Zero(0) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.Zero(1) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotZeroWrapper(t *testing.T) { - require := New(t) - require.NotZero(1) - - mockT := new(MockT) - mockRequire := New(mockT) - mockRequire.NotZero(0) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEqWrapper_EqualSONString(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"hello": "world", "foo": "bar"}`) - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEqWrapper_EquivalentButNotEqual(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEqWrapper_HashOfArraysAndHashes(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq("{\r\n\t\"numeric\": 1.5,\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]],\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\"\r\n}", - "{\r\n\t\"numeric\": 1.5,\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\",\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]]\r\n}") - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEqWrapper_Array(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq(`["foo", {"hello": "world", "nested": "hash"}]`, `["foo", {"nested": "hash", "hello": "world"}]`) - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEqWrapper_HashAndArrayNotEquivalent(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq(`["foo", {"hello": "world", "nested": "hash"}]`, `{"foo": "bar", {"nested": "hash", "hello": "world"}}`) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEqWrapper_HashesNotEquivalent(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq(`{"foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEqWrapper_ActualIsNotJSON(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq(`{"foo": "bar"}`, "Not JSON") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEqWrapper_ExpectedIsNotJSON(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq("Not JSON", `{"foo": "bar", "hello": "world"}`) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEqWrapper_ExpectedAndActualNotJSON(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq("Not JSON", "Not JSON") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEqWrapper_ArraysOfDifferentOrder(t *testing.T) { - mockT := new(MockT) - mockRequire := New(mockT) - - mockRequire.JSONEq(`["foo", {"hello": "world", "nested": "hash"}]`, `[{ "hello": "world", "nested": "hash"}, "foo"]`) - if !mockT.Failed { - t.Error("Check should fail") - } -} diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go deleted file mode 100644 index a0c4045..0000000 --- a/vendor/github.com/stretchr/testify/require/require.go +++ /dev/null @@ -1,423 +0,0 @@ -/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND - */ - -package require - -import ( - assert "github.com/stretchr/testify/assert" - http "net/http" - url "net/url" - time "time" -) - -// Condition uses a Comparison to assert a complex condition. -func Condition(t TestingT, comp assert.Comparison, msgAndArgs ...interface{}) { - if !assert.Condition(t, comp, msgAndArgs...) { - t.FailNow() - } -} - -// Contains asserts that the specified string, list(array, slice...) or map contains the -// specified substring or element. -// -// assert.Contains(t, "Hello World", "World", "But 'Hello World' does contain 'World'") -// assert.Contains(t, ["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") -// assert.Contains(t, {"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") -// -// Returns whether the assertion was successful (true) or not (false). -func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { - if !assert.Contains(t, s, contains, msgAndArgs...) { - t.FailNow() - } -} - -// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// assert.Empty(t, obj) -// -// Returns whether the assertion was successful (true) or not (false). -func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.Empty(t, object, msgAndArgs...) { - t.FailNow() - } -} - -// Equal asserts that two objects are equal. -// -// assert.Equal(t, 123, 123, "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.Equal(t, expected, actual, msgAndArgs...) { - t.FailNow() - } -} - -// EqualError asserts that a function returned an error (i.e. not `nil`) -// and that it is equal to the provided error. -// -// actualObj, err := SomeFunction() -// assert.EqualError(t, err, expectedErrorString, "An error was expected") -// -// Returns whether the assertion was successful (true) or not (false). -func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) { - if !assert.EqualError(t, theError, errString, msgAndArgs...) { - t.FailNow() - } -} - -// EqualValues asserts that two objects are equal or convertable to the same types -// and equal. -// -// assert.EqualValues(t, uint32(123), int32(123), "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.EqualValues(t, expected, actual, msgAndArgs...) { - t.FailNow() - } -} - -// Error asserts that a function returned an error (i.e. not `nil`). -// -// actualObj, err := SomeFunction() -// if assert.Error(t, err, "An error was expected") { -// assert.Equal(t, err, expectedError) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func Error(t TestingT, err error, msgAndArgs ...interface{}) { - if !assert.Error(t, err, msgAndArgs...) { - t.FailNow() - } -} - -// Exactly asserts that two objects are equal is value and type. -// -// assert.Exactly(t, int32(123), int64(123), "123 and 123 should NOT be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.Exactly(t, expected, actual, msgAndArgs...) { - t.FailNow() - } -} - -// Fail reports a failure through -func Fail(t TestingT, failureMessage string, msgAndArgs ...interface{}) { - if !assert.Fail(t, failureMessage, msgAndArgs...) { - t.FailNow() - } -} - -// FailNow fails test -func FailNow(t TestingT, failureMessage string, msgAndArgs ...interface{}) { - if !assert.FailNow(t, failureMessage, msgAndArgs...) { - t.FailNow() - } -} - -// False asserts that the specified value is false. -// -// assert.False(t, myBool, "myBool should be false") -// -// Returns whether the assertion was successful (true) or not (false). -func False(t TestingT, value bool, msgAndArgs ...interface{}) { - if !assert.False(t, value, msgAndArgs...) { - t.FailNow() - } -} - -// HTTPBodyContains asserts that a specified handler returns a -// body that contains a string. -// -// assert.HTTPBodyContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { - if !assert.HTTPBodyContains(t, handler, method, url, values, str) { - t.FailNow() - } -} - -// HTTPBodyNotContains asserts that a specified handler returns a -// body that does not contain a string. -// -// assert.HTTPBodyNotContains(t, myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { - if !assert.HTTPBodyNotContains(t, handler, method, url, values, str) { - t.FailNow() - } -} - -// HTTPError asserts that a specified handler returns an error status code. -// -// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) { - if !assert.HTTPError(t, handler, method, url, values) { - t.FailNow() - } -} - -// HTTPRedirect asserts that a specified handler returns a redirect status code. -// -// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) { - if !assert.HTTPRedirect(t, handler, method, url, values) { - t.FailNow() - } -} - -// HTTPSuccess asserts that a specified handler returns a success status code. -// -// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) -// -// Returns whether the assertion was successful (true) or not (false). -func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values) { - if !assert.HTTPSuccess(t, handler, method, url, values) { - t.FailNow() - } -} - -// Implements asserts that an object is implemented by the specified interface. -// -// assert.Implements(t, (*MyInterface)(nil), new(MyObject), "MyObject") -func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { - if !assert.Implements(t, interfaceObject, object, msgAndArgs...) { - t.FailNow() - } -} - -// InDelta asserts that the two numerals are within delta of each other. -// -// assert.InDelta(t, math.Pi, (22 / 7.0), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). -func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { - if !assert.InDelta(t, expected, actual, delta, msgAndArgs...) { - t.FailNow() - } -} - -// InDeltaSlice is the same as InDelta, except it compares two slices. -func InDeltaSlice(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { - if !assert.InDeltaSlice(t, expected, actual, delta, msgAndArgs...) { - t.FailNow() - } -} - -// InEpsilon asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). -func InEpsilon(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { - if !assert.InEpsilon(t, expected, actual, epsilon, msgAndArgs...) { - t.FailNow() - } -} - -// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. -func InEpsilonSlice(t TestingT, expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { - if !assert.InEpsilonSlice(t, expected, actual, epsilon, msgAndArgs...) { - t.FailNow() - } -} - -// IsType asserts that the specified objects are of the same type. -func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { - if !assert.IsType(t, expectedType, object, msgAndArgs...) { - t.FailNow() - } -} - -// JSONEq asserts that two JSON strings are equivalent. -// -// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) -// -// Returns whether the assertion was successful (true) or not (false). -func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) { - if !assert.JSONEq(t, expected, actual, msgAndArgs...) { - t.FailNow() - } -} - -// Len asserts that the specified object has specific length. -// Len also fails if the object has a type that len() not accept. -// -// assert.Len(t, mySlice, 3, "The size of slice is not 3") -// -// Returns whether the assertion was successful (true) or not (false). -func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) { - if !assert.Len(t, object, length, msgAndArgs...) { - t.FailNow() - } -} - -// Nil asserts that the specified object is nil. -// -// assert.Nil(t, err, "err should be nothing") -// -// Returns whether the assertion was successful (true) or not (false). -func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.Nil(t, object, msgAndArgs...) { - t.FailNow() - } -} - -// NoError asserts that a function returned no error (i.e. `nil`). -// -// actualObj, err := SomeFunction() -// if assert.NoError(t, err) { -// assert.Equal(t, actualObj, expectedObj) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func NoError(t TestingT, err error, msgAndArgs ...interface{}) { - if !assert.NoError(t, err, msgAndArgs...) { - t.FailNow() - } -} - -// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the -// specified substring or element. -// -// assert.NotContains(t, "Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") -// assert.NotContains(t, ["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") -// assert.NotContains(t, {"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") -// -// Returns whether the assertion was successful (true) or not (false). -func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { - if !assert.NotContains(t, s, contains, msgAndArgs...) { - t.FailNow() - } -} - -// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// if assert.NotEmpty(t, obj) { -// assert.Equal(t, "two", obj[1]) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.NotEmpty(t, object, msgAndArgs...) { - t.FailNow() - } -} - -// NotEqual asserts that the specified values are NOT equal. -// -// assert.NotEqual(t, obj1, obj2, "two objects shouldn't be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - if !assert.NotEqual(t, expected, actual, msgAndArgs...) { - t.FailNow() - } -} - -// NotNil asserts that the specified object is not nil. -// -// assert.NotNil(t, err, "err should be something") -// -// Returns whether the assertion was successful (true) or not (false). -func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) { - if !assert.NotNil(t, object, msgAndArgs...) { - t.FailNow() - } -} - -// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. -// -// assert.NotPanics(t, func(){ -// RemainCalm() -// }, "Calling RemainCalm() should NOT panic") -// -// Returns whether the assertion was successful (true) or not (false). -func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { - if !assert.NotPanics(t, f, msgAndArgs...) { - t.FailNow() - } -} - -// NotRegexp asserts that a specified regexp does not match a string. -// -// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") -// assert.NotRegexp(t, "^start", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { - if !assert.NotRegexp(t, rx, str, msgAndArgs...) { - t.FailNow() - } -} - -// NotZero asserts that i is not the zero value for its type and returns the truth. -func NotZero(t TestingT, i interface{}, msgAndArgs ...interface{}) { - if !assert.NotZero(t, i, msgAndArgs...) { - t.FailNow() - } -} - -// Panics asserts that the code inside the specified PanicTestFunc panics. -// -// assert.Panics(t, func(){ -// GoCrazy() -// }, "Calling GoCrazy() should panic") -// -// Returns whether the assertion was successful (true) or not (false). -func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { - if !assert.Panics(t, f, msgAndArgs...) { - t.FailNow() - } -} - -// Regexp asserts that a specified regexp matches a string. -// -// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") -// assert.Regexp(t, "start...$", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { - if !assert.Regexp(t, rx, str, msgAndArgs...) { - t.FailNow() - } -} - -// True asserts that the specified value is true. -// -// assert.True(t, myBool, "myBool should be true") -// -// Returns whether the assertion was successful (true) or not (false). -func True(t TestingT, value bool, msgAndArgs ...interface{}) { - if !assert.True(t, value, msgAndArgs...) { - t.FailNow() - } -} - -// WithinDuration asserts that the two times are within duration delta of each other. -// -// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") -// -// Returns whether the assertion was successful (true) or not (false). -func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { - if !assert.WithinDuration(t, expected, actual, delta, msgAndArgs...) { - t.FailNow() - } -} - -// Zero asserts that i is the zero value for its type and returns the truth. -func Zero(t TestingT, i interface{}, msgAndArgs ...interface{}) { - if !assert.Zero(t, i, msgAndArgs...) { - t.FailNow() - } -} diff --git a/vendor/github.com/stretchr/testify/require/require.go.tmpl b/vendor/github.com/stretchr/testify/require/require.go.tmpl deleted file mode 100644 index d2c38f6..0000000 --- a/vendor/github.com/stretchr/testify/require/require.go.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -{{.Comment}} -func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { - if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { - t.FailNow() - } -} diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go deleted file mode 100644 index 83e9842..0000000 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ /dev/null @@ -1,347 +0,0 @@ -/* -* CODE GENERATED AUTOMATICALLY WITH github.com/stretchr/testify/_codegen -* THIS FILE MUST NOT BE EDITED BY HAND - */ - -package require - -import ( - assert "github.com/stretchr/testify/assert" - http "net/http" - url "net/url" - time "time" -) - -// Condition uses a Comparison to assert a complex condition. -func (a *Assertions) Condition(comp assert.Comparison, msgAndArgs ...interface{}) { - Condition(a.t, comp, msgAndArgs...) -} - -// Contains asserts that the specified string, list(array, slice...) or map contains the -// specified substring or element. -// -// a.Contains("Hello World", "World", "But 'Hello World' does contain 'World'") -// a.Contains(["Hello", "World"], "World", "But ["Hello", "World"] does contain 'World'") -// a.Contains({"Hello": "World"}, "Hello", "But {'Hello': 'World'} does contain 'Hello'") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { - Contains(a.t, s, contains, msgAndArgs...) -} - -// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// a.Empty(obj) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) { - Empty(a.t, object, msgAndArgs...) -} - -// Equal asserts that two objects are equal. -// -// a.Equal(123, 123, "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - Equal(a.t, expected, actual, msgAndArgs...) -} - -// EqualError asserts that a function returned an error (i.e. not `nil`) -// and that it is equal to the provided error. -// -// actualObj, err := SomeFunction() -// a.EqualError(err, expectedErrorString, "An error was expected") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) { - EqualError(a.t, theError, errString, msgAndArgs...) -} - -// EqualValues asserts that two objects are equal or convertable to the same types -// and equal. -// -// a.EqualValues(uint32(123), int32(123), "123 and 123 should be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - EqualValues(a.t, expected, actual, msgAndArgs...) -} - -// Error asserts that a function returned an error (i.e. not `nil`). -// -// actualObj, err := SomeFunction() -// if a.Error(err, "An error was expected") { -// assert.Equal(t, err, expectedError) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { - Error(a.t, err, msgAndArgs...) -} - -// Exactly asserts that two objects are equal is value and type. -// -// a.Exactly(int32(123), int64(123), "123 and 123 should NOT be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - Exactly(a.t, expected, actual, msgAndArgs...) -} - -// Fail reports a failure through -func (a *Assertions) Fail(failureMessage string, msgAndArgs ...interface{}) { - Fail(a.t, failureMessage, msgAndArgs...) -} - -// FailNow fails test -func (a *Assertions) FailNow(failureMessage string, msgAndArgs ...interface{}) { - FailNow(a.t, failureMessage, msgAndArgs...) -} - -// False asserts that the specified value is false. -// -// a.False(myBool, "myBool should be false") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) False(value bool, msgAndArgs ...interface{}) { - False(a.t, value, msgAndArgs...) -} - -// HTTPBodyContains asserts that a specified handler returns a -// body that contains a string. -// -// a.HTTPBodyContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { - HTTPBodyContains(a.t, handler, method, url, values, str) -} - -// HTTPBodyNotContains asserts that a specified handler returns a -// body that does not contain a string. -// -// a.HTTPBodyNotContains(myHandler, "www.google.com", nil, "I'm Feeling Lucky") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}) { - HTTPBodyNotContains(a.t, handler, method, url, values, str) -} - -// HTTPError asserts that a specified handler returns an error status code. -// -// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values) { - HTTPError(a.t, handler, method, url, values) -} - -// HTTPRedirect asserts that a specified handler returns a redirect status code. -// -// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values) { - HTTPRedirect(a.t, handler, method, url, values) -} - -// HTTPSuccess asserts that a specified handler returns a success status code. -// -// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values) { - HTTPSuccess(a.t, handler, method, url, values) -} - -// Implements asserts that an object is implemented by the specified interface. -// -// a.Implements((*MyInterface)(nil), new(MyObject), "MyObject") -func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { - Implements(a.t, interfaceObject, object, msgAndArgs...) -} - -// InDelta asserts that the two numerals are within delta of each other. -// -// a.InDelta(math.Pi, (22 / 7.0), 0.01) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { - InDelta(a.t, expected, actual, delta, msgAndArgs...) -} - -// InDeltaSlice is the same as InDelta, except it compares two slices. -func (a *Assertions) InDeltaSlice(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { - InDeltaSlice(a.t, expected, actual, delta, msgAndArgs...) -} - -// InEpsilon asserts that expected and actual have a relative error less than epsilon -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) InEpsilon(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { - InEpsilon(a.t, expected, actual, epsilon, msgAndArgs...) -} - -// InEpsilonSlice is the same as InEpsilon, except it compares each value from two slices. -func (a *Assertions) InEpsilonSlice(expected interface{}, actual interface{}, epsilon float64, msgAndArgs ...interface{}) { - InEpsilonSlice(a.t, expected, actual, epsilon, msgAndArgs...) -} - -// IsType asserts that the specified objects are of the same type. -func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { - IsType(a.t, expectedType, object, msgAndArgs...) -} - -// JSONEq asserts that two JSON strings are equivalent. -// -// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) { - JSONEq(a.t, expected, actual, msgAndArgs...) -} - -// Len asserts that the specified object has specific length. -// Len also fails if the object has a type that len() not accept. -// -// a.Len(mySlice, 3, "The size of slice is not 3") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) { - Len(a.t, object, length, msgAndArgs...) -} - -// Nil asserts that the specified object is nil. -// -// a.Nil(err, "err should be nothing") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) { - Nil(a.t, object, msgAndArgs...) -} - -// NoError asserts that a function returned no error (i.e. `nil`). -// -// actualObj, err := SomeFunction() -// if a.NoError(err) { -// assert.Equal(t, actualObj, expectedObj) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { - NoError(a.t, err, msgAndArgs...) -} - -// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the -// specified substring or element. -// -// a.NotContains("Hello World", "Earth", "But 'Hello World' does NOT contain 'Earth'") -// a.NotContains(["Hello", "World"], "Earth", "But ['Hello', 'World'] does NOT contain 'Earth'") -// a.NotContains({"Hello": "World"}, "Earth", "But {'Hello': 'World'} does NOT contain 'Earth'") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { - NotContains(a.t, s, contains, msgAndArgs...) -} - -// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either -// a slice or a channel with len == 0. -// -// if a.NotEmpty(obj) { -// assert.Equal(t, "two", obj[1]) -// } -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { - NotEmpty(a.t, object, msgAndArgs...) -} - -// NotEqual asserts that the specified values are NOT equal. -// -// a.NotEqual(obj1, obj2, "two objects shouldn't be equal") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { - NotEqual(a.t, expected, actual, msgAndArgs...) -} - -// NotNil asserts that the specified object is not nil. -// -// a.NotNil(err, "err should be something") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) { - NotNil(a.t, object, msgAndArgs...) -} - -// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. -// -// a.NotPanics(func(){ -// RemainCalm() -// }, "Calling RemainCalm() should NOT panic") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { - NotPanics(a.t, f, msgAndArgs...) -} - -// NotRegexp asserts that a specified regexp does not match a string. -// -// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") -// a.NotRegexp("^start", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { - NotRegexp(a.t, rx, str, msgAndArgs...) -} - -// NotZero asserts that i is not the zero value for its type and returns the truth. -func (a *Assertions) NotZero(i interface{}, msgAndArgs ...interface{}) { - NotZero(a.t, i, msgAndArgs...) -} - -// Panics asserts that the code inside the specified PanicTestFunc panics. -// -// a.Panics(func(){ -// GoCrazy() -// }, "Calling GoCrazy() should panic") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { - Panics(a.t, f, msgAndArgs...) -} - -// Regexp asserts that a specified regexp matches a string. -// -// a.Regexp(regexp.MustCompile("start"), "it's starting") -// a.Regexp("start...$", "it's not starting") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { - Regexp(a.t, rx, str, msgAndArgs...) -} - -// True asserts that the specified value is true. -// -// a.True(myBool, "myBool should be true") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) True(value bool, msgAndArgs ...interface{}) { - True(a.t, value, msgAndArgs...) -} - -// WithinDuration asserts that the two times are within duration delta of each other. -// -// a.WithinDuration(time.Now(), time.Now(), 10*time.Second, "The difference should not be more than 10s") -// -// Returns whether the assertion was successful (true) or not (false). -func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { - WithinDuration(a.t, expected, actual, delta, msgAndArgs...) -} - -// Zero asserts that i is the zero value for its type and returns the truth. -func (a *Assertions) Zero(i interface{}, msgAndArgs ...interface{}) { - Zero(a.t, i, msgAndArgs...) -} diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl b/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl deleted file mode 100644 index b93569e..0000000 --- a/vendor/github.com/stretchr/testify/require/require_forward.go.tmpl +++ /dev/null @@ -1,4 +0,0 @@ -{{.CommentWithoutT "a"}} -func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { - {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) -} diff --git a/vendor/github.com/stretchr/testify/require/requirements.go b/vendor/github.com/stretchr/testify/require/requirements.go deleted file mode 100644 index 4114756..0000000 --- a/vendor/github.com/stretchr/testify/require/requirements.go +++ /dev/null @@ -1,9 +0,0 @@ -package require - -// TestingT is an interface wrapper around *testing.T -type TestingT interface { - Errorf(format string, args ...interface{}) - FailNow() -} - -//go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl diff --git a/vendor/github.com/stretchr/testify/require/requirements_test.go b/vendor/github.com/stretchr/testify/require/requirements_test.go deleted file mode 100644 index d2ccc99..0000000 --- a/vendor/github.com/stretchr/testify/require/requirements_test.go +++ /dev/null @@ -1,369 +0,0 @@ -package require - -import ( - "errors" - "testing" - "time" -) - -// AssertionTesterInterface defines an interface to be used for testing assertion methods -type AssertionTesterInterface interface { - TestMethod() -} - -// AssertionTesterConformingObject is an object that conforms to the AssertionTesterInterface interface -type AssertionTesterConformingObject struct { -} - -func (a *AssertionTesterConformingObject) TestMethod() { -} - -// AssertionTesterNonConformingObject is an object that does not conform to the AssertionTesterInterface interface -type AssertionTesterNonConformingObject struct { -} - -type MockT struct { - Failed bool -} - -func (t *MockT) FailNow() { - t.Failed = true -} - -func (t *MockT) Errorf(format string, args ...interface{}) { - _, _ = format, args -} - -func TestImplements(t *testing.T) { - - Implements(t, (*AssertionTesterInterface)(nil), new(AssertionTesterConformingObject)) - - mockT := new(MockT) - Implements(mockT, (*AssertionTesterInterface)(nil), new(AssertionTesterNonConformingObject)) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestIsType(t *testing.T) { - - IsType(t, new(AssertionTesterConformingObject), new(AssertionTesterConformingObject)) - - mockT := new(MockT) - IsType(mockT, new(AssertionTesterConformingObject), new(AssertionTesterNonConformingObject)) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestEqual(t *testing.T) { - - Equal(t, 1, 1) - - mockT := new(MockT) - Equal(mockT, 1, 2) - if !mockT.Failed { - t.Error("Check should fail") - } - -} - -func TestNotEqual(t *testing.T) { - - NotEqual(t, 1, 2) - mockT := new(MockT) - NotEqual(mockT, 2, 2) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestExactly(t *testing.T) { - - a := float32(1) - b := float32(1) - c := float64(1) - - Exactly(t, a, b) - - mockT := new(MockT) - Exactly(mockT, a, c) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotNil(t *testing.T) { - - NotNil(t, new(AssertionTesterConformingObject)) - - mockT := new(MockT) - NotNil(mockT, nil) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNil(t *testing.T) { - - Nil(t, nil) - - mockT := new(MockT) - Nil(mockT, new(AssertionTesterConformingObject)) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestTrue(t *testing.T) { - - True(t, true) - - mockT := new(MockT) - True(mockT, false) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestFalse(t *testing.T) { - - False(t, false) - - mockT := new(MockT) - False(mockT, true) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestContains(t *testing.T) { - - Contains(t, "Hello World", "Hello") - - mockT := new(MockT) - Contains(mockT, "Hello World", "Salut") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotContains(t *testing.T) { - - NotContains(t, "Hello World", "Hello!") - - mockT := new(MockT) - NotContains(mockT, "Hello World", "Hello") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestPanics(t *testing.T) { - - Panics(t, func() { - panic("Panic!") - }) - - mockT := new(MockT) - Panics(mockT, func() {}) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotPanics(t *testing.T) { - - NotPanics(t, func() {}) - - mockT := new(MockT) - NotPanics(mockT, func() { - panic("Panic!") - }) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNoError(t *testing.T) { - - NoError(t, nil) - - mockT := new(MockT) - NoError(mockT, errors.New("some error")) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestError(t *testing.T) { - - Error(t, errors.New("some error")) - - mockT := new(MockT) - Error(mockT, nil) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestEqualError(t *testing.T) { - - EqualError(t, errors.New("some error"), "some error") - - mockT := new(MockT) - EqualError(mockT, errors.New("some error"), "Not some error") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestEmpty(t *testing.T) { - - Empty(t, "") - - mockT := new(MockT) - Empty(mockT, "x") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotEmpty(t *testing.T) { - - NotEmpty(t, "x") - - mockT := new(MockT) - NotEmpty(mockT, "") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestWithinDuration(t *testing.T) { - - a := time.Now() - b := a.Add(10 * time.Second) - - WithinDuration(t, a, b, 15*time.Second) - - mockT := new(MockT) - WithinDuration(mockT, a, b, 5*time.Second) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestInDelta(t *testing.T) { - - InDelta(t, 1.001, 1, 0.01) - - mockT := new(MockT) - InDelta(mockT, 1, 2, 0.5) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestZero(t *testing.T) { - - Zero(t, "") - - mockT := new(MockT) - Zero(mockT, "x") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestNotZero(t *testing.T) { - - NotZero(t, "x") - - mockT := new(MockT) - NotZero(mockT, "") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEq_EqualSONString(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, `{"hello": "world", "foo": "bar"}`, `{"hello": "world", "foo": "bar"}`) - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEq_EquivalentButNotEqual(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEq_HashOfArraysAndHashes(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, "{\r\n\t\"numeric\": 1.5,\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]],\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\"\r\n}", - "{\r\n\t\"numeric\": 1.5,\r\n\t\"hash\": {\"nested\": \"hash\", \"nested_slice\": [\"this\", \"is\", \"nested\"]},\r\n\t\"string\": \"foo\",\r\n\t\"array\": [{\"foo\": \"bar\"}, 1, \"string\", [\"nested\", \"array\", 5.5]]\r\n}") - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEq_Array(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, `["foo", {"hello": "world", "nested": "hash"}]`, `["foo", {"nested": "hash", "hello": "world"}]`) - if mockT.Failed { - t.Error("Check should pass") - } -} - -func TestJSONEq_HashAndArrayNotEquivalent(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, `["foo", {"hello": "world", "nested": "hash"}]`, `{"foo": "bar", {"nested": "hash", "hello": "world"}}`) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEq_HashesNotEquivalent(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, `{"foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEq_ActualIsNotJSON(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, `{"foo": "bar"}`, "Not JSON") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEq_ExpectedIsNotJSON(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, "Not JSON", `{"foo": "bar", "hello": "world"}`) - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEq_ExpectedAndActualNotJSON(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, "Not JSON", "Not JSON") - if !mockT.Failed { - t.Error("Check should fail") - } -} - -func TestJSONEq_ArraysOfDifferentOrder(t *testing.T) { - mockT := new(MockT) - JSONEq(mockT, `["foo", {"hello": "world", "nested": "hash"}]`, `[{ "hello": "world", "nested": "hash"}, "foo"]`) - if !mockT.Failed { - t.Error("Check should fail") - } -} diff --git a/vendor/gopkg.in/yaml.v2/.travis.yml b/vendor/gopkg.in/yaml.v2/.travis.yml new file mode 100644 index 0000000..055480b --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/.travis.yml @@ -0,0 +1,16 @@ +language: go + +go: + - "1.4.x" + - "1.5.x" + - "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" + +go_import_path: gopkg.in/yaml.v2 diff --git a/vendor/gopkg.in/yaml.v2/LICENSE b/vendor/gopkg.in/yaml.v2/LICENSE index a68e67f..8dada3e 100644 --- a/vendor/gopkg.in/yaml.v2/LICENSE +++ b/vendor/gopkg.in/yaml.v2/LICENSE @@ -1,188 +1,201 @@ - -Copyright (c) 2011-2014 - Canonical Inc. - -This software is licensed under the LGPLv3, included below. - -As a special exception to the GNU Lesser General Public License version 3 -("LGPL3"), the copyright holders of this Library give you permission to -convey to a third party a Combined Work that links statically or dynamically -to this Library without providing any Minimal Corresponding Source or -Minimal Application Code as set out in 4d or providing the installation -information set out in section 4e, provided that you comply with the other -provisions of LGPL3 and provided that you meet, for the Application the -terms and conditions of the license(s) which apply to the Application. - -Except as stated in this special exception, the provisions of LGPL3 will -continue to comply in full to this Library. If you modify this Library, you -may apply this exception to your version of this Library, but you are not -obliged to do so. If you do not wish to do so, delete this exception -statement from your version. This exception does not (and cannot) modify any -license terms which apply to the Application, with which you must still -comply. - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/gopkg.in/yaml.v2/NOTICE b/vendor/gopkg.in/yaml.v2/NOTICE new file mode 100644 index 0000000..866d74a --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/NOTICE @@ -0,0 +1,13 @@ +Copyright 2011-2016 Canonical Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/vendor/gopkg.in/yaml.v2/README.md b/vendor/gopkg.in/yaml.v2/README.md index d6c919e..b50c6e8 100644 --- a/vendor/gopkg.in/yaml.v2/README.md +++ b/vendor/gopkg.in/yaml.v2/README.md @@ -42,7 +42,7 @@ The package API for yaml v2 will remain stable as described in [gopkg.in](https: License ------- -The yaml package is licensed under the LGPL with an exception that allows it to be linked statically. Please see the LICENSE file for details. +The yaml package is licensed under the Apache License 2.0. Please see the LICENSE file for details. Example @@ -65,9 +65,14 @@ b: d: [3, 4] ` +// Note: struct fields must be public in order for unmarshal to +// correctly populate the data. type T struct { A string - B struct{C int; D []int ",flow"} + B struct { + RenamedC int `yaml:"c"` + D []int `yaml:",flow"` + } } func main() { diff --git a/vendor/gopkg.in/yaml.v2/apic.go b/vendor/gopkg.in/yaml.v2/apic.go index 95ec014..1f7e87e 100644 --- a/vendor/gopkg.in/yaml.v2/apic.go +++ b/vendor/gopkg.in/yaml.v2/apic.go @@ -2,7 +2,6 @@ package yaml import ( "io" - "os" ) func yaml_insert_token(parser *yaml_parser_t, pos int, token *yaml_token_t) { @@ -48,9 +47,9 @@ func yaml_string_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err return n, nil } -// File read handler. -func yaml_file_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { - return parser.input_file.Read(buffer) +// Reader read handler. +func yaml_reader_read_handler(parser *yaml_parser_t, buffer []byte) (n int, err error) { + return parser.input_reader.Read(buffer) } // Set a string input. @@ -64,12 +63,12 @@ func yaml_parser_set_input_string(parser *yaml_parser_t, input []byte) { } // Set a file input. -func yaml_parser_set_input_file(parser *yaml_parser_t, file *os.File) { +func yaml_parser_set_input_reader(parser *yaml_parser_t, r io.Reader) { if parser.read_handler != nil { panic("must set the input source only once") } - parser.read_handler = yaml_file_read_handler - parser.input_file = file + parser.read_handler = yaml_reader_read_handler + parser.input_reader = r } // Set the source encoding. @@ -81,14 +80,13 @@ func yaml_parser_set_encoding(parser *yaml_parser_t, encoding yaml_encoding_t) { } // Create a new emitter object. -func yaml_emitter_initialize(emitter *yaml_emitter_t) bool { +func yaml_emitter_initialize(emitter *yaml_emitter_t) { *emitter = yaml_emitter_t{ buffer: make([]byte, output_buffer_size), raw_buffer: make([]byte, 0, output_raw_buffer_size), states: make([]yaml_emitter_state_t, 0, initial_stack_size), events: make([]yaml_event_t, 0, initial_queue_size), } - return true } // Destroy an emitter object. @@ -102,9 +100,10 @@ func yaml_string_write_handler(emitter *yaml_emitter_t, buffer []byte) error { return nil } -// File write handler. -func yaml_file_write_handler(emitter *yaml_emitter_t, buffer []byte) error { - _, err := emitter.output_file.Write(buffer) +// yaml_writer_write_handler uses emitter.output_writer to write the +// emitted text. +func yaml_writer_write_handler(emitter *yaml_emitter_t, buffer []byte) error { + _, err := emitter.output_writer.Write(buffer) return err } @@ -118,12 +117,12 @@ func yaml_emitter_set_output_string(emitter *yaml_emitter_t, output_buffer *[]by } // Set a file output. -func yaml_emitter_set_output_file(emitter *yaml_emitter_t, file io.Writer) { +func yaml_emitter_set_output_writer(emitter *yaml_emitter_t, w io.Writer) { if emitter.write_handler != nil { panic("must set the output target only once") } - emitter.write_handler = yaml_file_write_handler - emitter.output_file = file + emitter.write_handler = yaml_writer_write_handler + emitter.output_writer = w } // Set the output encoding. @@ -252,41 +251,41 @@ func yaml_emitter_set_break(emitter *yaml_emitter_t, line_break yaml_break_t) { // // Create STREAM-START. -func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) bool { +func yaml_stream_start_event_initialize(event *yaml_event_t, encoding yaml_encoding_t) { *event = yaml_event_t{ typ: yaml_STREAM_START_EVENT, encoding: encoding, } - return true } // Create STREAM-END. -func yaml_stream_end_event_initialize(event *yaml_event_t) bool { +func yaml_stream_end_event_initialize(event *yaml_event_t) { *event = yaml_event_t{ typ: yaml_STREAM_END_EVENT, } - return true } // Create DOCUMENT-START. -func yaml_document_start_event_initialize(event *yaml_event_t, version_directive *yaml_version_directive_t, - tag_directives []yaml_tag_directive_t, implicit bool) bool { +func yaml_document_start_event_initialize( + event *yaml_event_t, + version_directive *yaml_version_directive_t, + tag_directives []yaml_tag_directive_t, + implicit bool, +) { *event = yaml_event_t{ typ: yaml_DOCUMENT_START_EVENT, version_directive: version_directive, tag_directives: tag_directives, implicit: implicit, } - return true } // Create DOCUMENT-END. -func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) bool { +func yaml_document_end_event_initialize(event *yaml_event_t, implicit bool) { *event = yaml_event_t{ typ: yaml_DOCUMENT_END_EVENT, implicit: implicit, } - return true } ///* @@ -348,7 +347,7 @@ func yaml_sequence_end_event_initialize(event *yaml_event_t) bool { } // Create MAPPING-START. -func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) bool { +func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte, implicit bool, style yaml_mapping_style_t) { *event = yaml_event_t{ typ: yaml_MAPPING_START_EVENT, anchor: anchor, @@ -356,15 +355,13 @@ func yaml_mapping_start_event_initialize(event *yaml_event_t, anchor, tag []byte implicit: implicit, style: yaml_style_t(style), } - return true } // Create MAPPING-END. -func yaml_mapping_end_event_initialize(event *yaml_event_t) bool { +func yaml_mapping_end_event_initialize(event *yaml_event_t) { *event = yaml_event_t{ typ: yaml_MAPPING_END_EVENT, } - return true } // Destroy an event object. @@ -471,7 +468,7 @@ func yaml_event_delete(event *yaml_event_t) { // } context // tag_directive *yaml_tag_directive_t // -// context.error = YAML_NO_ERROR // Eliminate a compliler warning. +// context.error = YAML_NO_ERROR // Eliminate a compiler warning. // // assert(document) // Non-NULL document object is expected. // diff --git a/vendor/gopkg.in/yaml.v2/decode.go b/vendor/gopkg.in/yaml.v2/decode.go index 085cddc..129bc2a 100644 --- a/vendor/gopkg.in/yaml.v2/decode.go +++ b/vendor/gopkg.in/yaml.v2/decode.go @@ -4,6 +4,7 @@ import ( "encoding" "encoding/base64" "fmt" + "io" "math" "reflect" "strconv" @@ -22,19 +23,22 @@ type node struct { kind int line, column int tag string - value string - implicit bool - children []*node - anchors map[string]*node + // For an alias node, alias holds the resolved alias. + alias *node + value string + implicit bool + children []*node + anchors map[string]*node } // ---------------------------------------------------------------------------- // Parser, produces a node tree out of a libyaml event stream. type parser struct { - parser yaml_parser_t - event yaml_event_t - doc *node + parser yaml_parser_t + event yaml_event_t + doc *node + doneInit bool } func newParser(b []byte) *parser { @@ -42,21 +46,30 @@ func newParser(b []byte) *parser { if !yaml_parser_initialize(&p.parser) { panic("failed to initialize YAML emitter") } - if len(b) == 0 { b = []byte{'\n'} } - yaml_parser_set_input_string(&p.parser, b) + return &p +} - p.skip() - if p.event.typ != yaml_STREAM_START_EVENT { - panic("expected stream start event, got " + strconv.Itoa(int(p.event.typ))) +func newParserFromReader(r io.Reader) *parser { + p := parser{} + if !yaml_parser_initialize(&p.parser) { + panic("failed to initialize YAML emitter") } - p.skip() + yaml_parser_set_input_reader(&p.parser, r) return &p } +func (p *parser) init() { + if p.doneInit { + return + } + p.expect(yaml_STREAM_START_EVENT) + p.doneInit = true +} + func (p *parser) destroy() { if p.event.typ != yaml_NO_EVENT { yaml_event_delete(&p.event) @@ -64,16 +77,35 @@ func (p *parser) destroy() { yaml_parser_delete(&p.parser) } -func (p *parser) skip() { - if p.event.typ != yaml_NO_EVENT { - if p.event.typ == yaml_STREAM_END_EVENT { - failf("attempted to go past the end of stream; corrupted value?") +// expect consumes an event from the event stream and +// checks that it's of the expected type. +func (p *parser) expect(e yaml_event_type_t) { + if p.event.typ == yaml_NO_EVENT { + if !yaml_parser_parse(&p.parser, &p.event) { + p.fail() } - yaml_event_delete(&p.event) + } + if p.event.typ == yaml_STREAM_END_EVENT { + failf("attempted to go past the end of stream; corrupted value?") + } + if p.event.typ != e { + p.parser.problem = fmt.Sprintf("expected %s event but got %s", e, p.event.typ) + p.fail() + } + yaml_event_delete(&p.event) + p.event.typ = yaml_NO_EVENT +} + +// peek peeks at the next event in the event stream, +// puts the results into p.event and returns the event type. +func (p *parser) peek() yaml_event_type_t { + if p.event.typ != yaml_NO_EVENT { + return p.event.typ } if !yaml_parser_parse(&p.parser, &p.event) { p.fail() } + return p.event.typ } func (p *parser) fail() { @@ -81,6 +113,10 @@ func (p *parser) fail() { var line int if p.parser.problem_mark.line != 0 { line = p.parser.problem_mark.line + // Scanner errors don't iterate line before returning error + if p.parser.error == yaml_SCANNER_ERROR { + line++ + } } else if p.parser.context_mark.line != 0 { line = p.parser.context_mark.line } @@ -103,7 +139,8 @@ func (p *parser) anchor(n *node, anchor []byte) { } func (p *parser) parse() *node { - switch p.event.typ { + p.init() + switch p.peek() { case yaml_SCALAR_EVENT: return p.scalar() case yaml_ALIAS_EVENT: @@ -118,9 +155,8 @@ func (p *parser) parse() *node { // Happens when attempting to decode an empty buffer. return nil default: - panic("attempted to parse unknown event: " + strconv.Itoa(int(p.event.typ))) + panic("attempted to parse unknown event: " + p.event.typ.String()) } - panic("unreachable") } func (p *parser) node(kind int) *node { @@ -135,19 +171,20 @@ func (p *parser) document() *node { n := p.node(documentNode) n.anchors = make(map[string]*node) p.doc = n - p.skip() + p.expect(yaml_DOCUMENT_START_EVENT) n.children = append(n.children, p.parse()) - if p.event.typ != yaml_DOCUMENT_END_EVENT { - panic("expected end of document event but got " + strconv.Itoa(int(p.event.typ))) - } - p.skip() + p.expect(yaml_DOCUMENT_END_EVENT) return n } func (p *parser) alias() *node { n := p.node(aliasNode) n.value = string(p.event.anchor) - p.skip() + n.alias = p.doc.anchors[n.value] + if n.alias == nil { + failf("unknown anchor '%s' referenced", n.value) + } + p.expect(yaml_ALIAS_EVENT) return n } @@ -157,29 +194,29 @@ func (p *parser) scalar() *node { n.tag = string(p.event.tag) n.implicit = p.event.implicit p.anchor(n, p.event.anchor) - p.skip() + p.expect(yaml_SCALAR_EVENT) return n } func (p *parser) sequence() *node { n := p.node(sequenceNode) p.anchor(n, p.event.anchor) - p.skip() - for p.event.typ != yaml_SEQUENCE_END_EVENT { + p.expect(yaml_SEQUENCE_START_EVENT) + for p.peek() != yaml_SEQUENCE_END_EVENT { n.children = append(n.children, p.parse()) } - p.skip() + p.expect(yaml_SEQUENCE_END_EVENT) return n } func (p *parser) mapping() *node { n := p.node(mappingNode) p.anchor(n, p.event.anchor) - p.skip() - for p.event.typ != yaml_MAPPING_END_EVENT { + p.expect(yaml_MAPPING_START_EVENT) + for p.peek() != yaml_MAPPING_END_EVENT { n.children = append(n.children, p.parse(), p.parse()) } - p.skip() + p.expect(yaml_MAPPING_END_EVENT) return n } @@ -188,9 +225,14 @@ func (p *parser) mapping() *node { type decoder struct { doc *node - aliases map[string]bool + aliases map[*node]bool mapType reflect.Type terrors []string + strict bool + + decodeCount int + aliasCount int + aliasDepth int } var ( @@ -198,11 +240,13 @@ var ( durationType = reflect.TypeOf(time.Duration(0)) defaultMapType = reflect.TypeOf(map[interface{}]interface{}{}) ifaceType = defaultMapType.Elem() + timeType = reflect.TypeOf(time.Time{}) + ptrTimeType = reflect.TypeOf(&time.Time{}) ) -func newDecoder() *decoder { - d := &decoder{mapType: defaultMapType} - d.aliases = make(map[string]bool) +func newDecoder(strict bool) *decoder { + d := &decoder{mapType: defaultMapType, strict: strict} + d.aliases = make(map[*node]bool) return d } @@ -251,7 +295,7 @@ func (d *decoder) callUnmarshaler(n *node, u Unmarshaler) (good bool) { // // If n holds a null value, prepare returns before doing anything. func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) { - if n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == "" && (n.value == "null" || n.value == "") { + if n.tag == yaml_NULL_TAG || n.kind == scalarNode && n.tag == "" && (n.value == "null" || n.value == "~" || n.value == "" && n.implicit) { return out, false, false } again := true @@ -274,7 +318,43 @@ func (d *decoder) prepare(n *node, out reflect.Value) (newout reflect.Value, unm return out, false, false } +const ( + // 400,000 decode operations is ~500kb of dense object declarations, or + // ~5kb of dense object declarations with 10000% alias expansion + alias_ratio_range_low = 400000 + + // 4,000,000 decode operations is ~5MB of dense object declarations, or + // ~4.5MB of dense object declarations with 10% alias expansion + alias_ratio_range_high = 4000000 + + // alias_ratio_range is the range over which we scale allowed alias ratios + alias_ratio_range = float64(alias_ratio_range_high - alias_ratio_range_low) +) + +func allowedAliasRatio(decodeCount int) float64 { + switch { + case decodeCount <= alias_ratio_range_low: + // allow 99% to come from alias expansion for small-to-medium documents + return 0.99 + case decodeCount >= alias_ratio_range_high: + // allow 10% to come from alias expansion for very large documents + return 0.10 + default: + // scale smoothly from 99% down to 10% over the range. + // this maps to 396,000 - 400,000 allowed alias-driven decodes over the range. + // 400,000 decode operations is ~100MB of allocations in worst-case scenarios (single-item maps). + return 0.99 - 0.89*(float64(decodeCount-alias_ratio_range_low)/alias_ratio_range) + } +} + func (d *decoder) unmarshal(n *node, out reflect.Value) (good bool) { + d.decodeCount++ + if d.aliasDepth > 0 { + d.aliasCount++ + } + if d.aliasCount > 100 && d.decodeCount > 1000 && float64(d.aliasCount)/float64(d.decodeCount) > allowedAliasRatio(d.decodeCount) { + failf("document contains excessive aliasing") + } switch n.kind { case documentNode: return d.document(n, out) @@ -308,16 +388,15 @@ func (d *decoder) document(n *node, out reflect.Value) (good bool) { } func (d *decoder) alias(n *node, out reflect.Value) (good bool) { - an, ok := d.doc.anchors[n.value] - if !ok { - failf("unknown anchor '%s' referenced", n.value) - } - if d.aliases[n.value] { + if d.aliases[n] { + // TODO this could actually be allowed in some circumstances. failf("anchor '%s' value contains itself", n.value) } - d.aliases[n.value] = true - good = d.unmarshal(an, out) - delete(d.aliases, n.value) + d.aliases[n] = true + d.aliasDepth++ + good = d.unmarshal(n.alias, out) + d.aliasDepth-- + delete(d.aliases, n) return good } @@ -329,7 +408,7 @@ func resetMap(out reflect.Value) { } } -func (d *decoder) scalar(n *node, out reflect.Value) (good bool) { +func (d *decoder) scalar(n *node, out reflect.Value) bool { var tag string var resolved interface{} if n.tag == "" && !n.implicit { @@ -353,9 +432,26 @@ func (d *decoder) scalar(n *node, out reflect.Value) (good bool) { } return true } - if s, ok := resolved.(string); ok && out.CanAddr() { - if u, ok := out.Addr().Interface().(encoding.TextUnmarshaler); ok { - err := u.UnmarshalText([]byte(s)) + if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { + // We've resolved to exactly the type we want, so use that. + out.Set(resolvedv) + return true + } + // Perhaps we can use the value as a TextUnmarshaler to + // set its value. + if out.CanAddr() { + u, ok := out.Addr().Interface().(encoding.TextUnmarshaler) + if ok { + var text []byte + if tag == yaml_BINARY_TAG { + text = []byte(resolved.(string)) + } else { + // We let any value be unmarshaled into TextUnmarshaler. + // That might be more lax than we'd like, but the + // TextUnmarshaler itself should bowl out any dubious values. + text = []byte(n.value) + } + err := u.UnmarshalText(text) if err != nil { fail(err) } @@ -366,46 +462,54 @@ func (d *decoder) scalar(n *node, out reflect.Value) (good bool) { case reflect.String: if tag == yaml_BINARY_TAG { out.SetString(resolved.(string)) - good = true - } else if resolved != nil { + return true + } + if resolved != nil { out.SetString(n.value) - good = true + return true } case reflect.Interface: if resolved == nil { out.Set(reflect.Zero(out.Type())) + } else if tag == yaml_TIMESTAMP_TAG { + // It looks like a timestamp but for backward compatibility + // reasons we set it as a string, so that code that unmarshals + // timestamp-like values into interface{} will continue to + // see a string and not a time.Time. + // TODO(v3) Drop this. + out.Set(reflect.ValueOf(n.value)) } else { out.Set(reflect.ValueOf(resolved)) } - good = true + return true case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: switch resolved := resolved.(type) { case int: if !out.OverflowInt(int64(resolved)) { out.SetInt(int64(resolved)) - good = true + return true } case int64: if !out.OverflowInt(resolved) { out.SetInt(resolved) - good = true + return true } case uint64: if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { out.SetInt(int64(resolved)) - good = true + return true } case float64: if resolved <= math.MaxInt64 && !out.OverflowInt(int64(resolved)) { out.SetInt(int64(resolved)) - good = true + return true } case string: if out.Type() == durationType { d, err := time.ParseDuration(resolved) if err == nil { out.SetInt(int64(d)) - good = true + return true } } } @@ -414,44 +518,49 @@ func (d *decoder) scalar(n *node, out reflect.Value) (good bool) { case int: if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) - good = true + return true } case int64: if resolved >= 0 && !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) - good = true + return true } case uint64: if !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) - good = true + return true } case float64: if resolved <= math.MaxUint64 && !out.OverflowUint(uint64(resolved)) { out.SetUint(uint64(resolved)) - good = true + return true } } case reflect.Bool: switch resolved := resolved.(type) { case bool: out.SetBool(resolved) - good = true + return true } case reflect.Float32, reflect.Float64: switch resolved := resolved.(type) { case int: out.SetFloat(float64(resolved)) - good = true + return true case int64: out.SetFloat(float64(resolved)) - good = true + return true case uint64: out.SetFloat(float64(resolved)) - good = true + return true case float64: out.SetFloat(resolved) - good = true + return true + } + case reflect.Struct: + if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { + out.Set(resolvedv) + return true } case reflect.Ptr: if out.Type().Elem() == reflect.TypeOf(resolved) { @@ -459,13 +568,11 @@ func (d *decoder) scalar(n *node, out reflect.Value) (good bool) { elem := reflect.New(out.Type().Elem()) elem.Elem().Set(reflect.ValueOf(resolved)) out.Set(elem) - good = true + return true } } - if !good { - d.terror(n, tag, out) - } - return good + d.terror(n, tag, out) + return false } func settableValueOf(i interface{}) reflect.Value { @@ -482,6 +589,10 @@ func (d *decoder) sequence(n *node, out reflect.Value) (good bool) { switch out.Kind() { case reflect.Slice: out.Set(reflect.MakeSlice(out.Type(), l, l)) + case reflect.Array: + if l != out.Len() { + failf("invalid array: want %d elements but got %d", out.Len(), l) + } case reflect.Interface: // No type hints. Will have to use a generic sequence. iface = out @@ -500,7 +611,9 @@ func (d *decoder) sequence(n *node, out reflect.Value) (good bool) { j++ } } - out.Set(out.Slice(0, j)) + if out.Kind() != reflect.Array { + out.Set(out.Slice(0, j)) + } if iface.IsValid() { iface.Set(out) } @@ -561,7 +674,7 @@ func (d *decoder) mapping(n *node, out reflect.Value) (good bool) { } e := reflect.New(et).Elem() if d.unmarshal(n.children[i+1], e) { - out.SetMapIndex(k, e) + d.setMapIndex(n.children[i+1], out, k, e) } } } @@ -569,6 +682,14 @@ func (d *decoder) mapping(n *node, out reflect.Value) (good bool) { return true } +func (d *decoder) setMapIndex(n *node, out, k, v reflect.Value) { + if d.strict && out.MapIndex(k) != zeroValue { + d.terrors = append(d.terrors, fmt.Sprintf("line %d: key %#v already set in map", n.line+1, k.Interface())) + return + } + out.SetMapIndex(k, v) +} + func (d *decoder) mappingSlice(n *node, out reflect.Value) (good bool) { outt := out.Type() if outt.Elem() != mapItemType { @@ -616,6 +737,10 @@ func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) { elemType = inlineMap.Type().Elem() } + var doneFields []bool + if d.strict { + doneFields = make([]bool, len(sinfo.FieldsList)) + } for i := 0; i < l; i += 2 { ni := n.children[i] if isMerge(ni) { @@ -626,6 +751,13 @@ func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) { continue } if info, ok := sinfo.FieldsMap[name.String()]; ok { + if d.strict { + if doneFields[info.Id] { + d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s already set in type %s", ni.line+1, name.String(), out.Type())) + continue + } + doneFields[info.Id] = true + } var field reflect.Value if info.Inline == nil { field = out.Field(info.Num) @@ -639,7 +771,9 @@ func (d *decoder) mappingStruct(n *node, out reflect.Value) (good bool) { } value := reflect.New(elemType).Elem() d.unmarshal(n.children[i+1], value) - inlineMap.SetMapIndex(name, value) + d.setMapIndex(n.children[i+1], inlineMap, name, value) + } else if d.strict { + d.terrors = append(d.terrors, fmt.Sprintf("line %d: field %s not found in type %s", ni.line+1, name.String(), out.Type())) } } return true @@ -654,8 +788,7 @@ func (d *decoder) merge(n *node, out reflect.Value) { case mappingNode: d.unmarshal(n, out) case aliasNode: - an, ok := d.doc.anchors[n.value] - if ok && an.kind != mappingNode { + if n.alias != nil && n.alias.kind != mappingNode { failWantMap() } d.unmarshal(n, out) @@ -664,8 +797,7 @@ func (d *decoder) merge(n *node, out reflect.Value) { for i := len(n.children) - 1; i >= 0; i-- { ni := n.children[i] if ni.kind == aliasNode { - an, ok := d.doc.anchors[ni.value] - if ok && an.kind != mappingNode { + if ni.alias != nil && ni.alias.kind != mappingNode { failWantMap() } } else if ni.kind != mappingNode { diff --git a/vendor/gopkg.in/yaml.v2/decode_test.go b/vendor/gopkg.in/yaml.v2/decode_test.go deleted file mode 100644 index 179f2ce..0000000 --- a/vendor/gopkg.in/yaml.v2/decode_test.go +++ /dev/null @@ -1,962 +0,0 @@ -package yaml_test - -import ( - "errors" - . "gopkg.in/check.v1" - "gopkg.in/yaml.v2" - "math" - "net" - "reflect" - "strings" - "time" -) - -var unmarshalIntTest = 123 - -var unmarshalTests = []struct { - data string - value interface{} -}{ - { - "", - &struct{}{}, - }, { - "{}", &struct{}{}, - }, { - "v: hi", - map[string]string{"v": "hi"}, - }, { - "v: hi", map[string]interface{}{"v": "hi"}, - }, { - "v: true", - map[string]string{"v": "true"}, - }, { - "v: true", - map[string]interface{}{"v": true}, - }, { - "v: 10", - map[string]interface{}{"v": 10}, - }, { - "v: 0b10", - map[string]interface{}{"v": 2}, - }, { - "v: 0xA", - map[string]interface{}{"v": 10}, - }, { - "v: 4294967296", - map[string]int64{"v": 4294967296}, - }, { - "v: 0.1", - map[string]interface{}{"v": 0.1}, - }, { - "v: .1", - map[string]interface{}{"v": 0.1}, - }, { - "v: .Inf", - map[string]interface{}{"v": math.Inf(+1)}, - }, { - "v: -.Inf", - map[string]interface{}{"v": math.Inf(-1)}, - }, { - "v: -10", - map[string]interface{}{"v": -10}, - }, { - "v: -.1", - map[string]interface{}{"v": -0.1}, - }, - - // Simple values. - { - "123", - &unmarshalIntTest, - }, - - // Floats from spec - { - "canonical: 6.8523e+5", - map[string]interface{}{"canonical": 6.8523e+5}, - }, { - "expo: 685.230_15e+03", - map[string]interface{}{"expo": 685.23015e+03}, - }, { - "fixed: 685_230.15", - map[string]interface{}{"fixed": 685230.15}, - }, { - "neginf: -.inf", - map[string]interface{}{"neginf": math.Inf(-1)}, - }, { - "fixed: 685_230.15", - map[string]float64{"fixed": 685230.15}, - }, - //{"sexa: 190:20:30.15", map[string]interface{}{"sexa": 0}}, // Unsupported - //{"notanum: .NaN", map[string]interface{}{"notanum": math.NaN()}}, // Equality of NaN fails. - - // Bools from spec - { - "canonical: y", - map[string]interface{}{"canonical": true}, - }, { - "answer: NO", - map[string]interface{}{"answer": false}, - }, { - "logical: True", - map[string]interface{}{"logical": true}, - }, { - "option: on", - map[string]interface{}{"option": true}, - }, { - "option: on", - map[string]bool{"option": true}, - }, - // Ints from spec - { - "canonical: 685230", - map[string]interface{}{"canonical": 685230}, - }, { - "decimal: +685_230", - map[string]interface{}{"decimal": 685230}, - }, { - "octal: 02472256", - map[string]interface{}{"octal": 685230}, - }, { - "hexa: 0x_0A_74_AE", - map[string]interface{}{"hexa": 685230}, - }, { - "bin: 0b1010_0111_0100_1010_1110", - map[string]interface{}{"bin": 685230}, - }, { - "bin: -0b101010", - map[string]interface{}{"bin": -42}, - }, { - "decimal: +685_230", - map[string]int{"decimal": 685230}, - }, - - //{"sexa: 190:20:30", map[string]interface{}{"sexa": 0}}, // Unsupported - - // Nulls from spec - { - "empty:", - map[string]interface{}{"empty": nil}, - }, { - "canonical: ~", - map[string]interface{}{"canonical": nil}, - }, { - "english: null", - map[string]interface{}{"english": nil}, - }, { - "~: null key", - map[interface{}]string{nil: "null key"}, - }, { - "empty:", - map[string]*bool{"empty": nil}, - }, - - // Flow sequence - { - "seq: [A,B]", - map[string]interface{}{"seq": []interface{}{"A", "B"}}, - }, { - "seq: [A,B,C,]", - map[string][]string{"seq": []string{"A", "B", "C"}}, - }, { - "seq: [A,1,C]", - map[string][]string{"seq": []string{"A", "1", "C"}}, - }, { - "seq: [A,1,C]", - map[string][]int{"seq": []int{1}}, - }, { - "seq: [A,1,C]", - map[string]interface{}{"seq": []interface{}{"A", 1, "C"}}, - }, - // Block sequence - { - "seq:\n - A\n - B", - map[string]interface{}{"seq": []interface{}{"A", "B"}}, - }, { - "seq:\n - A\n - B\n - C", - map[string][]string{"seq": []string{"A", "B", "C"}}, - }, { - "seq:\n - A\n - 1\n - C", - map[string][]string{"seq": []string{"A", "1", "C"}}, - }, { - "seq:\n - A\n - 1\n - C", - map[string][]int{"seq": []int{1}}, - }, { - "seq:\n - A\n - 1\n - C", - map[string]interface{}{"seq": []interface{}{"A", 1, "C"}}, - }, - - // Literal block scalar - { - "scalar: | # Comment\n\n literal\n\n \ttext\n\n", - map[string]string{"scalar": "\nliteral\n\n\ttext\n"}, - }, - - // Folded block scalar - { - "scalar: > # Comment\n\n folded\n line\n \n next\n line\n * one\n * two\n\n last\n line\n\n", - map[string]string{"scalar": "\nfolded line\nnext line\n * one\n * two\n\nlast line\n"}, - }, - - // Map inside interface with no type hints. - { - "a: {b: c}", - map[interface{}]interface{}{"a": map[interface{}]interface{}{"b": "c"}}, - }, - - // Structs and type conversions. - { - "hello: world", - &struct{ Hello string }{"world"}, - }, { - "a: {b: c}", - &struct{ A struct{ B string } }{struct{ B string }{"c"}}, - }, { - "a: {b: c}", - &struct{ A *struct{ B string } }{&struct{ B string }{"c"}}, - }, { - "a: {b: c}", - &struct{ A map[string]string }{map[string]string{"b": "c"}}, - }, { - "a: {b: c}", - &struct{ A *map[string]string }{&map[string]string{"b": "c"}}, - }, { - "a:", - &struct{ A map[string]string }{}, - }, { - "a: 1", - &struct{ A int }{1}, - }, { - "a: 1", - &struct{ A float64 }{1}, - }, { - "a: 1.0", - &struct{ A int }{1}, - }, { - "a: 1.0", - &struct{ A uint }{1}, - }, { - "a: [1, 2]", - &struct{ A []int }{[]int{1, 2}}, - }, { - "a: 1", - &struct{ B int }{0}, - }, { - "a: 1", - &struct { - B int "a" - }{1}, - }, { - "a: y", - &struct{ A bool }{true}, - }, - - // Some cross type conversions - { - "v: 42", - map[string]uint{"v": 42}, - }, { - "v: -42", - map[string]uint{}, - }, { - "v: 4294967296", - map[string]uint64{"v": 4294967296}, - }, { - "v: -4294967296", - map[string]uint64{}, - }, - - // int - { - "int_max: 2147483647", - map[string]int{"int_max": math.MaxInt32}, - }, - { - "int_min: -2147483648", - map[string]int{"int_min": math.MinInt32}, - }, - { - "int_overflow: 9223372036854775808", // math.MaxInt64 + 1 - map[string]int{}, - }, - - // int64 - { - "int64_max: 9223372036854775807", - map[string]int64{"int64_max": math.MaxInt64}, - }, - { - "int64_max_base2: 0b111111111111111111111111111111111111111111111111111111111111111", - map[string]int64{"int64_max_base2": math.MaxInt64}, - }, - { - "int64_min: -9223372036854775808", - map[string]int64{"int64_min": math.MinInt64}, - }, - { - "int64_neg_base2: -0b111111111111111111111111111111111111111111111111111111111111111", - map[string]int64{"int64_neg_base2": -math.MaxInt64}, - }, - { - "int64_overflow: 9223372036854775808", // math.MaxInt64 + 1 - map[string]int64{}, - }, - - // uint - { - "uint_min: 0", - map[string]uint{"uint_min": 0}, - }, - { - "uint_max: 4294967295", - map[string]uint{"uint_max": math.MaxUint32}, - }, - { - "uint_underflow: -1", - map[string]uint{}, - }, - - // uint64 - { - "uint64_min: 0", - map[string]uint{"uint64_min": 0}, - }, - { - "uint64_max: 18446744073709551615", - map[string]uint64{"uint64_max": math.MaxUint64}, - }, - { - "uint64_max_base2: 0b1111111111111111111111111111111111111111111111111111111111111111", - map[string]uint64{"uint64_max_base2": math.MaxUint64}, - }, - { - "uint64_maxint64: 9223372036854775807", - map[string]uint64{"uint64_maxint64": math.MaxInt64}, - }, - { - "uint64_underflow: -1", - map[string]uint64{}, - }, - - // float32 - { - "float32_max: 3.40282346638528859811704183484516925440e+38", - map[string]float32{"float32_max": math.MaxFloat32}, - }, - { - "float32_nonzero: 1.401298464324817070923729583289916131280e-45", - map[string]float32{"float32_nonzero": math.SmallestNonzeroFloat32}, - }, - { - "float32_maxuint64: 18446744073709551615", - map[string]float32{"float32_maxuint64": float32(math.MaxUint64)}, - }, - { - "float32_maxuint64+1: 18446744073709551616", - map[string]float32{"float32_maxuint64+1": float32(math.MaxUint64 + 1)}, - }, - - // float64 - { - "float64_max: 1.797693134862315708145274237317043567981e+308", - map[string]float64{"float64_max": math.MaxFloat64}, - }, - { - "float64_nonzero: 4.940656458412465441765687928682213723651e-324", - map[string]float64{"float64_nonzero": math.SmallestNonzeroFloat64}, - }, - { - "float64_maxuint64: 18446744073709551615", - map[string]float64{"float64_maxuint64": float64(math.MaxUint64)}, - }, - { - "float64_maxuint64+1: 18446744073709551616", - map[string]float64{"float64_maxuint64+1": float64(math.MaxUint64 + 1)}, - }, - - // Overflow cases. - { - "v: 4294967297", - map[string]int32{}, - }, { - "v: 128", - map[string]int8{}, - }, - - // Quoted values. - { - "'1': '\"2\"'", - map[interface{}]interface{}{"1": "\"2\""}, - }, { - "v:\n- A\n- 'B\n\n C'\n", - map[string][]string{"v": []string{"A", "B\nC"}}, - }, - - // Explicit tags. - { - "v: !!float '1.1'", - map[string]interface{}{"v": 1.1}, - }, { - "v: !!null ''", - map[string]interface{}{"v": nil}, - }, { - "%TAG !y! tag:yaml.org,2002:\n---\nv: !y!int '1'", - map[string]interface{}{"v": 1}, - }, - - // Anchors and aliases. - { - "a: &x 1\nb: &y 2\nc: *x\nd: *y\n", - &struct{ A, B, C, D int }{1, 2, 1, 2}, - }, { - "a: &a {c: 1}\nb: *a", - &struct { - A, B struct { - C int - } - }{struct{ C int }{1}, struct{ C int }{1}}, - }, { - "a: &a [1, 2]\nb: *a", - &struct{ B []int }{[]int{1, 2}}, - }, { - "b: *a\na: &a {c: 1}", - &struct { - A, B struct { - C int - } - }{struct{ C int }{1}, struct{ C int }{1}}, - }, - - // Bug #1133337 - { - "foo: ''", - map[string]*string{"foo": new(string)}, - }, { - "foo: null", - map[string]string{"foo": ""}, - }, { - "foo: null", - map[string]interface{}{"foo": nil}, - }, - - // Ignored field - { - "a: 1\nb: 2\n", - &struct { - A int - B int "-" - }{1, 0}, - }, - - // Bug #1191981 - { - "" + - "%YAML 1.1\n" + - "--- !!str\n" + - `"Generic line break (no glyph)\n\` + "\n" + - ` Generic line break (glyphed)\n\` + "\n" + - ` Line separator\u2028\` + "\n" + - ` Paragraph separator\u2029"` + "\n", - "" + - "Generic line break (no glyph)\n" + - "Generic line break (glyphed)\n" + - "Line separator\u2028Paragraph separator\u2029", - }, - - // Struct inlining - { - "a: 1\nb: 2\nc: 3\n", - &struct { - A int - C inlineB `yaml:",inline"` - }{1, inlineB{2, inlineC{3}}}, - }, - - // Map inlining - { - "a: 1\nb: 2\nc: 3\n", - &struct { - A int - C map[string]int `yaml:",inline"` - }{1, map[string]int{"b": 2, "c": 3}}, - }, - - // bug 1243827 - { - "a: -b_c", - map[string]interface{}{"a": "-b_c"}, - }, - { - "a: +b_c", - map[string]interface{}{"a": "+b_c"}, - }, - { - "a: 50cent_of_dollar", - map[string]interface{}{"a": "50cent_of_dollar"}, - }, - - // Duration - { - "a: 3s", - map[string]time.Duration{"a": 3 * time.Second}, - }, - - // Issue #24. - { - "a: ", - map[string]string{"a": ""}, - }, - - // Base 60 floats are obsolete and unsupported. - { - "a: 1:1\n", - map[string]string{"a": "1:1"}, - }, - - // Binary data. - { - "a: !!binary gIGC\n", - map[string]string{"a": "\x80\x81\x82"}, - }, { - "a: !!binary |\n " + strings.Repeat("kJCQ", 17) + "kJ\n CQ\n", - map[string]string{"a": strings.Repeat("\x90", 54)}, - }, { - "a: !!binary |\n " + strings.Repeat("A", 70) + "\n ==\n", - map[string]string{"a": strings.Repeat("\x00", 52)}, - }, - - // Ordered maps. - { - "{b: 2, a: 1, d: 4, c: 3, sub: {e: 5}}", - &yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}}, - }, - - // Issue #39. - { - "a:\n b:\n c: d\n", - map[string]struct{ B interface{} }{"a": {map[interface{}]interface{}{"c": "d"}}}, - }, - - // Custom map type. - { - "a: {b: c}", - M{"a": M{"b": "c"}}, - }, - - // Support encoding.TextUnmarshaler. - { - "a: 1.2.3.4\n", - map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)}, - }, - - // Encode empty lists as zero-length slices. - { - "a: []", - &struct{ A []int }{[]int{}}, - }, -} - -type M map[interface{}]interface{} - -type inlineB struct { - B int - inlineC `yaml:",inline"` -} - -type inlineC struct { - C int -} - -func (s *S) TestUnmarshal(c *C) { - for _, item := range unmarshalTests { - t := reflect.ValueOf(item.value).Type() - var value interface{} - switch t.Kind() { - case reflect.Map: - value = reflect.MakeMap(t).Interface() - case reflect.String: - value = reflect.New(t).Interface() - case reflect.Ptr: - value = reflect.New(t.Elem()).Interface() - default: - c.Fatalf("missing case for %s", t) - } - err := yaml.Unmarshal([]byte(item.data), value) - if _, ok := err.(*yaml.TypeError); !ok { - c.Assert(err, IsNil) - } - if t.Kind() == reflect.String { - c.Assert(*value.(*string), Equals, item.value) - } else { - c.Assert(value, DeepEquals, item.value) - } - } -} - -func (s *S) TestUnmarshalNaN(c *C) { - value := map[string]interface{}{} - err := yaml.Unmarshal([]byte("notanum: .NaN"), &value) - c.Assert(err, IsNil) - c.Assert(math.IsNaN(value["notanum"].(float64)), Equals, true) -} - -var unmarshalErrorTests = []struct { - data, error string -}{ - {"v: !!float 'error'", "yaml: cannot decode !!str `error` as a !!float"}, - {"v: [A,", "yaml: line 1: did not find expected node content"}, - {"v:\n- [A,", "yaml: line 2: did not find expected node content"}, - {"a: *b\n", "yaml: unknown anchor 'b' referenced"}, - {"a: &a\n b: *a\n", "yaml: anchor 'a' value contains itself"}, - {"value: -", "yaml: block sequence entries are not allowed in this context"}, - {"a: !!binary ==", "yaml: !!binary value contains invalid base64 data"}, - {"{[.]}", `yaml: invalid map key: \[\]interface \{\}\{"\."\}`}, - {"{{.}}", `yaml: invalid map key: map\[interface\ \{\}\]interface \{\}\{".":interface \{\}\(nil\)\}`}, -} - -func (s *S) TestUnmarshalErrors(c *C) { - for _, item := range unmarshalErrorTests { - var value interface{} - err := yaml.Unmarshal([]byte(item.data), &value) - c.Assert(err, ErrorMatches, item.error, Commentf("Partial unmarshal: %#v", value)) - } -} - -var unmarshalerTests = []struct { - data, tag string - value interface{} -}{ - {"_: {hi: there}", "!!map", map[interface{}]interface{}{"hi": "there"}}, - {"_: [1,A]", "!!seq", []interface{}{1, "A"}}, - {"_: 10", "!!int", 10}, - {"_: null", "!!null", nil}, - {`_: BAR!`, "!!str", "BAR!"}, - {`_: "BAR!"`, "!!str", "BAR!"}, - {"_: !!foo 'BAR!'", "!!foo", "BAR!"}, -} - -var unmarshalerResult = map[int]error{} - -type unmarshalerType struct { - value interface{} -} - -func (o *unmarshalerType) UnmarshalYAML(unmarshal func(v interface{}) error) error { - if err := unmarshal(&o.value); err != nil { - return err - } - if i, ok := o.value.(int); ok { - if result, ok := unmarshalerResult[i]; ok { - return result - } - } - return nil -} - -type unmarshalerPointer struct { - Field *unmarshalerType "_" -} - -type unmarshalerValue struct { - Field unmarshalerType "_" -} - -func (s *S) TestUnmarshalerPointerField(c *C) { - for _, item := range unmarshalerTests { - obj := &unmarshalerPointer{} - err := yaml.Unmarshal([]byte(item.data), obj) - c.Assert(err, IsNil) - if item.value == nil { - c.Assert(obj.Field, IsNil) - } else { - c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value)) - c.Assert(obj.Field.value, DeepEquals, item.value) - } - } -} - -func (s *S) TestUnmarshalerValueField(c *C) { - for _, item := range unmarshalerTests { - obj := &unmarshalerValue{} - err := yaml.Unmarshal([]byte(item.data), obj) - c.Assert(err, IsNil) - c.Assert(obj.Field, NotNil, Commentf("Pointer not initialized (%#v)", item.value)) - c.Assert(obj.Field.value, DeepEquals, item.value) - } -} - -func (s *S) TestUnmarshalerWholeDocument(c *C) { - obj := &unmarshalerType{} - err := yaml.Unmarshal([]byte(unmarshalerTests[0].data), obj) - c.Assert(err, IsNil) - value, ok := obj.value.(map[interface{}]interface{}) - c.Assert(ok, Equals, true, Commentf("value: %#v", obj.value)) - c.Assert(value["_"], DeepEquals, unmarshalerTests[0].value) -} - -func (s *S) TestUnmarshalerTypeError(c *C) { - unmarshalerResult[2] = &yaml.TypeError{[]string{"foo"}} - unmarshalerResult[4] = &yaml.TypeError{[]string{"bar"}} - defer func() { - delete(unmarshalerResult, 2) - delete(unmarshalerResult, 4) - }() - - type T struct { - Before int - After int - M map[string]*unmarshalerType - } - var v T - data := `{before: A, m: {abc: 1, def: 2, ghi: 3, jkl: 4}, after: B}` - err := yaml.Unmarshal([]byte(data), &v) - c.Assert(err, ErrorMatches, ""+ - "yaml: unmarshal errors:\n"+ - " line 1: cannot unmarshal !!str `A` into int\n"+ - " foo\n"+ - " bar\n"+ - " line 1: cannot unmarshal !!str `B` into int") - c.Assert(v.M["abc"], NotNil) - c.Assert(v.M["def"], IsNil) - c.Assert(v.M["ghi"], NotNil) - c.Assert(v.M["jkl"], IsNil) - - c.Assert(v.M["abc"].value, Equals, 1) - c.Assert(v.M["ghi"].value, Equals, 3) -} - -type proxyTypeError struct{} - -func (v *proxyTypeError) UnmarshalYAML(unmarshal func(interface{}) error) error { - var s string - var a int32 - var b int64 - if err := unmarshal(&s); err != nil { - panic(err) - } - if s == "a" { - if err := unmarshal(&b); err == nil { - panic("should have failed") - } - return unmarshal(&a) - } - if err := unmarshal(&a); err == nil { - panic("should have failed") - } - return unmarshal(&b) -} - -func (s *S) TestUnmarshalerTypeErrorProxying(c *C) { - type T struct { - Before int - After int - M map[string]*proxyTypeError - } - var v T - data := `{before: A, m: {abc: a, def: b}, after: B}` - err := yaml.Unmarshal([]byte(data), &v) - c.Assert(err, ErrorMatches, ""+ - "yaml: unmarshal errors:\n"+ - " line 1: cannot unmarshal !!str `A` into int\n"+ - " line 1: cannot unmarshal !!str `a` into int32\n"+ - " line 1: cannot unmarshal !!str `b` into int64\n"+ - " line 1: cannot unmarshal !!str `B` into int") -} - -type failingUnmarshaler struct{} - -var failingErr = errors.New("failingErr") - -func (ft *failingUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error { - return failingErr -} - -func (s *S) TestUnmarshalerError(c *C) { - err := yaml.Unmarshal([]byte("a: b"), &failingUnmarshaler{}) - c.Assert(err, Equals, failingErr) -} - -type sliceUnmarshaler []int - -func (su *sliceUnmarshaler) UnmarshalYAML(unmarshal func(interface{}) error) error { - var slice []int - err := unmarshal(&slice) - if err == nil { - *su = slice - return nil - } - - var intVal int - err = unmarshal(&intVal) - if err == nil { - *su = []int{intVal} - return nil - } - - return err -} - -func (s *S) TestUnmarshalerRetry(c *C) { - var su sliceUnmarshaler - err := yaml.Unmarshal([]byte("[1, 2, 3]"), &su) - c.Assert(err, IsNil) - c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1, 2, 3})) - - err = yaml.Unmarshal([]byte("1"), &su) - c.Assert(err, IsNil) - c.Assert(su, DeepEquals, sliceUnmarshaler([]int{1})) -} - -// From http://yaml.org/type/merge.html -var mergeTests = ` -anchors: - list: - - &CENTER { "x": 1, "y": 2 } - - &LEFT { "x": 0, "y": 2 } - - &BIG { "r": 10 } - - &SMALL { "r": 1 } - -# All the following maps are equal: - -plain: - # Explicit keys - "x": 1 - "y": 2 - "r": 10 - label: center/big - -mergeOne: - # Merge one map - << : *CENTER - "r": 10 - label: center/big - -mergeMultiple: - # Merge multiple maps - << : [ *CENTER, *BIG ] - label: center/big - -override: - # Override - << : [ *BIG, *LEFT, *SMALL ] - "x": 1 - label: center/big - -shortTag: - # Explicit short merge tag - !!merge "<<" : [ *CENTER, *BIG ] - label: center/big - -longTag: - # Explicit merge long tag - ! "<<" : [ *CENTER, *BIG ] - label: center/big - -inlineMap: - # Inlined map - << : {"x": 1, "y": 2, "r": 10} - label: center/big - -inlineSequenceMap: - # Inlined map in sequence - << : [ *CENTER, {"r": 10} ] - label: center/big -` - -func (s *S) TestMerge(c *C) { - var want = map[interface{}]interface{}{ - "x": 1, - "y": 2, - "r": 10, - "label": "center/big", - } - - var m map[interface{}]interface{} - err := yaml.Unmarshal([]byte(mergeTests), &m) - c.Assert(err, IsNil) - for name, test := range m { - if name == "anchors" { - continue - } - c.Assert(test, DeepEquals, want, Commentf("test %q failed", name)) - } -} - -func (s *S) TestMergeStruct(c *C) { - type Data struct { - X, Y, R int - Label string - } - want := Data{1, 2, 10, "center/big"} - - var m map[string]Data - err := yaml.Unmarshal([]byte(mergeTests), &m) - c.Assert(err, IsNil) - for name, test := range m { - if name == "anchors" { - continue - } - c.Assert(test, Equals, want, Commentf("test %q failed", name)) - } -} - -var unmarshalNullTests = []func() interface{}{ - func() interface{} { var v interface{}; v = "v"; return &v }, - func() interface{} { var s = "s"; return &s }, - func() interface{} { var s = "s"; sptr := &s; return &sptr }, - func() interface{} { var i = 1; return &i }, - func() interface{} { var i = 1; iptr := &i; return &iptr }, - func() interface{} { m := map[string]int{"s": 1}; return &m }, - func() interface{} { m := map[string]int{"s": 1}; return m }, -} - -func (s *S) TestUnmarshalNull(c *C) { - for _, test := range unmarshalNullTests { - item := test() - zero := reflect.Zero(reflect.TypeOf(item).Elem()).Interface() - err := yaml.Unmarshal([]byte("null"), item) - c.Assert(err, IsNil) - if reflect.TypeOf(item).Kind() == reflect.Map { - c.Assert(reflect.ValueOf(item).Interface(), DeepEquals, reflect.MakeMap(reflect.TypeOf(item)).Interface()) - } else { - c.Assert(reflect.ValueOf(item).Elem().Interface(), DeepEquals, zero) - } - } -} - -func (s *S) TestUnmarshalSliceOnPreset(c *C) { - // Issue #48. - v := struct{ A []int }{[]int{1}} - yaml.Unmarshal([]byte("a: [2]"), &v) - c.Assert(v.A, DeepEquals, []int{2}) -} - -//var data []byte -//func init() { -// var err error -// data, err = ioutil.ReadFile("/tmp/file.yaml") -// if err != nil { -// panic(err) -// } -//} -// -//func (s *S) BenchmarkUnmarshal(c *C) { -// var err error -// for i := 0; i < c.N; i++ { -// var v map[string]interface{} -// err = yaml.Unmarshal(data, &v) -// } -// if err != nil { -// panic(err) -// } -//} -// -//func (s *S) BenchmarkMarshal(c *C) { -// var v map[string]interface{} -// yaml.Unmarshal(data, &v) -// c.ResetTimer() -// for i := 0; i < c.N; i++ { -// yaml.Marshal(&v) -// } -//} diff --git a/vendor/gopkg.in/yaml.v2/emitterc.go b/vendor/gopkg.in/yaml.v2/emitterc.go index 9b3dc4a..a1c2cc5 100644 --- a/vendor/gopkg.in/yaml.v2/emitterc.go +++ b/vendor/gopkg.in/yaml.v2/emitterc.go @@ -2,6 +2,7 @@ package yaml import ( "bytes" + "fmt" ) // Flush the buffer if needed. @@ -664,9 +665,8 @@ func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, return yaml_emitter_emit_mapping_start(emitter, event) default: return yaml_emitter_set_emitter_error(emitter, - "expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS") + fmt.Sprintf("expected SCALAR, SEQUENCE-START, MAPPING-START, or ALIAS, but got %v", event.typ)) } - return false } // Expect ALIAS. @@ -843,7 +843,7 @@ func yaml_emitter_select_scalar_style(emitter *yaml_emitter_t, event *yaml_event return true } -// Write an achor. +// Write an anchor. func yaml_emitter_process_anchor(emitter *yaml_emitter_t) bool { if emitter.anchor_data.anchor == nil { return true @@ -995,10 +995,10 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { break_space = false space_break = false - preceeded_by_whitespace = false - followed_by_whitespace = false - previous_space = false - previous_break = false + preceded_by_whitespace = false + followed_by_whitespace = false + previous_space = false + previous_break = false ) emitter.scalar_data.value = value @@ -1017,9 +1017,9 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { flow_indicators = true } - preceeded_by_whitespace = true + preceded_by_whitespace = true for i, w := 0, 0; i < len(value); i += w { - w = width(value[0]) + w = width(value[i]) followed_by_whitespace = i+w >= len(value) || is_blank(value, i+w) if i == 0 { @@ -1048,7 +1048,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { block_indicators = true } case '#': - if preceeded_by_whitespace { + if preceded_by_whitespace { flow_indicators = true block_indicators = true } @@ -1089,7 +1089,7 @@ func yaml_emitter_analyze_scalar(emitter *yaml_emitter_t, value []byte) bool { } // [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition. - preceeded_by_whitespace = is_blankz(value, i) + preceded_by_whitespace = is_blankz(value, i) } emitter.scalar_data.multiline = line_breaks diff --git a/vendor/gopkg.in/yaml.v2/encode.go b/vendor/gopkg.in/yaml.v2/encode.go index 84f8499..0ee738e 100644 --- a/vendor/gopkg.in/yaml.v2/encode.go +++ b/vendor/gopkg.in/yaml.v2/encode.go @@ -3,38 +3,67 @@ package yaml import ( "encoding" "fmt" + "io" "reflect" "regexp" "sort" "strconv" "strings" "time" + "unicode/utf8" ) +// jsonNumber is the interface of the encoding/json.Number datatype. +// Repeating the interface here avoids a dependency on encoding/json, and also +// supports other libraries like jsoniter, which use a similar datatype with +// the same interface. Detecting this interface is useful when dealing with +// structures containing json.Number, which is a string under the hood. The +// encoder should prefer the use of Int64(), Float64() and string(), in that +// order, when encoding this type. +type jsonNumber interface { + Float64() (float64, error) + Int64() (int64, error) + String() string +} + type encoder struct { emitter yaml_emitter_t event yaml_event_t out []byte flow bool + // doneInit holds whether the initial stream_start_event has been + // emitted. + doneInit bool } -func newEncoder() (e *encoder) { - e = &encoder{} - e.must(yaml_emitter_initialize(&e.emitter)) +func newEncoder() *encoder { + e := &encoder{} + yaml_emitter_initialize(&e.emitter) yaml_emitter_set_output_string(&e.emitter, &e.out) yaml_emitter_set_unicode(&e.emitter, true) - e.must(yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING)) - e.emit() - e.must(yaml_document_start_event_initialize(&e.event, nil, nil, true)) - e.emit() return e } -func (e *encoder) finish() { - e.must(yaml_document_end_event_initialize(&e.event, true)) +func newEncoderWithWriter(w io.Writer) *encoder { + e := &encoder{} + yaml_emitter_initialize(&e.emitter) + yaml_emitter_set_output_writer(&e.emitter, w) + yaml_emitter_set_unicode(&e.emitter, true) + return e +} + +func (e *encoder) init() { + if e.doneInit { + return + } + yaml_stream_start_event_initialize(&e.event, yaml_UTF8_ENCODING) e.emit() + e.doneInit = true +} + +func (e *encoder) finish() { e.emitter.open_ended = false - e.must(yaml_stream_end_event_initialize(&e.event)) + yaml_stream_end_event_initialize(&e.event) e.emit() } @@ -44,9 +73,7 @@ func (e *encoder) destroy() { func (e *encoder) emit() { // This will internally delete the e.event value. - if !yaml_emitter_emit(&e.emitter, &e.event) && e.event.typ != yaml_DOCUMENT_END_EVENT && e.event.typ != yaml_STREAM_END_EVENT { - e.must(false) - } + e.must(yaml_emitter_emit(&e.emitter, &e.event)) } func (e *encoder) must(ok bool) { @@ -59,13 +86,43 @@ func (e *encoder) must(ok bool) { } } +func (e *encoder) marshalDoc(tag string, in reflect.Value) { + e.init() + yaml_document_start_event_initialize(&e.event, nil, nil, true) + e.emit() + e.marshal(tag, in) + yaml_document_end_event_initialize(&e.event, true) + e.emit() +} + func (e *encoder) marshal(tag string, in reflect.Value) { - if !in.IsValid() { + if !in.IsValid() || in.Kind() == reflect.Ptr && in.IsNil() { e.nilv() return } iface := in.Interface() - if m, ok := iface.(Marshaler); ok { + switch m := iface.(type) { + case jsonNumber: + integer, err := m.Int64() + if err == nil { + // In this case the json.Number is a valid int64 + in = reflect.ValueOf(integer) + break + } + float, err := m.Float64() + if err == nil { + // In this case the json.Number is a valid float64 + in = reflect.ValueOf(float) + break + } + // fallback case - no number could be obtained + in = reflect.ValueOf(m.String()) + case time.Time, *time.Time: + // Although time.Time implements TextMarshaler, + // we don't want to treat it as a string for YAML + // purposes because YAML has special support for + // timestamps. + case Marshaler: v, err := m.MarshalYAML() if err != nil { fail(err) @@ -75,31 +132,34 @@ func (e *encoder) marshal(tag string, in reflect.Value) { return } in = reflect.ValueOf(v) - } else if m, ok := iface.(encoding.TextMarshaler); ok { + case encoding.TextMarshaler: text, err := m.MarshalText() if err != nil { fail(err) } in = reflect.ValueOf(string(text)) + case nil: + e.nilv() + return } switch in.Kind() { case reflect.Interface: - if in.IsNil() { - e.nilv() - } else { - e.marshal(tag, in.Elem()) - } + e.marshal(tag, in.Elem()) case reflect.Map: e.mapv(tag, in) case reflect.Ptr: - if in.IsNil() { - e.nilv() + if in.Type() == ptrTimeType { + e.timev(tag, in.Elem()) } else { e.marshal(tag, in.Elem()) } case reflect.Struct: - e.structv(tag, in) - case reflect.Slice: + if in.Type() == timeType { + e.timev(tag, in) + } else { + e.structv(tag, in) + } + case reflect.Slice, reflect.Array: if in.Type().Elem() == mapItemType { e.itemsv(tag, in) } else { @@ -191,10 +251,10 @@ func (e *encoder) mappingv(tag string, f func()) { e.flow = false style = yaml_FLOW_MAPPING_STYLE } - e.must(yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style)) + yaml_mapping_start_event_initialize(&e.event, nil, []byte(tag), implicit, style) e.emit() f() - e.must(yaml_mapping_end_event_initialize(&e.event)) + yaml_mapping_end_event_initialize(&e.event) e.emit() } @@ -240,23 +300,36 @@ var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0 func (e *encoder) stringv(tag string, in reflect.Value) { var style yaml_scalar_style_t s := in.String() - rtag, rs := resolve("", s) - if rtag == yaml_BINARY_TAG { - if tag == "" || tag == yaml_STR_TAG { - tag = rtag - s = rs.(string) - } else if tag == yaml_BINARY_TAG { + canUsePlain := true + switch { + case !utf8.ValidString(s): + if tag == yaml_BINARY_TAG { failf("explicitly tagged !!binary data must be base64-encoded") - } else { + } + if tag != "" { failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag)) } + // It can't be encoded directly as YAML so use a binary tag + // and encode it as base64. + tag = yaml_BINARY_TAG + s = encodeBase64(s) + case tag == "": + // Check to see if it would resolve to a specific + // tag when encoded unquoted. If it doesn't, + // there's no need to quote it. + rtag, _ := resolve("", s) + canUsePlain = rtag == yaml_STR_TAG && !isBase60Float(s) } - if tag == "" && (rtag != yaml_STR_TAG || isBase60Float(s)) { - style = yaml_DOUBLE_QUOTED_SCALAR_STYLE - } else if strings.Contains(s, "\n") { + // Note: it's possible for user code to emit invalid YAML + // if they explicitly specify a tag and a string containing + // text that's incompatible with that tag. + switch { + case strings.Contains(s, "\n"): style = yaml_LITERAL_SCALAR_STYLE - } else { + case canUsePlain: style = yaml_PLAIN_SCALAR_STYLE + default: + style = yaml_DOUBLE_QUOTED_SCALAR_STYLE } e.emitScalar(s, "", tag, style) } @@ -281,9 +354,20 @@ func (e *encoder) uintv(tag string, in reflect.Value) { e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) } +func (e *encoder) timev(tag string, in reflect.Value) { + t := in.Interface().(time.Time) + s := t.Format(time.RFC3339Nano) + e.emitScalar(s, "", tag, yaml_PLAIN_SCALAR_STYLE) +} + func (e *encoder) floatv(tag string, in reflect.Value) { - // FIXME: Handle 64 bits here. - s := strconv.FormatFloat(float64(in.Float()), 'g', -1, 32) + // Issue #352: When formatting, use the precision of the underlying value + precision := 64 + if in.Kind() == reflect.Float32 { + precision = 32 + } + + s := strconv.FormatFloat(in.Float(), 'g', -1, precision) switch s { case "+Inf": s = ".inf" diff --git a/vendor/gopkg.in/yaml.v2/encode_test.go b/vendor/gopkg.in/yaml.v2/encode_test.go deleted file mode 100644 index e340f58..0000000 --- a/vendor/gopkg.in/yaml.v2/encode_test.go +++ /dev/null @@ -1,478 +0,0 @@ -package yaml_test - -import ( - "fmt" - "math" - "strconv" - "strings" - "time" - - . "gopkg.in/check.v1" - "gopkg.in/yaml.v2" - "net" -) - -var marshalIntTest = 123 - -var marshalTests = []struct { - value interface{} - data string -}{ - { - nil, - "null\n", - }, { - &struct{}{}, - "{}\n", - }, { - map[string]string{"v": "hi"}, - "v: hi\n", - }, { - map[string]interface{}{"v": "hi"}, - "v: hi\n", - }, { - map[string]string{"v": "true"}, - "v: \"true\"\n", - }, { - map[string]string{"v": "false"}, - "v: \"false\"\n", - }, { - map[string]interface{}{"v": true}, - "v: true\n", - }, { - map[string]interface{}{"v": false}, - "v: false\n", - }, { - map[string]interface{}{"v": 10}, - "v: 10\n", - }, { - map[string]interface{}{"v": -10}, - "v: -10\n", - }, { - map[string]uint{"v": 42}, - "v: 42\n", - }, { - map[string]interface{}{"v": int64(4294967296)}, - "v: 4294967296\n", - }, { - map[string]int64{"v": int64(4294967296)}, - "v: 4294967296\n", - }, { - map[string]uint64{"v": 4294967296}, - "v: 4294967296\n", - }, { - map[string]interface{}{"v": "10"}, - "v: \"10\"\n", - }, { - map[string]interface{}{"v": 0.1}, - "v: 0.1\n", - }, { - map[string]interface{}{"v": float64(0.1)}, - "v: 0.1\n", - }, { - map[string]interface{}{"v": -0.1}, - "v: -0.1\n", - }, { - map[string]interface{}{"v": math.Inf(+1)}, - "v: .inf\n", - }, { - map[string]interface{}{"v": math.Inf(-1)}, - "v: -.inf\n", - }, { - map[string]interface{}{"v": math.NaN()}, - "v: .nan\n", - }, { - map[string]interface{}{"v": nil}, - "v: null\n", - }, { - map[string]interface{}{"v": ""}, - "v: \"\"\n", - }, { - map[string][]string{"v": []string{"A", "B"}}, - "v:\n- A\n- B\n", - }, { - map[string][]string{"v": []string{"A", "B\nC"}}, - "v:\n- A\n- |-\n B\n C\n", - }, { - map[string][]interface{}{"v": []interface{}{"A", 1, map[string][]int{"B": []int{2, 3}}}}, - "v:\n- A\n- 1\n- B:\n - 2\n - 3\n", - }, { - map[string]interface{}{"a": map[interface{}]interface{}{"b": "c"}}, - "a:\n b: c\n", - }, { - map[string]interface{}{"a": "-"}, - "a: '-'\n", - }, - - // Simple values. - { - &marshalIntTest, - "123\n", - }, - - // Structures - { - &struct{ Hello string }{"world"}, - "hello: world\n", - }, { - &struct { - A struct { - B string - } - }{struct{ B string }{"c"}}, - "a:\n b: c\n", - }, { - &struct { - A *struct { - B string - } - }{&struct{ B string }{"c"}}, - "a:\n b: c\n", - }, { - &struct { - A *struct { - B string - } - }{}, - "a: null\n", - }, { - &struct{ A int }{1}, - "a: 1\n", - }, { - &struct{ A []int }{[]int{1, 2}}, - "a:\n- 1\n- 2\n", - }, { - &struct { - B int "a" - }{1}, - "a: 1\n", - }, { - &struct{ A bool }{true}, - "a: true\n", - }, - - // Conditional flag - { - &struct { - A int "a,omitempty" - B int "b,omitempty" - }{1, 0}, - "a: 1\n", - }, { - &struct { - A int "a,omitempty" - B int "b,omitempty" - }{0, 0}, - "{}\n", - }, { - &struct { - A *struct{ X, y int } "a,omitempty,flow" - }{&struct{ X, y int }{1, 2}}, - "a: {x: 1}\n", - }, { - &struct { - A *struct{ X, y int } "a,omitempty,flow" - }{nil}, - "{}\n", - }, { - &struct { - A *struct{ X, y int } "a,omitempty,flow" - }{&struct{ X, y int }{}}, - "a: {x: 0}\n", - }, { - &struct { - A struct{ X, y int } "a,omitempty,flow" - }{struct{ X, y int }{1, 2}}, - "a: {x: 1}\n", - }, { - &struct { - A struct{ X, y int } "a,omitempty,flow" - }{struct{ X, y int }{0, 1}}, - "{}\n", - }, - - // Flow flag - { - &struct { - A []int "a,flow" - }{[]int{1, 2}}, - "a: [1, 2]\n", - }, { - &struct { - A map[string]string "a,flow" - }{map[string]string{"b": "c", "d": "e"}}, - "a: {b: c, d: e}\n", - }, { - &struct { - A struct { - B, D string - } "a,flow" - }{struct{ B, D string }{"c", "e"}}, - "a: {b: c, d: e}\n", - }, - - // Unexported field - { - &struct { - u int - A int - }{0, 1}, - "a: 1\n", - }, - - // Ignored field - { - &struct { - A int - B int "-" - }{1, 2}, - "a: 1\n", - }, - - // Struct inlining - { - &struct { - A int - C inlineB `yaml:",inline"` - }{1, inlineB{2, inlineC{3}}}, - "a: 1\nb: 2\nc: 3\n", - }, - - // Map inlining - { - &struct { - A int - C map[string]int `yaml:",inline"` - }{1, map[string]int{"b": 2, "c": 3}}, - "a: 1\nb: 2\nc: 3\n", - }, - - // Duration - { - map[string]time.Duration{"a": 3 * time.Second}, - "a: 3s\n", - }, - - // Issue #24: bug in map merging logic. - { - map[string]string{"a": ""}, - "a: \n", - }, - - // Issue #34: marshal unsupported base 60 floats quoted for compatibility - // with old YAML 1.1 parsers. - { - map[string]string{"a": "1:1"}, - "a: \"1:1\"\n", - }, - - // Binary data. - { - map[string]string{"a": "\x00"}, - "a: \"\\0\"\n", - }, { - map[string]string{"a": "\x80\x81\x82"}, - "a: !!binary gIGC\n", - }, { - map[string]string{"a": strings.Repeat("\x90", 54)}, - "a: !!binary |\n " + strings.Repeat("kJCQ", 17) + "kJ\n CQ\n", - }, - - // Ordered maps. - { - &yaml.MapSlice{{"b", 2}, {"a", 1}, {"d", 4}, {"c", 3}, {"sub", yaml.MapSlice{{"e", 5}}}}, - "b: 2\na: 1\nd: 4\nc: 3\nsub:\n e: 5\n", - }, - - // Encode unicode as utf-8 rather than in escaped form. - { - map[string]string{"a": "你好"}, - "a: 你好\n", - }, - - // Support encoding.TextMarshaler. - { - map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)}, - "a: 1.2.3.4\n", - }, - - // Ensure strings containing ": " are quoted (reported as PR #43, but not reproducible). - { - map[string]string{"a": "b: c"}, - "a: 'b: c'\n", - }, -} - -func (s *S) TestMarshal(c *C) { - for _, item := range marshalTests { - data, err := yaml.Marshal(item.value) - c.Assert(err, IsNil) - c.Assert(string(data), Equals, item.data) - } -} - -var marshalErrorTests = []struct { - value interface{} - error string - panic string -}{{ - value: &struct { - B int - inlineB ",inline" - }{1, inlineB{2, inlineC{3}}}, - panic: `Duplicated key 'b' in struct struct \{ B int; .*`, -}, { - value: &struct { - A int - B map[string]int ",inline" - }{1, map[string]int{"a": 2}}, - panic: `Can't have key "a" in inlined map; conflicts with struct field`, -}} - -func (s *S) TestMarshalErrors(c *C) { - for _, item := range marshalErrorTests { - if item.panic != "" { - c.Assert(func() { yaml.Marshal(item.value) }, PanicMatches, item.panic) - } else { - _, err := yaml.Marshal(item.value) - c.Assert(err, ErrorMatches, item.error) - } - } -} - -func (s *S) TestMarshalTypeCache(c *C) { - var data []byte - var err error - func() { - type T struct{ A int } - data, err = yaml.Marshal(&T{}) - c.Assert(err, IsNil) - }() - func() { - type T struct{ B int } - data, err = yaml.Marshal(&T{}) - c.Assert(err, IsNil) - }() - c.Assert(string(data), Equals, "b: 0\n") -} - -var marshalerTests = []struct { - data string - value interface{} -}{ - {"_:\n hi: there\n", map[interface{}]interface{}{"hi": "there"}}, - {"_:\n- 1\n- A\n", []interface{}{1, "A"}}, - {"_: 10\n", 10}, - {"_: null\n", nil}, - {"_: BAR!\n", "BAR!"}, -} - -type marshalerType struct { - value interface{} -} - -func (o marshalerType) MarshalText() ([]byte, error) { - panic("MarshalText called on type with MarshalYAML") -} - -func (o marshalerType) MarshalYAML() (interface{}, error) { - return o.value, nil -} - -type marshalerValue struct { - Field marshalerType "_" -} - -func (s *S) TestMarshaler(c *C) { - for _, item := range marshalerTests { - obj := &marshalerValue{} - obj.Field.value = item.value - data, err := yaml.Marshal(obj) - c.Assert(err, IsNil) - c.Assert(string(data), Equals, string(item.data)) - } -} - -func (s *S) TestMarshalerWholeDocument(c *C) { - obj := &marshalerType{} - obj.value = map[string]string{"hello": "world!"} - data, err := yaml.Marshal(obj) - c.Assert(err, IsNil) - c.Assert(string(data), Equals, "hello: world!\n") -} - -type failingMarshaler struct{} - -func (ft *failingMarshaler) MarshalYAML() (interface{}, error) { - return nil, failingErr -} - -func (s *S) TestMarshalerError(c *C) { - _, err := yaml.Marshal(&failingMarshaler{}) - c.Assert(err, Equals, failingErr) -} - -func (s *S) TestSortedOutput(c *C) { - order := []interface{}{ - false, - true, - 1, - uint(1), - 1.0, - 1.1, - 1.2, - 2, - uint(2), - 2.0, - 2.1, - "", - ".1", - ".2", - ".a", - "1", - "2", - "a!10", - "a/2", - "a/10", - "a~10", - "ab/1", - "b/1", - "b/01", - "b/2", - "b/02", - "b/3", - "b/03", - "b1", - "b01", - "b3", - "c2.10", - "c10.2", - "d1", - "d12", - "d12a", - } - m := make(map[interface{}]int) - for _, k := range order { - m[k] = 1 - } - data, err := yaml.Marshal(m) - c.Assert(err, IsNil) - out := "\n" + string(data) - last := 0 - for i, k := range order { - repr := fmt.Sprint(k) - if s, ok := k.(string); ok { - if _, err = strconv.ParseFloat(repr, 32); s == "" || err == nil { - repr = `"` + repr + `"` - } - } - index := strings.Index(out, "\n"+repr+":") - if index == -1 { - c.Fatalf("%#v is not in the output: %#v", k, out) - } - if index < last { - c.Fatalf("%#v was generated before %#v: %q", k, order[i-1], out) - } - last = index - } -} diff --git a/vendor/gopkg.in/yaml.v2/go.mod b/vendor/gopkg.in/yaml.v2/go.mod new file mode 100644 index 0000000..1934e87 --- /dev/null +++ b/vendor/gopkg.in/yaml.v2/go.mod @@ -0,0 +1,5 @@ +module "gopkg.in/yaml.v2" + +require ( + "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 +) diff --git a/vendor/gopkg.in/yaml.v2/parserc.go b/vendor/gopkg.in/yaml.v2/parserc.go index 0a7037a..81d05df 100644 --- a/vendor/gopkg.in/yaml.v2/parserc.go +++ b/vendor/gopkg.in/yaml.v2/parserc.go @@ -166,7 +166,6 @@ func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool default: panic("invalid parser state") } - return false } // Parse the production: diff --git a/vendor/gopkg.in/yaml.v2/readerc.go b/vendor/gopkg.in/yaml.v2/readerc.go index d5fb097..7c1f5fa 100644 --- a/vendor/gopkg.in/yaml.v2/readerc.go +++ b/vendor/gopkg.in/yaml.v2/readerc.go @@ -93,9 +93,18 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { panic("read handler must be set") } + // [Go] This function was changed to guarantee the requested length size at EOF. + // The fact we need to do this is pretty awful, but the description above implies + // for that to be the case, and there are tests + // If the EOF flag is set and the raw buffer is empty, do nothing. if parser.eof && parser.raw_buffer_pos == len(parser.raw_buffer) { - return true + // [Go] ACTUALLY! Read the documentation of this function above. + // This is just broken. To return true, we need to have the + // given length in the buffer. Not doing that means every single + // check that calls this function to make sure the buffer has a + // given length is Go) panicking; or C) accessing invalid memory. + //return true } // Return if the buffer contains enough characters. @@ -247,7 +256,7 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { if parser.encoding == yaml_UTF16LE_ENCODING { low, high = 0, 1 } else { - high, low = 1, 0 + low, high = 1, 0 } // The UTF-16 encoding is not as simple as one might @@ -357,23 +366,26 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { if value <= 0x7F { // 0000 0000-0000 007F . 0xxxxxxx parser.buffer[buffer_len+0] = byte(value) + buffer_len += 1 } else if value <= 0x7FF { // 0000 0080-0000 07FF . 110xxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xC0 + (value >> 6)) parser.buffer[buffer_len+1] = byte(0x80 + (value & 0x3F)) + buffer_len += 2 } else if value <= 0xFFFF { // 0000 0800-0000 FFFF . 1110xxxx 10xxxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xE0 + (value >> 12)) parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 6) & 0x3F)) parser.buffer[buffer_len+2] = byte(0x80 + (value & 0x3F)) + buffer_len += 3 } else { // 0001 0000-0010 FFFF . 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx parser.buffer[buffer_len+0] = byte(0xF0 + (value >> 18)) parser.buffer[buffer_len+1] = byte(0x80 + ((value >> 12) & 0x3F)) parser.buffer[buffer_len+2] = byte(0x80 + ((value >> 6) & 0x3F)) parser.buffer[buffer_len+3] = byte(0x80 + (value & 0x3F)) + buffer_len += 4 } - buffer_len += width parser.unread++ } @@ -386,6 +398,15 @@ func yaml_parser_update_buffer(parser *yaml_parser_t, length int) bool { break } } + // [Go] Read the documentation of this function above. To return true, + // we need to have the given length in the buffer. Not doing that means + // every single check that calls this function to make sure the buffer + // has a given length is Go) panicking; or C) accessing invalid memory. + // This happens here due to the EOF above breaking early. + for buffer_len < length { + parser.buffer[buffer_len] = 0 + buffer_len++ + } parser.buffer = parser.buffer[:buffer_len] return true } diff --git a/vendor/gopkg.in/yaml.v2/resolve.go b/vendor/gopkg.in/yaml.v2/resolve.go index 93a8632..4120e0c 100644 --- a/vendor/gopkg.in/yaml.v2/resolve.go +++ b/vendor/gopkg.in/yaml.v2/resolve.go @@ -3,9 +3,10 @@ package yaml import ( "encoding/base64" "math" + "regexp" "strconv" "strings" - "unicode/utf8" + "time" ) type resolveMapItem struct { @@ -74,12 +75,14 @@ func longTag(tag string) string { func resolvableTag(tag string) bool { switch tag { - case "", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG: + case "", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG, yaml_TIMESTAMP_TAG: return true } return false } +var yamlStyleFloat = regexp.MustCompile(`^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$`) + func resolve(tag string, in string) (rtag string, out interface{}) { if !resolvableTag(tag) { return tag, in @@ -89,6 +92,19 @@ func resolve(tag string, in string) (rtag string, out interface{}) { switch tag { case "", rtag, yaml_STR_TAG, yaml_BINARY_TAG: return + case yaml_FLOAT_TAG: + if rtag == yaml_INT_TAG { + switch v := out.(type) { + case int64: + rtag = yaml_FLOAT_TAG + out = float64(v) + return + case int: + rtag = yaml_FLOAT_TAG + out = float64(v) + return + } + } } failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag)) }() @@ -122,6 +138,15 @@ func resolve(tag string, in string) (rtag string, out interface{}) { case 'D', 'S': // Int, float, or timestamp. + // Only try values as a timestamp if the value is unquoted or there's an explicit + // !!timestamp tag. + if tag == "" || tag == yaml_TIMESTAMP_TAG { + t, ok := parseTimestamp(in) + if ok { + return yaml_TIMESTAMP_TAG, t + } + } + plain := strings.Replace(in, "_", "", -1) intv, err := strconv.ParseInt(plain, 0, 64) if err == nil { @@ -135,9 +160,11 @@ func resolve(tag string, in string) (rtag string, out interface{}) { if err == nil { return yaml_INT_TAG, uintv } - floatv, err := strconv.ParseFloat(plain, 64) - if err == nil { - return yaml_FLOAT_TAG, floatv + if yamlStyleFloat.MatchString(plain) { + floatv, err := strconv.ParseFloat(plain, 64) + if err == nil { + return yaml_FLOAT_TAG, floatv + } } if strings.HasPrefix(plain, "0b") { intv, err := strconv.ParseInt(plain[2:], 2, 64) @@ -153,28 +180,20 @@ func resolve(tag string, in string) (rtag string, out interface{}) { return yaml_INT_TAG, uintv } } else if strings.HasPrefix(plain, "-0b") { - intv, err := strconv.ParseInt(plain[3:], 2, 64) + intv, err := strconv.ParseInt("-" + plain[3:], 2, 64) if err == nil { - if intv == int64(int(intv)) { - return yaml_INT_TAG, -int(intv) + if true || intv == int64(int(intv)) { + return yaml_INT_TAG, int(intv) } else { - return yaml_INT_TAG, -intv + return yaml_INT_TAG, intv } } } - // XXX Handle timestamps here. - default: panic("resolveTable item not yet handled: " + string(rune(hint)) + " (with " + in + ")") } } - if tag == yaml_BINARY_TAG { - return yaml_BINARY_TAG, in - } - if utf8.ValidString(in) { - return yaml_STR_TAG, in - } - return yaml_BINARY_TAG, encodeBase64(in) + return yaml_STR_TAG, in } // encodeBase64 encodes s as base64 that is broken up into multiple lines @@ -201,3 +220,39 @@ func encodeBase64(s string) string { } return string(out[:k]) } + +// This is a subset of the formats allowed by the regular expression +// defined at http://yaml.org/type/timestamp.html. +var allowedTimestampFormats = []string{ + "2006-1-2T15:4:5.999999999Z07:00", // RCF3339Nano with short date fields. + "2006-1-2t15:4:5.999999999Z07:00", // RFC3339Nano with short date fields and lower-case "t". + "2006-1-2 15:4:5.999999999", // space separated with no time zone + "2006-1-2", // date only + // Notable exception: time.Parse cannot handle: "2001-12-14 21:59:43.10 -5" + // from the set of examples. +} + +// parseTimestamp parses s as a timestamp string and +// returns the timestamp and reports whether it succeeded. +// Timestamp formats are defined at http://yaml.org/type/timestamp.html +func parseTimestamp(s string) (time.Time, bool) { + // TODO write code to check all the formats supported by + // http://yaml.org/type/timestamp.html instead of using time.Parse. + + // Quick check: all date formats start with YYYY-. + i := 0 + for ; i < len(s); i++ { + if c := s[i]; c < '0' || c > '9' { + break + } + } + if i != 4 || i == len(s) || s[i] != '-' { + return time.Time{}, false + } + for _, format := range allowedTimestampFormats { + if t, err := time.Parse(format, s); err == nil { + return t, true + } + } + return time.Time{}, false +} diff --git a/vendor/gopkg.in/yaml.v2/scannerc.go b/vendor/gopkg.in/yaml.v2/scannerc.go index fe93b19..b33bdba 100644 --- a/vendor/gopkg.in/yaml.v2/scannerc.go +++ b/vendor/gopkg.in/yaml.v2/scannerc.go @@ -9,7 +9,7 @@ import ( // ************ // // The following notes assume that you are familiar with the YAML specification -// (http://yaml.org/spec/cvs/current.html). We mostly follow it, although in +// (http://yaml.org/spec/1.2/spec.html). We mostly follow it, although in // some cases we are less restrictive that it requires. // // The process of transforming a YAML stream into a sequence of events is @@ -611,7 +611,7 @@ func yaml_parser_set_scanner_tag_error(parser *yaml_parser_t, directive bool, co if directive { context = "while parsing a %TAG directive" } - return yaml_parser_set_scanner_error(parser, context, context_mark, "did not find URI escaped octet") + return yaml_parser_set_scanner_error(parser, context, context_mark, problem) } func trace(args ...interface{}) func() { @@ -634,13 +634,14 @@ func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool { need_more_tokens = true } else { // Check if any potential simple key may occupy the head position. - if !yaml_parser_stale_simple_keys(parser) { - return false - } - - for i := range parser.simple_keys { + for i := len(parser.simple_keys) - 1; i >= 0; i-- { simple_key := &parser.simple_keys[i] - if simple_key.possible && simple_key.token_number == parser.tokens_parsed { + if simple_key.token_number < parser.tokens_parsed { + break + } + if valid, ok := yaml_simple_key_is_valid(parser, simple_key); !ok { + return false + } else if valid && simple_key.token_number == parser.tokens_parsed { need_more_tokens = true break } @@ -678,11 +679,6 @@ func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool { return false } - // Remove obsolete potential simple keys. - if !yaml_parser_stale_simple_keys(parser) { - return false - } - // Check the indentation level against the current column. if !yaml_parser_unroll_indent(parser, parser.mark.column) { return false @@ -837,29 +833,30 @@ func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool { "found character that cannot start any token") } -// Check the list of potential simple keys and remove the positions that -// cannot contain simple keys anymore. -func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool { - // Check for a potential simple key for each flow level. - for i := range parser.simple_keys { - simple_key := &parser.simple_keys[i] - - // The specification requires that a simple key - // - // - is limited to a single line, - // - is shorter than 1024 characters. - if simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) { - - // Check if the potential simple key to be removed is required. - if simple_key.required { - return yaml_parser_set_scanner_error(parser, - "while scanning a simple key", simple_key.mark, - "could not find expected ':'") - } - simple_key.possible = false +func yaml_simple_key_is_valid(parser *yaml_parser_t, simple_key *yaml_simple_key_t) (valid, ok bool) { + if !simple_key.possible { + return false, true + } + + // The 1.2 specification says: + // + // "If the ? indicator is omitted, parsing needs to see past the + // implicit key to recognize it as such. To limit the amount of + // lookahead required, the “:” indicator must appear at most 1024 + // Unicode characters beyond the start of the key. In addition, the key + // is restricted to a single line." + // + if simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index { + // Check if the potential simple key to be removed is required. + if simple_key.required { + return false, yaml_parser_set_scanner_error(parser, + "while scanning a simple key", simple_key.mark, + "could not find expected ':'") } + simple_key.possible = false + return false, true } - return true + return true, true } // Check if a simple key may start at the current position and add it if @@ -871,12 +868,6 @@ func yaml_parser_save_simple_key(parser *yaml_parser_t) bool { required := parser.flow_level == 0 && parser.indent == parser.mark.column - // A simple key is required only when it is the first token in the current - // line. Therefore it is always allowed. But we add a check anyway. - if required && !parser.simple_key_allowed { - panic("should not happen") - } - // // If the current position may start a simple key, save it. // @@ -885,8 +876,8 @@ func yaml_parser_save_simple_key(parser *yaml_parser_t) bool { possible: true, required: required, token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), + mark: parser.mark, } - simple_key.mark = parser.mark if !yaml_parser_remove_simple_key(parser) { return false @@ -912,13 +903,26 @@ func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool { return true } +// max_flow_level limits the flow_level +const max_flow_level = 10000 + // Increase the flow level and resize the simple key list if needed. func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool { // Reset the simple key on the next level. - parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{}) + parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{ + possible: false, + required: false, + token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), + mark: parser.mark, + }) // Increase the flow level. parser.flow_level++ + if parser.flow_level > max_flow_level { + return yaml_parser_set_scanner_error(parser, + "while increasing flow level", parser.simple_keys[len(parser.simple_keys)-1].mark, + fmt.Sprintf("exceeded max depth of %d", max_flow_level)) + } return true } @@ -931,6 +935,9 @@ func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool { return true } +// max_indents limits the indents stack size +const max_indents = 10000 + // Push the current indentation level to the stack and set the new level // the current column is greater than the indentation level. In this case, // append or insert the specified token into the token queue. @@ -945,6 +952,11 @@ func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml // indentation level. parser.indents = append(parser.indents, parser.indent) parser.indent = column + if len(parser.indents) > max_indents { + return yaml_parser_set_scanner_error(parser, + "while increasing indent level", parser.simple_keys[len(parser.simple_keys)-1].mark, + fmt.Sprintf("exceeded max depth of %d", max_indents)) + } // Create a token and insert it into the queue. token := yaml_token_t{ @@ -961,7 +973,7 @@ func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml } // Pop indentation levels from the indents stack until the current level -// becomes less or equal to the column. For each intendation level, append +// becomes less or equal to the column. For each indentation level, append // the BLOCK-END token. func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { // In the flow context, do nothing. @@ -969,7 +981,7 @@ func yaml_parser_unroll_indent(parser *yaml_parser_t, column int) bool { return true } - // Loop through the intendation levels in the stack. + // Loop through the indentation levels in the stack. for parser.indent > column { // Create a token and append it to the queue. token := yaml_token_t{ @@ -1276,7 +1288,11 @@ func yaml_parser_fetch_value(parser *yaml_parser_t) bool { simple_key := &parser.simple_keys[len(parser.simple_keys)-1] // Have we found a simple key? - if simple_key.possible { + if valid, ok := yaml_simple_key_is_valid(parser, simple_key); !ok { + return false + + } else if valid { + // Create the KEY token and insert it into the queue. token := yaml_token_t{ typ: yaml_KEY_TOKEN, @@ -1546,7 +1562,7 @@ func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool // Unknown directive. } else { yaml_parser_set_scanner_error(parser, "while scanning a directive", - start_mark, "found uknown directive name") + start_mark, "found unknown directive name") return false } @@ -1944,7 +1960,7 @@ func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_ma } else { // It's either the '!' tag or not really a tag handle. If it's a %TAG // directive, it's an error. If it's a tag token, it must be a part of URI. - if directive && !(s[0] == '!' && s[1] == 0) { + if directive && string(s) != "!" { yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "did not find expected '!'") return false @@ -1959,6 +1975,7 @@ func yaml_parser_scan_tag_handle(parser *yaml_parser_t, directive bool, start_ma func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte, start_mark yaml_mark_t, uri *[]byte) bool { //size_t length = head ? strlen((char *)head) : 0 var s []byte + hasTag := len(head) > 0 // Copy the head if needed. // @@ -2000,10 +2017,10 @@ func yaml_parser_scan_tag_uri(parser *yaml_parser_t, directive bool, head []byte if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } + hasTag = true } - // Check if the tag is non-empty. - if len(s) == 0 { + if !hasTag { yaml_parser_set_scanner_tag_error(parser, directive, start_mark, "did not find expected tag URI") return false @@ -2085,14 +2102,14 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l return false } if is_digit(parser.buffer, parser.buffer_pos) { - // Check that the intendation is greater than 0. + // Check that the indentation is greater than 0. if parser.buffer[parser.buffer_pos] == '0' { yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an intendation indicator equal to 0") + start_mark, "found an indentation indicator equal to 0") return false } - // Get the intendation level and eat the indicator. + // Get the indentation level and eat the indicator. increment = as_digit(parser.buffer, parser.buffer_pos) skip(parser) } @@ -2102,7 +2119,7 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l if parser.buffer[parser.buffer_pos] == '0' { yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found an intendation indicator equal to 0") + start_mark, "found an indentation indicator equal to 0") return false } increment = as_digit(parser.buffer, parser.buffer_pos) @@ -2157,7 +2174,7 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l end_mark := parser.mark - // Set the intendation level if it was specified. + // Set the indentation level if it was specified. var indent int if increment > 0 { if parser.indent >= 0 { @@ -2217,7 +2234,7 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l leading_break = read_line(parser, leading_break) - // Eat the following intendation spaces and line breaks. + // Eat the following indentation spaces and line breaks. if !yaml_parser_scan_block_scalar_breaks(parser, &indent, &trailing_breaks, start_mark, &end_mark) { return false } @@ -2245,15 +2262,15 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l return true } -// Scan intendation spaces and line breaks for a block scalar. Determine the -// intendation level if needed. +// Scan indentation spaces and line breaks for a block scalar. Determine the +// indentation level if needed. func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, breaks *[]byte, start_mark yaml_mark_t, end_mark *yaml_mark_t) bool { *end_mark = parser.mark - // Eat the intendation spaces and line breaks. + // Eat the indentation spaces and line breaks. max_indent := 0 for { - // Eat the intendation spaces. + // Eat the indentation spaces. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false } @@ -2267,10 +2284,10 @@ func yaml_parser_scan_block_scalar_breaks(parser *yaml_parser_t, indent *int, br max_indent = parser.mark.column } - // Check for a tab character messing the intendation. + // Check for a tab character messing the indentation. if (*indent == 0 || parser.mark.column < *indent) && is_tab(parser.buffer, parser.buffer_pos) { return yaml_parser_set_scanner_error(parser, "while scanning a block scalar", - start_mark, "found a tab character where an intendation space is expected") + start_mark, "found a tab character where an indentation space is expected") } // Have we found a non-empty line? @@ -2474,6 +2491,10 @@ func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, si } } + if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { + return false + } + // Check if we are at the end of the scalar. if single { if parser.buffer[parser.buffer_pos] == '\'' { @@ -2486,10 +2507,6 @@ func yaml_parser_scan_flow_scalar(parser *yaml_parser_t, token *yaml_token_t, si } // Consume blank characters. - if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { - return false - } - for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { if is_blank(parser.buffer, parser.buffer_pos) { // Consume a space or a tab character. @@ -2591,19 +2608,10 @@ func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) b // Consume non-blank characters. for !is_blankz(parser.buffer, parser.buffer_pos) { - // Check for 'x:x' in the flow context. TODO: Fix the test "spec-08-13". - if parser.flow_level > 0 && - parser.buffer[parser.buffer_pos] == ':' && - !is_blankz(parser.buffer, parser.buffer_pos+1) { - yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found unexpected ':'") - return false - } - // Check for indicators that may end a plain scalar. if (parser.buffer[parser.buffer_pos] == ':' && is_blankz(parser.buffer, parser.buffer_pos+1)) || (parser.flow_level > 0 && - (parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == ':' || + (parser.buffer[parser.buffer_pos] == ',' || parser.buffer[parser.buffer_pos] == '?' || parser.buffer[parser.buffer_pos] == '[' || parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || parser.buffer[parser.buffer_pos] == '}')) { @@ -2655,10 +2663,10 @@ func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) b for is_blank(parser.buffer, parser.buffer_pos) || is_break(parser.buffer, parser.buffer_pos) { if is_blank(parser.buffer, parser.buffer_pos) { - // Check for tab character that abuse intendation. + // Check for tab characters that abuse indentation. if leading_blanks && parser.mark.column < indent && is_tab(parser.buffer, parser.buffer_pos) { yaml_parser_set_scanner_error(parser, "while scanning a plain scalar", - start_mark, "found a tab character that violate intendation") + start_mark, "found a tab character that violates indentation") return false } @@ -2687,7 +2695,7 @@ func yaml_parser_scan_plain_scalar(parser *yaml_parser_t, token *yaml_token_t) b } } - // Check intendation level. + // Check indentation level. if parser.flow_level == 0 && parser.mark.column < indent { break } diff --git a/vendor/gopkg.in/yaml.v2/sorter.go b/vendor/gopkg.in/yaml.v2/sorter.go index 5958822..4c45e66 100644 --- a/vendor/gopkg.in/yaml.v2/sorter.go +++ b/vendor/gopkg.in/yaml.v2/sorter.go @@ -51,6 +51,15 @@ func (l keyList) Less(i, j int) bool { } var ai, bi int var an, bn int64 + if ar[i] == '0' || br[i] == '0' { + for j := i-1; j >= 0 && unicode.IsDigit(ar[j]); j-- { + if ar[j] != '0' { + an = 1 + bn = 1 + break + } + } + } for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ { an = an*10 + int64(ar[ai]-'0') } diff --git a/vendor/gopkg.in/yaml.v2/suite_test.go b/vendor/gopkg.in/yaml.v2/suite_test.go deleted file mode 100644 index c5cf1ed..0000000 --- a/vendor/gopkg.in/yaml.v2/suite_test.go +++ /dev/null @@ -1,12 +0,0 @@ -package yaml_test - -import ( - . "gopkg.in/check.v1" - "testing" -) - -func Test(t *testing.T) { TestingT(t) } - -type S struct{} - -var _ = Suite(&S{}) diff --git a/vendor/gopkg.in/yaml.v2/writerc.go b/vendor/gopkg.in/yaml.v2/writerc.go index 190362f..a2dde60 100644 --- a/vendor/gopkg.in/yaml.v2/writerc.go +++ b/vendor/gopkg.in/yaml.v2/writerc.go @@ -18,72 +18,9 @@ func yaml_emitter_flush(emitter *yaml_emitter_t) bool { return true } - // If the output encoding is UTF-8, we don't need to recode the buffer. - if emitter.encoding == yaml_UTF8_ENCODING { - if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { - return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) - } - emitter.buffer_pos = 0 - return true - } - - // Recode the buffer into the raw buffer. - var low, high int - if emitter.encoding == yaml_UTF16LE_ENCODING { - low, high = 0, 1 - } else { - high, low = 1, 0 - } - - pos := 0 - for pos < emitter.buffer_pos { - // See the "reader.c" code for more details on UTF-8 encoding. Note - // that we assume that the buffer contains a valid UTF-8 sequence. - - // Read the next UTF-8 character. - octet := emitter.buffer[pos] - - var w int - var value rune - switch { - case octet&0x80 == 0x00: - w, value = 1, rune(octet&0x7F) - case octet&0xE0 == 0xC0: - w, value = 2, rune(octet&0x1F) - case octet&0xF0 == 0xE0: - w, value = 3, rune(octet&0x0F) - case octet&0xF8 == 0xF0: - w, value = 4, rune(octet&0x07) - } - for k := 1; k < w; k++ { - octet = emitter.buffer[pos+k] - value = (value << 6) + (rune(octet) & 0x3F) - } - pos += w - - // Write the character. - if value < 0x10000 { - var b [2]byte - b[high] = byte(value >> 8) - b[low] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1]) - } else { - // Write the character using a surrogate pair (check "reader.c"). - var b [4]byte - value -= 0x10000 - b[high] = byte(0xD8 + (value >> 18)) - b[low] = byte((value >> 10) & 0xFF) - b[high+2] = byte(0xDC + ((value >> 8) & 0xFF)) - b[low+2] = byte(value & 0xFF) - emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3]) - } - } - - // Write the raw buffer. - if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil { + if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) } emitter.buffer_pos = 0 - emitter.raw_buffer = emitter.raw_buffer[:0] return true } diff --git a/vendor/gopkg.in/yaml.v2/yaml.go b/vendor/gopkg.in/yaml.v2/yaml.go index 6af88c0..89650e2 100644 --- a/vendor/gopkg.in/yaml.v2/yaml.go +++ b/vendor/gopkg.in/yaml.v2/yaml.go @@ -9,6 +9,7 @@ package yaml import ( "errors" "fmt" + "io" "reflect" "strings" "sync" @@ -77,8 +78,65 @@ type Marshaler interface { // supported tag options. // func Unmarshal(in []byte, out interface{}) (err error) { + return unmarshal(in, out, false) +} + +// UnmarshalStrict is like Unmarshal except that any fields that are found +// in the data that do not have corresponding struct members, or mapping +// keys that are duplicates, will result in +// an error. +func UnmarshalStrict(in []byte, out interface{}) (err error) { + return unmarshal(in, out, true) +} + +// A Decoder reads and decodes YAML values from an input stream. +type Decoder struct { + strict bool + parser *parser +} + +// NewDecoder returns a new decoder that reads from r. +// +// The decoder introduces its own buffering and may read +// data from r beyond the YAML values requested. +func NewDecoder(r io.Reader) *Decoder { + return &Decoder{ + parser: newParserFromReader(r), + } +} + +// SetStrict sets whether strict decoding behaviour is enabled when +// decoding items in the data (see UnmarshalStrict). By default, decoding is not strict. +func (dec *Decoder) SetStrict(strict bool) { + dec.strict = strict +} + +// Decode reads the next YAML-encoded value from its input +// and stores it in the value pointed to by v. +// +// See the documentation for Unmarshal for details about the +// conversion of YAML into a Go value. +func (dec *Decoder) Decode(v interface{}) (err error) { + d := newDecoder(dec.strict) + defer handleErr(&err) + node := dec.parser.parse() + if node == nil { + return io.EOF + } + out := reflect.ValueOf(v) + if out.Kind() == reflect.Ptr && !out.IsNil() { + out = out.Elem() + } + d.unmarshal(node, out) + if len(d.terrors) > 0 { + return &TypeError{d.terrors} + } + return nil +} + +func unmarshal(in []byte, out interface{}, strict bool) (err error) { defer handleErr(&err) - d := newDecoder() + d := newDecoder(strict) p := newParser(in) defer p.destroy() node := p.parse() @@ -99,8 +157,8 @@ func Unmarshal(in []byte, out interface{}) (err error) { // of the generated document will reflect the structure of the value itself. // Maps and pointers (to struct, string, int, etc) are accepted as the in value. // -// Struct fields are only unmarshalled if they are exported (have an upper case -// first letter), and are unmarshalled using the field name lowercased as the +// Struct fields are only marshalled if they are exported (have an upper case +// first letter), and are marshalled using the field name lowercased as the // default key. Custom keys may be defined via the "yaml" name in the field // tag: the content preceding the first comma is used as the key, and the // following comma-separated options are used to tweak the marshalling process. @@ -114,10 +172,13 @@ func Unmarshal(in []byte, out interface{}) (err error) { // // omitempty Only include the field if it's not set to the zero // value for the type or to empty slices or maps. -// Does not apply to zero valued structs. +// Zero valued structs will be omitted if all their public +// fields are zero, unless they implement an IsZero +// method (see the IsZeroer interface type), in which +// case the field will be included if that method returns true. // // flow Marshal using a flow style (useful for structs, -// sequences and maps. +// sequences and maps). // // inline Inline the field, which must be a struct or a map, // causing all of its fields or keys to be processed as if @@ -129,7 +190,7 @@ func Unmarshal(in []byte, out interface{}) (err error) { // For example: // // type T struct { -// F int "a,omitempty" +// F int `yaml:"a,omitempty"` // B int // } // yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" @@ -139,12 +200,47 @@ func Marshal(in interface{}) (out []byte, err error) { defer handleErr(&err) e := newEncoder() defer e.destroy() - e.marshal("", reflect.ValueOf(in)) + e.marshalDoc("", reflect.ValueOf(in)) e.finish() out = e.out return } +// An Encoder writes YAML values to an output stream. +type Encoder struct { + encoder *encoder +} + +// NewEncoder returns a new encoder that writes to w. +// The Encoder should be closed after use to flush all data +// to w. +func NewEncoder(w io.Writer) *Encoder { + return &Encoder{ + encoder: newEncoderWithWriter(w), + } +} + +// Encode writes the YAML encoding of v to the stream. +// If multiple items are encoded to the stream, the +// second and subsequent document will be preceded +// with a "---" document separator, but the first will not. +// +// See the documentation for Marshal for details about the conversion of Go +// values to YAML. +func (e *Encoder) Encode(v interface{}) (err error) { + defer handleErr(&err) + e.encoder.marshalDoc("", reflect.ValueOf(v)) + return nil +} + +// Close closes the encoder by writing any remaining data. +// It does not write a stream terminating string "...". +func (e *Encoder) Close() (err error) { + defer handleErr(&err) + e.encoder.finish() + return nil +} + func handleErr(err *error) { if v := recover(); v != nil { if e, ok := v.(yamlError); ok { @@ -200,6 +296,9 @@ type fieldInfo struct { Num int OmitEmpty bool Flow bool + // Id holds the unique field identifier, so we can cheaply + // check for field duplicates without maintaining an extra map. + Id int // Inline holds the field index if the field is part of an inlined struct. Inline []int @@ -222,7 +321,7 @@ func getStructInfo(st reflect.Type) (*structInfo, error) { inlineMap := -1 for i := 0; i != n; i++ { field := st.Field(i) - if field.PkgPath != "" { + if field.PkgPath != "" && !field.Anonymous { continue // Private field } @@ -279,6 +378,7 @@ func getStructInfo(st reflect.Type) (*structInfo, error) { } else { finfo.Inline = append([]int{i}, finfo.Inline...) } + finfo.Id = len(fieldsList) fieldsMap[finfo.Key] = finfo fieldsList = append(fieldsList, finfo) } @@ -300,11 +400,16 @@ func getStructInfo(st reflect.Type) (*structInfo, error) { return nil, errors.New(msg) } + info.Id = len(fieldsList) fieldsList = append(fieldsList, info) fieldsMap[info.Key] = info } - sinfo = &structInfo{fieldsMap, fieldsList, inlineMap} + sinfo = &structInfo{ + FieldsMap: fieldsMap, + FieldsList: fieldsList, + InlineMap: inlineMap, + } fieldMapMutex.Lock() structMap[st] = sinfo @@ -312,8 +417,23 @@ func getStructInfo(st reflect.Type) (*structInfo, error) { return sinfo, nil } +// IsZeroer is used to check whether an object is zero to +// determine whether it should be omitted when marshaling +// with the omitempty flag. One notable implementation +// is time.Time. +type IsZeroer interface { + IsZero() bool +} + func isZero(v reflect.Value) bool { - switch v.Kind() { + kind := v.Kind() + if z, ok := v.Interface().(IsZeroer); ok { + if (kind == reflect.Ptr || kind == reflect.Interface) && v.IsNil() { + return true + } + return z.IsZero() + } + switch kind { case reflect.String: return len(v.String()) == 0 case reflect.Interface, reflect.Ptr: @@ -324,13 +444,15 @@ func isZero(v reflect.Value) bool { return v.Len() == 0 case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return v.Int() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Bool: return !v.Bool() case reflect.Struct: vt := v.Type() - for i := v.NumField()-1; i >= 0; i-- { + for i := v.NumField() - 1; i >= 0; i-- { if vt.Field(i).PkgPath != "" { continue // Private field } diff --git a/vendor/gopkg.in/yaml.v2/yamlh.go b/vendor/gopkg.in/yaml.v2/yamlh.go index d60a6b6..e25cee5 100644 --- a/vendor/gopkg.in/yaml.v2/yamlh.go +++ b/vendor/gopkg.in/yaml.v2/yamlh.go @@ -1,6 +1,7 @@ package yaml import ( + "fmt" "io" ) @@ -239,6 +240,27 @@ const ( yaml_MAPPING_END_EVENT // A MAPPING-END event. ) +var eventStrings = []string{ + yaml_NO_EVENT: "none", + yaml_STREAM_START_EVENT: "stream start", + yaml_STREAM_END_EVENT: "stream end", + yaml_DOCUMENT_START_EVENT: "document start", + yaml_DOCUMENT_END_EVENT: "document end", + yaml_ALIAS_EVENT: "alias", + yaml_SCALAR_EVENT: "scalar", + yaml_SEQUENCE_START_EVENT: "sequence start", + yaml_SEQUENCE_END_EVENT: "sequence end", + yaml_MAPPING_START_EVENT: "mapping start", + yaml_MAPPING_END_EVENT: "mapping end", +} + +func (e yaml_event_type_t) String() string { + if e < 0 || int(e) >= len(eventStrings) { + return fmt.Sprintf("unknown event %d", e) + } + return eventStrings[e] +} + // The event structure. type yaml_event_t struct { @@ -508,7 +530,7 @@ type yaml_parser_t struct { problem string // Error description. - // The byte about which the problem occured. + // The byte about which the problem occurred. problem_offset int problem_value int problem_mark yaml_mark_t @@ -521,9 +543,9 @@ type yaml_parser_t struct { read_handler yaml_read_handler_t // Read handler. - input_file io.Reader // File input data. - input []byte // String input data. - input_pos int + input_reader io.Reader // File input data. + input []byte // String input data. + input_pos int eof bool // EOF flag @@ -632,7 +654,7 @@ type yaml_emitter_t struct { write_handler yaml_write_handler_t // Write handler. output_buffer *[]byte // String output data. - output_file io.Writer // File output data. + output_writer io.Writer // File output data. buffer []byte // The working buffer. buffer_pos int // The current position of the buffer. diff --git a/vendor/modules.txt b/vendor/modules.txt new file mode 100644 index 0000000..72f4e38 --- /dev/null +++ b/vendor/modules.txt @@ -0,0 +1,37 @@ +# github.com/aws/aws-sdk-go v1.26.3 +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/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/credentials/ec2rolecreds +github.com/aws/aws-sdk-go/aws/credentials/endpointcreds +github.com/aws/aws-sdk-go/aws/credentials/processcreds +github.com/aws/aws-sdk-go/aws/credentials/stscreds +github.com/aws/aws-sdk-go/aws/csm +github.com/aws/aws-sdk-go/aws/defaults +github.com/aws/aws-sdk-go/aws/ec2metadata +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/aws/signer/v4 +github.com/aws/aws-sdk-go/internal/ini +github.com/aws/aws-sdk-go/internal/sdkio +github.com/aws/aws-sdk-go/internal/sdkmath +github.com/aws/aws-sdk-go/internal/sdkrand +github.com/aws/aws-sdk-go/internal/sdkuri +github.com/aws/aws-sdk-go/internal/shareddefaults +github.com/aws/aws-sdk-go/private/protocol +github.com/aws/aws-sdk-go/private/protocol/json/jsonutil +github.com/aws/aws-sdk-go/private/protocol/query +github.com/aws/aws-sdk-go/private/protocol/query/queryutil +github.com/aws/aws-sdk-go/private/protocol/rest +github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil +github.com/aws/aws-sdk-go/service/sts +github.com/aws/aws-sdk-go/service/sts/stsiface +# github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af +github.com/jmespath/go-jmespath +# gopkg.in/yaml.v2 v2.2.7 +gopkg.in/yaml.v2 diff --git a/vendor/vendor.json b/vendor/vendor.json deleted file mode 100644 index 1d798cb..0000000 --- a/vendor/vendor.json +++ /dev/null @@ -1,298 +0,0 @@ -{ - "comment": "", - "ignore": "", - "package": [ - { - "checksumSHA1": "nQcqx+x0SHJCqAvGXxZBGzdNvPg=", - "path": "github.com/aws/aws-sdk-go", - "revision": "0bbc97afc1bd36f23958f2f26764ecf0253834bd", - "revisionTime": "2017-04-05T23:52:32Z" - }, - { - "checksumSHA1": "Qut42oJHTy4LF5vvVPMSGgkzPvk=", - "path": "github.com/aws/aws-sdk-go/aws", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "Y9W+4GimK4Fuxq+vyIskVYFRnX4=", - "path": "github.com/aws/aws-sdk-go/aws/awserr", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "MfvvTPp96r7BWhNyHkMR99tPXhY=", - "path": "github.com/aws/aws-sdk-go/aws/awsutil", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "iThCyNRL/oQFD9CF2SYgBGl+aww=", - "path": "github.com/aws/aws-sdk-go/aws/client", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "ieAJ+Cvp/PKv1LpUEnUXpc3OI6E=", - "path": "github.com/aws/aws-sdk-go/aws/client/metadata", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "oqks2E/FEKyhf35weCzaD7QbMTw=", - "path": "github.com/aws/aws-sdk-go/aws/corehandlers", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "1Y5lQ5DiXxKPe0iITIzx2wbItZc=", - "path": "github.com/aws/aws-sdk-go/aws/credentials", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "vNezRqMaW2P4eroQOw+X8VvdRLk=", - "path": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "3gcwv0Ttdiby3736WSTLqc6hsNk=", - "path": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "cQk39tx00VRyXFMTetVl81SFTQc=", - "path": "github.com/aws/aws-sdk-go/aws/credentials/stscreds", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "m4eWUyny2MMk6jGxgYZXq9U7yi0=", - "path": "github.com/aws/aws-sdk-go/aws/defaults", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "Vs428vDEBSyEMdEqyW7a6qxSNCw=", - "path": "github.com/aws/aws-sdk-go/aws/ec2metadata", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "Zgxq4iNCaREMbnXnwF1IyyJqvks=", - "path": "github.com/aws/aws-sdk-go/aws/endpoints", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "v3t5a12NAMt4W+mMR2K0Xqe7Ch0=", - "path": "github.com/aws/aws-sdk-go/aws/request", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "ypBq4ogWmCJdIgqHNTgceMHYdV8=", - "path": "github.com/aws/aws-sdk-go/aws/session", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "CgM0Xb1WPeTur4KYHmfiVhK3iVg=", - "path": "github.com/aws/aws-sdk-go/aws/signer/v4", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "VF6UbXmnQq/6hpqQEBgrMVby6cU=", - "path": "github.com/aws/aws-sdk-go/awstesting", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "iOAj9X968hli6R2oCTjFVQPH5Ug=", - "path": "github.com/aws/aws-sdk-go/awstesting/mock", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "MIp5H1niMhCZFAwYsjJx9NxmHIc=", - "path": "github.com/aws/aws-sdk-go/awstesting/unit", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "YVb6IGbsYv0bBxIflqDLow+vnmY=", - "path": "github.com/aws/aws-sdk-go/private/protocol", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "aVUsyOCFzg2hd2fMg63gxnAgFb0=", - "path": "github.com/aws/aws-sdk-go/private/protocol/ec2query", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "Kv0l+/YRDWr7wdo6QuTiZAtsbkk=", - "path": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "qr4eS1+EN+4U4szC4RECfwmsplA=", - "path": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "PhxtzIUJrSnxZNy+Rjsi2UNIWaE=", - "path": "github.com/aws/aws-sdk-go/private/protocol/query", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "Drt1JfLMa0DQEZLWrnMlTWaIcC8=", - "path": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "2V+Q+QAP6NuwPl50GLJNHnPUTpk=", - "path": "github.com/aws/aws-sdk-go/private/protocol/rest", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "0SjECVV4X95GVFmhETbuplteb7w=", - "path": "github.com/aws/aws-sdk-go/private/protocol/restjson", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "Sk/3cK6moKfKbkWvpS13qEYWDaU=", - "path": "github.com/aws/aws-sdk-go/private/protocol/restxml", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "SvtQIBR4oTPeRTCdIcsUf8LlkDs=", - "path": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "01b4hmyUzoReoOyEDylDinWBSdA=", - "path": "github.com/aws/aws-sdk-go/private/util", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "zAiOuU0DuHfsBjB7NwyvEQhSzEY=", - "path": "github.com/aws/aws-sdk-go/service/cloudfront", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "aL8nF6gVDtbTKvpWKARCZCZT890=", - "path": "github.com/aws/aws-sdk-go/service/dynamodb", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "FLZfqbUVl+dWyrz+stgDy9KGxyQ=", - "path": "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "oZ9nV3besQdwyejmAVOh3Rhstek=", - "path": "github.com/aws/aws-sdk-go/service/ec2", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "DXUC3RnwFUQ4GqmCFoXaegLhnTE=", - "path": "github.com/aws/aws-sdk-go/service/elastictranscoder", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "AMdc+xpvIQd2LU2wrprrhW215bo=", - "path": "github.com/aws/aws-sdk-go/service/kinesis", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "ZT+czT3XwdoUvwpWbxnMHE8Qy00=", - "path": "github.com/aws/aws-sdk-go/service/route53", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "boyZXE6i5mOBXSUdgTqx77rG1fw=", - "path": "github.com/aws/aws-sdk-go/service/s3", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "s3Iy4ZOgz5UZpFZS1+9NhkP0YkA=", - "path": "github.com/aws/aws-sdk-go/service/sqs", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "qEfVbSM27+ww5jx0sjBYroPl6eg=", - "path": "github.com/aws/aws-sdk-go/service/sts", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "OFu4xJEIjiI8Suu+j/gabfp+y6Q=", - "origin": "github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew", - "path": "github.com/davecgh/go-spew/spew", - "revision": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e", - "revisionTime": "2016-11-17T07:43:51Z" - }, - { - "checksumSHA1": "GCCxJvhfV1OCg8+88xO77cj8rH8=", - "origin": "github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini", - "path": "github.com/go-ini/ini", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "TDeiKiCXvRCyaC5uBryv5Av5SMk=", - "origin": "github.com/aws/aws-sdk-go/vendor/github.com/jmespath/go-jmespath", - "path": "github.com/jmespath/go-jmespath", - "revision": "2518e87b4936ee9928eadf38957b1fd86e25052c", - "revisionTime": "2017-04-03T20:52:32Z" - }, - { - "checksumSHA1": "zKKp5SZ3d3ycKe4EKMNT0BqAWBw=", - "origin": "github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib", - "path": "github.com/pmezard/go-difflib/difflib", - "revision": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e", - "revisionTime": "2016-11-17T07:43:51Z" - }, - { - "checksumSHA1": "FQxphxs1ORrfgfaeVz34UvgV+/8=", - "path": "github.com/stretchr/testify/assert", - "revision": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e", - "revisionTime": "2016-11-17T07:43:51Z" - }, - { - "checksumSHA1": "iJ5P2CP9FG3k6s0cDSX1s+a+bKE=", - "path": "github.com/stretchr/testify/require", - "revision": "18a02ba4a312f95da08ff4cfc0055750ce50ae9e", - "revisionTime": "2016-11-17T07:43:51Z" - }, - { - "path": "gopkg.in/yaml.v2", - "revision": "5d6f7e02b7cdad63b06ab3877915532cd30073b4", - "revisionTime": "2015-01-19T16:55:52-02:00" - } - ], - "rootPath": "github.com/remind101/assume-role" -}